Ejemplo n.º 1
0
 /**
  * Dispatches the component
  * 
  * @param KCommandContext $context Command chain context
  * 
  * @return boolean
  */
 protected function _actionDispatch(KCommandContext $context)
 {
     parent::_actionDispatch($context);
     $this->_application->triggerEvent('onAfterDispatch', array($context));
     //render if it's only an HTML
     //otherwise just send back the request
     if (!$context->response->isRedirect() && $context->request->getFormat() == 'html' && !$context->request->isAjax()) {
         $this->render($context);
     }
     $this->_application->triggerEvent('onAfterRender', array($context));
     $this->send($context);
 }
Ejemplo n.º 2
0
 /**
  * Dispatches the component
  * 
  * @param KCommandContext $context Command chain context
  * 
  * @return boolean
  */
 protected function _actionDispatch(KCommandContext $context)
 {
     if ($context->request->get('option') != 'com_application') {
         parent::_actionDispatch($context);
     }
     $this->_application->triggerEvent('onAfterDispatch', array($context));
     //render if it's only an HTML
     //otherwise just send back the request
     //@TODO arash. For some reason the line below Need to fix the line below
     //not working properly
     //$redirect = $context->response->isRedirect()
     if (!$context->response->getHeader('Location') && $context->request->getFormat() == 'html' && !$context->request->isAjax()) {
         $config = array('request' => $context->request, 'response' => $context->response, 'theme' => $this->_application->getTemplate());
         $layout = $this->_request->get('tmpl', 'default');
         $this->getService('com://site/application.controller.page', $config)->layout($layout)->render();
     }
     $this->_application->triggerEvent('onAfterRender', array($context));
     $this->send($context);
 }