X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/19e297c21b10b1b8a3acad5e73fc71dcb35db44a..6932310fd58ebef145fa01eb76edf7150284d8ea:/includes/specialpage/PageQueryPage.php diff --git a/includes/specialpage/PageQueryPage.php b/includes/specialpage/PageQueryPage.php new file mode 100644 index 00000000..f7f04993 --- /dev/null +++ b/includes/specialpage/PageQueryPage.php @@ -0,0 +1,65 @@ +executeLBFromResultWrapper( $res ); + } + + /** + * 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 ); + + if ( $title instanceof Title ) { + $text = $wgContLang->convert( $title->getPrefixedText() ); + return $this->getLinkRenderer()->makeLink( $title, $text ); + } else { + return Html::element( 'span', [ 'class' => 'mw-invalidtitle' ], + Linker::getInvalidTitleDescription( $this->getContext(), $row->namespace, $row->title ) ); + } + } +}