Conditions | 5 |
Paths | 4 |
Total Lines | 22 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | public function html(\admin_plugin_config $plugin, $echo = false) { |
||
11 | $disable = ''; |
||
12 | |||
13 | if($this->isProtected()) { |
||
14 | $value = $this->protected; |
||
15 | $disable = 'disabled="disabled"'; |
||
16 | } else { |
||
17 | if($echo && $this->error) { |
||
18 | $value = $this->input; |
||
19 | } else { |
||
20 | $value = is_null($this->local) ? $this->default : $this->local; |
||
21 | } |
||
22 | } |
||
23 | |||
24 | $key = htmlspecialchars($this->key); |
||
25 | $value = htmlspecialchars($value); |
||
26 | |||
27 | $label = '<label for="config___' . $key . '">' . $this->prompt($plugin) . '</label>'; |
||
28 | $input = '<input id="config___' . $key . '" name="config[' . $key . |
||
29 | ']" type="text" class="edit" value="' . $value . '" ' . $disable . '/>'; |
||
30 | return array($label, $input); |
||
31 | } |
||
32 | } |
||
33 |