/** * Method to set a view object attached to the controller. * * @param mixed $view An object that implements KObjectIdentifiable, an object that * implements KIndentifierInterface or valid identifier string * * @throws KDatabaseRowsetException If the identifier is not a view identifier * * @return KControllerAbstract */ public function setView($view) { parent::setView($view); if (!$this->_view instanceof LibBaseViewAbstract) { unregister_default($this->_view); } }
/** * After getting the access token store the token in the session and redirect * * @param KCommandContext $context Context parameter * @param void */ protected function _actionGetaccesstoken($context) { parent::_actionGetaccesstoken($context); $token = $this->getAPI()->getToken(); if (empty($token)) { $context->response->setRedirect(JRoute::_('index.php?')); return false; } $context->response->setRedirect(JRoute::_('option=com_connect&view=login')); }
/** * Set the request information. * * @param array An associative array of request information * * @return LibBaseControllerAbstract */ public function setRequest(array $request) { parent::setRequest($request); if (isset($this->_request->term)) { $term = $this->getService('anahita:filter.term')->sanitize($this->_request->term); $this->_request->term = $term; $this->term = $term; } return $this; }
/** * Initializes the default configuration for the object. * * Called from {@link __construct()} as a first step of object instantiation. * * @param KConfig $config An optional KConfig object with configuration options. */ protected function _initialize(KConfig $config) { $config->append(array('behaviors' => array('ownable'))); parent::_initialize($config); }
/** * Initializes the default configuration for the object. * * you can set the redirect url for when a user is logged in * as follow * * <code> * KService::setConfig('com://site/people.controller.session', array( * 'redirect_to_after_login' => 'mynewurl' * 'redirect_to_after_logout' => 'mynewurl' * )); * </code> * * Called from {@link __construct()} as a first step of object instantiation. * * @param KConfig $config An optional KConfig object with configuration options. */ protected function _initialize(KConfig $config) { $config->append(array('redirect_to_after_login' => '', 'redirect_to_after_logout' => '', 'request' => array('format' => 'json'))); parent::_initialize($config); }
/** * Initializes the options for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param object An optional KConfig object with configuration options. * @return void */ protected function _initialize(KConfig $config) { $config->append(array('base_path' => get_config_value('com_html.content_path'), 'request' => array('layout' => 'default'))); parent::_initialize($config); }
/** * Initializes the default configuration for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param KConfig $config An optional KConfig object with configuration options. * * @return void */ protected function _initialize(KConfig $config) { $config->append(array('toolbars' => array('menubar', $this->getIdentifier()->name), 'behaviors' => to_hash(array('serviceable', 'persistable')), 'request' => array('limit' => 20, 'sort' => 'id', 'direction' => 'ASC'))); parent::_initialize($config); }
/** * Initializes the default configuration for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param KConfig $config An optional KConfig object with configuration options. * * @return void */ protected function _initialize(KConfig $config) { $config->append(array('behaviors' => array('com://site/mailer.controller.behavior.mailer'))); parent::_initialize($config); }
/** * Initializes the default configuration for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param KConfig $config An optional KConfig object with configuration options. * * @return void */ protected function _initialize(KConfig $config) { $config->append(array('parser' => 'com://site/notifications.template.helper.parser', 'behaviors' => array('com://site/mailer.controller.behavior.mailer' => $config->toArray()))); parent::_initialize($config); }
/** * Dispatches a call to the oauth handler. * * @return */ protected function _actionGet(KCommandContext $context) { if ($context->request->getFormat() == 'html') { $context->response->setRedirect(JRoute::_('format=json&option=com_connect&view=' . $this->view)); return; } if ($this->get) { $url = ltrim($this->get, '/'); $data = KConfig::unbox($this->api->get($url)); $data = json_encode($data); } else { $data = (array) $this->api->getUser(); } $this->getView()->data($data); return parent::_actionGet($context); }
/** * Override context */ public function execute($name, KCommandContext $context) { $data = $context->data; $data->append(KRequest::get('session.signup', 'raw', array())); KRequest::set('session.signup', $data->toArray()); $result = parent::execute($name, $context); return $result; }
/** * Set the request information. * * @param array An associative array of request information * * @return LibBaseControllerAbstract */ public function setRequest(array $request) { parent::setRequest($request); if (isset($this->_request->term)) { $value = $this->getService('anahita:filter.term')->sanitize($this->_request->term); $this->_request->term = $value; $this->term = $value; } if (isset($this->_request->search_range)) { $value = (int) $this->_request->search_range; $this->_request->search_range = $value; $this->search_range = $value; } if ($this->_request->search_comments == 1 || $this->_request->search_comments == 'true') { $value = true; } else { $value = false; } $this->_request->search_comments = $value; $this->search_comments = $value; return $this; }
/** * Initializes the options for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param object An optional KConfig object with configuration options. * @return void */ protected function _initialize(KConfig $config) { parent::_initialize($config); $config->append(array('behaviors' => to_hash('serviceable'), 'toolbars' => array($this->getIdentifier()->name, 'menubar', 'actorbar'), 'request' => array('limit' => 20, 'offset' => 0, 'sort' => 'recent', 'scope' => ''))); }
/** * Initializes the default configuration for the object. * * Called from {@link __construct()} as a first step of object instantiation. * * @param KConfig $config An optional KConfig object with configuration options. */ protected function _initialize(KConfig $config) { $config->append(array('behaviors' => array('ownable'), 'toolbars' => array('actorbar', ' setting'))); parent::_initialize($config); }
/** * Initializes the options for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param object An optional KConfig object with configuration options. * @return void */ protected function _initialize(KConfig $config) { $config->append(array('toolbars' => array($this->getIdentifier()->name, 'menubar', 'actorbar'))); parent::_initialize($config); }
/** * Set the request information * * @param array An associative array of request information * * @return LibBaseControllerAbstract */ public function setRequest(array $request) { parent::setRequest($request); if (isset($this->_request->return)) { $return = $this->getService('com://site/people.filter.return')->sanitize($this->_request->return); $this->_request->return = $return; $this->return = $return; } return $this; }