]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/helper/web/class_WebFormHelper.php
Templates rewritten
[shipsimu.git] / inc / classes / main / helper / web / class_WebFormHelper.php
index 7ba0343549b88189ed76b414f3526b8353a61cc9..ddb10a84c38204725eb9dcf56f6fac23fa336e9d 100644 (file)
@@ -293,6 +293,22 @@ class WebFormHelper extends BaseHelper {
                $this->addInputHiddenField($fieldName, $fieldValue);
        }
 
+       /**
+        * Add a hidden input tag to the form with configuration value
+        *
+        * @param       $fieldName      Input field name
+        * @param       $prefix         Prefix for configuration without trailing _
+        * @return      void
+        */
+       public function addInputHiddenConfiguredField ($fieldName, $prefix) {
+               // Get the value from instance
+               $fieldValue = $this->getConfigInstance()->readConfig("{$prefix}_{$fieldName}");
+               //* DEBUG: */ echo __METHOD__.":".$fieldName."=".$fieldValue."<br />\n";
+
+               // Add the text field
+               $this->addInputHiddenField($fieldName, $fieldValue);
+       }
+
        /**
         * Add a checkbox input tag to the form or throw an exception if it is not
         * yet opened. The field's name will be set as id.
@@ -720,6 +736,16 @@ class WebFormHelper extends BaseHelper {
                return $isUnconfirmed;
        }
 
+       /**
+        * Checks wether this form is secured by a CAPTCHA
+        *
+        * @return      $isSecured      Wether this form is secured by a CAPTCHA
+        */
+       public function ifFormSecuredWithCaptcha () {
+               $isSecured = ($this->getConfigInstance()->readConfig($this->formName."_captcha_secured") == "Y");
+               return $isSecured;
+       }
+
        /**
         * Flushs the content out (not yet secured against open forms, etc.!) or
         * close the form automatically