MDL-19791 Upgraded calls to choose_from_menu

This commit is contained in:
nicolasconnault
2009-08-17 15:16:26 +00:00
parent dad2baefae
commit ba179d56c9
3 changed files with 20 additions and 8 deletions
+1 -1
View File
@@ -188,7 +188,7 @@ function comp(v) { // general entry point for all cases
$options[52] = get_string('weekly','block_loancalc');
$options[26] = get_string('fortnightly','block_loancalc');
$options[12] = get_string('monthly','block_loancalc');
$this->content->text .= choose_from_menu($options,'LOANPAYPERIOD','12',NULL,NULL,NULL,true);
$this->content->text .= $OUTPUT->select(html_select::make($options,'LOANPAYPERIOD','12'));
$this->content->text .= '</td>
<td></td>
</tr>
+2 -2
View File
@@ -1518,14 +1518,14 @@ function calendar_format_event_time($event, $now, $morehref, $usecommonwords = t
}
function calendar_print_month_selector($name, $selected) {
global $OUTPUT;
$months = array();
for ($i=1; $i<=12; $i++) {
$months[$i] = userdate(gmmktime(12, 0, 0, $i, 15, 2000), '%B');
}
choose_from_menu($months, $name, $selected, '');
echo $OUTPUT->select(html_select::make($months, $name, $selected, false));
}
function calendar_get_filters_status() {
+17 -5
View File
@@ -9,7 +9,9 @@
$options['0'] = get_string('default', 'calendar');
$options[CALENDAR_TF_12] = get_string('timeformat_12', 'calendar');
$options[CALENDAR_TF_24] = get_string('timeformat_24', 'calendar');
choose_from_menu ($options, "timeformat", $prefs->timeformat, "", "", "");
$select = html_select::make($options, "timeformat", $prefs->timeformat, false);
$select->nothingvalue = '';
echo $OUTPUT->select($select);
?>
<p><?php print_string('explain_timeformat', 'calendar'); ?></p>
</td>
@@ -27,7 +29,9 @@
$options[4] = get_string('thursday', 'calendar');
$options[5] = get_string('friday', 'calendar');
$options[6] = get_string('saturday', 'calendar');
choose_from_menu($options, 'startwday', $prefs->startwday, '', '', '');
$select = html_select::make($options, 'startwday', $prefs->startwday, false);
$select->nothingvalue = '';
echo $OUTPUT->select($select);
?>
<p><?php print_string('explain_startwday', 'calendar'); ?></p>
</td>
@@ -41,7 +45,9 @@
for ($i=1; $i<=20; $i++) {
$options[$i] = $i;
}
choose_from_menu ($options, "maxevents", $prefs->maxevents, "", "", "");
$select = html_select::make($options, "maxevents", $prefs->maxevents, false);
$select->nothingvalue = '';
echo $OUTPUT->select($select);
?>
<p><?php print_string('explain_maxevents', 'calendar'); ?></p>
</td>
@@ -55,7 +61,9 @@
for ($i=1; $i<=200; $i++) {
$options[$i] = $i;
}
choose_from_menu ($options, "lookahead", $prefs->lookahead, "", "", "");
$select = html_select::make($options, "lookahead", $prefs->lookahead, false);
$select->nothingvalue = '';
echo $OUTPUT->select($select);
?>
<p><?php print_string('explain_lookahead', 'calendar'); ?></p>
</td>
@@ -64,7 +72,11 @@
<tr>
<th scope="row"><?php print_string('pref_persistflt', 'calendar')?>:</th>
<td>
<?php choose_from_menu (array(0 => get_string('no'), 1 => get_string('yes')), 'persistflt', $prefs->persistflt, '', '', ''); ?>
<?php
$select = html_select::make(array(0 => get_string('no'), 1 => get_string('yes')), 'persistflt', $prefs->persistflt, false);
$select->nothingvalue = '';
echo $OUTPUT->select($select);
?>
<p><?php print_string('explain_persistflt', 'calendar'); ?></p>
</td>
</tr>