]> git.mxchange.org Git - core.git/commitdiff
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 113fae8d913b84dfb5600f13a850edd0b92c1da4..c8b407a5e251fdd9795050108959880ce7b8687f 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
                // 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);
 
                        // Set it in request
                        $requestInstance->setRequestElement('command', $commandName);
index 2cb7ec7882aaa72a62ae4dbf88c5e41dabf65fd0..135409dee32a22cf884112a34f17df036a8e2435 100644 (file)
@@ -49,12 +49,12 @@ class HtmlNewsFactory extends BaseFactory {
                $configEntry = 'news_reader_class';
 
                // Get "page"
                $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
                        // Then add it
-                       $configEntry = sprintf('news_reader_%s_class', $page);
+                       $configEntry = sprintf('news_reader_%s_class', $command);
 
                        // Get 'action'
                        $action = $requestInstance->getRequestElement('action');
 
                        // 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
                        // 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
 
                        } // END - if
                } // END - if
 
index 09121d59c334248958ebb38465a33a241a82708d..e41de2db354e0492e77e2692d6a49e92636170e8 100644 (file)
@@ -84,10 +84,10 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
                } // END - if
 
                // Get page (this will throw an exception if not set)
                } // 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
 
                // Construct config entry
-               $configEntry = $page . '_' . $linkName . '_action_url';
+               $configEntry = $command . '_' . $linkName . '_action_url';
 
                // Is the deprecated parameter set?
                if (!is_null($linkBase)) {
 
                // 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
 
                        $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;
                try {
                        $newLinkBase = $helperInstance->getConfigInstance()->getConfigEntry($configEntry);
                        $linkBase = $newLinkBase;
index 1f3512b62c0492dc5ad4a5cb9989d6da4acb8998..23324eddab8131ff0ef9e54121b07c53a6417ada 100644 (file)
@@ -49,18 +49,18 @@ class BaseMenu extends BaseFrameworkSystem {
                // Load the menu template for all
                $templateInstance->loadMenuTemplate('generic_menu_entries');
 
                // 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 page is empty, choose default
-               if (empty($page)) {
+               if (empty($command)) {
                        // Use default page as none has been specified
                        // 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 {
                } // 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());
                } catch (FileIoException $e) {
                        // Log exception @TODO Maybe to intrusive?
                        self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: Exception caught: ' . $e->__toString() . ', with message: ' . $e->getMessage());
index 5d23a680b81d9eee94853dec1ed99f5ac6b8d456..9f5cc8e5a1088ce40397a35b06413510f59a9a06 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 = 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');
 
                // Add limitation from config
                $criteriaInstance->setConfiguredLimit('news_' . $command . '_limit');
index c3af732e7f75ab54edff47c5a21e9156aba4d9f0..8ff4a9b424a121cd7baf6ceb34e3d534ade9de85 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 () {
         * (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');
 
                // 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 = 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
 
                // 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);
 
                // Get a resultInstance back from the database
                $resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance);
index 6afc20fcfece706a639f921391ef1a8e629e4543..0becb5820df511bc9dff1c1a74a974b4d4b32f8d 100644 (file)
@@ -227,7 +227,7 @@ class BaseResponse extends BaseFrameworkSystem {
         *
         * @return      $defaultCommand         Default command for this response
         */
         *
         * @return      $defaultCommand         Default command for this response
         */
-       public function getDefaultCommand () {
+       public function determineDefaultCommand () {
                // Get application instance
                $applicationInstance = Registry::getRegistry()->getInstance('app');
 
                // Get application instance
                $applicationInstance = Registry::getRegistry()->getInstance('app');