5 * @author Ant P <p@cpi.merseine.nu>
6 * @license http://specialops.ath.cx/repos/so2/trunk/COPYING (New BSD Licence)
15 function __construct($name, $label)
18 $this->label
= $label;
19 $this->value
= isset($_POST[$this->name
]);
22 function is_selected()
24 return isset($_POST[$this->name
]);
30 '<input type="checkbox" name="'.$this->name
.'"'.($this->value ?
' checked="checked"' : '').'/>'.
31 htmlspecialchars($this->label
).'</label>';
34 static function factory(array $boxes)
37 foreach ( $boxes as $name => $label ) {
38 $ret[$name] = new HTML_Checkbox($name, $label);