Sometimes 'page' is wanted, sometimes 'command' but basicly both want a command
authorRoland Haeder <roland@mxchange.org>
Mon, 6 Apr 2015 09:48:07 +0000 (11:48 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 6 Apr 2015 09:48:07 +0000 (11:48 +0200)
instance. So it is better to rename it everywhere to 'command'.

Signed-off-by: Roland H├Ąder <roland@mxchange.org>
application/tests/class_ApplicationHelper.php
inc/classes/main/factories/html/class_HtmlNewsFactory.php
inc/classes/main/helper/html/links/class_HtmlLinkHelper.php
inc/classes/main/menu/class_BaseMenu.php
inc/classes/main/reader/class_ConsoleNewsReader.php
inc/classes/main/reader/class_DefaultNewsReader.php
inc/classes/main/response/class_BaseResponse.php

index 113fae8..c8b407a 100644 (file)
@@ -182,7 +182,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
                // If it is null then get default command
                if (is_null($commandName)) {
                        // Get default command
-                       $commandName = $responseInstance->getDefaultCommand();
+                       $commandName = $responseInstance->determineDefaultCommand();
 
                        // Set it in request
                        $requestInstance->setRequestElement('command', $commandName);
index 2cb7ec7..135409d 100644 (file)
@@ -49,12 +49,12 @@ class HtmlNewsFactory extends BaseFactory {
                $configEntry = 'news_reader_class';
 
                // Get "page"
-               $page = $requestInstance->getRequestElement('page');
+               $command = $requestInstance->getRequestElement('command');
 
-               // Is 'page' used?
-               if (!empty($page)) {
+               // Is 'command' used?
+               if (!empty($command)) {
                        // Then add it
-                       $configEntry = sprintf('news_reader_%s_class', $page);
+                       $configEntry = sprintf('news_reader_%s_class', $command);
 
                        // Get 'action'
                        $action = $requestInstance->getRequestElement('action');
@@ -62,7 +62,7 @@ class HtmlNewsFactory extends BaseFactory {
                        // Is it also there?
                        if (!empty($action)) {
                                // Then use both for config entry
-                               $configEntry = sprintf('news_reader_%s_%s_class', $page, $action);
+                               $configEntry = sprintf('news_reader_%s_%s_class', $command, $action);
                        } // END - if
                } // END - if
 
index 09121d5..e41de2d 100644 (file)
@@ -84,10 +84,10 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
                } // END - if
 
                // Get page (this will throw an exception if not set)
-               $page = $helperInstance->convertDashesToUnderscores($requestInstance->getRequestElement('page'));
+               $command = $helperInstance->convertDashesToUnderscores($requestInstance->getRequestElement('command'));
 
                // Construct config entry
-               $configEntry = $page . '_' . $linkName . '_action_url';
+               $configEntry = $command . '_' . $linkName . '_action_url';
 
                // Is the deprecated parameter set?
                if (!is_null($linkBase)) {
@@ -95,7 +95,7 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
                        $helperInstance->deprecationWarning('[' . __METHOD__ . ':' . __LINE__ . ']:  linkBase is deprecated. Please remove it from your templates and add a config entry ' . $configEntry . ' in your config.php file.');
                } // END - if
 
-               // Determine link base from config now and 'page' request
+               // Determine link base from config now and 'command' request
                try {
                        $newLinkBase = $helperInstance->getConfigInstance()->getConfigEntry($configEntry);
                        $linkBase = $newLinkBase;
index 1f3512b..23324ed 100644 (file)
@@ -49,18 +49,18 @@ class BaseMenu extends BaseFrameworkSystem {
                // Load the menu template for all
                $templateInstance->loadMenuTemplate('generic_menu_entries');
 
-               // Get the 'page' from request instance
-               $page = $this->getApplicationInstance()->getRequestInstance()->getRequestElement('page');
+               // Get the 'command' from request instance
+               $command = $this->getApplicationInstance()->getRequestInstance()->getRequestElement('command');
 
                // If page is empty, choose default
-               if (empty($page)) {
+               if (empty($command)) {
                        // Use default page as none has been specified
-                       $page = $this->getConfigInstance()->getConfigEntry('default_' . $this->getApplicationInstance()->getAppShortName() . '_' . self::getResponseTypeFromSystem() . '_command');
+                       $command = $this->getConfigInstance()->getConfigEntry('default_' . $this->getApplicationInstance()->getAppShortName() . '_' . self::getResponseTypeFromSystem() . '_command');
                } // END - if
 
                // Load the menu template for this page
                try {
-                       $templateInstance->loadMenuTemplate($page . '_menu_entries');
+                       $templateInstance->loadMenuTemplate($command . '_menu_entries');
                } catch (FileIoException $e) {
                        // Log exception @TODO Maybe to intrusive?
                        self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: Exception caught: ' . $e->__toString() . ', with message: ' . $e->getMessage());
index 5d23a68..9f5cc8e 100644 (file)
@@ -66,7 +66,7 @@ class ConsoleNewsReader extends BaseFrameworkSystem implements ReadableNews, Reg
                $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
 
                // Add the command as criteria to it at lease
-               $criteriaInstance->addCriteria('page', $command);
+               $criteriaInstance->addCriteria('command', $command);
 
                // Add limitation from config
                $criteriaInstance->setConfiguredLimit('news_' . $command . '_limit');
index c3af732..8ff4a9b 100644 (file)
@@ -50,14 +50,14 @@ class DefaultNewsReader extends BaseFrameworkSystem implements ReadableNews, Reg
        }
 
        /**
-        * Initializes this reader class by pre-fetching news depending on 'page'
+        * Initializes this reader class by pre-fetching news depending on 'command'
         * (outside or login area), which amount of news and how much to skip
         *
         * @return      void
         */
        public function initializeReader () {
-               // Get 'page' for saving some calls
-               $page = $this->getRequestInstance()->getRequestElement('page');
+               // Get 'command' for saving some calls
+               $command = $this->getRequestInstance()->getRequestElement('command');
 
                // First get a wrapper instance
                $wrapperInstance = ObjectFactory::createObjectByConfiguredName('news_db_wrapper_class');
@@ -66,10 +66,10 @@ class DefaultNewsReader extends BaseFrameworkSystem implements ReadableNews, Reg
                $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
 
                // Add the page as criteria to it at lease
-               $criteriaInstance->addCriteria('page', $page);
+               $criteriaInstance->addCriteria('command', $command);
 
                // Add limitation from config
-               $criteriaInstance->setConfiguredLimit('news_' . $page . '_limit');
+               $criteriaInstance->setConfiguredLimit('news_' . $command . '_limit');
 
                // Get a resultInstance back from the database
                $resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance);
index 6afc20f..0becb58 100644 (file)
@@ -227,7 +227,7 @@ class BaseResponse extends BaseFrameworkSystem {
         *
         * @return      $defaultCommand         Default command for this response
         */
-       public function getDefaultCommand () {
+       public function determineDefaultCommand () {
                // Get application instance
                $applicationInstance = Registry::getRegistry()->getInstance('app');