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
33 lines
671 B
PHP
33 lines
671 B
PHP
<?php
|
|
|
|
class Form_Select extends Form_Input
|
|
{
|
|
protected $_values;
|
|
|
|
public function __construct($title, $value, array $values, $allowMultiple = false)
|
|
{
|
|
parent::__construct($title);
|
|
|
|
if ($allowMultiple)
|
|
$this->_attributes['multiple'] = 'multiple';
|
|
|
|
$this->_values = $values;
|
|
}
|
|
|
|
protected function _getInput()
|
|
{
|
|
$element = 'select';
|
|
foreach ($this->_attributes as $key => $value)
|
|
$element .= ' '.$key.'="'. htmlspecialchars($value).'"';
|
|
|
|
$options = '';
|
|
foreach ($this->_values as $value => $name)
|
|
$options .= '<option value="'. htmlspecialchars($value) .'">'. $name .'</option>';
|
|
|
|
return <<<EOT
|
|
<{$element}>
|
|
{$options}
|
|
</select>
|
|
EOT;
|
|
}
|
|
} |