diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index 231de2f..7aa9ae8 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -1491,67 +1491,14 @@ function notice_yesno($message, $linkyes, $linkno, $optionsyes=NULL, $optionsno= } /** - * Prints a scale menu (as part of an existing form) including help button - * @deprecated since Moodle 2.0 - */ -function print_scale_menu() { - throw new coding_exception('print_scale_menu() has been deprecated since the Jurassic period. Get with the times!.'); -} - -/** - * Given an array of values, output the HTML for a select element with those options. - * - * @deprecated since Moodle 2.0 - * - * Normally, you only need to use the first few parameters. - * - * @param array $options The options to offer. An array of the form - * $options[{value}] = {text displayed for that option}; - * @param string $name the name of this form control, as in <select name="..." ... - * @param string $selected the option to select initially, default none. - * @param string $nothing The label for the 'nothing is selected' option. Defaults to get_string('choose'). - * Set this to '' if you don't want a 'nothing is selected' option. - * @param string $script if not '', then this is added to the <select> element as an onchange handler. - * @param string $nothingvalue The value corresponding to the $nothing option. Defaults to 0. - * @param boolean $return if false (the default) the the output is printed directly, If true, the - * generated HTML is returned as a string. - * @param boolean $disabled if true, the select is generated in a disabled state. Default, false. - * @param int $tabindex if give, sets the tabindex attribute on the <select> element. Default none. - * @param string $id value to use for the id attribute of the <select> element. If none is given, - * then a suitable one is constructed. - * @param mixed $listbox if false, display as a dropdown menu. If true, display as a list box. - * By default, the list box will have a number of rows equal to min(10, count($options)), but if - * $listbox is an integer, that number is used for size instead. - * @param boolean $multiple if true, enable multiple selections, else only 1 item can be selected. Used - * when $listbox display is enabled - * @param string $class value to use for the class attribute of the <select> element. If none is given, - * then a suitable one is constructed. - * @return string|void If $return=true returns string, else echo's and returns void + * @deprecated use html_writer::select() instead. + * @todo remove completely in MDL-40517 */ function choose_from_menu ($options, $name, $selected='', $nothing='choose', $script='', $nothingvalue='0', $return=false, $disabled=false, $tabindex=0, $id='', $listbox=false, $multiple=false, $class='') { - global $OUTPUT; - debugging('choose_from_menu() has been deprecated. Please change your code to use html_writer::select().'); - - if ($script) { - debugging('The $script parameter has been deprecated. You must use component_actions instead', DEBUG_DEVELOPER); - } - $attributes = array(); - $attributes['disabled'] = $disabled ? 'disabled' : null; - $attributes['tabindex'] = $tabindex ? $tabindex : null; - $attributes['multiple'] = $multiple ? $multiple : null; - $attributes['class'] = $class ? $class : null; - $attributes['id'] = $id ? $id : null; - - $output = html_writer::select($options, $name, $selected, array($nothingvalue=>$nothing), $attributes); - - if ($return) { - return $output; - } else { - echo $output; - } + throw new coding_exception('choose_from_menu() can not be used anymore. Please use html_writer::select() instead.'); } /**