mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 13:02:07 +02:00
MDL-31294 Forms Library: Removed deprecated functions from forms library
This commit is contained in:
parent
fc9ae8d164
commit
c277b502ab
@ -42,17 +42,6 @@ class MoodleQuickForm_rubriceditor extends HTML_QuickForm_input {
|
||||
parent::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
* set html for help button
|
||||
*
|
||||
* @access public
|
||||
* @param array $help array of arguments to make a help button
|
||||
* @param string $function function name to call to get html
|
||||
*/
|
||||
public function setHelpButton($helpbuttonargs, $function='helpbutton'){
|
||||
debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
|
||||
}
|
||||
|
||||
/**
|
||||
* get html for help button
|
||||
*
|
||||
|
@ -84,19 +84,6 @@ class MoodleQuickForm_advcheckbox extends HTML_QuickForm_advcheckbox{
|
||||
parent::HTML_QuickForm_advcheckbox($elementName, $elementLabel, $text, $attributes, $values);
|
||||
}
|
||||
|
||||
/**
|
||||
* set html for help button
|
||||
*
|
||||
* @param array $helpbuttonargs array of arguments to make a help button
|
||||
* @param string $function (optional)function name get help html
|
||||
* @deprecated since Moodle 2.0. Please do not call this function any more.
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @see MoodleQuickForm::setHelpButton()
|
||||
*/
|
||||
function setHelpButton($helpbuttonargs, $function='helpbutton'){
|
||||
debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
|
||||
}
|
||||
|
||||
/**
|
||||
* get html for help button
|
||||
*
|
||||
|
@ -54,19 +54,6 @@ class MoodleQuickForm_button extends HTML_QuickForm_button
|
||||
parent::HTML_QuickForm_button($elementName, $value, $attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
* set html for help button
|
||||
*
|
||||
* @param array $helpbuttonargs array of arguments to make a help button
|
||||
* @param string $function function name to call to get html
|
||||
* @deprecated since Moodle 2.0. Please do not call this function any more.
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @see MoodleQuickForm::setHelpButton()
|
||||
*/
|
||||
function setHelpButton($helpbuttonargs, $function='helpbutton'){
|
||||
debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
|
||||
}
|
||||
|
||||
/**
|
||||
* get html for help button
|
||||
*
|
||||
|
@ -56,19 +56,6 @@ class MoodleQuickForm_checkbox extends HTML_QuickForm_checkbox{
|
||||
parent::HTML_QuickForm_checkbox($elementName, $elementLabel, $text, $attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
* set html for help button
|
||||
*
|
||||
* @param array $helpbuttonargs array of arguments to make a help button
|
||||
* @param string $function function name to call to get html
|
||||
* @deprecated since Moodle 2.0. Please do not call this function any more.
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @see MoodleQuickForm::setHelpButton()
|
||||
*/
|
||||
function setHelpButton($helpbuttonargs, $function='helpbutton'){
|
||||
debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
|
||||
}
|
||||
|
||||
/**
|
||||
* get html for help button
|
||||
*
|
||||
|
@ -208,10 +208,11 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element {
|
||||
* @param mixed $_helpbuttonargs arguments to create help button
|
||||
* @param string $function name of the callback function
|
||||
* @deprecated since Moodle 2.0. Please do not call this function any more.
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @todo MDL-34508 this api will be removed.
|
||||
* @see MoodleQuickForm::setHelpButton()
|
||||
*/
|
||||
function setHelpButton($_helpbuttonargs, $function='_helpbutton') {
|
||||
debugging('setHelpButton() is deprecated, please use $mform->addHelpButton() instead');
|
||||
if (!is_array($_helpbuttonargs)) {
|
||||
$_helpbuttonargs = array($_helpbuttonargs);
|
||||
} else {
|
||||
|
@ -169,19 +169,6 @@ class MoodleQuickForm_filemanager extends HTML_QuickForm_element {
|
||||
$this->_options['maxfiles'] = $num;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets help button for filemanager
|
||||
*
|
||||
* @param mixed $helpbuttonargs arguments to create help button
|
||||
* @param string $function name of the callback function
|
||||
* @deprecated since Moodle 2.0. Please do not call this function any more.
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @see MoodleQuickForm::setHelpButton()
|
||||
*/
|
||||
function setHelpButton($helpbuttonargs, $function='helpbutton'){
|
||||
debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns html for help button.
|
||||
*
|
||||
|
@ -84,19 +84,6 @@ class MoodleQuickForm_filepicker extends HTML_QuickForm_input {
|
||||
parent::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets help button for filepicker
|
||||
*
|
||||
* @param mixed $helpbuttonargs arguments to create help button
|
||||
* @param string $function name of the callback function
|
||||
* @deprecated since Moodle 2.0. Please do not call this function any more.
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @see MoodleQuickForm::setHelpButton()
|
||||
*/
|
||||
function setHelpButton($helpbuttonargs, $function='helpbutton') {
|
||||
debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns html for help button.
|
||||
*
|
||||
|
@ -89,19 +89,6 @@ class MoodleQuickForm_grading extends HTML_QuickForm_input{
|
||||
return $this->get_gradinginstance()->render_grading_element($PAGE, $this);
|
||||
}
|
||||
|
||||
/**
|
||||
* set html for help button
|
||||
*
|
||||
* @param array $helpbuttonargs array of arguments to make a help button
|
||||
* @param string $function function name to call to get html
|
||||
* @deprecated since Moodle 2.0. Please do not call this function any more.
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @see MoodleQuickForm::setHelpButton()
|
||||
*/
|
||||
public function setHelpButton($helpbuttonargs, $function='helpbutton'){
|
||||
debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
|
||||
}
|
||||
|
||||
/**
|
||||
* get html for help button
|
||||
*
|
||||
|
@ -57,19 +57,6 @@ class MoodleQuickForm_group extends HTML_QuickForm_group{
|
||||
/** @var string template type, would cause problems with client side validation so will leave for now */
|
||||
//var $_elementTemplateType='fieldset';
|
||||
|
||||
/**
|
||||
* set html for help button
|
||||
*
|
||||
* @param array $helpbuttonargs array of arguments to make a help button
|
||||
* @param string $function function name to call to get html
|
||||
* @deprecated since Moodle 2.0. Please do not call this function any more.
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @see MoodleQuickForm::setHelpButton()
|
||||
*/
|
||||
function setHelpButton($helpbuttonargs, $function='helpbutton'){
|
||||
debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
|
||||
}
|
||||
|
||||
/**
|
||||
* set html for help button
|
||||
*/
|
||||
|
@ -63,19 +63,6 @@ class MoodleQuickForm_header extends HTML_QuickForm_header
|
||||
$renderer->renderHeader($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* set html for help button
|
||||
*
|
||||
* @param array $helpbuttonargs array of arguments to make a help button
|
||||
* @param string $function function name to call to get html
|
||||
* @deprecated since Moodle 2.0. Please do not call this function any more.
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @see MoodleQuickForm::setHelpButton()
|
||||
*/
|
||||
function setHelpButton($helpbuttonargs, $function='helpbutton'){
|
||||
debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
|
||||
}
|
||||
|
||||
/**
|
||||
* get html for help button
|
||||
*
|
||||
|
@ -59,11 +59,11 @@ class MoodleQuickForm_hidden extends HTML_QuickForm_hidden{
|
||||
* @param array $helpbuttonargs array of arguments to make a help button
|
||||
* @param string $function function name to call to get html
|
||||
* @deprecated since Moodle 2.0. Please do not call this function any more.
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @todo MDL-34508 this api will be removed.
|
||||
* @see MoodleQuickForm::setHelpButton()
|
||||
*/
|
||||
function setHelpButton($helpbuttonargs, $function='helpbutton'){
|
||||
|
||||
debugging('setHelpButton() is deprecated, please use $mform->addHelpButton() instead');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -85,19 +85,6 @@ class MoodleQuickForm_htmleditor extends MoodleQuickForm_textarea{
|
||||
editors_head_setup();
|
||||
}
|
||||
|
||||
/**
|
||||
* set html for help button
|
||||
*
|
||||
* @param array $helpbuttonargs array of arguments to make a help button
|
||||
* @param string $function function name to call to get html
|
||||
* @deprecated since Moodle 2.0. Please do not call this function any more.
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @see MoodleQuickForm::setHelpButton()
|
||||
*/
|
||||
function setHelpButton($helpbuttonargs, $function='helpbutton'){
|
||||
debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the input field in HTML
|
||||
*
|
||||
|
@ -68,19 +68,6 @@ class MoodleQuickForm_password extends HTML_QuickForm_password{
|
||||
parent::HTML_QuickForm_password($elementName, $elementLabel, $attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
* set html for help button
|
||||
*
|
||||
* @param array $helpbuttonargs array of arguments to make a help button
|
||||
* @param string $function function name to call to get html
|
||||
* @deprecated since Moodle 2.0. Please do not call this function any more.
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @see MoodleQuickForm::setHelpButton()
|
||||
*/
|
||||
function setHelpButton($helpbuttonargs, $function='helpbutton'){
|
||||
debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
|
||||
}
|
||||
|
||||
/**
|
||||
* get html for help button
|
||||
*
|
||||
|
@ -55,19 +55,6 @@ class MoodleQuickForm_radio extends HTML_QuickForm_radio{
|
||||
parent::HTML_QuickForm_radio($elementName, $elementLabel, $text, $value, $attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
* set html for help button
|
||||
*
|
||||
* @param array $helpbuttonargs array of arguments to make a help button
|
||||
* @param string $function function name to call to get html
|
||||
* @deprecated since Moodle 2.0. Please do not call this function any more.
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @see MoodleQuickForm::setHelpButton()
|
||||
*/
|
||||
function setHelpButton($helpbuttonargs, $function='helpbutton'){
|
||||
debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
|
||||
}
|
||||
|
||||
/**
|
||||
* get html for help button
|
||||
*
|
||||
|
@ -110,19 +110,6 @@ class MoodleQuickForm_recaptcha extends HTML_QuickForm_input {
|
||||
return $html . recaptcha_get_html($CFG->recaptchapublickey, $error, $this->_https);
|
||||
}
|
||||
|
||||
/**
|
||||
* set html for help button
|
||||
*
|
||||
* @param array $helpbuttonargs array of arguments to make a help button
|
||||
* @param string $function function name to call to get html
|
||||
* @deprecated since Moodle 2.0. Please do not call this function any more.
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @see MoodleQuickForm::setHelpButton()
|
||||
*/
|
||||
function setHelpButton($helpbuttonargs, $function='helpbutton'){
|
||||
debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
|
||||
}
|
||||
|
||||
/**
|
||||
* get html for help button
|
||||
*
|
||||
|
@ -80,19 +80,6 @@ class MoodleQuickForm_select extends HTML_QuickForm_select{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* set html for help button
|
||||
*
|
||||
* @param array $helpbuttonargs array of arguments to make a help button
|
||||
* @param string $function function name to call to get html
|
||||
* @deprecated since Moodle 2.0. Please do not call this function any more.
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @see MoodleQuickForm::setHelpButton()
|
||||
*/
|
||||
function setHelpButton($helpbuttonargs, $function='helpbutton'){
|
||||
debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
|
||||
}
|
||||
|
||||
/**
|
||||
* get html for help button
|
||||
*
|
||||
|
@ -474,19 +474,6 @@ class MoodleQuickForm_selectgroups extends HTML_QuickForm_element {
|
||||
$this->_hiddenLabel = $hiddenLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* set html for help button
|
||||
*
|
||||
* @param array $helpbuttonargs array of arguments to make a help button
|
||||
* @param string $function function name to call to get html
|
||||
* @deprecated since Moodle 2.0. Please do not call this function any more.
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @see MoodleQuickForm::setHelpButton()
|
||||
*/
|
||||
function setHelpButton($helpbuttonargs, $function='helpbutton'){
|
||||
debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
|
||||
}
|
||||
|
||||
/**
|
||||
* get html for help button
|
||||
*
|
||||
|
@ -119,19 +119,6 @@ class MoodleQuickForm_selectwithlink extends HTML_QuickForm_select{
|
||||
return $retval;
|
||||
}
|
||||
|
||||
/**
|
||||
* set html for help button
|
||||
*
|
||||
* @param array $helpbuttonargs array of arguments to make a help button
|
||||
* @param string $function function name to call to get html
|
||||
* @deprecated since Moodle 2.0. Please do not call this function any more.
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @see MoodleQuickForm::setHelpButton()
|
||||
*/
|
||||
function setHelpButton($helpbuttonargs, $function='helpbutton'){
|
||||
debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
|
||||
}
|
||||
|
||||
/**
|
||||
* get html for help button
|
||||
*
|
||||
|
@ -55,19 +55,6 @@ class MoodleQuickForm_static extends HTML_QuickForm_static{
|
||||
parent::HTML_QuickForm_static($elementName, $elementLabel, $text);
|
||||
}
|
||||
|
||||
/**
|
||||
* set html for help button
|
||||
*
|
||||
* @param array $helpbuttonargs array of arguments to make a help button
|
||||
* @param string $function function name to call to get html
|
||||
* @deprecated since Moodle 2.0. Please do not call this function any more.
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @see MoodleQuickForm::setHelpButton()
|
||||
*/
|
||||
function setHelpButton($helpbuttonargs, $function='helpbutton'){
|
||||
debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
|
||||
}
|
||||
|
||||
/**
|
||||
* get html for help button
|
||||
*
|
||||
|
@ -79,19 +79,6 @@ class MoodleQuickForm_text extends HTML_QuickForm_text{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* set html for help button
|
||||
*
|
||||
* @param array $helpbuttonargs array of arguments to make a help button
|
||||
* @param string $function function name to call to get html
|
||||
* @deprecated since Moodle 2.0. Please do not call this function any more.
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @see MoodleQuickForm::setHelpButton()
|
||||
*/
|
||||
function setHelpButton($helpbuttonargs, $function='helpbutton'){
|
||||
debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
|
||||
}
|
||||
|
||||
/**
|
||||
* get html for help button
|
||||
*
|
||||
|
@ -58,19 +58,6 @@ class MoodleQuickForm_textarea extends HTML_QuickForm_textarea{
|
||||
parent::HTML_QuickForm_textarea($elementName, $elementLabel, $attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
* set html for help button
|
||||
*
|
||||
* @param array $helpbuttonargs array of arguments to make a help button
|
||||
* @param string $function function name to call to get html
|
||||
* @deprecated since Moodle 2.0. Please do not call this function any more.
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @see MoodleQuickForm::setHelpButton()
|
||||
*/
|
||||
function setHelpButton($helpbuttonargs, $function='helpbutton'){
|
||||
debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
|
||||
}
|
||||
|
||||
/**
|
||||
* get html for help button
|
||||
*
|
||||
|
@ -127,19 +127,6 @@ EOD;
|
||||
return $str;
|
||||
}
|
||||
|
||||
/**
|
||||
* set html for help button
|
||||
*
|
||||
* @param array $helpbuttonargs array of arguments to make a help button
|
||||
* @param string $function function name to call to get html
|
||||
* @deprecated since Moodle 2.0. Please do not call this function any more.
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @see MoodleQuickForm::setHelpButton()
|
||||
*/
|
||||
function setHelpButton($helpbuttonargs, $function='helpbutton'){
|
||||
debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
|
||||
}
|
||||
|
||||
/**
|
||||
* get html for help button
|
||||
*
|
||||
|
@ -62,19 +62,6 @@ class MoodleQuickForm_warning extends HTML_QuickForm_static{
|
||||
$this->_class = $elementClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* set html for help button
|
||||
*
|
||||
* @param array $helpbuttonargs array of arguments to make a help button
|
||||
* @param string $function function name to call to get html
|
||||
* @deprecated since Moodle 2.0. Please do not call this function any more.
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @see MoodleQuickForm::setHelpButton()
|
||||
*/
|
||||
function setHelpButton($helpbuttonargs, $function='helpbutton'){
|
||||
debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns HTML for this form element.
|
||||
*
|
||||
|
@ -1529,63 +1529,6 @@ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless {
|
||||
$this->setDefaults(array($elementName=>$defaultValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an array of buttons to the form
|
||||
*
|
||||
* @param array $buttons An associative array representing help button to attach to
|
||||
* to the form. keys of array correspond to names of elements in form.
|
||||
* @param bool $suppresscheck if true then string check will be suppressed
|
||||
* @param string $function callback function to dispaly help button.
|
||||
* @deprecated since Moodle 2.0 use addHelpButton() call on each element manually
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @see MoodleQuickForm::addHelpButton()
|
||||
*/
|
||||
function setHelpButtons($buttons, $suppresscheck=false, $function='helpbutton'){
|
||||
|
||||
debugging('function moodle_form::setHelpButtons() is deprecated');
|
||||
//foreach ($buttons as $elementname => $button){
|
||||
// $this->setHelpButton($elementname, $button, $suppresscheck, $function);
|
||||
//}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a help button to element
|
||||
*
|
||||
* @param string $elementname name of the element to add the item to
|
||||
* @param array $buttonargs arguments to pass to function $function
|
||||
* @param bool $suppresscheck whether to throw an error if the element
|
||||
* doesn't exist.
|
||||
* @param string $function - function to generate html from the arguments in $button
|
||||
* @deprecated since Moodle 2.0 - use addHelpButton() call on each element manually
|
||||
* @todo MDL-31047 this api will be removed.
|
||||
* @see MoodleQuickForm::addHelpButton()
|
||||
*/
|
||||
function setHelpButton($elementname, $buttonargs, $suppresscheck=false, $function='helpbutton'){
|
||||
global $OUTPUT;
|
||||
|
||||
debugging('function moodle_form::setHelpButton() is deprecated');
|
||||
if ($function !== 'helpbutton') {
|
||||
//debugging('parameter $function in moodle_form::setHelpButton() is not supported any more');
|
||||
}
|
||||
|
||||
$buttonargs = (array)$buttonargs;
|
||||
|
||||
if (array_key_exists($elementname, $this->_elementIndex)) {
|
||||
//_elements has a numeric index, this code accesses the elements by name
|
||||
$element = $this->_elements[$this->_elementIndex[$elementname]];
|
||||
|
||||
$page = isset($buttonargs[0]) ? $buttonargs[0] : null;
|
||||
$text = isset($buttonargs[1]) ? $buttonargs[1] : null;
|
||||
$module = isset($buttonargs[2]) ? $buttonargs[2] : 'moodle';
|
||||
$linktext = isset($buttonargs[3]) ? $buttonargs[3] : false;
|
||||
|
||||
$element->_helpbutton = $OUTPUT->old_help_icon($page, $text, $module, $linktext);
|
||||
|
||||
} else if (!$suppresscheck) {
|
||||
print_error('nonexistentformelements', 'form', '', $elementname);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a help button to element, only one button per element is allowed.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user