Example #1
0
 /**
  * Add block with user questions
  *
  * @return object $this
  *
  * @todo finish up with pagination
  *
  */
 protected function addQuestions()
 {
     /**
      * html of parsed questions and pagination links
      * at the bottom all wrapped inside <div class="user_tags">
      *
      * @var $userQuestions
      */
     $userQuestions = UserQuestions::get($this->Registry, $this->User);
     /**
      * UserQuestions::get() may return an empty string
      * if this user does not have
      * any questions in which case skip the
      * rest of the method
      */
     if (empty($userQuestions)) {
         return $this;
     }
     $cond = $this->Registry->Request->get('sort', 's', 'recent');
     $tabs = Urhere::factory($this->Registry)->get('tplSortuq', $cond, array('uid' => $this->User->getUid()));
     $questiondBlock = '<div id="uquestions" class="sortable paginated">' . $userQuestions . '</div>';
     $this->aPageVars['body'] .= $tabs . $questiondBlock;
     return $this;
 }
Example #2
0
 /**
  * Get content of sorted and paginated User Questions
  * block and return in via XHR
  *
  */
 protected function getQuestions()
 {
     $s = \Lampcms\UserQuestions::get($this->Registry, $this->User);
     Responder::sendJSON(array('replace' => array('target' => 'uquestions', 'content' => $s)));
 }