Exemple #1
0
 /**
  * Dispatch the controller and redirect
  * 
  * This function divert the standard behavior and will redirect if no view
  * information can be found in the request.
  * 
  * @param   string      The view to dispatch. If null, it will default to
  *                      retrieve the controller information from the request or
  *                      default to the component name if no controller info can
  *                      be found.
  *
  * @return  KDispatcherDefault
  */
 protected function _actionDispatch(KCommandContext $context)
 {
     //Redirect if no view information can be found in the request
     if (!$this->getRequest()->view) {
         $route = $this->getController()->getView()->getRoute();
         JFactory::getApplication()->redirect($route);
     }
     return parent::_actionDispatch($context);
 }
Exemple #2
0
 /**
  * Dispatch the controller and redirect
  * 
  * This function divert the standard behavior and will redirect if no view
  * information can be found in the request.
  * 
  * @param   string      The view to dispatch. If null, it will default to
  *                      retrieve the controller information from the request or
  *                      default to the component name if no controller info can
  *                      be found.
  *
  * @return  KDispatcherDefault
  */
 protected function _actionDispatch(KCommandContext $context)
 {
     //Redirect if no view information can be found in the request
     if (!KRequest::has('get.view')) {
         $url = clone KRequest::url();
         $url->query['view'] = $this->getController()->getView()->getName();
         JFactory::getApplication()->redirect($url);
     }
     return parent::_actionDispatch($context);
 }
 /**
  * Dispatch the controller and redirect
  *
  * This function divert the standard behavior and will redirect if no view
  * information can be found in the request.
  *
  * @param   string      The view to dispatch. If null, it will default to
  *                      retrieve the controller information from the request or
  *                      default to the component name if no controller info can
  *                      be found.
  *
  * @return  KDispatcherDefault
  */
 protected function _actionDispatch(KCommandContext $context)
 {
     //Redirect if no view information can be found in the request
     if (!KRequest::has('get.view')) {
         $package = $this->getIdentifier()->package;
         $view = $this->getController()->getView()->getName();
         $route = JRoute::_('index.php?option=com_' . $package . '&view=' . $view, false);
         JFactory::getApplication()->redirect($route);
     }
     return parent::_actionDispatch($context);
 }
 /**
  * Dispatch the controller and redirect
  * 
  * This function divert the standard behavior and will redirect if no view
  * information can be found in the request.
  * 
  * @param   string      The view to dispatch. If null, it will default to
  *                      retrieve the controller information from the request or
  *                      default to the component name if no controller info can
  *                      be found.
  *
  * @return  KDispatcherDefault
  */
 protected function _actionDispatch(KCommandContext $context)
 {
     //Redirect if no view information can be found in the request
     if (!KRequest::has('get.view')) {
         $view = count($context->data) ? $context->data : $this->_controller_default;
         $url = clone KRequest::url();
         $url->query['view'] = $view;
         KFactory::get('lib.joomla.application')->redirect($url);
     }
     return parent::_actionDispatch($context);
 }
Exemple #5
0
 /**
  * Dispatch the controller and redirect
  * 
  * This function divert the standard behavior and will redirect if no view
  * information can be found in the request.
  * 
  * @param   string      The view to dispatch. If null, it will default to
  *                      retrieve the controller information from the request or
  *                      default to the component name if no controller info can
  *                      be found.
  *
  * @return  KDispatcherDefault
  */
 protected function _actionDispatch(KCommandContext $context)
 {
     //Redirect if no view information can be found in the request
     if(!KRequest::has('get.view')) 
     {
         $url = clone(KRequest::url());
         $url->query['option'] = 'com_'.$this->getIdentifier()->package;
         $url->query['view']   = $this->getController()->getView()->getName();
        
         KFactory::get('joomla:application')->redirect($url);
     }
    
     return parent::_actionDispatch($context);
 }