]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/helper/web/class_WebFormHelper.php
Comments fixed... ;) And pre/post filters for registrations now supported
[shipsimu.git] / inc / classes / main / helper / web / class_WebFormHelper.php
index 0c761d8fc7f27a4bd76c6d7934ae8b1aa0ab2d60..d3fecfc48f40545f8f29d0b1b06987f701933cb9 100644 (file)
@@ -55,7 +55,7 @@ class WebFormHelper extends BaseHelper {
        const EXCEPTION_UNEXPECTED_CLOSED_GROUP = 0xb03;
 
        /**
-        * Private constructor
+        * Protected constructor
         *
         * @return      void
         */
@@ -64,7 +64,10 @@ class WebFormHelper extends BaseHelper {
                parent::__construct(__CLASS__);
 
                // Set part description
-               $this->setObjectDescription("HTML-Formularhilfsklasse");
+               $this->setObjectDescription("Helper class for HTML forms");
+
+               // Create unique ID number
+               $this->createUniqueID();
        }
 
        /**
@@ -118,9 +121,9 @@ class WebFormHelper extends BaseHelper {
                        // Add HTML code
                        $formContent = sprintf("<form name=\"%s\" class=\"forms\" action=\"%s\" method=\"%s\" target=\"%s\"",
                                $formName,
-                               $this->getConfigInstance()->readConfig("form_action"),
-                               $this->getConfigInstance()->readConfig("form_method"),
-                               $this->getConfigInstance()->readConfig("form_target")
+                               $this->getConfigInstance()->readConfig('form_action'),
+                               $this->getConfigInstance()->readConfig('form_method'),
+                               $this->getConfigInstance()->readConfig('form_target')
                        );
 
                        // Is the form id set?
@@ -139,7 +142,7 @@ class WebFormHelper extends BaseHelper {
                        $this->formName = $formName;
                } else {
                        // Add the hidden field required to identify safely this form
-                       $this->addInputHiddenField("form", $this->formName);
+                       $this->addInputHiddenField('form', $this->formName);
 
                        // Is a group open?
                        if ($this->groupOpened === true) {
@@ -519,7 +522,7 @@ class WebFormHelper extends BaseHelper {
         * @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;
        }
 
@@ -529,7 +532,7 @@ class WebFormHelper extends BaseHelper {
         * @return      $required       Wether profile shall be asked
         */
        public function ifRegisterIncludesProfile () {
-               $required = ($this->getConfigInstance()->readConfig("register_includes_profile") == "Y");
+               $required = ($this->getConfigInstance()->readConfig('register_includes_profile') == "Y");
                return $required;
        }
 
@@ -539,10 +542,20 @@ class WebFormHelper extends BaseHelper {
         * @return      $required       Wether personal data shall be asked
         */
        public function ifRegisterIncludesPersonaData () {
-               $required = ($this->getConfigInstance()->readConfig("register_personal_data") == "Y");
+               $required = ($this->getConfigInstance()->readConfig('register_personal_data') == "Y");
                return $required;
        }
 
+       /**
+        * Checks wether email addresses can only be once used
+        *
+        * @return      $isUnique
+        */
+       public function ifEmailMustBeUnique () {
+               $isUnique = ($this->getConfigInstance()->readConfig('register_email_unique') == "Y");
+               return $isUnique;
+       }
+
        /**
         * Checks wether the specified chat protocol is enabled in this form
         *