MDL-34508 Formslib: Removed deprecated setHelpButton() from editor.php and hidden.php
authorRajesh Taneja <rajesh@moodle.com>
Wed, 17 Apr 2013 06:17:41 +0000 (14:17 +0800)
committerRajesh Taneja <rajesh@moodle.com>
Wed, 17 Apr 2013 06:21:07 +0000 (14:21 +0800)
lib/form/editor.php
lib/form/hidden.php

index e3e23aa..e8ef54e 100644 (file)
@@ -227,28 +227,10 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element {
     }
 
     /**
-     * Sets help button for editor
-     *
-     * @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-34508 this api will be removed.
-     * @see MoodleQuickForm::addHelpButton()
+     * @deprecated since Moodle 2.0
      */
     function setHelpButton($_helpbuttonargs, $function='_helpbutton') {
-        debugging('setHelpButton() is deprecated, please use $mform->addHelpButton() instead');
-        if (!is_array($_helpbuttonargs)) {
-            $_helpbuttonargs = array($_helpbuttonargs);
-        } else {
-            $_helpbuttonargs = $_helpbuttonargs;
-        }
-        //we do this to to return html instead of printing it
-        //without having to specify it in every call to make a button.
-        if ('_helpbutton' == $function){
-            $defaultargs = array('', '', 'moodle', true, false, '', true);
-            $_helpbuttonargs = $_helpbuttonargs + $defaultargs ;
-        }
-        $this->_helpbutton=call_user_func_array($function, $_helpbuttonargs);
+        throw new coding_exception('setHelpButton() can not be used any more, please see MoodleQuickForm::addHelpButton().');
     }
 
     /**
index b0e78b4..6c2f239 100644 (file)
@@ -54,16 +54,10 @@ class MoodleQuickForm_hidden extends HTML_QuickForm_hidden{
     }
 
     /**
-     * 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-34508 this api will be removed.
-     * @see MoodleQuickForm::addHelpButton()
+     * @deprecated since Moodle 2.0
      */
     function setHelpButton($helpbuttonargs, $function='helpbutton'){
-        debugging('setHelpButton() is deprecated, please use $mform->addHelpButton() instead');
+        throw new coding_exception('setHelpButton() can not be used any more, please see MoodleQuickForm::addHelpButton().');
     }
 
     /**