MDL-20204 one more step away from html_select

This commit is contained in:
Petr Skoda 2010-02-09 18:54:03 +00:00
parent c86a91d508
commit 2f0e96e447
8 changed files with 29 additions and 80 deletions

View file

@ -1606,24 +1606,6 @@ class html_select_option extends labelled_html_component {
parent::prepare($output, $page, $target);
}
/**
* Shortcut for making a checkbox-ready option
* @param string $value The value of the checkbox
* @param boolean $checked
* @param string $label
* @param string $alt
* @return html_select_option A component ready for $OUTPUT->checkbox()
*/
public static function make_checkbox($value, $checked, $label, $alt=null) {
$checkbox = new html_select_option();
$checkbox->value = $value;
$checkbox->selected = $checked;
$checkbox->text = $label;
$checkbox->label->text = $label;
$checkbox->alt = $alt;
return $checkbox;
}
}