Skip to content
Browse files

MDL-31294 Forms Library: Removed deprecated functions from forms library

  • Loading branch information...
1 parent fc9ae8d commit c277b502ab3bf3424529d762b92934680e54e09e @rajeshtaneja rajeshtaneja committed
View
11 grade/grading/form/rubric/rubriceditor.php
@@ -43,17 +43,6 @@ function MoodleQuickForm_rubriceditor($elementName=null, $elementLabel=null, $at
}
/**
- * 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
*
* @access public
View
13 lib/form/advcheckbox.php
@@ -85,19 +85,6 @@ function MoodleQuickForm_advcheckbox($elementName=null, $elementLabel=null, $tex
}
/**
- * 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
*
* @return string html for help button
View
13 lib/form/button.php
@@ -55,19 +55,6 @@ function MoodleQuickForm_button($elementName=null, $value=null, $attributes=null
}
/**
- * 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
*
* @return string html for help button
View
13 lib/form/checkbox.php
@@ -57,19 +57,6 @@ function MoodleQuickForm_checkbox($elementName=null, $elementLabel=null, $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
*
* @return string html for help button
View
3 lib/form/editor.php
@@ -208,10 +208,11 @@ function isRequired() {
* @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 {
View
13 lib/form/filemanager.php
@@ -170,19 +170,6 @@ function setMaxfiles($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.
*
* @return string html for help button
View
13 lib/form/filepicker.php
@@ -85,19 +85,6 @@ function MoodleQuickForm_filepicker($elementName=null, $elementLabel=null, $attr
}
/**
- * 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.
*
* @return string html for help button
View
13 lib/form/grading.php
@@ -90,19 +90,6 @@ public function toHtml(){
}
/**
- * 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
*
* @return string html for help button
View
13 lib/form/group.php
@@ -59,19 +59,6 @@ function MoodleQuickForm_group($elementName=null, $elementLabel=null, $elements=
/**
* 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
*/
function getHelpButton(){
return $this->_helpbutton;
View
13 lib/form/header.php
@@ -64,19 +64,6 @@ function accept(&$renderer, $required=false, $error=null)
}
/**
- * 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
*
* @return string html for help button
View
4 lib/form/hidden.php
@@ -59,11 +59,11 @@ function MoodleQuickForm_hidden($elementName=null, $value='', $attributes=null)
* @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');
}
/**
View
13 lib/form/htmleditor.php
@@ -86,19 +86,6 @@ function MoodleQuickForm_htmleditor($elementName=null, $elementLabel=null, $opti
}
/**
- * 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
*
* @return string
View
13 lib/form/password.php
@@ -69,19 +69,6 @@ function MoodleQuickForm_password($elementName=null, $elementLabel=null, $attrib
}
/**
- * 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
*
* @return string html for help button
View
13 lib/form/radio.php
@@ -56,19 +56,6 @@ function MoodleQuickForm_radio($elementName=null, $elementLabel=null, $text=null
}
/**
- * 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
*
* @return string html for help button
View
13 lib/form/recaptcha.php
@@ -111,19 +111,6 @@ function toHtml() {
}
/**
- * 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
*
* @return string html for help button
View
13 lib/form/select.php
@@ -81,19 +81,6 @@ function toHtml(){
}
/**
- * 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
*
* @return string html for help button
View
13 lib/form/selectgroups.php
@@ -475,19 +475,6 @@ function setHiddenLabel($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
*
* @return string html for help button
View
13 lib/form/selectwithlink.php
@@ -120,19 +120,6 @@ function toHtml(){
}
/**
- * 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
*
* @return string html for help button
View
13 lib/form/static.php
@@ -56,19 +56,6 @@ function MoodleQuickForm_static($elementName=null, $elementLabel=null, $text=nul
}
/**
- * 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
*
* @return string html for help button
View
13 lib/form/text.php
@@ -80,19 +80,6 @@ function toHtml(){
}
/**
- * 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
*
* @return string html for help button
View
13 lib/form/textarea.php
@@ -59,19 +59,6 @@ function MoodleQuickForm_textarea($elementName=null, $elementLabel=null, $attrib
}
/**
- * 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
*
* @return string html for help button
View
13 lib/form/url.php
@@ -128,19 +128,6 @@ function toHtml(){
}
/**
- * 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
*
* @return string html for help button
View
13 lib/form/warning.php
@@ -63,19 +63,6 @@ function MoodleQuickForm_warning($elementName=null, $elementClass='notifyproblem
}
/**
- * 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.
*
* @return string
View
57 lib/formslib.php
@@ -1530,63 +1530,6 @@ function setDefault($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.
*
* This is new, simplified and preferable method of setting a help icon on form elements.

0 comments on commit c277b50

Please sign in to comment.
Something went wrong with that request. Please try again.