From 4784db9a4e75ec39c113049807c6f83018b19d8b Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Mon, 10 Aug 2009 03:35:38 +0000 Subject: [PATCH] MDL-19787 Converted calls to popup_form() --- admin/environment.php | 5 +++-- admin/filters.php | 14 +++++++++----- admin/lang.php | 17 ++++++++++++----- admin/roles/assign.php | 6 ++++-- admin/roles/override.php | 6 ++++-- 5 files changed, 32 insertions(+), 16 deletions(-) diff --git a/admin/environment.php b/admin/environment.php index e819844597..93c8bf043b 100644 --- a/admin/environment.php +++ b/admin/environment.php @@ -121,8 +121,9 @@ /// Print form and popup menu echo '
'.$strmoodleversion.' '; - popup_form("$CFG->wwwroot/$CFG->admin/environment.php?version=", - $versions, 'selectversion', $version, ''); + $select = moodle_select::make_popup_form("$CFG->wwwroot/$CFG->admin/environment.php", 'version', $versions, 'selectversion', $version); + $select->nothinglabel = false; + echo $OUTPUT->select($select); echo '
'; /// End of main box diff --git a/admin/filters.php b/admin/filters.php index 30ce0402c6..45a72fd8ff 100644 --- a/admin/filters.php +++ b/admin/filters.php @@ -248,8 +248,10 @@ function get_table_row($filterinfo, $isfirstrow, $islastactive, $applytostrings) } // Disable/off/on - $row[] = popup_form(action_url($filter, 'setstate') . '&newstate=', $activechoices, - 'active' . basename($filter), $filterinfo->active, '', '', '', true, 'self', '', NULL, get_string('save', 'admin')); + $select = moodle_select::make_popup_form(action_url($filter, 'setstate'), 'newstate', $activechoices, 'active' . basename($filter), $filterinfo->active); + $select->nothinglabel = false; + $select->form->button->text = get_string('save', 'admin'); + $row[] = $OUTPUT->select($select); // Re-order $updown = ''; @@ -269,9 +271,11 @@ function get_table_row($filterinfo, $isfirstrow, $islastactive, $applytostrings) $row[] = $updown; // Apply to strings. - $row[] = popup_form(action_url($filter, 'setapplyto') . '&stringstoo=', $applytochoices, - 'applyto' . basename($filter), $applytostrings, '', '', '', true, 'self', '', NULL, get_string('save', 'admin'), - $filterinfo->active == TEXTFILTER_DISABLED); + $select = moodle_select::make_popup_form(action_url($filter, 'setapplyto'), 'stringstoo', $applytochoices, 'applyto' . basename($filter), $applytostrings); + $select->nothinglabel = false; + $select->disabled = $filterinfo->active == TEXTFILTER_DISABLED; + $select->form->button->text = get_string('save', 'admin'); + $row[] = $OUTPUT->select($select); // Settings link, if required if (filter_has_global_settings($filter)) { diff --git a/admin/lang.php b/admin/lang.php index c446c1c901..55ca4156e1 100644 --- a/admin/lang.php +++ b/admin/lang.php @@ -140,7 +140,10 @@ print_box_start(); $currlang = current_language(); $langs = get_list_of_languages(false, true); - popup_form ("$CFG->wwwroot/$CFG->admin/lang.php?lang=", $langs, "chooselang", $currlang, "", "", "", false, 'self', $strcurrentlanguage.':'); + $select = moodle_select::make_popup_form("$CFG->wwwroot/$CFG->admin/lang.php", 'lang', $langs, "chooselang", $currlang); + $select->nothinglabel = false; + $select->set_label($strcurrentlanguage.':'); + echo $OUTPUT->select($select); print_box_end(); echo $OUTPUT->footer(); exit; @@ -491,8 +494,10 @@ //$selectionlabel .= $strfilestoredin; $selectionlabel .= $uselocal ? "{$currentlang}_local" : $currentlang; $selectionlabel .= '/'; - popup_form("$CFG->wwwroot/$CFG->admin/lang.php?mode=compare&currentfile=", $menufiles, "choosefile", - $currentfile, $strchoosefiletoedit, '', '', false, 'self', $selectionlabel); + $select = moodle_select::make_popup_form("$CFG->wwwroot/$CFG->admin/lang.php?mode=compare", 'currentfile', $menufiles, "choosefile", $currentfile); + $select->nothinglabel = $strchoosefiletoedit; + $select->set_label($selectionlabel); + echo $OUTPUT->select($select); helpbutton('langswitchstorage', $strfilestoredinhelp, 'moodle'); print_box_end(); @@ -756,8 +761,10 @@ //$selectionlabel .= $strfilestoredin; $selectionlabel .= $uselocal ? "{$currentlang}_local" : $currentlang; $selectionlabel .= '/help/'; - popup_form("$CFG->wwwroot/$CFG->admin/lang.php?mode=helpfiles&currentfile=", $menufiles, "choosefile", - $currentfile, $strchoosefiletoedit, '', '', false, 'self', $selectionlabel); + $select = moodle_select::make_popup_form("$CFG->wwwroot/$CFG->admin/lang.php?mode=helpfiles", 'currentfile', $menufiles, "choosefile", $currentfile); + $select->nothinglabel = $strchoosefiletoedit; + $select->set_label($selectionlabel); + echo $OUTPUT->select($select); helpbutton('langswitchstorage', $strfilestoredinhelp, 'moodle'); print_box_end(); diff --git a/admin/roles/assign.php b/admin/roles/assign.php index 8697675b06..6debd8642b 100755 --- a/admin/roles/assign.php +++ b/admin/roles/assign.php @@ -373,8 +373,10 @@ /// Print a form to swap roles, and a link back to the all roles list. echo ''; diff --git a/admin/roles/override.php b/admin/roles/override.php index 0f32447922..b762d7ec1a 100755 --- a/admin/roles/override.php +++ b/admin/roles/override.php @@ -231,8 +231,10 @@ /// Print a form to swap roles, and a link back to the all roles list. echo ''; -- 2.39.5