| Conditions | 4 |
| Paths | 6 |
| Total Lines | 27 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | public function getHTML() |
||
| 45 | { |
||
| 46 | $details = $this->getHTMLDetails(); |
||
| 47 | extract($details); |
||
| 48 | |||
| 49 | $name = " name='{$this['name']}[]'"; |
||
| 50 | $options = null; |
||
| 51 | $selectedValues = is_array($this['checked']) ? $this['checked'] : []; |
||
| 52 | |||
| 53 | foreach ($this['options'] as $optValue => $optText) { |
||
| 54 | $selected = in_array($optValue, $selectedValues) |
||
| 55 | ? " selected" |
||
| 56 | : null; |
||
| 57 | $options .= "<option value='{$optValue}'{$selected}>{$optText}</option>\n"; |
||
| 58 | } |
||
| 59 | |||
| 60 | return <<<EOD |
||
| 61 | <p> |
||
| 62 | <label for='$id'>$label</label>$brAfterLabel |
||
| 63 | <select id='$id'{$size}{$class}{$name}{$autofocus}{$required}{$readonly}{$title} multiple> |
||
| 64 | {$options} |
||
| 65 | </select> |
||
| 66 | {$messages} |
||
| 67 | </p> |
||
| 68 | <p class='cf-desc'>{$description}</p> |
||
| 69 | EOD; |
||
| 70 | } |
||
| 71 | } |
||
| 72 |