Simple exception handler and error handler added, profile update added with stubs
[shipsimu.git] / inc / classes / main / helper / web / class_WebFormHelper.php
index 5debdda12b3dc07c83cd3350cd837b71126e1bb4..1369fe4595cbc3b3c33633d551df363f64088986 100644 (file)
@@ -134,7 +134,7 @@ class WebFormHelper extends BaseHelper {
                if (($this->formOpened === false) && ($formName === false)) {
                        // Thrown an exception
                        throw new InvalidFormNameException ($this, self::EXCEPTION_FORM_NAME_INVALID);
-               }
+               } // END - if
 
                // Close the form is default
                $formContent = "</form>";
@@ -172,7 +172,7 @@ class WebFormHelper extends BaseHelper {
                        if ($this->groupOpened === true) {
                                // Then automatically close it here
                                $this->addFormGroup("", "");
-                       }
+                       } // END - if
 
                        /* @TODO Add some unique PIN here to bypass problems with some browser and/or extensions */
                        // Simply close it
@@ -197,7 +197,7 @@ class WebFormHelper extends BaseHelper {
                if ($this->formOpened === false) {
                        // Throw an exception
                        throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
-               }
+               } // END - if
 
                // Generate the content
                $inputContent = sprintf("<input type=\"text\" class=\"textfield\" id=\"%s\" name=\"%s\" value=\"%s\" />",
@@ -239,7 +239,7 @@ class WebFormHelper extends BaseHelper {
                if ($this->formOpened === false) {
                        // Throw an exception
                        throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
-               }
+               } // END - if
 
                // Generate the content
                $inputContent = sprintf("<input type=\"password\" class=\"password\" id=\"%s\" name=\"%s\" value=\"%s\" />",
@@ -266,7 +266,7 @@ class WebFormHelper extends BaseHelper {
                if ($this->formOpened === false) {
                        // Throw an exception
                        throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
-               }
+               } // END - if
 
                // Generate the content
                $inputContent = sprintf("<input type=\"hidden\" name=\"%s\" value=\"%s\" />",
@@ -292,7 +292,7 @@ class WebFormHelper extends BaseHelper {
                if ($this->formOpened === false) {
                        // Throw an exception
                        throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
-               }
+               } // END - if
 
                // Set wether the check box is checked...
                $checked = " checked=\"checked\"";
@@ -322,7 +322,7 @@ class WebFormHelper extends BaseHelper {
                if ($this->formOpened === false) {
                        // Throw an exception
                        throw new FormClosedException (array($this, "reset"), self::EXCEPTION_CLOSED_FORM);
-               }
+               } // END - if
 
                // Generate the content
                $inputContent = sprintf("<input type=\"reset\" class=\"reset_button\" id=\"%s_reset\" value=\"%s\" />",
@@ -347,7 +347,7 @@ class WebFormHelper extends BaseHelper {
                if ($this->formOpened === false) {
                        // Throw an exception
                        throw new FormClosedException (array($this, "submit"), self::EXCEPTION_CLOSED_FORM);
-               }
+               } // END - if
 
                // Generate the content
                $inputContent = sprintf("<input type=\"submit\" class=\"submit_button\" id=\"%s_submit\" name=\"%s_button\" value=\"%s\" />",
@@ -374,13 +374,13 @@ class WebFormHelper extends BaseHelper {
                if ($this->formOpened === false) {
                        // Throw exception here
                        throw new FormClosedException(array($this, $groupName), self::EXCEPTION_CLOSED_FORM);
-               }
+               } // END - if
 
                // At least the group name should be set
                if ((empty($groupName)) && ($this->groupOpened === false)) {
                        // Throw exception here
                        throw new EmptyVariableException(array($this, 'groupName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               }
+               } // END - if
 
                // Initialize content with closing div by default
                $content = "    </div>\n</div><!-- Group - CLOSE //-->";
@@ -411,7 +411,7 @@ class WebFormHelper extends BaseHelper {
                        if ($this->subGroupOpened === true) {
                                // Close it here
                                $this->addFormSubGroup("", "");
-                       }
+                       } // END - if
 
                        // Add the content
                        $this->addContent($content);
@@ -422,7 +422,7 @@ class WebFormHelper extends BaseHelper {
                        // All call it again if the group name is not empty
                        if (!empty($groupName)) {
                                $this->addFormGroup($groupName, $groupText);
-                       }
+                       } // END - if
                }
        }
 
@@ -442,13 +442,13 @@ class WebFormHelper extends BaseHelper {
                if ($this->groupOpened === false) {
                        // Throw exception here
                        throw new FormGroupClosedException(array($this, $subGroupName), self::EXCEPTION_UNEXPECTED_CLOSED_GROUP);
-               }
+               } // END - if
 
                // At least the sub group name should be set
                if ((empty($subGroupName)) && ($this->subGroupOpened === false)) {
                        // Throw exception here
                        throw new EmptyVariableException(array($this, 'groupName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               }
+               } // END - if
 
                // Initialize content with closing div by default
                $content = "    </div>\n</div><!-- Sub group- CLOSE //-->";
@@ -485,7 +485,7 @@ class WebFormHelper extends BaseHelper {
                        // All call it again if sub group name is not empty
                        if (!empty($subGroupName)) {
                                $this->addFormSubGroup($subGroupName, $subGroupText);
-                       }
+                       } // END - if
                }
        }
 
@@ -503,7 +503,7 @@ class WebFormHelper extends BaseHelper {
                if ($this->formOpened === false) {
                        // Throw an exception
                        throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
-               }
+               } // END - if
 
                // Set the block type
                $block = "div";
@@ -536,13 +536,13 @@ class WebFormHelper extends BaseHelper {
                if ($this->formOpened === false) {
                        // Throw an exception
                        throw new FormClosedException (array($this, "form_notes"), self::EXCEPTION_CLOSED_FORM);
-               }
+               } // END - if
 
                // Is a group open?
                if ($this->groupOpened === true) {
                        // Then automatically close it here
                        $this->addFormGroup("", "");
-               }
+               } // END - if
 
                // Generate the content
                $inputContent = sprintf("       <div id=\"form_note\">
@@ -687,7 +687,7 @@ class WebFormHelper extends BaseHelper {
                if ($this->formOpened === true) {
                        // Throw an exception
                        throw new FormOpenedException ($this, self::EXCEPTION_OPENED_FORM);
-               }
+               } // END - if
 
                // Send content to template engine
                $this->getTemplateInstance()->assignVariable($this->formName, $this->getContent());