Skip to content

Commit

Permalink
MDL-19756 Renamed moodle_select to html_select for better API consist…
Browse files Browse the repository at this point in the history
…ency
  • Loading branch information
nicolasconnault committed Aug 10, 2009
1 parent 8c61317 commit 7b1f2c8
Show file tree
Hide file tree
Showing 62 changed files with 956 additions and 956 deletions.
2 changes: 1 addition & 1 deletion admin/environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@

/// Print form and popup menu
echo '<div style="text-align:center">'.$strmoodleversion.' ';
$select = moodle_select::make_popup_form("$CFG->wwwroot/$CFG->admin/environment.php", 'version', $versions, 'selectversion', $version);
$select = html_select::make_popup_form("$CFG->wwwroot/$CFG->admin/environment.php", 'version', $versions, 'selectversion', $version);
$select->nothinglabel = false;
echo $OUTPUT->select($select);
echo '</div>';
Expand Down
4 changes: 2 additions & 2 deletions admin/filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ function get_table_row($filterinfo, $isfirstrow, $islastactive, $applytostrings)
}

// Disable/off/on
$select = moodle_select::make_popup_form(action_url($filter, 'setstate'), 'newstate', $activechoices, 'active' . basename($filter), $filterinfo->active);
$select = html_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);
Expand All @@ -271,7 +271,7 @@ function get_table_row($filterinfo, $isfirstrow, $islastactive, $applytostrings)
$row[] = $updown;

// Apply to strings.
$select = moodle_select::make_popup_form(action_url($filter, 'setapplyto'), 'stringstoo', $applytochoices, 'applyto' . basename($filter), $applytostrings);
$select = html_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');
Expand Down
6 changes: 3 additions & 3 deletions admin/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
echo $OUTPUT->box_start();
$currlang = current_language();
$langs = get_list_of_languages(false, true);
$select = moodle_select::make_popup_form("$CFG->wwwroot/$CFG->admin/lang.php", 'lang', $langs, "chooselang", $currlang);
$select = html_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);
Expand Down Expand Up @@ -494,7 +494,7 @@
//$selectionlabel .= $strfilestoredin;
$selectionlabel .= $uselocal ? "{$currentlang}_local" : $currentlang;
$selectionlabel .= '/</code>';
$select = moodle_select::make_popup_form("$CFG->wwwroot/$CFG->admin/lang.php?mode=compare", 'currentfile', $menufiles, "choosefile", $currentfile);
$select = html_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);
Expand Down Expand Up @@ -761,7 +761,7 @@
//$selectionlabel .= $strfilestoredin;
$selectionlabel .= $uselocal ? "{$currentlang}_local" : $currentlang;
$selectionlabel .= '/help/</code>';
$select = moodle_select::make_popup_form("$CFG->wwwroot/$CFG->admin/lang.php?mode=helpfiles", 'currentfile', $menufiles, "choosefile", $currentfile);
$select = html_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);
Expand Down
2 changes: 1 addition & 1 deletion admin/roles/assign.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@

/// Print a form to swap roles, and a link back to the all roles list.
echo '<div class="backlink">';
$select = moodle_select::make_popup_form($baseurl, 'roleid', $nameswithcounts, 'switchrole', $roleid);
$select = html_select::make_popup_form($baseurl, 'roleid', $nameswithcounts, 'switchrole', $roleid);
$select->set_label(get_string('assignanotherrole', 'role'));
$select->nothinglabel = false;
echo $OUTPUT->select($select);
Expand Down
2 changes: 1 addition & 1 deletion admin/roles/override.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@

/// Print a form to swap roles, and a link back to the all roles list.
echo '<div class="backlink">';
$select = moodle_select::make_popup_form($baseurl, 'roleid', $nameswithcounts, 'switchrole', $roleid);
$select = html_select::make_popup_form($baseurl, 'roleid', $nameswithcounts, 'switchrole', $roleid);
$select->set_label(get_string('overrideanotherrole', 'role'));
$select->nothinglabel = false;
echo $OUTPUT->select($select);
Expand Down
2 changes: 1 addition & 1 deletion auth/shibboleth/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
} else {
$currlang = current_language();
$langs = get_list_of_languages();
$select = moodle_select::make_popup_form("$CFG->httpswwwroot/login/index.php", 'lang', $langs, 'chooselang', $currlang);
$select = html_select::make_popup_form("$CFG->httpswwwroot/login/index.php", 'lang', $langs, 'chooselang', $currlang);
$select->nothinglabel = false;
$select->set_label(get_accesshide(get_string('language')));
$langmenu = $OUTPUT->select($select);
Expand Down
6 changes: 3 additions & 3 deletions backup/restore_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@
/// (some formats like main page, social..., haven't it and rolling dates
/// from 0 produces crazy dates. MDL-10125
if ($form1->startdate) {
$dayselector = moodle_select::make_time_selector('days', "startday", $form1->startdate);
$monthselector = moodle_select::make_time_selector('months', "startmonth", $form1->startdate);
$yearselector = moodle_select::make_time_selector('years', "startyear", $form1->startdate);
$dayselector = html_select::make_time_selector('days', "startday", $form1->startdate);
$monthselector = html_select::make_time_selector('months', "startmonth", $form1->startdate);
$yearselector = html_select::make_time_selector('years', "startyear", $form1->startdate);

echo $OUTPUT->select($dayselector) . $OUTPUT->select($monthselector) . $OUTPUT->select($yearselector);
helpbutton("coursestartdate", get_string("startdate"));
Expand Down
2 changes: 1 addition & 1 deletion blocks/rss_client/managefeeds.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
$deleteaction->link->title = get_string('delete');
$deleteaction->image->src = $OUTPUT->old_icon_url('t/delete');
$deleteaction->image->alt = get_string('delete');
$deleteaction->link->add_action('click', 'confirm_dialog', array('message' => get_string('deletefeedconfirm', 'block_rss_client')));
$deleteaction->link->add_confirm_action(get_string('deletefeedconfirm', 'block_rss_client'));

$feedicons = $OUTPUT->action_icon($editaction) . ' ' . $OUTPUT->action_icon($deleteaction);

Expand Down
4 changes: 2 additions & 2 deletions calendar/event_edit.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
$startselectors = moodle_select::make_time_selectors(array(
$startselectors = html_select::make_time_selectors(array(
'days' => 'startday',
'months' => 'startmon',
'years' => 'startyr',
'hours' => 'starthr',
'minutes' => 'startmin'), $form->timestart);

$endselectors = moodle_select::make_time_selectors(array(
$endselectors = html_select::make_time_selectors(array(
'days' => 'endday',
'months' => 'endmon',
'years' => 'endyr',
Expand Down
4 changes: 2 additions & 2 deletions calendar/event_new.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
// The following is a hack to fix bug 1488
$course = $DB->get_record('course', array('id'=>($form->courseid ? $form->courseid : $site->id)));
$startselectors = moodle_select::make_time_selectors(array(
$startselectors = html_select::make_time_selectors(array(
'days' => 'startday',
'months' => 'startmon',
'years' => 'startyr',
'hours' => 'starthr',
'minutes' => 'startmin'), (int) $form->timestart);

$endselectors = moodle_select::make_time_selectors(array(
$endselectors = html_select::make_time_selectors(array(
'days' => 'endday',
'months' => 'endmon',
'years' => 'endyr',
Expand Down
2 changes: 1 addition & 1 deletion calendar/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ function calendar_course_filter_selector($getvars = '') {
} else {
$selected = '';
}
$select = moodle_select::make_popup_form(CALENDAR_URL.'set.php?var=setcourse&'.$getvars, 'id', $courseoptions, 'cal_courses_flt', $selected);
$select = html_select::make_popup_form(CALENDAR_URL.'set.php?var=setcourse&'.$getvars, 'id', $courseoptions, 'cal_courses_flt', $selected);
$select->nothinglabel = false;
return $OUTPUT->select($select);
}
Expand Down
4 changes: 2 additions & 2 deletions course/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
make_categories_list($displaylist, $notused);

echo '<div class="categorypicker">';
$select = moodle_select::make_popup_form('category.php', 'id', $displaylist, 'switchcategory', $category->id);
$select = html_select::make_popup_form('category.php', 'id', $displaylist, 'switchcategory', $category->id);
$select->set_label($strcategories.':');
$select->nothinglabel = false;
echo $OUTPUT->select($select);
Expand Down Expand Up @@ -410,7 +410,7 @@
make_categories_list($movetocategories, $notused, 'moodle/category:manage');
$movetocategories[$category->id] = get_string('moveselectedcoursesto');
echo '<tr><td colspan="3" align="right">';
$select = new moodle_select();
$select = new html_select();
$select->options = $movetocategories;
$select->name = 'moveto';
$select->selectedvalue = $category->id;
Expand Down
2 changes: 1 addition & 1 deletion course/format/topics/format.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
if (!empty($sectionmenu)) {
echo '<div class="jumpmenu">';
$popupurl = $CFG->wwwroot.'/course/view.php?id='.$course->id;
$select = moodle_select::make_popup_form($popupurl, 'topic', $sectionmenu, 'sectionmenu');
$select = html_select::make_popup_form($popupurl, 'topic', $sectionmenu, 'sectionmenu');
$select->set_label(get_string('jumpto'));
echo $OUTPUT->select($select);
echo '</div>';
Expand Down
2 changes: 1 addition & 1 deletion course/format/weeks/format.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
if (!empty($sectionmenu)) {
echo '<div class="jumpmenu">';
$popupurl = $CFG->wwwroot.'/course/view.php?id='.$course->id;
$select = moodle_select::make_popup_form($popupurl, 'week', $sectionmenu, 'sectionmenu');
$select = html_select::make_popup_form($popupurl, 'week', $sectionmenu, 'sectionmenu');
$select->set_label(get_string('jumpto'));
echo $OUTPUT->select($select);
echo '</div>';
Expand Down
2 changes: 1 addition & 1 deletion course/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ function print_category_edit($category, $displaylist, $parentslist, $depth=-1, $
}
}
$popupurl = "index.php?move=$category->id&sesskey=".sesskey();
$select = moodle_select::make_popup_form($popupurl, 'moveto', $tempdisplaylist, "moveform$category->id", $category->parent);
$select = html_select::make_popup_form($popupurl, 'moveto', $tempdisplaylist, "moveform$category->id", $category->parent);
$select->nothinglabel = false;
echo $OUTPUT->select($select);
}
Expand Down
4 changes: 2 additions & 2 deletions course/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1605,14 +1605,14 @@ function print_section_add_menus($course, $section, $modnames, $vertical=false,
$popupurl = "$CFG->wwwroot/course/mod.php?id=$course->id&section=$section&sesskey=".sesskey();

if (!empty($resources)) {
$select = moodle_select::make_popup_form($popupurl, 'add', $resources, "ressection$section", null);
$select = html_select::make_popup_form($popupurl, 'add', $resources, "ressection$section", null);
$select->nothinglabel = $straddresource;
$select->set_help_icon('resource/types', $straddresource);
$output .= $OUTPUT->select($select);
}

if (!empty($activities)) {
$select = moodle_select::make_popup_form($popupurl, 'add', $activities, "section$section", null);
$select = html_select::make_popup_form($popupurl, 'add', $activities, "section$section", null);
$select->nothinglabel = $straddactivity;
$select->set_help_icon('mods', $straddactivity);
$output .= $OUTPUT->select($select);
Expand Down
2 changes: 1 addition & 1 deletion course/report/log/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function print_mnet_log_selector_form($hostid, $course, $selecteduser=0, $select
echo "<input type=\"hidden\" name=\"showcourses\" value=\"$showcourses\" />\n";
if (has_capability('coursereport/log:view', $sitecontext) && $showcourses) {
$cid = empty($course->id)? '1' : $course->id;
$select = moodle_select::make($dropdown, "host_course", $hostid.'/'.$cid);
$select = html_select::make($dropdown, "host_course", $hostid.'/'.$cid);
$select->nested = true;
echo $OUTPUT->select($select);
} else {
Expand Down
4 changes: 2 additions & 2 deletions course/report/participation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
echo '<form class="participationselectform" action="index.php" method="get"><div>'."\n".
'<input type="hidden" name="id" value="'.$course->id.'" />'."\n";
echo '<label for="menuinstanceid">'.get_string('activitymodule').'</label>'."\n";
$select = moodle_select::make($instanceoptions, 'instanceid', $instanceid);
$select = html_select::make($instanceoptions, 'instanceid', $instanceid);
$select->nested = true;
echo $OUTPUT->select($select);
echo '<label for="menutimefrom">'.get_string('lookback').'</label>'."\n";
Expand Down Expand Up @@ -275,7 +275,7 @@
echo '<input type="button" onclick="checknos()" value="'.get_string('selectnos').'" />'."\n";
}
$displaylist['messageselect.php'] = get_string('messageselectadd');
$select = new moodle_select();
$select = new html_select();
$select->options = $displaylist;
$select->name = "formaction";
$select->label = get_string("withselectedusers");
Expand Down
2 changes: 1 addition & 1 deletion course/report/stats/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function report_stats_mode_menu($course, $mode, $time, $url) {
$options[STATS_MODE_RANKED] = get_string('reports');
}
$popupurl = $url."?course=$course->id&time=$time";
$select = moodle_select::make_popup_form($popupurl, 'mode', $options, 'switchmode', $mode);
$select = html_select::make_popup_form($popupurl, 'mode', $options, 'switchmode', $mode);
$select->nothinglabel = false;
return $OUTPUT->select($select);
}
Expand Down
2 changes: 1 addition & 1 deletion course/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@
echo "<br />";
echo "<input type=\"button\" onclick=\"checkall()\" value=\"$strselectall\" />\n";
echo "<input type=\"button\" onclick=\"checknone()\" value=\"$strdeselectall\" />\n";
$select = new moodle_select();
$select = new html_select();
$select->options = $displaylist;
$select->name = "moveto";
$select->label = get_string("moveselectedcoursesto");
Expand Down
4 changes: 2 additions & 2 deletions enrol/authorize/config_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@
<td align="right">an_cutoff:</td>
<td><?php
$curtime = make_timestamp(2000,1,1,$frm->an_cutoff_hour,$frm->an_cutoff_min);
$hourselector = moodle_select::make_time_selector('hours', 'an_cutoff_hour', $curtime);
$minselector = moodle_select::make_time_selector('minutes', 'an_cutoff_min', $curtime);
$hourselector = html_select::make_time_selector('hours', 'an_cutoff_hour', $curtime);
$minselector = html_select::make_time_selector('minutes', 'an_cutoff_min', $curtime);
echo $OUTPUT->select($hourselector) . $OUTPUT->select($minselector);
?><br />
<?php print_string("cutofftime", "enrol_authorize") ?></td>
Expand Down
6 changes: 3 additions & 3 deletions enrol/authorize/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function authorize_print_orders($courseid, $userid) {
if (($popupcrs = $DB->get_records_sql_menu($sql, $params))) {
$popupcrs = array($SITE->id => $SITE->fullname) + $popupcrs;
}
$popupmenu = empty($popupcrs) ? '' : $OUTPUT->select(moodle_select::make_popup_form($baseurl.'&status='.$status, 'course', $popupcrs, 'coursesmenu', $courseid));
$popupmenu = empty($popupcrs) ? '' : $OUTPUT->select(html_select::make_popup_form($baseurl.'&status='.$status, 'course', $popupcrs, 'coursesmenu', $courseid));
$popupmenu .= '<br />';
$statusmenu = array(
AN_STATUS_NONE => $strs->all,
Expand All @@ -66,7 +66,7 @@ function authorize_print_orders($courseid, $userid) {
AN_STATUS_TEST => $authstrs->tested
);

$popupmenu .= $OUTPUT->select(moodle_select::make_popup_form($baseurl.'&course='.$courseid, 'status', $statusmenu, 'statusmenu', $status));
$popupmenu .= $OUTPUT->select(html_select::make_popup_form($baseurl.'&course='.$courseid, 'status', $statusmenu, 'statusmenu', $status));
if ($canmanagepayments) {
$popupmenu .= '<br />';
$checkbox = html_select_option::make_checkbox(1, $userid == $USER->id, get_string('mypaymentsonly', 'enrol_authorize'));
Expand All @@ -92,7 +92,7 @@ function authorize_print_orders($courseid, $userid) {

if ($perpage > 100) { $perpage = 100; }
$perpagemenus = array(5 => 5, 10 => 10, 20 => 20, 50 => 50, 100 => 100);
$perpagemenu = $OUTPUT->select(moodle_select::make_popup_form($baseurl.'&status='.$status.'&course='.$courseid, 'perpage',$perpagemenus,'perpagemenu',$perpage));
$perpagemenu = $OUTPUT->select(html_select::make_popup_form($baseurl.'&status='.$status.'&course='.$courseid, 'perpage',$perpagemenus,'perpagemenu',$perpage));
$table->define_columns(array('id', 'userid', 'timecreated', 'status', 'action'));
$table->define_headers(array($authstrs->orderid, $authstrs->shopper, $strs->time, $strs->status, $perpagemenu));
$table->define_baseurl($baseurl."&amp;status=$status&amp;course=$courseid&amp;perpage=$perpage");
Expand Down
2 changes: 1 addition & 1 deletion enrol/mnet/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
if (is_array($mnethosts)) {
$servercount = count(array_keys($mnethosts));
}
$select = moodle_select::make_yes_no('enrol_mnet_allow_allcourses', $frm->enrol_mnet_allow_allcourses);
$select = html_select::make_yes_no('enrol_mnet_allow_allcourses', $frm->enrol_mnet_allow_allcourses);

?>
<table cellspacing="0" cellpadding="5" border="0" class="boxaligncenter">
Expand Down
2 changes: 1 addition & 1 deletion grade/edit/tree/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@
echo '<br /><br />';
echo '<input type="hidden" name="bulkmove" value="0" id="bulkmoveinput" />';
echo get_string('moveselectedto', 'grades') . ' ';
$select = new moodle_select();
$select = new html_select();
$select->options = $categories;
$select->name = 'moveafter';
$select->disabled = true;
Expand Down
2 changes: 1 addition & 1 deletion grade/edit/tree/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ public function get_category_cell($category, $levelclass, $params) {
}
}

$select = new moodle_select();
$select = new html_select();
$select->options = $options;
$select->name = 'aggregation_'.$category->id;
$select->selectedvalue = $category->aggregation;
Expand Down
4 changes: 2 additions & 2 deletions grade/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ function print_graded_users_selector($course, $actionpage, $userid=0, $groupid=0
if ($includeall) {
$menu[0] .= " (" . (count($menu) - 1) . ")";
}
$select = moodle_select::make_popup_form($CFG->wwwroot.'/grade/' . $actionpage, 'userid', $menu, 'choosegradeuser', $userid);
$select = html_select::make_popup_form($CFG->wwwroot.'/grade/' . $actionpage, 'userid', $menu, 'choosegradeuser', $userid);
$select->set_label($label);
return $OUTPUT->select($select);
}
Expand Down Expand Up @@ -359,7 +359,7 @@ function print_grade_plugin_selector($plugin_info, $return=false) {

// finally print/return the popup form
if ($count > 1) {
$select = moodle_select::make_popup_form('', '', $menu, 'choosepluginreport', '');
$select = html_select::make_popup_form('', '', $menu, 'choosepluginreport', '');
$select->override_option_values($menu);

if ($return) {
Expand Down
4 changes: 2 additions & 2 deletions group/overview.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
$options[$grouping->id] = strip_tags(format_string($grouping->name));
}
$popupurl = $rooturl.'&group='.$groupid;
$select = moodle_select::make_popup_form($popupurl, 'grouping', $options, 'selectgrouping', $groupingid);
$select = html_select::make_popup_form($popupurl, 'grouping', $options, 'selectgrouping', $groupingid);
$select->set_label($strgrouping);
echo $OUTPUT->select($select);
}
Expand All @@ -141,7 +141,7 @@
$options[$group->id] = strip_tags(format_string($group->name));
}
$popupurl = $rooturl.'&grouping='.$groupingid;
$select = moodle_select::make_popup_form($popupurl, 'group', $options, 'selectgroup', $groupid);
$select = html_select::make_popup_form($popupurl, 'group', $options, 'selectgroup', $groupid);
$select->set_label($strgroup);
echo $OUTPUT->select($select);

Expand Down
Loading

0 comments on commit 7b1f2c8

Please sign in to comment.