Merge "ORDER BY/GROUP BY accept arrays"
[lhc/web/wiklou.git] / includes / PageQueryPage.php
1 <?php
2
3 /**
4 * Variant of QueryPage which formats the result as a simple link to the page
5 *
6 * @ingroup SpecialPage
7 */
8 abstract class PageQueryPage extends QueryPage {
9
10 /**
11 * Format the result as a simple link to the page
12 *
13 * @param $skin Skin
14 * @param $row Object: result row
15 * @return string
16 */
17 public function formatResult( $skin, $row ) {
18 global $wgContLang;
19
20 $title = Title::makeTitleSafe( $row->namespace, $row->title );
21
22 if ( $title instanceof Title ) {
23 $text = $wgContLang->convert( $title->getPrefixedText() );
24 return Linker::linkKnown( $title, htmlspecialchars( $text ) );
25 } else {
26 return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
27 Linker::getInvalidTitleDescription( $this->getContext(), $row->namespace, $row->title ) );
28 }
29 }
30 }