protected function makeQlistBody()
 {
     $uid = $this->Registry->Viewer->getUid();
     $in = '';
     $categories = null;
     $aUserTags = $this->Registry->Viewer['a_f_t'];
     $showDeleted = $this->Registry->Viewer->isModerator();
     $contributed = $this->_('You have contributed to this question');
     $following = $this->_('You are following this question');
     $asked = $this->_('Asked');
     $latestBy = $this->_('Latest answer by');
     $toggle = $this->_('Toggle Unread/Read Status');
     if ($this->Registry->Ini->CATEGORIES > 0) {
         $categories = $this->Registry->Cache->categories;
         $in = $this->_('In');
     }
     $func = function (&$a) use($uid, $aUserTags, $showDeleted, $following, $contributed, $asked, $latestBy, $toggle, $categories, $in) {
         if ($uid == $a['i_uid'] || !empty($a['a_uids']) && in_array($uid, $a['a_uids'])) {
             $a['dot'] = '<div class="fr pad2"><span class="ico person ttt" title="' . $contributed . '">&nbsp;</span></div>';
         }
         if (!empty($a['a_flwrs']) && in_array($uid, $a['a_flwrs'])) {
             $a['following_q'] = '<div class="fr pad2"><span class="icoc check ttt" title="' . $following . '">&nbsp;</span></div>';
         }
         if ($categories && !empty($a['i_cat']) && !empty($categories[$a['i_cat']])) {
             $a['category'] = '<br><span class="categ">' . $in . ' <a href="/category/' . $categories[$a['i_cat']]['slug'] . '">' . $categories[$a['i_cat']]['title'] . '</a></span>';
         }
         /**
          * Add special flag if user following
          * at least one of the tag of this question.
          */
         if (count(array_intersect($a['a_tags'], $aUserTags)) > 0) {
             $a['following_tag'] = '  followed_tag';
         }
         $a['asked'] = $asked;
         $a['toggle'] = $toggle;
         $a['latest_by'] = $latestBy;
     };
     $sQdivs = \tplQrecent::loop($this->Cursor, true, $func);
     $sQlist = \tplQlist::parse(array($this->typeDiv, $sQdivs, $this->pagerLinks, $this->notAjaxPaginatable), false);
     $this->aPageVars['body'] = $sQlist;
     d('cp');
     /**
      * In case of Ajax can just send out sQlist as result
      */
     return $this;
 }
 /**
  * (non-PHPdoc)
  *
  * @see Lampcms\Controllers.Viewquestions::makeQlistBody()
  * @return \Lampcms\Controllers\Viewqtags
  */
 protected function makeQlistBody()
 {
     $sQdivs = \tplTagslist::loop($this->Cursor);
     $sQlist = \tplQlist::parse(array($this->typeDiv, $sQdivs . $this->pagerLinks, '', $this->notAjaxPaginatable), false);
     $this->aPageVars['body'] = $sQlist;
     /**
      * In case of Ajax can just send out sQlist as result
      */
     return $this;
 }
Beispiel #3
0
 /**
  * (non-PHPdoc)
  * @see Lampcms\Controllers.Viewquestions::makeQlistBody()
  */
 protected function makeQlistBody()
 {
     /**
      * @todo pass false to loop
      * but we MUST be sure that we have consistent
      * field names in QUESTION_TAGS collection and that
      * they are always in the same order, which would be
      * the case normally as long as they are inserted using
      * the same class
      *
      */
     $sQdivs = \tplTagslist::loop($this->Cursor);
     $sQlist = \tplQlist::parse(array($this->typeDiv, $sQdivs . $this->pagerLinks, '', $this->notAjaxPaginatable), false);
     $this->aPageVars['body'] = $sQlist;
     /**
      * In case of Ajax can just send out sQlist as result
      */
     return $this;
 }
Beispiel #4
0
 protected function makeBody()
 {
     $this->aPageVars['body'] = \tplQlist::parse(array('', $this->Search->getHtml(), $this->Search->getPagerLinks(), $this->notAjaxPaginatable), false);
     return $this;
 }