mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-20204 one more step away from html_select
This commit is contained in:
parent
c86a91d508
commit
2f0e96e447
8 changed files with 29 additions and 80 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue