$id='', $listbox=false, $multiple=false, $class='') {
global $OUTPUT;
- // debugging('choose_from_menu() has been deprecated. Please change your code to use $OUTPUT->select($select).');
+ debugging('choose_from_menu() has been deprecated. Please change your code to use $OUTPUT->select($select).');
if ($script) {
debugging('The $script parameter has been deprecated. You must use component_actions instead', DEBUG_DEVELOPER);
* @param array $options used to initialise {@link $options}.
* @param string $name used to initialise {@link $name}.
* @param string $selected used to initialise {@link $selected}.
+ * @param string $nothinglabel The label for the 'nothing is selected' option. Defaults to "Choose..."
* @return html_select A html_select object with the three common fields initialised.
*/
- public static function make($options, $name, $selected = '') {
+ public static function make($options, $name, $selected = '', $nothinglabel='choosedots') {
$menu = new html_select();
$menu->options = $options;
$menu->name = $name;
* This function is not part of the public api.
*/
function download_buttons(){
+ global $OUTPUT;
if ($this->is_downloadable() && !$this->is_downloading()){
$downloadoptions = $this->get_download_menu();
$html = '<form action="'. $this->baseurl .'" method="post">';
$html .= '<div class="mdl-align">';
$html .= '<input type="submit" value="'.get_string('downloadas', 'table').'"/>';
- $html .= choose_from_menu ($downloadoptions, 'download', $this->defaultdownloadformat, '', '', '', true);
+ $select = html_select::make($downloadoptions, 'download', $this->defaultdownloadformat, false);
+ $select->nothingvalue = '';
+ $html .= $OUTPUT->select($select);
$html .= helpbutton('tableexportformats', get_string('tableexportformats', 'table'), 'moodle', true, false, '', true);
$html .= '</div></form>';
for ($i=100; $i>=1; $i--) {
$grades[$i] = $i;
}
- $output .= choose_from_menu($grades, $name, $current, '', '', 0, true);
+ $output .= $OUTPUT->select(html_select::make($grades, $name, $current, false));
$linkobject = '<span class="helplink"><img class="iconhelp" alt="'.$strscales.'" src="'.$OUTPUT->old_icon_url('help') . '" /></span>';
$output .= link_to_popup_window ('/course/scales.php?id='. $courseid .'&list=true', 'ratingscales',
}
function message_print_settings() {
- global $USER;
+ global $USER, $OUTPUT;
if ($frm = data_submitted() and confirm_sesskey()) {
$cbemailmessages = (get_user_preferences('message_emailmessages', 1) == '1') ? 'checked="checked"' : '';
$txemailaddress = get_user_preferences('message_emailaddress', $USER->email);
$txemailtimenosee = get_user_preferences('message_emailtimenosee', 10);
- $format_select = choose_from_menu( array(FORMAT_PLAIN => get_string('formatplain'),
+ $format_select = $OUTPUT->select(html_select::make( array(FORMAT_PLAIN => get_string('formatplain'),
FORMAT_HTML => get_string('formathtml')),
'emailformat',
- get_user_preferences('message_emailformat', FORMAT_PLAIN),
- false, '', '0', true );
+ get_user_preferences('message_emailformat', FORMAT_PLAIN)));
include('settings.html');
}