public function makeTargetList()
 {
     global $wgUser;
     $sk = $wgUser->getSkin();
     $targets = $this->getTargets();
     $list = Xml::openElement('ul');
     foreach ($targets as $t) {
         $link = $sk->link($t, $t->getPrefixedText(), array(), array(), array('known', 'noclasses'));
         $list .= Xml::tags('li', null, $link);
     }
     $list .= Xml::CloseElement('ul');
     return $list;
 }
Esempio n. 2
0
 /**
  * @param $thread Thread
  * @param $startAt
  * @param $maxCount
  * @param $showThreads
  * @param $cascadeOptions
  * @param $interruption bool
  */
 function showThreadReplies($thread, $startAt, $maxCount, $showThreads, $cascadeOptions, $interruption = false)
 {
     $repliesClass = 'lqt-thread-replies lqt-thread-replies-' . $this->threadNestingLevel;
     if ($interruption) {
         $repliesClass .= ' lqt-thread-replies-interruption';
     }
     $div = Xml::openElement('div', array('class' => $repliesClass));
     $subthreadCount = count($thread->subthreads());
     $i = 0;
     $showCount = 0;
     $showThreads = true;
     $mustShowThreads = $cascadeOptions['mustShowThreads'];
     $replies = $thread->subthreads();
     usort($replies, array('Thread', 'createdSortCallback'));
     foreach ($replies as $st) {
         ++$i;
         // Only show undeleted threads that are above our 'startAt' index.
         $shown = false;
         if ($st->type() != Threads::TYPE_DELETED && $i >= $startAt && $showThreads) {
             if ($showCount > $maxCount && $maxCount > 0) {
                 // We've shown too many threads.
                 $link = $this->getShowMore($thread, $st, $i);
                 $this->output->addHTML($div . $link . '</div>');
                 $showThreads = false;
                 continue;
             }
             ++$showCount;
             if ($showCount == 1) {
                 // There's a post sep before each reply group to
                 //	separate from the parent thread.
                 $this->output->addHTML($div);
             }
             $this->showThread($st, $i, $subthreadCount, $cascadeOptions);
             $shown = true;
         }
         // Handle must-show threads.
         // FIXME this thread will be duplicated if somebody clicks the
         //	"show more" link (probably needs fixing in the JS)
         if ($st->type() != Threads::TYPE_DELETED && !$shown && array_key_exists($st->id(), $mustShowThreads)) {
             $this->showThread($st, $i, $subthreadCount, $cascadeOptions);
         }
     }
     // Show reply stuff
     $this->showReplyBox($thread);
     $finishDiv = '';
     $finishDiv .= Xml::tags('div', array('class' => 'lqt-replies-finish'), '&#160;');
     $this->output->addHTML($finishDiv . Xml::CloseElement('div'));
 }