namespace Org\Mxchange\CoreFramework\Helper;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Helper\Template\HelpableTemplate;
use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
*
* @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
*
*
* @return void
*/
- protected function __construct () {
+ private function __construct () {
// Call parent constructor
parent::__construct(__CLASS__);
}
* @param $blockName Name of the block we shall generate
* @return $helperInstance A prepared instance of this helper
*/
- public static final function createHtmlBlockHelper (CompileableTemplate $templateInstance, $blockName) {
+ public static final function createHtmlBlockHelper (CompileableTemplate $templateInstance, string $blockName) {
// Get new instance
$helperInstance = new HtmlBlockHelper();
* @param $blockName Name of the block we shall generate
* @return void
*/
- protected final function setBlockName ($blockName) {
- $this->blockName = (string) $blockName;
+ protected final function setBlockName (string $blockName) {
+ $this->blockName = $blockName;
}
/**
* @return $withRegistration Whether with registration date
*/
public function ifIncludeRegistrationStamp () {
- $withRegistration = ($this->getConfigInstance()->getConfigEntry('block_shows_registration') == 'Y');
+ $withRegistration = FrameworkBootstrap::getConfigurationInstance()->isEnabled('block_shows_registration');
return $withRegistration;
}
* @param $messageId Message id to load an assign
* @return void
*/
- public function assignMessageField ($templateVariable, $messageId) {
+ public function assignMessageField (string $templateVariable, string $messageId) {
// Get message
- $message = $this->getLanguageInstance()->getMessage($messageId);
+ $message = FrameworkBootstrap::getLanguageInstance()->getMessage($messageId);
// And assign it
$this->getTemplateInstance()->assignVariable($templateVariable, $message);
* @param $actionValue Action value to assign
* @return void
*/
- public function assignLinkFieldWithAction ($linkField, $actionValue) {
+ public function assignLinkFieldWithAction (string $linkField, $actionValue) {
$this->getTemplateInstance()->assignVariable($linkField . '_action', $actionValue);
}
* @param $userStatus Raw user status from database layer
* @return $translated Translated user status
*/
- protected function doFilterUserStatusTranslator ($userStatus) {
+ protected function doFilterUserStatusTranslator (string $userStatus) {
// Generate message id
- $messageId = 'user_status_' . strtolower($userStatus);
+ $messageId = sprintf('user_status_%s', strtolower($userStatus));
// Get that message
- $translated = $this->getLanguageInstance()->getMessage($messageId);
+ $translated = FrameworkBootstrap::getLanguageInstance()->getMessage($messageId);
// Return it
return $translated;