Beispiel #1
0
 /**
  * Dispatches the component.
  *
  * @param KCommandContext $context Command chain context
  *
  * @return bool
  */
 protected function _actionDispatch(KCommandContext $context)
 {
     $option = $context->request->get('option');
     $view = $context->request->get('view');
     $legacyComponents = array('com_cpanel', 'com_plugins', 'com_languages', 'com_config', 'com_login', 'com_templates');
     if (!in_array($option, $legacyComponents) && empty($view)) {
         $query = $context->request->toArray();
         if (file_exists(JPATH_COMPONENT . '/config.xml')) {
             $query['view'] = 'configurations';
         } elseif (file_exists(JPATH_COMPONENT . '/views')) {
             $query['view'] = str_replace('com_', '', $option);
         } else {
             //this shouldn't happen
             $query['view'] = '';
         }
         $context->response->setRedirect('index.php?option=' . $query['option'] . '&view=' . $query['view']);
     }
     parent::_actionDispatch($context);
 }