MDL-19976 Refactored select_menu() into select(), now supporting menu, radio and checkbox rendering. Added radio() and checkbox() functions.

This commit is contained in:
nicolasconnault
2009-08-04 02:05:32 +00:00
parent 36bb9878a6
commit 49c8c8d27e
19 changed files with 504 additions and 398 deletions
+8 -8
View File
@@ -210,15 +210,15 @@ function lockoptionsallsetup(formid) {
* submits the form designated by args.id. If args.selectid is also
* given, it only submits the form if the selected <option> is not
* the first one (usually the "Choose..." option)
* Example usage of the moodle_select_menu component with this function:
* Example usage of the moodle_select component with this function:
* <pre>
* $selectmenu = new moodle_select_menu();
* $selectmenu->options = array('delete' => get_string('delete'));
* $selectmenu->name = 'action';
* $selectmenu->button->label = get_string('withselected', 'quiz');
* $selectmenu->id = 'menuaction';
* $selectmenu->add_action('change', 'submit_form_by_id', array('id' => 'attemptsform', 'selectid' => 'menuaction'));
* echo $OUTPUT->select_menu($selectmenu);
* $select = new moodle_select();
* $select->options = array('delete' => get_string('delete'));
* $select->name = 'action';
* $select->button->label = get_string('withselected', 'quiz');
* $select->id = 'menuaction';
* $select->add_action('change', 'submit_form_by_id', array('id' => 'attemptsform', 'selectid' => 'menuaction'));
* echo $OUTPUT->select($select);
* </pre>
*/
function submit_form_by_id(e, args) {