/** * Format an individual result * * @param Skin $skin Skin to use for UI elements * @param object $result Result row * @return string */ public function formatResult($skin, $result) { $title = Title::makeTitleSafe($result->namespace, $result->title); if ($title instanceof Title) { if ($this->isCached()) { $pageLink = $title->exists() ? '<s>' . $skin->makeLinkObj($title) . '</s>' : $skin->makeBrokenLinkObj($title); } else { $pageLink = $skin->makeBrokenLinkObj($title); } return wfSpecialList($pageLink, $this->makeWlhLink($title, $skin, $result)); } else { $tsafe = htmlspecialchars($result->title); return "Invalid title in result set; {$tsafe}"; } }
/** * Format a result row * * @param Skin $skin Skin to use for UI elements * @param object $result Result row * @return string */ public function formatResult($skin, $result) { $title = Title::makeTitleSafe($result->namespace, $result->title); if ($title instanceof Title) { return wfSpecialList($skin->makeLinkObj($title), $this->makeWlhLink($title, $skin, $result)); } else { $tsafe = htmlspecialchars($result->title); return "Invalid title in result set; {$tsafe}"; } }
/** * Format a result row * * @param Skin $skin Skin to use for UI elements * @param object $result Result row * @return string */ public function formatResult($skin, $result) { $title = Title::makeTitleSafe($result->namespace, $result->title); $skin->link($title); return wfSpecialList($skin->makeLinkObj($title), $this->makeWlhLink($title, $skin, $result)); }
/** * Build a single list item containing a check box selecting a title * and a link to that title, with various additional bits * * @param Title $title * @param bool $redirect * @param Skin $skin * @return string */ private function buildRemoveLine($title, $redirect, $skin) { $link = $skin->makeLinkObj($title); if ($redirect) { $link = '<span class="watchlistredir">' . $link . '</span>'; } $tools[] = $skin->makeLinkObj($title->getTalkPage(), wfMsgHtml('talkpagelinktext')); if ($title->exists()) { $tools[] = $skin->makeKnownLinkObj($title, wfMsgHtml('history_short'), 'action=history'); } if ($title->getNamespace() == NS_USER && !$title->isSubpage()) { $tools[] = $skin->makeKnownLinkObj(SpecialPage::getTitleFor('Contributions', $title->getText()), wfMsgHtml('contributions')); } return '<li>' . Xml::check('titles[]', false, array('value' => $title->getPrefixedText())) . $link . ' (' . implode(' | ', $tools) . ')' . '</li>'; }