Beispiel #1
0
 /**
  * Search and return the result.
  *
  * @param KCommandContext $context Controller command chain context
  *
  * @return string The result to render
  */
 protected function _actionGet(KCommandContext $context)
 {
     $this->setView('searches');
     if ($this->actor) {
         $this->getToolbar('actorbar')->setTitle($this->actor->name);
         $this->getService()->set('com://site/search.owner', $this->actor);
     }
     $this->_state->append(array('search_comments' => false));
     $this->_state->insert('term')->insert('scope')->insert('search_comments')->insert('search_leaders');
     JFactory::getLanguage()->load('com_actors');
     $this->keywords = array_filter(explode(' ', $this->term));
     $this->scopes = $this->getService('com://site/components.domain.entityset.scope');
     $this->current_scope = $this->scopes->find($this->scope);
     $query = $this->getService('com://site/search.domain.query.node')->ownerContext($this->actor)->searchTerm($this->term)->searchComments($this->search_comments)->limit($this->limit, $this->start);
     if ($this->current_scope) {
         $query->scope($this->current_scope);
     }
     if ($this->sort == 'recent') {
         $query->order('node.created_on', 'DESC');
     } else {
         $query->orderByRelevance();
     }
     $entities = $query->toEntitySet();
     $this->_state->setList($entities);
     parent::_actionGet($context);
 }
Beispiel #2
0
 /**
  * Renders the sign up view
  * 
  * @param  KCommandContext $context
  * @return void
  */
 protected function _actionGet(KCommandContext $context)
 {
     $this->_request->append(array('layout' => 'default'));
     $this->getCommandChain()->run('layout.' . $this->getRequest()->get('layout'), $context);
     if ($this->getRequest()->get('layout') == 'login' && !$this->viewer->guest()) {
         $context->response->setRedirect(JRoute::_('option=com_subscriptions&view=signup&layout=payment&id=' . $this->getItem()->id));
         return false;
     }
     return parent::_actionGet($context);
 }
Beispiel #3
0
 /**
  * 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);
 }