/** * Forwards the request to com_files. * * @param KDispatcherContextInterface $context The context object. */ protected function _forward(KDispatcherContextInterface $context) { $mixer = $this->getMixer(); $parts = $mixer->getIdentifier()->toArray(); $parts['path'] = array('controller', 'permission'); $parts['name'] = 'attachment'; $permission = $this->getIdentifier($parts)->toString(); $parts['path'] = array('controller', 'behavior'); $behavior = $this->getIdentifier($parts)->toString(); $parts['path'] = array('controller'); $controller = $this->getIdentifier($parts)->toString(); // Set controller on attachment behavior and push attachment permission to file controller. $this->getIdentifier('com:files.controller.file')->getConfig()->append(array('behaviors' => array($behavior => array('controller' => $controller), 'permissible' => array('permission' => $permission)))); $context->getRequest()->getQuery()->container = $this->_container; $context->param = 'com:files.dispatcher.http'; $this->forward($context); }
protected function _actionSend(KDispatcherContextInterface $context) { if (!$context->getRequest()->isGet() || $context->getResponse()->getContentType() !== 'text/html') { return parent::_actionSend($context); } }