Merge "registration: Only allow one extension to set a specific config setting"
[lhc/web/wiklou.git] / includes / specials / SpecialUnusedtemplates.php
index 1dc9f42..f73be43 100644 (file)
  * @ingroup SpecialPage
  */
 class UnusedtemplatesPage extends QueryPage {
-
        function __construct( $name = 'Unusedtemplates' ) {
                parent::__construct( $name );
        }
 
-       function isExpensive() {
+       public function isExpensive() {
                return true;
        }
 
@@ -47,19 +46,23 @@ class UnusedtemplatesPage extends QueryPage {
                return false;
        }
 
-       function getQueryInfo() {
-               return array(
-                       'tables' => array( 'page', 'templatelinks' ),
-                       'fields' => array( 'namespace' => 'page_namespace',
-                                       'title' => 'page_title',
-                                       'value' => 'page_title' ),
-                       'conds' => array( 'page_namespace' => NS_TEMPLATE,
-                                       'tl_from IS NULL',
-                                       'page_is_redirect' => 0 ),
-                       'join_conds' => array( 'templatelinks' => array(
-                               'LEFT JOIN', array( 'tl_title = page_title',
-                                       'tl_namespace = page_namespace' ) ) )
-               );
+       public function getQueryInfo() {
+               return [
+                       'tables' => [ 'page', 'templatelinks' ],
+                       'fields' => [
+                               'namespace' => 'page_namespace',
+                               'title' => 'page_title',
+                               'value' => 'page_title'
+                       ],
+                       'conds' => [
+                               'page_namespace' => NS_TEMPLATE,
+                               'tl_from IS NULL',
+                               'page_is_redirect' => 0
+                       ],
+                       'join_conds' => [ 'templatelinks' => [
+                               'LEFT JOIN', [ 'tl_title = page_title',
+                                       'tl_namespace = page_namespace' ] ] ]
+               ];
        }
 
        /**
@@ -68,17 +71,19 @@ class UnusedtemplatesPage extends QueryPage {
         * @return string
         */
        function formatResult( $skin, $result ) {
+               $linkRenderer = $this->getLinkRenderer();
                $title = Title::makeTitle( NS_TEMPLATE, $result->title );
-               $pageLink = Linker::linkKnown(
+               $pageLink = $linkRenderer->makeKnownLink(
                        $title,
                        null,
-                       array(),
-                       array( 'redirect' => 'no' )
+                       [],
+                       [ 'redirect' => 'no' ]
                );
-               $wlhLink = Linker::linkKnown(
+               $wlhLink = $linkRenderer->makeKnownLink(
                        SpecialPage::getTitleFor( 'Whatlinkshere', $title->getPrefixedText() ),
-                       $this->msg( 'unusedtemplateswlh' )->escaped()
+                       $this->msg( 'unusedtemplateswlh' )->text()
                );
+
                return $this->getLanguage()->specialList( $pageLink, $wlhLink );
        }