Skip to content

Commit

Permalink
MDL-20204 some more steps away from html_select
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Feb 9, 2010
1 parent aebddeb commit 6fe3775
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 32 deletions.
8 changes: 4 additions & 4 deletions admin/environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@
}

/// Print form and popup menu
echo '<div style="text-align:center">'.$strmoodleversion.' ';
$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 style="text-align:center"> ';
$select = new single_select(new moodle_url('/admin/environment.php'), 'version', $versions, $version, null);
$select->label = $strmoodleversion;
echo $OUTPUT->render($select);
echo '</div>';

/// End of main box
Expand Down
24 changes: 12 additions & 12 deletions admin/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@
echo $OUTPUT->box_start();
$currlang = current_language();
$langs = get_list_of_languages(false, true);
$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);
$select = new single_select(new moodle_url('/admin/lang.php'), 'lang', $langs, $currlang, null);
$select->label = $strcurrentlanguage.':';
$select->formid = 'chooselang';
echo $OUTPUT->render($select);
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
exit;
Expand Down Expand Up @@ -492,10 +492,10 @@
//$selectionlabel .= $strfilestoredin;
$selectionlabel .= $uselocal ? "{$currentlang}_local" : $currentlang;
$selectionlabel .= '/</code>';
$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);
$select = new single_select(new moodle_url('/admin/lang.php?mode=compare'), 'currentfile', $menufiles, $currentfile, array(''=>$strchoosefiletoedit));
$select->label = $selectionlabel;
$select->formid = 'choosefile';
echo $OUTPUT->render($select);
echo $OUTPUT->help_icon('langswitchstorage', $strfilestoredinhelp);
echo $OUTPUT->box_end();

Expand Down Expand Up @@ -759,10 +759,10 @@
//$selectionlabel .= $strfilestoredin;
$selectionlabel .= $uselocal ? "{$currentlang}_local" : $currentlang;
$selectionlabel .= '/help/</code>';
$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);
$select = new single_select(new moodle_url('/admin/lang.php?mode=helpfiles'), 'currentfile', $menufiles, $currentfile, array(''=>$strchoosefiletoedit));
$select->label = $selectionlabel;
$select->formid = 'choosefile';
echo $OUTPUT->render($select);
echo $OUTPUT->help_icon('langswitchstorage', $strfilestoredinhelp);
echo $OUTPUT->box_end();

Expand Down
2 changes: 1 addition & 1 deletion calendar/set.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
// Required due to changes in view/lib.php mainly (calendar_session_vars())
$courseid = '';
if (!empty($id)) {
$courseid = '&amp;course='.$id;
$courseid = '&course='.$id;
}

switch($var) {
Expand Down
7 changes: 4 additions & 3 deletions calendar/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ function calendar_course_filter_selector($getvars = '') {

unset($courses[SITEID]);

$courseoptions = array();
$courseoptions[SITEID] = get_string('fulllistofcourses');
foreach ($courses as $course) {
$courseoptions[$course->id] = format_string($course->shortname);
Expand All @@ -652,7 +653,7 @@ function calendar_course_filter_selector($getvars = '') {
} else {
$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);
$select = new single_select(new moodle_url(CALENDAR_URL.'set.php?var=setcourse&'.$getvars), 'id', $courseoptions, $selected, null);
$select->class = 'cal_courses_flt';
echo $OUTPUT->render($select);
}
11 changes: 5 additions & 6 deletions course/format/topics/format.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,9 @@
echo "</ul>\n";

if (!empty($sectionmenu)) {
echo '<div class="jumpmenu">';
$popupurl = $CFG->wwwroot.'/course/view.php?id='.$course->id;
$select = html_select::make_popup_form($popupurl, 'topic', $sectionmenu, 'sectionmenu');
$select->set_label(get_string('jumpto'));
echo $OUTPUT->select($select);
echo '</div>';
$select = new single_select(new moodle_url('/course/view.php', array('id'=>$course->id)), 'topic', $sectionmenu);
$select->label = get_string('jumpto');
$select->class = 'jumpmenu';
$select->formid = 'sectionmenu';
echo $OUTPUT->render($select);
}
11 changes: 5 additions & 6 deletions course/format/weeks/format.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,9 @@
echo "</ul>\n";

if (!empty($sectionmenu)) {
echo '<div class="jumpmenu">';
$popupurl = $CFG->wwwroot.'/course/view.php?id='.$course->id;
$select = html_select::make_popup_form($popupurl, 'week', $sectionmenu, 'sectionmenu');
$select->set_label(get_string('jumpto'));
echo $OUTPUT->select($select);
echo '</div>';
$select = new single_select(new moodle_url('/course/view.php', array('id'=>$course->id)), 'week', $sectionmenu);
$select->label = get_string('jumpto');
$select->class = 'jumpmenu';
$select->formid = 'sectionmenu';
echo $OUTPUT->render($select);
}

0 comments on commit 6fe3775

Please sign in to comment.