From 3e8b394e088cfe979caa11e0d6b5b11d3e15dafe Mon Sep 17 00:00:00 2001 From: skodak Date: Sun, 7 Jun 2009 09:43:27 +0000 Subject: [PATCH] MDL-19416 fixed PHP 5.3 compatiblity issue - fixes weird use of constructors in quickforms --- lib/form/button.php | 3 +++ lib/form/checkbox.php | 3 +++ lib/form/file.php | 3 +++ lib/form/group.php | 3 +++ lib/form/header.php | 4 ++++ lib/form/hidden.php | 5 +++++ lib/form/password.php | 3 +++ lib/form/passwordunmask.php | 4 ++++ lib/form/radio.php | 3 +++ lib/form/select.php | 4 ++++ lib/form/static.php | 3 +++ lib/form/submit.php | 3 +++ lib/form/submitlink.php | 5 ++++- lib/form/text.php | 5 +++++ lib/form/textarea.php | 3 +++ 15 files changed, 53 insertions(+), 1 deletion(-) diff --git a/lib/form/button.php b/lib/form/button.php index 2e5649f3f8..31aa6673f7 100644 --- a/lib/form/button.php +++ b/lib/form/button.php @@ -38,6 +38,9 @@ class MoodleQuickForm_button extends HTML_QuickForm_button * @var string */ var $_helpbutton=''; + function MoodleQuickForm_button($elementName=null, $value=null, $attributes=null) { + parent::HTML_QuickForm_button($elementName, $value, $attributes); + } /** * set html for help button * diff --git a/lib/form/checkbox.php b/lib/form/checkbox.php index a2d9cbd970..d3c026214a 100644 --- a/lib/form/checkbox.php +++ b/lib/form/checkbox.php @@ -14,6 +14,9 @@ class MoodleQuickForm_checkbox extends HTML_QuickForm_checkbox{ * @var string */ var $_helpbutton=''; + function MoodleQuickForm_checkbox($elementName=null, $elementLabel=null, $text='', $attributes=null) { + parent::HTML_QuickForm_checkbox($elementName, $elementLabel, $text, $attributes); + } /** * set html for help button * diff --git a/lib/form/file.php b/lib/form/file.php index b25842b702..6d7726f11b 100644 --- a/lib/form/file.php +++ b/lib/form/file.php @@ -14,6 +14,9 @@ class MoodleQuickForm_file extends HTML_QuickForm_file{ * @var string */ var $_helpbutton=''; + function MoodleQuickForm_file($elementName=null, $elementLabel=null, $attributes=null) { + parent::HTML_QuickForm_file($elementName, $elementLabel, $attributes); + } /** * set html for help button * diff --git a/lib/form/group.php b/lib/form/group.php index fa173da6b8..a8f5633790 100644 --- a/lib/form/group.php +++ b/lib/form/group.php @@ -17,6 +17,9 @@ class MoodleQuickForm_group extends HTML_QuickForm_group{ * @var string */ var $_helpbutton=''; + function MoodleQuickForm_group($elementName=null, $elementLabel=null, $elements=null, $separator=null, $appendName = true) { + parent::HTML_QuickForm_group($elementName, $elementLabel, $elements, $separator, $appendName); + } //would cause problems with client side validation so will leave for now //var $_elementTemplateType='fieldset'; /** diff --git a/lib/form/header.php b/lib/form/header.php index b2f6b7e408..cc6425b5bd 100644 --- a/lib/form/header.php +++ b/lib/form/header.php @@ -16,6 +16,10 @@ class MoodleQuickForm_header extends HTML_QuickForm_header */ var $_helpbutton=''; + function MoodleQuickForm_header($elementName = null, $text = null) { + parent::HTML_QuickForm_header($elementName, $text); + } + // {{{ accept() /** diff --git a/lib/form/hidden.php b/lib/form/hidden.php index 7e78b1b1fa..1c5997d85d 100644 --- a/lib/form/hidden.php +++ b/lib/form/hidden.php @@ -14,6 +14,11 @@ class MoodleQuickForm_hidden extends HTML_QuickForm_hidden{ * @var string */ var $_helpbutton=''; + + function MoodleQuickForm_hidden($elementName=null, $value='', $attributes=null) { + parent::HTML_QuickForm_hidden($elementName, $value, $attributes); + } + /** * set html for help button * diff --git a/lib/form/password.php b/lib/form/password.php index 9c0cc08aff..a17b8327a6 100644 --- a/lib/form/password.php +++ b/lib/form/password.php @@ -14,6 +14,9 @@ class MoodleQuickForm_password extends HTML_QuickForm_password{ * @var string */ var $_helpbutton=''; + function MoodleQuickForm_password($elementName=null, $elementLabel=null, $attributes=null) { + parent::HTML_QuickForm_password($elementName, $elementLabel, $attributes); + } /** * set html for help button * diff --git a/lib/form/passwordunmask.php b/lib/form/passwordunmask.php index 29105159c8..ea9148787b 100644 --- a/lib/form/passwordunmask.php +++ b/lib/form/passwordunmask.php @@ -14,6 +14,10 @@ require_once($CFG->libdir.'/form/password.php'); */ class MoodleQuickForm_passwordunmask extends MoodleQuickForm_password { + function MoodleQuickForm_passwordunmask($elementName=null, $elementLabel=null, $attributes=null) { + parent::MoodleQuickForm_password($elementName, $elementLabel, $attributes); + } + function toHtml() { if ($this->_flagFrozen) { return $this->getFrozenHtml(); diff --git a/lib/form/radio.php b/lib/form/radio.php index cdd3fabbda..66384bda2b 100644 --- a/lib/form/radio.php +++ b/lib/form/radio.php @@ -14,6 +14,9 @@ class MoodleQuickForm_radio extends HTML_QuickForm_radio{ * @var string */ var $_helpbutton=''; + function MoodleQuickForm_radio($elementName=null, $elementLabel=null, $text=null, $value=null, $attributes=null) { + parent::HTML_QuickForm_radio($elementName, $elementLabel, $text, $value, $attributes); + } /** * set html for help button * diff --git a/lib/form/select.php b/lib/form/select.php index 6dfff5fede..92a69cba19 100644 --- a/lib/form/select.php +++ b/lib/form/select.php @@ -15,6 +15,10 @@ class MoodleQuickForm_select extends HTML_QuickForm_select{ */ var $_helpbutton=''; var $_hiddenLabel=false; + + function MoodleQuickForm_select($elementName=null, $elementLabel=null, $options=null, $attributes=null) { + parent::HTML_QuickForm_select($elementName, $elementLabel, $options, $attributes); + } function setHiddenLabel($hiddenLabel){ $this->_hiddenLabel = $hiddenLabel; } diff --git a/lib/form/static.php b/lib/form/static.php index 4e5503d08f..56274c09c5 100644 --- a/lib/form/static.php +++ b/lib/form/static.php @@ -15,6 +15,9 @@ class MoodleQuickForm_static extends HTML_QuickForm_static{ * @var string */ var $_helpbutton=''; + function MoodleQuickForm_static($elementName=null, $elementLabel=null, $text=null) { + parent::HTML_QuickForm_static($elementName, $elementLabel, $text); + } /** * set html for help button * diff --git a/lib/form/submit.php b/lib/form/submit.php index 406b2941a3..e990721051 100644 --- a/lib/form/submit.php +++ b/lib/form/submit.php @@ -11,6 +11,9 @@ require_once("HTML/QuickForm/submit.php"); * @access public */ class MoodleQuickForm_submit extends HTML_QuickForm_submit { + function MoodleQuickForm_submit($elementName=null, $value=null, $attributes=null) { + parent::HTML_QuickForm_submit($elementName, $value, $attributes); + } /** * Called by HTML_QuickForm whenever form event is made on this element * diff --git a/lib/form/submitlink.php b/lib/form/submitlink.php index 9b5c6b015c..fca8f5fec5 100644 --- a/lib/form/submitlink.php +++ b/lib/form/submitlink.php @@ -4,7 +4,10 @@ require_once("$CFG->libdir/form/submit.php"); class MoodleQuickForm_submitlink extends MoodleQuickForm_submit { var $_js; var $_onclick; - + function MoodleQuickForm_submitlink($elementName=null, $value=null, $attributes=null) { + parent::MoodleQuickForm_submit($elementName, $value, $attributes); + } + function toHtml() { $text = $this->_attributes['value']; $onmouseover = "window.status=\'" . $text . "\';"; diff --git a/lib/form/text.php b/lib/form/text.php index b0eccb4f89..32f48d52b3 100644 --- a/lib/form/text.php +++ b/lib/form/text.php @@ -15,6 +15,11 @@ class MoodleQuickForm_text extends HTML_QuickForm_text{ */ var $_helpbutton=''; var $_hiddenLabel=false; + + function MoodleQuickForm_text($elementName=null, $elementLabel=null, $attributes=null) { + parent::HTML_QuickForm_text($elementName, $elementLabel, $attributes); + } + function setHiddenLabel($hiddenLabel){ $this->_hiddenLabel = $hiddenLabel; } diff --git a/lib/form/textarea.php b/lib/form/textarea.php index 5803c28ac1..fc4dc04fa9 100644 --- a/lib/form/textarea.php +++ b/lib/form/textarea.php @@ -23,6 +23,9 @@ class MoodleQuickForm_textarea extends HTML_QuickForm_textarea{ var $_hiddenLabel=false; + function MoodleQuickForm_textarea($elementName=null, $elementLabel=null, $attributes=null) { + parent::HTML_QuickForm_textarea($elementName, $elementLabel, $attributes); + } /** * set html for help button * -- 2.39.5