From 1bf698c4da02928e31d531ac0fd8c60c9eec2c71 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Tue, 13 Mar 2012 19:28:03 +0100 Subject: [PATCH] Minor - adding comments --- .../lib/formvalidator/FormValidator.class.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/main/inc/lib/formvalidator/FormValidator.class.php b/main/inc/lib/formvalidator/FormValidator.class.php index a931b53422..a20fef637a 100644 --- a/main/inc/lib/formvalidator/FormValidator.class.php +++ b/main/inc/lib/formvalidator/FormValidator.class.php @@ -64,7 +64,8 @@ class FormValidator extends HTML_QuickForm { // Modify the default templates $renderer = & $this->defaultRenderer(); - + + //Form template $form_template = << @@ -73,9 +74,11 @@ class FormValidator extends HTML_QuickForm {
- EOT; $renderer->setFormTemplate($form_template); + + //Element template + $element_template = << @@ -101,10 +104,15 @@ EOT; EOT; $renderer->setElementTemplate($element_template); + + //Set Header template + $header_template = <<{header} EOT; $renderer->setHeaderTemplate($header_template); + + //Set required field template HTML_QuickForm::setRequiredNote('* '.get_lang('ThisFieldIsRequired').''); $required_note_template = << @@ -123,7 +131,6 @@ EOT; * @param array $attributes (optional) List of attributes for the form-element */ function add_textfield($name, $label, $required = true, $attributes = array()) { - $this->addElement('text', $name, $label, $attributes); $this->applyFilter($name, 'trim'); if ($required) { @@ -253,8 +260,7 @@ EOT; */ function add_real_progress_bar($upload_id, $element_after, $delay = 2, $wait_after_upload = false) { - if (!function_exists('uploadprogress_get_info')) { - + if (!function_exists('uploadprogress_get_info')) { $this -> add_progress_bar($delay); return; } @@ -292,7 +298,6 @@ EOT; - '); } @@ -388,4 +393,4 @@ function html_filter_teacher_fullpage($html) { function html_filter_student_fullpage($html) { return html_filter($html, STUDENT_HTML_FULLPAGE); -} +} \ No newline at end of file