Bug 32673: Keep the username in the input field if not existing
[lhc/web/wiklou.git] / includes / specials / SpecialBrokenRedirects.php
index ddd6d48..5279481 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 /**
- * A special page listing redirects tonon existent page. Those should be
+ * A special page listing redirects to non existent page. Those should be
  * fixed to point to an existing page.
  *
  * @ingroup SpecialPage
@@ -32,13 +32,13 @@ class BrokenRedirectsPage extends PageQueryPage {
        function __construct( $name = 'BrokenRedirects' ) {
                parent::__construct( $name );
        }
-       
+
        function isExpensive() { return true; }
        function isSyndicated() { return false; }
        function sortDescending() { return false; }
 
        function getPageHeader() {
-               return wfMsgExt( 'brokenredirectstext', array( 'parse' ) );
+               return $this->msg( 'brokenredirectstext' )->parseAsBlock();
        }
 
        function getQueryInfo() {
@@ -53,7 +53,7 @@ class BrokenRedirectsPage extends PageQueryPage {
                        'conds' => array( 'rd_namespace >= 0',
                                        'p2.page_namespace IS NULL'
                        ),
-                       'join_conds' => array( 'p1' => array( 'LEFT JOIN', array(
+                       'join_conds' => array( 'p1' => array( 'JOIN', array(
                                                'rd_from=p1.page_id',
                                        ) ),
                                        'p2' => array( 'LEFT JOIN', array(
@@ -64,13 +64,19 @@ class BrokenRedirectsPage extends PageQueryPage {
                );
        }
 
+       /**
+        * @return array
+        */
        function getOrderFields() {
                return array ( 'rd_namespace', 'rd_title', 'rd_from' );
        }
 
+       /**
+        * @param $skin Skin
+        * @param $result
+        * @return String
+        */
        function formatResult( $skin, $result ) {
-               global $wgUser, $wgContLang, $wgLang;
-
                $fromObj = Title::makeTitle( $result->namespace, $result->title );
                if ( isset( $result->rd_title ) ) {
                        $toObj = Title::makeTitle( $result->rd_namespace, $result->rd_title );
@@ -85,43 +91,43 @@ class BrokenRedirectsPage extends PageQueryPage {
 
                // $toObj may very easily be false if the $result list is cached
                if ( !is_object( $toObj ) ) {
-                       return '<del>' . $skin->link( $fromObj ) . '</del>';
+                       return '<del>' . Linker::link( $fromObj ) . '</del>';
                }
 
-               $from = $skin->linkKnown(
+               $from = Linker::linkKnown(
                        $fromObj,
                        null,
                        array(),
                        array( 'redirect' => 'no' )
                );
                $links = array();
-               $links[] = $skin->linkKnown(
+               $links[] = Linker::linkKnown(
                        $fromObj,
-                       wfMsgHtml( 'brokenredirects-edit' ),
+                       $this->msg( 'brokenredirects-edit' )->escaped(),
                        array(),
                        array( 'action' => 'edit' )
                );
-               $to   = $skin->link(
+               $to = Linker::link(
                        $toObj,
                        null,
                        array(),
                        array(),
                        array( 'broken' )
                );
-               $arr = $wgContLang->getArrow();
+               $arr = $this->getLanguage()->getArrow();
 
-               $out = $from . wfMsg( 'word-separator' );
+               $out = $from . $this->msg( 'word-separator' )->escaped();
 
-               if( $wgUser->isAllowed( 'delete' ) ) {
-                       $links[] = $skin->linkKnown(
+               if( $this->getUser()->isAllowed( 'delete' ) ) {
+                       $links[] = Linker::linkKnown(
                                $fromObj,
-                               wfMsgHtml( 'brokenredirects-delete' ),
+                               $this->msg( 'brokenredirects-delete' )->escaped(),
                                array(),
                                array( 'action' => 'delete' )
                        );
                }
 
-               $out .= wfMsg( 'parentheses', $wgLang->pipeList( $links ) );
+               $out .= $this->msg( 'parentheses' )->rawParams( $this->getLanguage()->pipeList( $links ) )->escaped();
                $out .= " {$arr} {$to}";
                return $out;
        }