MDL-19794 Migrated choose_from_menu to the new $OUTPUT->select_menu() function
This commit is contained in:
+6
-1
@@ -406,7 +406,12 @@
|
||||
make_categories_list($movetocategories, $notused, 'moodle/category:manage');
|
||||
$movetocategories[$category->id] = get_string('moveselectedcoursesto');
|
||||
echo '<tr><td colspan="3" align="right">';
|
||||
choose_from_menu($movetocategories, 'moveto', $category->id, '', "javascript:submitFormById('movecourses')");
|
||||
$selectmenu = new moodle_select_menu();
|
||||
$selectmenu->options = $movetocategories;
|
||||
$selectmenu->name = 'moveto';
|
||||
$selectmenu->selectedvalue = $category->id;
|
||||
$selectmenu->add_action('change', 'submit_form_by_id', array('id' => 'movecourses'));
|
||||
echo $OUTPUT->select_menu($selectmenu);
|
||||
echo '<input type="hidden" name="id" value="'.$category->id.'" />';
|
||||
echo '</td></tr>';
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
$action = optional_param('action', '', PARAM_ALPHA);
|
||||
$page = optional_param('page', 0, PARAM_INT); // which page to show
|
||||
$perpage = optional_param('perpage', DEFAULT_PAGE_SIZE, PARAM_INT); // how many per page
|
||||
|
||||
$PAGE->set_url('course/report/participation/index.php', compact('id', 'roleid', 'instanceid', 'timefrom', 'page', 'perpage'));
|
||||
|
||||
if ($action != 'view' and $action != 'post') {
|
||||
$action = ''; // default to all (don't restrict)
|
||||
@@ -271,7 +273,12 @@
|
||||
echo '<input type="button" onclick="checknos()" value="'.get_string('selectnos').'" />'."\n";
|
||||
}
|
||||
$displaylist['messageselect.php'] = get_string('messageselectadd');
|
||||
choose_from_menu ($displaylist, "formaction", "", get_string("withselectedusers"), "if(checksubmit(this.form))this.form.submit();", "");
|
||||
$selectmenu = new moodle_select_menu();
|
||||
$selectmenu->options = $displaylist;
|
||||
$selectmenu->name = "formaction";
|
||||
$selectmenu->label = get_string("withselectedusers");
|
||||
$selectmenu->add_action('change', 'conditionalsubmit', array('formid' => 'studentsform'));
|
||||
echo $OUTPUT->select_menu($selectmenu);
|
||||
helpbutton("participantswithselectedusers", get_string("withselectedusers"));
|
||||
echo '<input type="submit" value="' . get_string('ok') . '" />'."\n";
|
||||
echo '</div>'."\n";
|
||||
|
||||
+9
-2
@@ -14,7 +14,9 @@
|
||||
$show = optional_param('show', 0, PARAM_INT);
|
||||
$blocklist = optional_param('blocklist', 0, PARAM_INT);
|
||||
$modulelist= optional_param('modulelist', '', PARAM_ALPHAEXT);
|
||||
|
||||
|
||||
$PAGE->set_url('course/search.php', compact('search', 'page', 'perpage', 'blocklist', 'modulelist', 'edit'));
|
||||
$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
|
||||
$search = trim(strip_tags($search)); // trim & clean raw searched string
|
||||
|
||||
if ($search) {
|
||||
@@ -307,7 +309,12 @@
|
||||
echo "<br />";
|
||||
echo "<input type=\"button\" onclick=\"checkall()\" value=\"$strselectall\" />\n";
|
||||
echo "<input type=\"button\" onclick=\"checknone()\" value=\"$strdeselectall\" />\n";
|
||||
choose_from_menu ($displaylist, "moveto", "", get_string("moveselectedcoursesto"), "javascript: getElementById('movecourses').submit()");
|
||||
$selectmenu = new moodle_select_menu();
|
||||
$selectmenu->options = $displaylist;
|
||||
$selectmenu->name = "moveto";
|
||||
$selectmenu->label = get_string("moveselectedcoursesto");
|
||||
$selectmenu->add_action('change', 'submit_form_by_id', array('id' => 'movecourses'));
|
||||
echo $OUTPUT->select_menu($selectmenu);
|
||||
echo "</td>\n</tr>\n";
|
||||
echo "</table>\n</form>";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user