array(),
);
protected $_description;
public function __construct($name, $title, $description, $checked, $value = 'yes')
{
parent::__construct($name, $title, 'checkbox', $value);
$this->_description = $description;
if ($checked)
$this->_attributes['checked'] = 'checked';
$this->column->addClass('checkbox');
}
public function displayAsRadio($id = null)
{
$this->_attributes['type'] = 'radio';
if ($id != null) {
$this->_attributes['id'] = $id;
} else {
$this->_attributes['id'] = $this->_attributes['name'] . '_' . $this->_attributes['value'] . ':' .substr(uniqid(), 9);
}
return $this;
}
protected function _getInput()
{
$input = parent::_getInput();
if (!empty($this->_description) || is_numeric($this->_description))
return '';
return '';
}
}