mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
system - removed trailing unused form-html Form - set proper width for submit-button column Element - support returning raw-list for Inputs Group,Input - renamed getColumnWidth to getWidth Input - make setWidth consistent with Form->setWidth, directly add proper class to column
39 lines
578 B
PHP
39 lines
578 B
PHP
<?php
|
|
|
|
class Form_Element
|
|
{
|
|
protected $_classes = array();
|
|
protected $_parent;
|
|
|
|
public function addClass($class)
|
|
{
|
|
$this->_classes[$class] = true;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function removeClass($class)
|
|
{
|
|
unset($this->_classes[$class]);
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getHtmlClass($wrapped = true)
|
|
{
|
|
if (empty($this->_classes))
|
|
return '';
|
|
|
|
$list = implode(' ', array_keys($this->_classes));
|
|
|
|
if (!$wrapped)
|
|
return $list;
|
|
|
|
return 'class="'. $list .'"';
|
|
}
|
|
|
|
protected function _setParent(Form_Element $parent)
|
|
{
|
|
$this->_parent = $parent;
|
|
}
|
|
} |