instance. So it is better to rename it everywhere to 'command'.
Signed-off-by: Roland Häder <roland@mxchange.org>
// 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);
$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)) {
- $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');
// 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
} // 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)) {
$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;
// 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
// 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());
$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');
- * 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');
$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);
*
* @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');