$legend); parent::__construct("", $name, $properties); } public function render() { $wrapperClass = $this->getWrapperCssClass(); if (!empty($wrapperClass)) { $existing = isset($this->attributes['class']) ? $this->attributes['class'] . ' ' : ''; $this->attributes['class'] = $existing . $wrapperClass; } $wrapperID = $this->getWrapperCssId(); if (!empty($wrapperID)) { $this->attributes['id'] = $wrapperID; } $legend = $this->attributes['legend']; $style = isset($this->attributes['fieldset_style']) ? $this->attributes['fieldset_style'] : 'border-off-title-off'; $exclude = array('legend', 'fieldset_style'); // Add border class for border-on variants $has_border = in_array($style, array('border-on-title-off', 'border-on-title-inline', 'border-on-title-outside', 'border-on-title-inside'), true); if ($has_border) { $existing = isset($this->attributes['class']) ? $this->attributes['class'] . ' ' : ''; $this->attributes['class'] = $existing . 'accua-fieldset-border'; } switch ($style) { case 'border-on-title-outside': if ($legend !== '') { echo '

', $legend, '

'; } echo '
getAttributes($exclude), '>'; break; case 'border-on-title-inside': case 'border-off-title-on': echo '
getAttributes($exclude), '>'; if ($legend !== '') { echo '

', $legend, '

'; } break; case 'border-on-title-inline': echo '
getAttributes($exclude), '>'; if ($legend !== '') { echo '', $legend, ''; } break; default: // 'border-off-title-off', 'border-on-title-off' echo '
getAttributes($exclude), '>'; break; } } }