protected function __construct () {
// Call parent constructor
parent::__construct(__CLASS__);
-
- // Set part description
- $this->setObjectDescription("A helper for generating web blocks");
}
/**
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
*