]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/helper/web/forms/class_WebFormHelper.php
Copyright updated, interface RenderableMenu added
[core.git] / inc / classes / main / helper / web / forms / class_WebFormHelper.php
index e20545f0d254246a2e90694eae6073aaed0be568..5542d3a5e1bb5e527ef41c755cb9138cbf58d9f4 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007 - 2009 Roland Haeder, this is free software
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -59,7 +59,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         *
         * @param       $templateInstance       An instance of a valid template engine
         * @param       $formName                       Name of the form
-        * @param       $formId                         Value for "id" attribute (default: $formName)
+        * @param       $formId                         Value for 'id' attribute (default: $formName)
         * @param       $withForm                       Wether include the form tag
         * @return      $helperInstance         A preparedf instance of this helper
         */
@@ -79,7 +79,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                // Set form name
                $helperInstance->setFormName($formName);
 
-               // A form-less field may say "false" here...
+               // A form-less field may say 'false' here...
                if ($withForm === true) {
                        // Create the form
                        $helperInstance->addFormTag($formName, $formId);
@@ -96,9 +96,9 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         * Add the form tag or close it an already opened form tag
         *
         * @param       $formName       Name of the form (default: false)
-        * @param       $formId         Id of the form (attribute "id"; 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) {
@@ -109,7 +109,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                } // END - if
 
                // Close the form is default
-               $formContent = "</form>";
+               $formContent = '</form>';
 
                // Check wether we shall open or close the form
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
@@ -128,7 +128,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                        );
 
                        // Add close bracket
-                       $formContent .= ">";
+                       $formContent .= '>';
 
                        // Open the form and remeber the form name
                        $this->formOpened = true;
@@ -176,7 +176,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
                        $fieldValue
                );
 
-               // And add it maybe with a "li" tag
+               // And add it maybe with a 'li' tag
                $this->addContentToPreviousGroup($inputContent);
        }
 
@@ -189,7 +189,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
        public function addInputTextFieldWithDefault ($fieldName) {
                // Get the value from instance
                $fieldValue = $this->getValueField($fieldName);
-               //* DEBUG: */ echo __METHOD__.":".$fieldName."=".$fieldValue."<br />\n";
+               //* DEBUG: */ echo __METHOD__.':'.$fieldName.'='.$fieldValue."<br />\n";
 
                // Add the text field
                $this->addInputTextField($fieldName, $fieldValue);
@@ -257,7 +257,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
        public function addInputHiddenFieldWithDefault ($fieldName) {
                // Get the value from instance
                $fieldValue = $this->getValueField($fieldName);
-               //* DEBUG: */ echo __METHOD__.":".$fieldName."=".$fieldValue."<br />\n";
+               //* DEBUG: */ echo __METHOD__.':'.$fieldName.'='.$fieldValue."<br />\n";
 
                // Add the text field
                $this->addInputHiddenField($fieldName, $fieldValue);
@@ -273,7 +273,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
        public function addInputHiddenConfiguredField ($fieldName, $prefix) {
                // Get the value from instance
                $fieldValue = $this->getConfigInstance()->readConfig("{$prefix}_{$fieldName}");
-               //* DEBUG: */ echo __METHOD__.":".$fieldName."=".$fieldValue."<br />\n";
+               //* DEBUG: */ echo __METHOD__.':'.$fieldName.'='.$fieldValue."<br />\n";
 
                // Add the text field
                $this->addInputHiddenField($fieldName, $fieldValue);
@@ -297,7 +297,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
 
                // Set wether 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/>",
@@ -428,7 +428,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
 
                        // All call it again if group name is not empty
                        if ((!empty($groupId)) && ($groupId != $prevGroupId)) {
-                               //* DEBUG: */ echo $groupId."/".$prevGroupId."<br />\n";
+                               //* DEBUG: */ echo $groupId.'/'.$prevGroupId."<br />\n";
                                $this->addFormGroup($groupId, $groupText);
                        } // END - if
                }
@@ -723,7 +723,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         * @return      $required       Wether the email address is required
         */
        public function ifRegisterRequiresEmailVerification () {
-               $required = ($this->getConfigInstance()->readConfig('register_requires_email') === "Y");
+               $required = ($this->getConfigInstance()->readConfig('register_requires_email') == 'Y');
                return $required;
        }
 
@@ -733,7 +733,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         * @return      $required       Wether profile data shall be asked
         */
        public function ifRegisterIncludesProfile () {
-               $required = ($this->getConfigInstance()->readConfig('register_includes_profile') === "Y");
+               $required = ($this->getConfigInstance()->readConfig('register_includes_profile') == 'Y');
                return $required;
        }
 
@@ -743,7 +743,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         * @return      $isSecured      Wether this form is secured by a CAPTCHA
         */
        public function ifFormSecuredWithCaptcha () {
-               $isSecured = ($this->getConfigInstance()->readConfig($this->getFormName().'_captcha_secured') === "Y");
+               $isSecured = ($this->getConfigInstance()->readConfig($this->getFormName().'_captcha_secured') == 'Y');
                return $isSecured;
        }