Made lower to upper case:
[core.git] / inc / classes / main / helper / web / forms / class_WebFormHelper.php
index 5ab3d89fb25e4d1faf2aab4de7b7ca298c1bb217..e0eea486924ae1ca515eade78eb8d4e3d70e009c 100644 (file)
@@ -26,7 +26,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         * Whether the form tag is opened (keep at false or else your forms will
         * never work!)
         */
-       private $formOpened = false;
+       private $formOpened = FALSE;
 
        /**
         * Name of the form
@@ -36,7 +36,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
        /**
         * Whether form tag is enabled (default: true)
         */
-       private $formEnabled = true;
+       private $formEnabled = TRUE;
 
        // Class Constants
        const EXCEPTION_FORM_NAME_INVALID       = 0x120;
@@ -63,7 +63,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         * @param       $withForm                       Whether include the form tag
         * @return      $helperInstance         A preparedf instance of this helper
         */
-       public static final function createWebFormHelper (CompileableTemplate $templateInstance, $formName, $formId = false, $withForm = true) {
+       public static final function createWebFormHelper (CompileableTemplate $templateInstance, $formName, $formId = FALSE, $withForm = TRUE) {
                // Get new instance
                $helperInstance = new WebFormHelper();
 
@@ -71,7 +71,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                $helperInstance->setTemplateInstance($templateInstance);
 
                // Is the form id not set?
-               if ($formId === false) {
+               if ($formId === FALSE) {
                        // Use form id from form name
                        $formId = $formName;
                } // END - if
@@ -80,7 +80,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                $helperInstance->setFormName($formName);
 
                // A form-less field may say 'false' here...
-               if ($withForm === true) {
+               if ($withForm === TRUE) {
                        // Create the form
                        $helperInstance->addFormTag($formName, $formId);
                } else {
@@ -98,12 +98,12 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         * @param       $formName       Name of the form (default: false)
         * @param       $formId         Id of the form (attribute 'id'; default: false)
         * @return      void
-        * @throws      InvalidFormNameException        If the form name is invalid ( = false)
+        * @throws      InvalidFormNameException        If the form name is invalid ( = FALSE)
         * @todo        Add some unique PIN here to bypass problems with some browser and/or extensions
         */
-       public function addFormTag ($formName = false, $formId = false) {
+       public function addFormTag ($formName = FALSE, $formId = FALSE) {
                // When the form is not yet opened at least form name must be valid
-               if (($this->formOpened === false) && ($formName === false)) {
+               if (($this->formOpened === FALSE) && ($formName === FALSE)) {
                        // Thrown an exception
                        throw new InvalidFormNameException ($this, self::EXCEPTION_FORM_NAME_INVALID);
                } // END - if
@@ -112,7 +112,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                $formContent = '</form>';
 
                // Check whether we shall open or close the form
-               if (($this->formOpened === false) && ($this->formEnabled === true)) {
+               if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
                        // Add HTML code
                        $formContent = sprintf("<form name=\"%s\" class=\"forms\" action=\"%s/%s\" method=\"%s\" target=\"%s\"",
                                $formName,
@@ -131,7 +131,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                        $formContent .= '>';
 
                        // Open the form and remeber the form name
-                       $this->formOpened = true;
+                       $this->formOpened = TRUE;
 
                        // Add it to the content
                        $this->addHeaderContent($formContent);
@@ -146,7 +146,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                        } // END - if
 
                        // Simply close it
-                       $this->formOpened = false;
+                       $this->formOpened = FALSE;
 
                        // Add it to the content
                        $this->addFooterContent($formContent);
@@ -164,7 +164,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         */
        public function addInputTextField ($fieldName, $fieldValue = '') {
                // Is the form opened?
-               if (($this->formOpened === false) && ($this->formEnabled === true)) {
+               if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
                        // Throw an exception
                        throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
                } // END - if
@@ -206,7 +206,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         */
        public function addInputPasswordField ($fieldName, $fieldValue = '') {
                // Is the form opened?
-               if (($this->formOpened === false) && ($this->formEnabled === true)) {
+               if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
                        // Throw an exception
                        throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
                } // END - if
@@ -233,7 +233,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         */
        public function addInputHiddenField ($fieldName, $fieldValue = '') {
                // Is the form opened?
-               if (($this->formOpened === false) && ($this->formEnabled === true)) {
+               if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
                        // Throw an exception
                        throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
                } // END - if
@@ -288,16 +288,16 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
-       public function addInputCheckboxField ($fieldName, $fieldChecked = true) {
+       public function addInputCheckboxField ($fieldName, $fieldChecked = TRUE) {
                // Is the form opened?
-               if (($this->formOpened === false) && ($this->formEnabled === true)) {
+               if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
                        // Throw an exception
                        throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
                } // END - if
 
                // Set whether the check box is checked...
                $checked = " checked=\"checked\"";
-               if ($fieldChecked === false) $checked = ' ';
+               if ($fieldChecked === FALSE) $checked = ' ';
 
                // Generate the content
                $inputContent = sprintf("<input type=\"checkbox\" name=\"%s\" class=\"checkbox %s_field\" value=\"1\"%s/>",
@@ -320,7 +320,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         */
        public function addInputResetButton ($buttonText) {
                // Is the form opened?
-               if (($this->formOpened === false) && ($this->formEnabled === true)) {
+               if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
                        // Throw an exception
                        throw new FormClosedException (array($this, 'reset'), self::EXCEPTION_CLOSED_FORM);
                } // END - if
@@ -345,7 +345,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         */
        public function addInputSubmitButton ($buttonText) {
                // Is the form opened?
-               if (($this->formOpened === false) && ($this->formEnabled === true)) {
+               if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
                        // Throw an exception
                        throw new FormClosedException (array($this, 'submit'), self::EXCEPTION_CLOSED_FORM);
                } // END - if
@@ -372,13 +372,13 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         */
        public function addFormGroup ($groupId = '', $groupText = '') {
                // Is a form opened?
-               if (($this->formOpened === false) && ($this->formEnabled === true)) {
+               if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
                        // Throw exception here
                        throw new FormClosedException(array($this, $groupId), self::EXCEPTION_CLOSED_FORM);
                } // END - if
 
                // At least the group name should be set
-               if ((empty($groupId)) && ($this->ifGroupOpenedPreviously() === false)) {
+               if ((empty($groupId)) && ($this->ifGroupOpenedPreviously() === FALSE)) {
                        // Throw exception here
                        throw new EmptyVariableException(array($this, 'groupId'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
                } elseif (empty($groupId)) {
@@ -387,7 +387,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                }
 
                // Same group to open?
-               if (($this->ifGroupOpenedPreviously() === false) && ($groupId === $this->getPreviousGroupId())) {
+               if (($this->ifGroupOpenedPreviously() === FALSE) && ($groupId === $this->getPreviousGroupId())) {
                        // Abort here silently
                        return false;
                } // END - if
@@ -396,7 +396,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                $content = "    </div>\n</div><!-- Group - CLOSE //-->";
 
                // Is this group opened?
-               if ($this->ifGroupOpenedPreviously() === false) {
+               if ($this->ifGroupOpenedPreviously() === FALSE) {
                        // Begin the div/span blocks
                        $content = sprintf("<!-- Group %s - OPEN //-->
 <div class=\"group_box\" id=\"%s_group_box\">
@@ -447,13 +447,13 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         */
        public function addFormSubGroup ($subGroupId = '', $subGroupText = '') {
                // Is a group opened?
-               if ($this->ifGroupOpenedPreviously() === false) {
+               if ($this->ifGroupOpenedPreviously() === FALSE) {
                        // Throw exception here
                        throw new FormFormClosedException(array($this, $subGroupId), self::EXCEPTION_UNEXPECTED_CLOSED_GROUP);
                } // END - if
 
                // At least the sub group name should be set
-               if ((empty($subGroupId)) && ($this->ifSubGroupOpenedPreviously() === false)) {
+               if ((empty($subGroupId)) && ($this->ifSubGroupOpenedPreviously() === FALSE)) {
                        // Throw exception here
                        throw new EmptyVariableException(array($this, 'subGroupId'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
                } elseif (empty($subGroupId)) {
@@ -462,7 +462,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                }
 
                // Same sub group to open?
-               if (($this->ifSubGroupOpenedPreviously() === false) && ($subGroupId == $this->getPreviousSubGroupId())) {
+               if (($this->ifSubGroupOpenedPreviously() === FALSE) && ($subGroupId == $this->getPreviousSubGroupId())) {
                        // Abort here silently
                        return false;
                } // END - if
@@ -471,7 +471,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                $content = "    </div>\n</div><!-- Sub group- CLOSE //-->";
 
                // Is this group opened?
-               if ($this->ifSubGroupOpenedPreviously() === false) {
+               if ($this->ifSubGroupOpenedPreviously() === FALSE) {
                        // Begin the span block
                        $content = sprintf("<!-- Sub group %s - OPEN //-->
 <div class=\"subgroup_box\" id=\"%s_subgroup_box\">
@@ -513,7 +513,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         */
        public function addFieldText ($fieldName, $fieldText) {
                // Is the form opened?
-               if (($this->formOpened === false) && ($this->formEnabled === true)) {
+               if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
                        // Throw an exception
                        throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
                } // END - if
@@ -547,7 +547,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         */
        public function addFormNote ($noteId, $formNotes) {
                // Is the form opened?
-               if (($this->formOpened === false) && ($this->formEnabled === true)) {
+               if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
                        // Throw an exception
                        throw new FormClosedException (array($this, 'form_notes'), self::EXCEPTION_CLOSED_FORM);
                } // END - if
@@ -575,13 +575,13 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         */
        public function addInputSelectField ($selectId, $firstEntry) {
                // Is the form group opened?
-               if (($this->formOpened === false) && ($this->formEnabled === true)) {
+               if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
                        // Throw an exception
                        throw new FormClosedException (array($this, 'form_notes'), self::EXCEPTION_CLOSED_FORM);
                } // END - if
 
                // Shall we close or open the sub group?
-               if (($this->ifSubGroupOpenedPreviously() === false) && ($this->getPreviousSubGroupId() !== $selectId)) {
+               if (($this->ifSubGroupOpenedPreviously() === FALSE) && ($this->getPreviousSubGroupId() !== $selectId)) {
                        // Initialize first entry (which might be non-selectable if content is provided
                        if (!empty($firstEntry)) {
                                // Add selection around it
@@ -622,7 +622,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         */
        public function addSelectSubOption ($subName, $subValue) {
                // Is there a sub group (shall be a selection box!)
-               if ($this->ifSubGroupOpenedPreviously() === false) {
+               if ($this->ifSubGroupOpenedPreviously() === FALSE) {
                        // Then throw an exception here
                        throw new HelperNoPreviousOpenedSubGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED);
                } // END - if
@@ -650,7 +650,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         */
        public function addSelectOption ($optionName, $optionValue) {
                // Is there a sub group (shall be a selection box!)
-               if ($this->ifSubGroupOpenedPreviously() === false) {
+               if ($this->ifSubGroupOpenedPreviously() === FALSE) {
                        // Then throw an exception here
                        throw new HelperNoPreviousOpenedSubGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED);
                } // END - if
@@ -702,7 +702,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         * @param       $formEnabled    Whether form is enabled or disabled
         * @return      void
         */
-       public final function enableForm ($formEnabled = true) {
+       public final function enableForm ($formEnabled = TRUE) {
                $this->formEnabled = (bool) $formEnabled;
        }
 
@@ -915,10 +915,10 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         */
        public function flushContent () {
                // Is the form still open?
-               if (($this->formOpened === true) && ($this->formEnabled === true)) {
+               if (($this->formOpened === TRUE) && ($this->formEnabled === TRUE)) {
                        // Close the form automatically
                        $this->addFormTag();
-               } elseif ($this->formEnabled === false) {
+               } elseif ($this->formEnabled === FALSE) {
                        if ($this->ifSubGroupOpenedPreviously()) {
                                // Close sub group
                                $this->addFormSubGroup();