| 1 |
<?php |
| 2 |
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped -- PFBC framework extension, HTML output is controlled |
| 3 |
class AccuaForm_Element_FieldsetBegin extends Element { |
| 4 |
public function __construct($legend, $name = "", $properties = array()) { |
| 5 |
$properties += array("legend" => $legend); |
| 6 |
parent::__construct("", $name, $properties); |
| 7 |
} |
| 8 |
|
| 9 |
public function render() { |
| 10 |
$wrapperClass = $this->getWrapperCssClass(); |
| 11 |
if (!empty($wrapperClass)) { |
| 12 |
$existing = isset($this->attributes['class']) ? $this->attributes['class'] . ' ' : ''; |
| 13 |
$this->attributes['class'] = $existing . $wrapperClass; |
| 14 |
} |
| 15 |
$wrapperID = $this->getWrapperCssId(); |
| 16 |
if (!empty($wrapperID)) { |
| 17 |
$this->attributes['id'] = $wrapperID; |
| 18 |
} |
| 19 |
echo '<fieldset ', $this->getAttributes(array('legend')), '><legend>', $this->attributes["legend"], '</legend>'; |
| 20 |
} |
| 21 |
|
| 22 |
} |