public function __construct(KConfigInterface $config) { parent::__construct($config); if (KRequest::type() == 'AJAX' && KRequest::method() == 'POST') { $this->unregisterCallback('after.dispatch', array($this, 'forward')); } }
protected function _actionRender(KCommandContext $context) { if ($this->_request->routed) { return $context->result; } return parent::_actionRender($context); }
protected function _initialize(KConfig $config) { $config->append(array( 'controller' => 'items', )); parent::_initialize($config); }
public function getRequest() { $request = parent::getRequest(); if ($request->alias && !$request->slug) { $request->slug = array_pop(explode('-', $request->alias, 2)); } $menu = JFactory::getApplication()->getMenu()->getActive(); if ($menu) { $request->Itemid = $menu->id; } if (JFactory::getUser()->authorise('core.manage', 'com_docman') !== true) { // Can't use executable behavior here as it calls getController which in turn calls this method $request->enabled = 1; $request->status = 'published'; } $request->access = JFactory::getUser()->getAuthorisedViewLevels(); $request->page = $request->Itemid; // These are read-only for outsiders unset($request->page_conditions); $request->current_user = JFactory::getUser()->id; return $request; }
protected function _initialize(KConfig $config) { // TODO: Remove this workaround if SEF bug was fixed. if (KRequest::get('get.view', 'cmd', 'news') == 'news') { JFactory::getApplication()->redirect('index.php?option=com_news&view=articles'); } parent::_initialize($config); }
/** * @param KCommandContext $context * @return false|mixed */ protected function _actionForward(KCommandContext $context) { if ($this->getRequest()->format == 'json') { $context->result = $this->getController()->execute('display', $context); return $context->result; } parent::_actionForward($context); }
public function _actionAuthorize(KCommandContext $context) { $result = parent::_actionAuthorize($context); if (!JFactory::getUser()->authorize('com_weblinks', 'manage')) { throw new KDispatcherException(JText::_('ALERTNOTAUTH'), KHttpResponse::FORBIDDEN); $result = false; } return $result; }
/** * Overloaded to comply with FancyUpload. * It doesn't let us pass AJAX headers so this is needed. */ public function _actionForward(KCommandContext $context) { if (KRequest::type() == 'FLASH' || KRequest::format() == 'json') { $context->result = $this->getController()->execute('display', $context); } else { parent::_actionForward($context); } return $context->result; }
public function getRequest() { $request = parent::getRequest(); // If Itemid is passed load the default model from frontend to do filtering based on pages if ($request->Itemid) { $request->page = $request->Itemid; $this->getService('koowa:loader')->loadIdentifier('com://site/docman.model.default'); } return $request; }
protected function _actionDispatch(KCommandContext $context) { if (!JFactory::getUser()->guest) { //Redirect if user is already logged in if ($this->getRequest()->view == 'login') { JFactory::getApplication()->redirect('index.php'); } } return parent::_actionDispatch($context); }
/** * Constructor. * * @param object An optional KConfig object with configuration options. */ public function __construct(KConfig $config) { parent::__construct($config); $view = $this->getController()->getView(); $format = $view->getFormat(); if ($format != 'json') { $this->registerCallback('after.render', array($view, 'setDocumentTitle')); $this->registerCallback('after.render', array($view, 'setBreadcrumbs')); $this->registerCallback('after.render', array($view, 'setCanonical')); } }
protected function _actionDispatch(KCommandContext $context) { if (KRequest::method() == KHttpRequest::GET) { $view = KRequest::get('get.view', 'cmd', $this->_controller); if ($view == 'modules' && !KRequest::has('get.application')) { $url = clone KRequest::url(); $url->query['application'] = 'site'; JFactory::getApplication()->redirect($url); } } return parent::_actionDispatch($context); }
protected function _actionDispatch(KCommandContext $context) { $view = KRequest::get('get.view', 'cmd', $this->_controller); if($view == 'pages' && !KRequest::has('get.menu')) { $page = KFactory::get('com://admin/pages.model.pages')->home(1)->getList()->top(); $url = clone(KRequest::url()); $url->query['view'] = $view; $url->query['menu'] = $page->pages_menu_id; KFactory::get('joomla:application')->redirect($url); } return parent::_actionDispatch($context); }
protected function _initialize(KConfig $config) { $config->append(array('controller' => 'file', 'behaviors' => array('com://admin/fileman.controller.behavior.routable'))); parent::_initialize($config); }
protected function _initialize(KConfig $config) { $config->append(array('request' => array('view' => 'activities'))); parent::_initialize($config); }
public function _initialize(KConfig $config) { $config->controller = 'config'; return parent::_initialize($config); }
protected function _initialize(KConfig $config) { $config->append(array('controller' => 'pressreview')); parent::_initialize($config); }
/** * @param KConfig $config */ protected function _initialize(KConfig $config) { $config->append(array('controller' => 'categories')); parent::_initialize($config); }
public function _initialize(KConfig $config) { $config->append(array('controller' => 'publications')); parent::_initialize($config); }
/** * Initialize method * * @param $config * ->controller_default The default controller */ protected function _initialize(KConfig $config) { $config->append(array('controller_default' => 'forum')); parent::_initialize($config); }