From: Roland Häder Date: Sat, 20 Dec 2008 20:20:05 +0000 (+0000) Subject: Application helper class rewritten, buildMasterTemplateName() method added, Manageabl... X-Git-Url: https://git.mxchange.org/?p=core.git;a=commitdiff_plain;h=81d28b14f65e35ece6524eee9ae0b74d6c6117d8 Application helper class rewritten, buildMasterTemplateName() method added, ManageableApplication interface updated --- diff --git a/inc/classes/interfaces/application/class_ManageableApplication.php b/inc/classes/interfaces/application/class_ManageableApplication.php index ec0e2b65..e40e58f7 100644 --- a/inc/classes/interfaces/application/class_ManageableApplication.php +++ b/inc/classes/interfaces/application/class_ManageableApplication.php @@ -27,57 +27,6 @@ * along with this program. If not, see . */ interface ManageableApplication extends FrameworkInterface { - /** - * Getter for application's version number - * - * @return $appVersion The application's version number - */ - function getAppVersion (); - /** - * Setter for application's version number - * - * @param $appVersion The application's version number - * @return void - */ - function setAppVersion ($appVersion); - - /** - * Getter for application's human-readable name - * - * @return $appName The application's name readable for humans - */ - function getAppName (); - - /** - * Setter for application's human-readable name - * - * @param $appName The application's name readable for humans - * @return void - */ - function setAppName ($appName); - - /** - * Getter for application's short uni*-like name - * - * @return $shortName The application's name readable for humans - */ - function getAppShortName (); - - /** - * Setter for application's short uni*-like name - * - * @param $shortName The application's name readable for humans - * @return void - */ - function setAppShortName ($shortName); - - /** - * Getter for master template name - * - * @return $masterTemplate Name of the master template - */ - function getMasterTemplate (); - /** * Launches the application * @@ -93,6 +42,13 @@ interface ManageableApplication extends FrameworkInterface { * @return void */ function handleFatalMessages (array $messageList); + + /** + * Builds the master template's name + * + * @return $masterTemplateName Name of the master template + */ + function buildMasterTemplateName(); } // [EOF] diff --git a/inc/classes/main/commands/web/class_WebConfirmCommand.php b/inc/classes/main/commands/web/class_WebConfirmCommand.php index ca44f8b6..fed2ab9a 100644 --- a/inc/classes/main/commands/web/class_WebConfirmCommand.php +++ b/inc/classes/main/commands/web/class_WebConfirmCommand.php @@ -70,7 +70,7 @@ class WebConfirmCommand extends BaseCommand implements Commandable { $templateInstance->assignConfigVariable('base_url'); // Load the master template - $masterTemplate = $appInstance->getMasterTemplate(); + $masterTemplate = $appInstance->buildMasterTemplateName(); // Load header template $templateInstance->loadCodeTemplate('header'); diff --git a/inc/classes/main/commands/web/class_WebHomeCommand.php b/inc/classes/main/commands/web/class_WebHomeCommand.php index 6aad8cfb..cac84cf4 100644 --- a/inc/classes/main/commands/web/class_WebHomeCommand.php +++ b/inc/classes/main/commands/web/class_WebHomeCommand.php @@ -67,7 +67,7 @@ class WebHomeCommand extends BaseCommand implements Commandable { $templateInstance->assignApplicationData($appInstance); // Load the master template - $masterTemplate = $appInstance->getMasterTemplate(); + $masterTemplate = $appInstance->buildMasterTemplateName(); // Load header template $templateInstance->loadCodeTemplate('header'); diff --git a/inc/classes/main/commands/web/class_WebLoginAreaCommand.php b/inc/classes/main/commands/web/class_WebLoginAreaCommand.php index 749de174..ee38a4b7 100644 --- a/inc/classes/main/commands/web/class_WebLoginAreaCommand.php +++ b/inc/classes/main/commands/web/class_WebLoginAreaCommand.php @@ -96,7 +96,7 @@ class WebLoginAreaCommand extends BaseCommand implements Commandable { $templateInstance->assignApplicationData($appInstance); // Load the master template - $masterTemplate = $appInstance->getMasterTemplate(); + $masterTemplate = $appInstance->buildMasterTemplateName(); // Load header template $templateInstance->loadCodeTemplate('header'); diff --git a/inc/classes/main/commands/web/class_WebLoginCommand.php b/inc/classes/main/commands/web/class_WebLoginCommand.php index 9726e847..96d62a4e 100644 --- a/inc/classes/main/commands/web/class_WebLoginCommand.php +++ b/inc/classes/main/commands/web/class_WebLoginCommand.php @@ -70,7 +70,7 @@ class WebLoginCommand extends BaseCommand implements Commandable { $templateInstance->assignConfigVariable('base_url'); // Load the master template - $masterTemplate = $appInstance->getMasterTemplate(); + $masterTemplate = $appInstance->buildMasterTemplateName(); // Load header template $templateInstance->loadCodeTemplate('header'); diff --git a/inc/classes/main/commands/web/class_WebLoginFailedCommand.php b/inc/classes/main/commands/web/class_WebLoginFailedCommand.php index f2b6b810..c9768010 100644 --- a/inc/classes/main/commands/web/class_WebLoginFailedCommand.php +++ b/inc/classes/main/commands/web/class_WebLoginFailedCommand.php @@ -67,7 +67,7 @@ class WebLoginFailedCommand extends BaseCommand implements Commandable { $templateInstance->assignApplicationData($appInstance); // Load the master template - $masterTemplate = $appInstance->getMasterTemplate(); + $masterTemplate = $appInstance->buildMasterTemplateName(); // Load header template $templateInstance->loadCodeTemplate('header'); diff --git a/inc/classes/main/commands/web/class_WebLogoutDoneCommand.php b/inc/classes/main/commands/web/class_WebLogoutDoneCommand.php index 8dfdee36..8d2fc080 100644 --- a/inc/classes/main/commands/web/class_WebLogoutDoneCommand.php +++ b/inc/classes/main/commands/web/class_WebLogoutDoneCommand.php @@ -67,7 +67,7 @@ class WebLogoutDoneCommand extends BaseCommand implements Commandable { $templateInstance->assignApplicationData($appInstance); // Load the master template - $masterTemplate = $appInstance->getMasterTemplate(); + $masterTemplate = $appInstance->buildMasterTemplateName(); // Load header template $templateInstance->loadCodeTemplate('header'); diff --git a/inc/classes/main/commands/web/class_WebRegisterCommand.php b/inc/classes/main/commands/web/class_WebRegisterCommand.php index 89c0e9c3..778228a0 100644 --- a/inc/classes/main/commands/web/class_WebRegisterCommand.php +++ b/inc/classes/main/commands/web/class_WebRegisterCommand.php @@ -73,7 +73,7 @@ class WebRegisterCommand extends BaseCommand implements Commandable, Registerabl $templateInstance->assignConfigVariable('base_url'); // Load the master template - $masterTemplate = $appInstance->getMasterTemplate(); + $masterTemplate = $appInstance->buildMasterTemplateName(); // Load header template $templateInstance->loadCodeTemplate('header'); diff --git a/inc/classes/main/mailer/debug/class_DebugMailer.php b/inc/classes/main/mailer/debug/class_DebugMailer.php index 14bdd412..21265be8 100644 --- a/inc/classes/main/mailer/debug/class_DebugMailer.php +++ b/inc/classes/main/mailer/debug/class_DebugMailer.php @@ -164,7 +164,7 @@ class DebugMailer extends BaseMailer implements DeliverableMail { $templateInstance->assignTemplateWithVariable('footer', 'footer'); // Load the master template - $templateInstance->loadCodeTemplate($this->getApplicationInstance()->getMasterTemplate()); + $templateInstance->loadCodeTemplate($this->getApplicationInstance()->buildMasterTemplateName()); // Then compile it again $templateInstance->compileVariables(); diff --git a/inc/classes/main/template/class_BaseTemplateEngine.php b/inc/classes/main/template/class_BaseTemplateEngine.php index 8690db6f..207d53eb 100644 --- a/inc/classes/main/template/class_BaseTemplateEngine.php +++ b/inc/classes/main/template/class_BaseTemplateEngine.php @@ -1119,7 +1119,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { */ protected function loadViewHelper ($helperName) { // Make first character upper case, rest low - $helperName = ucfirst($helperName); + $helperName = $this->convertToClassName($helperName); // Is this view helper loaded? if (!isset($this->helpers[$helperName])) {