예제 #1
0
 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);
 }
예제 #3
0
 protected function _initialize(KConfig $config)
 {
     $config->append(array(
     	'controller' => 'items',
     ));
     parent::_initialize($config);
 }
예제 #4
0
    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;
    }
예제 #5
0
 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);
 }
예제 #6
0
 /**
  * @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);
 }
예제 #7
0
 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;
 }
예제 #8
0
 /**
  * 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;
 }
예제 #9
0
 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;
 }
예제 #10
0
 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);
 }
예제 #11
0
 /**
  * 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'));
     }
 }
예제 #12
0
 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);
 }
예제 #13
0
	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);
 }
예제 #15
0
 protected function _initialize(KConfig $config)
 {
     $config->append(array('request' => array('view' => 'activities')));
     parent::_initialize($config);
 }
예제 #16
0
 public function _initialize(KConfig $config)
 {
     $config->controller = 'config';
     return parent::_initialize($config);
 }
예제 #17
0
 protected function _initialize(KConfig $config)
 {
     $config->append(array('controller' => 'pressreview'));
     parent::_initialize($config);
 }
예제 #18
0
 /**
  * @param KConfig $config
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('controller' => 'categories'));
     parent::_initialize($config);
 }
예제 #19
0
 public function _initialize(KConfig $config)
 {
     $config->append(array('controller' => 'publications'));
     parent::_initialize($config);
 }
예제 #20
0
 /**
  * Initialize method
  *
  * @param $config
  * 				->controller_default	The default controller
  */
 protected function _initialize(KConfig $config)
 {
     $config->append(array('controller_default' => 'forum'));
     parent::_initialize($config);
 }