| Conditions | 4 |
| Paths | 5 |
| Total Lines | 29 |
| Code Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function getHTML() |
||
| 32 | { |
||
| 33 | $details = $this->getHTMLDetails(); |
||
| 34 | extract($details); |
||
|
|
|||
| 35 | |||
| 36 | $ret = null; |
||
| 37 | foreach ($this['values'] as $val) { |
||
| 38 | $id .= $val; |
||
| 39 | $item = $onlyValue = htmlentities($val, ENT_QUOTES, $this->characterEncoding); |
||
| 40 | $value = " value='{$onlyValue}'"; |
||
| 41 | $checked = isset($this['checked']) && $val === $this['checked'] |
||
| 42 | ? " checked='checked'" |
||
| 43 | : null; |
||
| 44 | |||
| 45 | $ret .= <<<EOD |
||
| 46 | <{$wrapperElement}{$wrapperClass}> |
||
| 47 | <input id='$id'{$type}{$class}{$name}{$value}{$autofocus}{$readonly}{$checked}{$title} /> |
||
| 48 | <label for='$id'>$item</label> |
||
| 49 | {$messages} |
||
| 50 | </{$wrapperElement}> |
||
| 51 | EOD; |
||
| 52 | } |
||
| 53 | |||
| 54 | return <<<EOD |
||
| 55 | <{$wrapperElement}{$wrapperClass}> |
||
| 56 | <p class='cf-label'>{$label}</p> |
||
| 57 | {$ret} |
||
| 58 | <p class='cf-desc'>{$description}</p> |
||
| 59 | </{$wrapperElement}> |
||
| 60 | EOD; |
||
| 63 |