コード例 #1
0
 /**
  * Format the result as a simple link to the page
  *
  * @param Skin $skin
  * @param object $row Result row
  * @return string
  */
 public function formatResult($skin, $row)
 {
     global $wgContLang;
     $title = Title::makeTitleSafe($row->namespace, $row->title);
     return $skin->makeKnownLinkObj($title, htmlspecialchars($wgContLang->convert($title->getPrefixedText())));
 }
コード例 #2
0
 /**
  * Make a "what links here" link for a specified result if required
  *
  * @param Title $title Title to make the link for
  * @param Skin $skin Skin to use
  * @param object $result Result row
  * @return string
  */
 private function makeWlhLink($title, $skin, $result)
 {
     global $wgLang;
     if ($this->nlinks) {
         $wlh = SpecialPage::getTitleFor('Whatlinkshere');
         $label = wfMsgExt('nlinks', array('parsemag', 'escape'), $wgLang->formatNum($result->value));
         return $skin->makeKnownLinkObj($wlh, $label, 'target=' . $title->getPrefixedUrl());
     } else {
         return null;
     }
 }
コード例 #3
0
 /**
  * Build a set of links for convenient navigation
  * between watchlist viewing and editing modes
  *
  * @param Skin $skin Skin to use
  * @return string
  */
 public static function buildTools($skin)
 {
     $tools = array();
     $modes = array('view' => false, 'edit' => 'edit', 'raw' => 'raw');
     foreach ($modes as $mode => $subpage) {
         $tools[] = $skin->makeKnownLinkObj(SpecialPage::getTitleFor('Watchlist', $subpage), wfMsgHtml("watchlisttools-{$mode}"));
     }
     return implode(' | ', $tools);
 }