From: Roland Häder Date: Tue, 24 Mar 2009 11:09:28 +0000 (+0000) Subject: Menu classes added, unfinished X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5e89637b5069092a60b8a6c38b670bf0cf7aa4fd;p=core.git Menu classes added, unfinished --- diff --git a/.gitattributes b/.gitattributes index ccdfe9fd..4b84788b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -388,6 +388,8 @@ inc/classes/main/mailer/class_ -text inc/classes/main/mailer/class_BaseMailer.php -text inc/classes/main/mailer/debug/.htaccess -text inc/classes/main/mailer/debug/class_DebugMailer.php -text +inc/classes/main/menu/.htaccess -text +inc/classes/main/menu/class_BaseMenu.php -text inc/classes/main/output/.htaccess -text inc/classes/main/output/class_ConsoleOutput.php -text inc/classes/main/output/class_WebOutput.php -text diff --git a/inc/classes/main/commands/web/class_WebConfirmCommand.php b/inc/classes/main/commands/web/class_WebConfirmCommand.php index 5158794d..090dbad9 100644 --- a/inc/classes/main/commands/web/class_WebConfirmCommand.php +++ b/inc/classes/main/commands/web/class_WebConfirmCommand.php @@ -104,6 +104,10 @@ class WebConfirmCommand extends BaseCommand implements Commandable { // Set username $templateInstance->assignVariable('username', $userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USERNAME)); + // Construct the menu in every command. We could do this in BaseCommand class. But this means + // *every* command has a navigation system and that is want we don't want. + $menuInstance = ObjectFactory::createObjectByConfiguredName('confirm_menu_class', array($appInstance)); + // ... and all variables. This should be merged together in a pattern // to make things easier. A cache mechanism should be added between // these two calls to cache compiled templates. diff --git a/inc/classes/main/commands/web/class_WebHomeCommand.php b/inc/classes/main/commands/web/class_WebHomeCommand.php index e082900c..56e112ef 100644 --- a/inc/classes/main/commands/web/class_WebHomeCommand.php +++ b/inc/classes/main/commands/web/class_WebHomeCommand.php @@ -95,6 +95,10 @@ class WebHomeCommand extends BaseCommand implements Commandable { // Set title $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage('page_home_title')); + // Construct the menu in every command. We could do this in BaseCommand class. But this means + // *every* command has a navigation system and that is want we don't want. + $menuInstance = ObjectFactory::createObjectByConfiguredName('home_menu_class', array($appInstance)); + // ... and all variables. This should be merged together in a pattern // to make things easier. A cache mechanism should be added between // these two calls to cache compiled templates. diff --git a/inc/classes/main/commands/web/class_WebLoginAreaCommand.php b/inc/classes/main/commands/web/class_WebLoginAreaCommand.php index 48ea537e..673858d8 100644 --- a/inc/classes/main/commands/web/class_WebLoginAreaCommand.php +++ b/inc/classes/main/commands/web/class_WebLoginAreaCommand.php @@ -132,6 +132,10 @@ class WebLoginAreaCommand extends BaseCommand implements Commandable { // Set title $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage($this->actionName . '_title')); + // Construct the menu in every command. We could do this in BaseCommand class. But this means + // *every* command has a navigation system and that is want we don't want. + $menuInstance = ObjectFactory::createObjectByConfiguredName('login_area_menu_class', array($appInstance)); + // ... and all variables. This should be merged together in a pattern // to make things easier. A cache mechanism should be added between // these two calls to cache compiled templates. diff --git a/inc/classes/main/commands/web/class_WebLoginCommand.php b/inc/classes/main/commands/web/class_WebLoginCommand.php index e1c314b1..0f6758f6 100644 --- a/inc/classes/main/commands/web/class_WebLoginCommand.php +++ b/inc/classes/main/commands/web/class_WebLoginCommand.php @@ -98,6 +98,10 @@ class WebLoginCommand extends BaseCommand implements Commandable { // Set title $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage('page_login_title')); + // Construct the menu in every command. We could do this in BaseCommand class. But this means + // *every* command has a navigation system and that is want we don't want. + $menuInstance = ObjectFactory::createObjectByConfiguredName('login_menu_class', array($appInstance)); + // ... and all variables. This should be merged together in a pattern // to make things easier. A cache mechanism should be added between // these two calls to cache compiled templates. diff --git a/inc/classes/main/commands/web/class_WebLoginFailedCommand.php b/inc/classes/main/commands/web/class_WebLoginFailedCommand.php index 4a4a5a53..1e39413b 100644 --- a/inc/classes/main/commands/web/class_WebLoginFailedCommand.php +++ b/inc/classes/main/commands/web/class_WebLoginFailedCommand.php @@ -98,6 +98,10 @@ class WebLoginFailedCommand extends BaseCommand implements Commandable { // Assign base URL $templateInstance->assignConfigVariable('base_url'); + // Construct the menu in every command. We could do this in BaseCommand class. But this means + // *every* command has a navigation system and that is want we don't want. + $menuInstance = ObjectFactory::createObjectByConfiguredName('login_failed_menu_class', array($appInstance)); + // ... and all variables. This should be merged together in a pattern // to make things easier. A cache mechanism should be added between // these two calls to cache compiled templates. diff --git a/inc/classes/main/commands/web/class_WebLogoutDoneCommand.php b/inc/classes/main/commands/web/class_WebLogoutDoneCommand.php index fa11b02c..12376483 100644 --- a/inc/classes/main/commands/web/class_WebLogoutDoneCommand.php +++ b/inc/classes/main/commands/web/class_WebLogoutDoneCommand.php @@ -98,6 +98,10 @@ class WebLogoutDoneCommand extends BaseCommand implements Commandable { // Assign base URL $templateInstance->assignConfigVariable('base_url'); + // Construct the menu in every command. We could do this in BaseCommand class. But this means + // *every* command has a navigation system and that is want we don't want. + $menuInstance = ObjectFactory::createObjectByConfiguredName('logout_menu_class', array($appInstance)); + // ... and all variables. This should be merged together in a pattern // to make things easier. A cache mechanism should be added between // these two calls to cache compiled templates. diff --git a/inc/classes/main/commands/web/class_WebRegisterCommand.php b/inc/classes/main/commands/web/class_WebRegisterCommand.php index b8c858e5..d72a3acd 100644 --- a/inc/classes/main/commands/web/class_WebRegisterCommand.php +++ b/inc/classes/main/commands/web/class_WebRegisterCommand.php @@ -102,6 +102,10 @@ class WebRegisterCommand extends BaseCommand implements Commandable, Registerabl // Set title $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage('page_register_title')); + // Construct the menu in every command. We could do this in BaseCommand class. But this means + // *every* command has a navigation system and that is want we don't want. + $menuInstance = ObjectFactory::createObjectByConfiguredName('register_menu_class', array($appInstance)); + // ... and all variables. This should be merged together in a pattern // to make things easier. A cache mechanism should be added between // these two calls to cache compiled templates. diff --git a/inc/classes/main/menu/.htaccess b/inc/classes/main/menu/.htaccess new file mode 100644 index 00000000..3a428827 --- /dev/null +++ b/inc/classes/main/menu/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/main/menu/class_BaseMenu.php b/inc/classes/main/menu/class_BaseMenu.php new file mode 100644 index 00000000..4c7c18c0 --- /dev/null +++ b/inc/classes/main/menu/class_BaseMenu.php @@ -0,0 +1,42 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007 - 2009 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class BaseMenu extends BaseFrameworkSystem { + /** + * Protected constructor + * + * @param $className Name of the class + * @return void + */ + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + + // Clean up a little + $this->removeNumberFormaters(); + $this->removeSystemArray(); + } +} + +// [EOF] +?>