]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19787 Converted calls to popup_form()
authornicolasconnault <nicolasconnault>
Mon, 10 Aug 2009 03:35:38 +0000 (03:35 +0000)
committernicolasconnault <nicolasconnault>
Mon, 10 Aug 2009 03:35:38 +0000 (03:35 +0000)
admin/environment.php
admin/filters.php
admin/lang.php
admin/roles/assign.php
admin/roles/override.php

index e819844597d0d0de28305fa251470265c9b34628..93c8bf043bd60f698a4c301d63af4e0f63d6fe28 100644 (file)
 
 /// Print form and popup menu
     echo '<div style="text-align:center">'.$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 '</div>';
 
 /// End of main box
index 30ce0402c60bd71510046398e6291a2939130244..45a72fd8ffd386f52f3d3a72449d1c2910b60376 100644 (file)
@@ -248,8 +248,10 @@ function get_table_row($filterinfo, $isfirstrow, $islastactive, $applytostrings)
     }
 
     // Disable/off/on
-    $row[] = popup_form(action_url($filter, 'setstate') . '&amp;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') . '&amp;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)) {
index c446c1c901f397d0fd67b2c5016f54c251fb590b..55ca4156e172abaa9739b6effebb6ef175cb1500 100644 (file)
         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;
         //$selectionlabel .= $strfilestoredin;
         $selectionlabel .= $uselocal ? "{$currentlang}_local" : $currentlang;
         $selectionlabel .= '/</code>';
-        popup_form("$CFG->wwwroot/$CFG->admin/lang.php?mode=compare&amp;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();
         
         //$selectionlabel .= $strfilestoredin;
         $selectionlabel .= $uselocal ? "{$currentlang}_local" : $currentlang;
         $selectionlabel .= '/help/</code>';
-        popup_form("$CFG->wwwroot/$CFG->admin/lang.php?mode=helpfiles&amp;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();
 
index 8697675b06c31cb5033cc327c124b4e4028c97e1..6debd8642b965b197a905157f84d652152d18213 100755 (executable)
 
     /// Print a form to swap roles, and a link back to the all roles list.
         echo '<div class="backlink">';
-        popup_form($baseurl . '&amp;roleid=', $nameswithcounts, 'switchrole',
-                $roleid, '', '', '', false, 'self', get_string('assignanotherrole', 'role'));
+        $select = moodle_select::make_popup_form($baseurl, 'roleid', $nameswithcounts, 'switchrole', $roleid);
+        $select->set_label(get_string('assignanotherrole', 'role'));
+        $select->nothinglabel = false;
+        echo $OUTPUT->select($select);
         echo '<p><a href="' . $baseurl . '">' . get_string('backtoallroles', 'role') . '</a></p>';
         echo '</div>';
 
index 0f324479228196db109cae7eaff5a2a2662196de..b762d7ec1aea89f95a00f42eacc291e912f72223 100755 (executable)
 
     /// Print a form to swap roles, and a link back to the all roles list.
         echo '<div class="backlink">';
-        popup_form($baseurl . '&amp;roleid=', $nameswithcounts, 'switchrole',
-                $roleid, '', '', '', false, 'self',  get_string('overrideanotherrole', 'role'));
+        $select = moodle_select::make_popup_form($baseurl, 'roleid', $nameswithcounts, 'switchrole', $roleid);
+        $select->set_label(get_string('overrideanotherrole', 'role'));
+        $select->nothinglabel = false;
+        echo $OUTPUT->select($select);
         echo '<p><a href="' . $baseurl . '">' . get_string('backtoallroles', 'role') . '</a></p>';
         echo '</div>';