pfsense/usr/local/www/classes/Form/Element.class.php
Sjon Hortensius 69f9ff4034 final touches on Forms
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
2015-01-27 21:33:41 +01:00

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;
}
}