Continued:
[core.git] / framework / main / classes / helper / html / forms / class_HtmlFormHelper.php
index 30549f57325747ec9fc45383c07ecd047fe5f907..967ad93fcfd882feffe46811a82cd9a2e3802d35 100644 (file)
@@ -3,11 +3,12 @@
 namespace Org\Mxchange\CoreFramework\Helper;
 
 // Import framework stuff
-use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseWrapper;
-use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseFrontend;
+use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Helper\Template\HelpableTemplate;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
 
 // Import SPL stuff
@@ -18,7 +19,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -68,7 +69,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         *
         * @return      void
         */
-       protected function __construct () {
+       private function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
        }
@@ -82,7 +83,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $withForm                       Whether include the form tag
         * @return      $helperInstance         A preparedf instance of this helper
         */
-       public static final function createHtmlFormHelper (CompileableTemplate $templateInstance, $formName, $formId = false, $withForm = true) {
+       public static final function createHtmlFormHelper (CompileableTemplate $templateInstance, string $formName, string $formId = NULL, bool $withForm = true) {
                // Get new instance
                $helperInstance = new HtmlFormHelper();
 
@@ -90,10 +91,10 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
                $helperInstance->setTemplateInstance($templateInstance);
 
                // Is the form id not set?
-               if ($formId === false) {
+               if (is_null($formId)) {
                        // Use form id from form name
                        $formId = $formName;
-               } // END - if
+               }
 
                // Set form name
                $helperInstance->setFormName($formName);
@@ -120,12 +121,12 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @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 (string $formName = NULL, string $formId = NULL) {
                // When the form is not yet opened at least form name must be valid
-               if (($this->formOpened === false) && ($formName === false)) {
+               if (($this->formOpened === false) && (is_null($formName))) {
                        // Thrown an exception
                        throw new InvalidFormNameException ($this, self::EXCEPTION_FORM_NAME_INVALID);
-               } // END - if
+               }
 
                // Close the form is default
                $formContent = '</form>';
@@ -135,10 +136,10 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
                        // Add HTML code
                        $formContent = sprintf("<form name=\"%s\" class=\"forms\" action=\"%s/%s\" method=\"%s\" target=\"%s\" id=\"%s_form\">",
                                $formName,
-                               $this->getConfigInstance()->getConfigEntry('base_url'),
-                               $this->getConfigInstance()->getConfigEntry('form_action'),
-                               $this->getConfigInstance()->getConfigEntry('form_method'),
-                               $this->getConfigInstance()->getConfigEntry('form_target'),
+                               FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('base_url'),
+                               FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('form_action'),
+                               FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('form_method'),
+                               FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('form_target'),
                                $formId
                        );
 
@@ -157,7 +158,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
                        if ($this->ifGroupOpenedPreviously()) {
                                // Then automatically close it here
                                $this->addFormGroup();
-                       } // END - if
+                       }
 
                        // Simply close it
                        $this->formOpened = false;
@@ -176,12 +177,12 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
-       public function addInputTextField ($fieldName, $fieldValue = '') {
+       public function addInputTextField (string $fieldName, string $fieldValue = '') {
                // Is the form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
                        throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
-               } // END - if
+               }
 
                // Generate the content
                $inputContent = sprintf('<input type="text" class="form-control" id="%s_%s_field" name="%s" value="%s" />',
@@ -201,7 +202,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $fieldName      Input field name
         * @return      void
         */
-       public function addInputTextFieldWithDefault ($fieldName) {
+       public function addInputTextFieldWithDefault (string $fieldName) {
                // Get the value from instance
                $fieldValue = $this->getValueField($fieldName);
                //* DEBUG: */ print __METHOD__.':'.$fieldName.'='.$fieldValue."<br />\n";
@@ -219,12 +220,12 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
-       public function addInputPasswordField ($fieldName, $fieldValue = '') {
+       public function addInputPasswordField (string $fieldName, string $fieldValue = '') {
                // Is the form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
                        throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
-               } // END - if
+               }
 
                // Generate the content
                $inputContent = sprintf('<input type="password" class="form-control" id="%s_%s_field" name="%s" value="%s" />',
@@ -247,12 +248,12 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
-       public function addInputHiddenField ($fieldName, $fieldValue = '') {
+       public function addInputHiddenField (string $fieldName, string $fieldValue = '') {
                // Is the form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // 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" />',
@@ -270,7 +271,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $fieldName      Input field name
         * @return      void
         */
-       public function addInputHiddenFieldWithDefault ($fieldName) {
+       public function addInputHiddenFieldWithDefault (string $fieldName) {
                // Get the value from instance
                $fieldValue = $this->getValueField($fieldName);
                //* DEBUG: */ print __METHOD__.':'.$fieldName.'='.$fieldValue."<br />\n";
@@ -286,9 +287,9 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $prefix         Prefix for configuration without trailing _
         * @return      void
         */
-       public function addInputHiddenConfiguredField ($fieldName, $prefix) {
+       public function addInputHiddenConfiguredField (string $fieldName, string $prefix) {
                // Get the value from instance
-               $fieldValue = $this->getConfigInstance()->getConfigEntry("{$prefix}_{$fieldName}");
+               $fieldValue = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry("{$prefix}_{$fieldName}");
                //* DEBUG: */ print __METHOD__.':'.$fieldName.'='.$fieldValue."<br />\n";
 
                // Add the text field
@@ -304,21 +305,20 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
-       public function addInputCheckboxField ($fieldName, $fieldChecked = true) {
+       public function addInputCheckboxField (string $fieldName, bool $fieldChecked = true) {
                // Is the form opened?
                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 = ' ';
+               $checked = ($fieldChecked ? ' checked="checked"' : ' ');
 
                // Generate the content
                $inputContent = sprintf('<input type="checkbox" name="%s" class="checkbox" id="%s_%s_field" value="1"%s />',
-                       $this->getFormId(),
                        $fieldName,
+                       $this->getFormId(),
                        $fieldName,
                        $checked
                );
@@ -335,12 +335,12 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
-       public function addInputResetButton ($buttonText) {
+       public function addInputResetButton (string $buttonText) {
                // Is the form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // 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" />',
@@ -360,12 +360,12 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
-       public function addInputSubmitButton ($buttonText) {
+       public function addInputSubmitButton (string $buttonText) {
                // Is the form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // 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_submit" value="%s" />',
@@ -387,7 +387,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @throws      FormClosedException             If no form has been opened before
         * @throws      InvalidArgumentException        If $groupId is not set
         */
-       public function addFormGroup ($groupId = '', $groupText = '') {
+       public function addFormGroup (string $groupId = '', string $groupText = '') {
                // Is a form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw exception here
@@ -404,7 +404,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
                if (($this->ifGroupOpenedPreviously() === false) && ($groupId === $this->getPreviousGroupId())) {
                        // Abort here silently
                        return false;
-               } // END - if
+               }
 
                // Initialize content with closing div by default
                $content = "    </div>\n</div><!-- Group - CLOSE //-->";
@@ -432,7 +432,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
                        if ($this->ifSubGroupOpenedPreviously()) {
                                // Close it here
                                $this->addFormSubGroup();
-                       } // END - if
+                       }
 
                        // Get previous group id
                        $prevGroupId = $this->getPreviousGroupId();
@@ -444,7 +444,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
                        if ((!empty($groupId)) && ($groupId != $prevGroupId)) {
                                //* DEBUG: */ echo $groupId.'/'.$prevGroupId."<br />\n";
                                $this->addFormGroup($groupId, $groupText);
-                       } // END - if
+                       }
                }
        }
 
@@ -459,7 +459,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @throws      FormFormClosedException         If no group has been opened before
         * @throws      InvalidArgumentException                If $subGroupId is not set
         */
-       public function addFormSubGroup ($subGroupId = '', $subGroupText = '') {
+       public function addFormSubGroup (string $subGroupId = '', string $subGroupText = '') {
                // Is a group opened?
                if ($this->ifGroupOpenedPreviously() === false) {
                        // Throw exception here
@@ -476,7 +476,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
                if (($this->ifSubGroupOpenedPreviously() === false) && ($subGroupId == $this->getPreviousSubGroupId())) {
                        // Abort here silently
                        return false;
-               } // END - if
+               }
 
                // Initialize content with closing div by default
                $content = "    </div>\n</div><!-- Sub group- CLOSE //-->";
@@ -509,7 +509,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
                        // All call it again if sub group name is not empty
                        if ((!empty($subGroupId)) && ($subGroupId != $prevSubGroupId)) {
                                $this->addFormSubGroup($subGroupId, $subGroupText);
-                       } // END - if
+                       }
                }
        }
 
@@ -522,12 +522,12 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
-       public function addFieldLabel ($fieldName, $fieldText, $fieldTitle = '') {
+       public function addFieldLabel (string $fieldName, string $fieldText, string $fieldTitle = '') {
                // Is the form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
                        throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
-               } // END - if
+               }
 
                // Default is no title attribute
                $titleAttribute = '';
@@ -536,7 +536,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
                if (!empty($fieldTitle)) {
                        // Create title attribute
                        $titleAttribute = sprintf(' title="%s" data-toggle="tooltip"', $fieldTitle);
-               } // END - if
+               }
 
                // Generate the content
                $inputContent = sprintf('<label class="col-form-label" for="%s_%s_field"%s>
@@ -561,12 +561,12 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
-       public function addFormNote ($noteId, $formNotes) {
+       public function addFormNote (string $noteId, string $formNotes) {
                // Is the form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
                        throw new FormClosedException (array($this, 'form_notes'), self::EXCEPTION_CLOSED_FORM);
-               } // END - if
+               }
 
                // Generate the content
                $inputContent = sprintf("       <div id=\"form_note_%s\">
@@ -589,12 +589,12 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
-       public function addInputSelectField ($selectId, $firstEntry) {
+       public function addInputSelectField (string $selectId, string $firstEntry) {
                // Is the form group opened?
                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)) {
@@ -604,7 +604,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
                                $firstEntry = sprintf("<option value=\"invalid\" disabled=\"disabled\">%s</option>\n",
                                        $firstEntry
                                );
-                       } // END - if
+                       }
 
                        // Construct the opening select tag
                        $content = sprintf("<select class=\"select_box\" id=\"%s_%s\" name=\"%s\">\n%s",
@@ -636,12 +636,12 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @throws      HelperNoPreviousOpenedSubGroupException If no previously opened sub group was found
         * @todo        Add checking if sub option is already added
         */
-       public function addSelectSubOption ($subName, $subValue) {
+       public function addSelectSubOption (string $subName, string $subValue) {
                // Is there a sub group (shall be a selection box!)
                if ($this->ifSubGroupOpenedPreviously() === false) {
                        // Then throw an exception here
                        throw new HelperNoPreviousOpenedSubGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED);
-               } // END - if
+               }
 
                // Render the content
                $content = sprintf("<option value=\"invalid\" class=\"suboption suboption_%s\" disabled=\"disabled\">%s</option>\n",
@@ -664,12 +664,12 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @throws      HelperNoPreviousOpenedSubGroupException If no previously opened sub group was found
         * @todo        Add checking if sub option is already added
         */
-       public function addSelectOption ($optionName, $optionValue) {
+       public function addSelectOption (string $optionName, string $optionValue) {
                // Is there a sub group (shall be a selection box!)
                if ($this->ifSubGroupOpenedPreviously() === false) {
                        // Then throw an exception here
                        throw new HelperNoPreviousOpenedSubGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED);
-               } // END - if
+               }
 
                // Render the content
                $content = sprintf("<option value=\"%s\" class=\"option option_%s\">%s</option>\n",
@@ -693,7 +693,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
 
                try {
                        // Get last executed pre filter
-                       $extraInstance = GenericRegistry::getRegistry()->getInstance('extra');
+                       $extraInstance = ObjectRegistry::getRegistry('generic')->getInstance('extra');
                } catch (NullPointerException $e) {
                        // Instance in registry is not set (NULL)
                        // @TODO We need to log this later
@@ -718,8 +718,8 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $formEnabled    Whether form is enabled or disabled
         * @return      void
         */
-       public final function enableForm ($formEnabled = true) {
-               $this->formEnabled = (bool) $formEnabled;
+       public final function enableForm (bool $formEnabled = true) {
+               $this->formEnabled = $formEnabled;
        }
 
        /**
@@ -728,8 +728,8 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $formName       Name of this form
         * @return      void
         */
-       public final function setFormName ($formName) {
-               $this->formName = (string) $formName;
+       public final function setFormName (string $formName) {
+               $this->formName = $formName;
        }
 
        /**
@@ -747,8 +747,8 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $formId Id of this form
         * @return      void
         */
-       public final function setFormId ($formId) {
-               $this->formId = (string) $formId;
+       public final function setFormId (string $formId) {
+               $this->formId = $formId;
        }
 
        /**
@@ -766,7 +766,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $required       Whether the email address is required
         */
        public function ifRegisterRequiresEmailVerification () {
-               $required = ($this->getConfigInstance()->getConfigEntry('register_requires_email') == 'Y');
+               $required = FrameworkBootstrap::getConfigurationInstance()->isEnabled('register_requires_email');
                return $required;
        }
 
@@ -776,7 +776,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $required       Whether profile data shall be asked
         */
        public function ifRegisterIncludesProfile () {
-               $required = ($this->getConfigInstance()->getConfigEntry('register_includes_profile') == 'Y');
+               $required = FrameworkBootstrap::getConfigurationInstance()->isEnabled('register_includes_profile');
                return $required;
        }
 
@@ -786,7 +786,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $isSecured      Whether this form is secured by a CAPTCHA
         */
        public function ifFormSecuredWithCaptcha () {
-               $isSecured = ($this->getConfigInstance()->getConfigEntry($this->getFormName() . '_captcha_secured') == 'Y');
+               $isSecured = FrameworkBootstrap::getConfigurationInstance()->isEnabled($this->getFormName() . '_captcha_secured');
                return $isSecured;
        }
 
@@ -796,7 +796,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $required       Whether personal data shall be asked
         */
        public function ifRegisterIncludesPersonaData () {
-               $required = ($this->getConfigInstance()->getConfigEntry('register_personal_data') == 'Y');
+               $required = FrameworkBootstrap::getConfigurationInstance()->isEnabled('register_personal_data');
                return $required;
        }
 
@@ -806,7 +806,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $required       Whether birthday shall be asked
         */
        public function ifProfileIncludesBirthDay () {
-               $required = ($this->getConfigInstance()->getConfigEntry('profile_includes_birthday') == 'Y');
+               $required = FrameworkBootstrap::getConfigurationInstance()->isEnabled('profile_includes_birthday');
                return $required;
        }
 
@@ -816,7 +816,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $isUnique
         */
        public function ifEmailMustBeUnique () {
-               $isUnique = ($this->getConfigInstance()->getConfigEntry('register_email_unique') == 'Y');
+               $isUnique = FrameworkBootstrap::getConfigurationInstance()->isEnabled('register_email_unique');
                return $isUnique;
        }
 
@@ -825,8 +825,8 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         *
         * @return      $required       Whether the specified chat protocol is enabled
         */
-       public function ifChatEnabled ($chatProtocol) {
-               $required = ($this->getConfigInstance()->getConfigEntry('chat_enabled_' . $chatProtocol) == 'Y');
+       public function ifChatEnabled (string $chatProtocol) {
+               $required = FrameworkBootstrap::getConfigurationInstance()->isEnabled('chat_protocol_' . $chatProtocol);
                return $required;
        }
 
@@ -836,7 +836,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $isEnabled      Whether the login is enabled or disabled
         */
        public function ifLoginIsEnabled () {
-               $isEnabled = ($this->getConfigInstance()->getConfigEntry('login_enabled') == 'Y');
+               $isEnabled = FrameworkBootstrap::getConfigurationInstance()->isEnabled('user_login');
                return $isEnabled;
        }
 
@@ -846,7 +846,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $isEnabled      Whether the login shall be done by username
         */
        public function ifLoginWithUsername () {
-               $isEnabled = ($this->getConfigInstance()->getConfigEntry('login_type') == "username");
+               $isEnabled = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('login_type') == 'username');
                return $isEnabled;
        }
 
@@ -856,7 +856,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $isEnabled      Whether the login shall be done by email
         */
        public function ifLoginWithEmail () {
-               $isEnabled = ($this->getConfigInstance()->getConfigEntry('login_type') == "email");
+               $isEnabled = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('login_type') == 'email');
                return $isEnabled;
        }
 
@@ -866,7 +866,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $isAllowed      Whether guest login is allowed
         */
        public function ifGuestLoginAllowed () {
-               $isAllowed = ($this->getConfigInstance()->getConfigEntry('guest_login_allowed') == 'Y');
+               $isAllowed = FrameworkBootstrap::getConfigurationInstance()->isEnabled('guest_login');
                return $isAllowed;
        }
 
@@ -876,7 +876,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $requireConfirm         Whether email change must be confirmed
         */
        public function ifEmailChangeRequireConfirmation () {
-               $requireConfirm = ($this->getConfigInstance()->getConfigEntry('email_change_confirmation') == 'Y');
+               $requireConfirm = FrameworkBootstrap::getConfigurationInstance()->isEnabled('email_change_confirmation');
                return $requireConfirm;
        }
 
@@ -896,7 +896,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $emailChange    Whether changing email address is allowed
         */
        public function ifEmailChangeAllowed () {
-               $emailChange = ($this->getConfigInstance()->getConfigEntry('email_change_allowed') == 'Y');
+               $emailChange = FrameworkBootstrap::getConfigurationInstance()->isEnabled('email_change');
                return $emailChange;
        }
 
@@ -906,7 +906,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $isUnconfirmed  Whether the user account is unconfirmed
         */
        public function ifUserAccountUnconfirmed () {
-               $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->getConfigEntry('user_status_unconfirmed'));
+               $isUnconfirmed = ($this->getValueField(UserDatabaseFrontend::DB_COLUMN_USER_STATUS) === FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('user_status_unconfirmed'));
                return $isUnconfirmed;
        }
 
@@ -916,7 +916,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $isUnconfirmed  Whether the user account is locked
         */
        public function ifUserAccountLocked () {
-               $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->getConfigEntry('user_status_locked'));
+               $isUnconfirmed = ($this->getValueField(UserDatabaseFrontend::DB_COLUMN_USER_STATUS) === FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('user_status_locked'));
                return $isUnconfirmed;
        }
 
@@ -926,7 +926,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $isUnconfirmed  Whether the user account is a guest
         */
        public function ifUserAccountGuest () {
-               $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->getConfigEntry('user_status_guest'));
+               $isUnconfirmed = ($this->getValueField(UserDatabaseFrontend::DB_COLUMN_USER_STATUS) === FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('user_status_guest'));
                return $isUnconfirmed;
        }
 
@@ -937,7 +937,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      $refillActive   Whether the refill page is active
         */
        public function ifRefillPageActive () {
-               $refillActive = ($this->getConfigInstance()->getConfigEntry('refill_page_active') == 'Y');
+               $refillActive = FrameworkBootstrap::getConfigurationInstance()->isEnabled('refill_page_active');
                return $refillActive;
        }