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
28 lines
580 B
PHP
28 lines
580 B
PHP
<?php
|
|
|
|
class Form_Checkbox extends Form_Input
|
|
{
|
|
protected $_description;
|
|
|
|
public function __construct($title, $description, $checked, $value = 'yes')
|
|
{
|
|
parent::__construct($title, 'checkbox');
|
|
|
|
$this->_description = $description;
|
|
$this->removeClass('form-control');
|
|
|
|
if ($checked)
|
|
$this->_attributes['checked'] = 'checked';
|
|
}
|
|
|
|
protected function _getInput()
|
|
{
|
|
$this->addColumnClass('checkbox');
|
|
$input = parent::_getInput();
|
|
|
|
if (!isset($this->_description))
|
|
return $input;
|
|
|
|
return '<label>'. $input .' '. gettext($this->_description) .'</label>';
|
|
}
|
|
} |