]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/helper/web/blocks/class_WebBlockHelper.php
- XHTML errors/warnings fixed in some pages
[shipsimu.git] / inc / classes / main / helper / web / blocks / class_WebBlockHelper.php
index a71b36d71d944dde9b7ccb59cf980938e296e4b0..48b32d838d02ca70e5b485f0c0aa9509a125b6f6 100644 (file)
@@ -35,9 +35,6 @@ class WebBlockHelper extends BaseWebHelper implements HelpableTemplate {
        protected function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
-
-               // Set part description
-               $this->setObjectDescription("A helper for generating web blocks");
        }
 
        /**
@@ -90,6 +87,49 @@ class WebBlockHelper extends BaseWebHelper implements HelpableTemplate {
                return $withRegistration;
        }
 
+       /**
+        * Assignes a template variable with a message from a given message id
+        *
+        * @param       $templateVariable       Template variable to assign
+        * @param       $messageId                      Message id to load an assign
+        * @return      void
+        */
+       public function assignMessageField ($templateVariable, $messageId) {
+               // Get message
+               $message = $this->getLanguageInstance()->getMessage($messageId);
+
+               // And assign it
+               $this->getTemplateInstance()->assignVariable($templateVariable, $message);
+       }
+
+       /**
+        * Assigns a link field with a given value
+        *
+        * @param       $linkField              "Link field" (variable) to assign
+        * @param       $actionValue    Action value to assign
+        * @return      void
+        */
+       public function assignLinkFieldWithAction ($linkField, $actionValue) {
+               $this->getTemplateInstance()->assignVariable($linkField . '_action', $actionValue);
+       }
+
+       /**
+        * "Filter" method for translating the raw user status into something human-readable
+        *
+        * @param       $userStatus             Raw user status from database layer
+        * @return      $translated             Translated user status
+        */
+       protected function doFilterUserStatusTranslator ($userStatus) {
+               // Generate message id
+               $messageId = 'user_status_' . strtolower($userStatus);
+
+               // Get that message
+               $translated = $this->getLanguageInstance()->getMessage($messageId);
+
+               // Return it
+               return $translated;
+       }
+
        /**
         * Flush the content out,e g. to a template variable
         *