]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - includes/specials/SpecialBrokenRedirects.php
MediaWiki 1.17.0
[autoinstallsdev/mediawiki.git] / includes / specials / SpecialBrokenRedirects.php
index 0a16e6de327436dc72b36373a8ee93105a520cde..98b0212640a21bb20bca57499ac308963a80fae1 100644 (file)
@@ -1,12 +1,30 @@
 <?php
 /**
+ * Implements Special:Brokenredirects
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
  * @file
  * @ingroup SpecialPage
  */
 
 /**
- * A special page listing redirects to non existent page. Those should be
+ * A special page listing redirects tonon existent page. Those should be
  * fixed to point to an existing page.
+ *
  * @ingroup SpecialPage
  */
 class BrokenRedirectsPage extends PageQueryPage {
@@ -33,9 +51,9 @@ class BrokenRedirectsPage extends PageQueryPage {
                                rd_namespace,
                                rd_title
                           FROM $redirect AS rd
-                   JOIN $page p1 ON (rd.rd_from=p1.page_id)
+                     JOIN $page p1 ON (rd.rd_from=p1.page_id)
                      LEFT JOIN $page AS p2 ON (rd_namespace=p2.page_namespace AND rd_title=p2.page_title )
-                                 WHERE rd_namespace >= 0
+                                 WHERE rd_namespace >= 0
                                    AND p2.page_namespace IS NULL";
                return $sql;
        }
@@ -45,7 +63,7 @@ class BrokenRedirectsPage extends PageQueryPage {
        }
 
        function formatResult( $skin, $result ) {
-               global $wgUser, $wgContLang;
+               global $wgUser, $wgContLang, $wgLang;
 
                $fromObj = Title::makeTitle( $result->namespace, $result->title );
                if ( isset( $result->rd_title ) ) {
@@ -61,21 +79,43 @@ class BrokenRedirectsPage extends PageQueryPage {
 
                // $toObj may very easily be false if the $result list is cached
                if ( !is_object( $toObj ) ) {
-                       return '<s>' . $skin->makeLinkObj( $fromObj ) . '</s>';
+                       return '<del>' . $skin->link( $fromObj ) . '</del>';
                }
 
-               $from = $skin->makeKnownLinkObj( $fromObj ,'', 'redirect=no' );
-               $edit = $skin->makeKnownLinkObj( $fromObj, wfMsgHtml( 'brokenredirects-edit' ), 'action=edit' );
-               $to   = $skin->makeBrokenLinkObj( $toObj );
+               $from = $skin->linkKnown(
+                       $fromObj,
+                       null,
+                       array(),
+                       array( 'redirect' => 'no' )
+               );
+               $links = array();
+               $links[] = $skin->linkKnown(
+                       $fromObj,
+                       wfMsgHtml( 'brokenredirects-edit' ),
+                       array(),
+                       array( 'action' => 'edit' )
+               );
+               $to   = $skin->link(
+                       $toObj,
+                       null,
+                       array(),
+                       array(),
+                       array( 'broken' )
+               );
                $arr = $wgContLang->getArrow();
 
-               $out = "{$from} {$edit}";
+               $out = $from . wfMsg( 'word-separator' );
 
                if( $wgUser->isAllowed( 'delete' ) ) {
-                       $delete = $skin->makeKnownLinkObj( $fromObj, wfMsgHtml( 'brokenredirects-delete' ), 'action=delete' );
-                       $out .= " {$delete}";
+                       $links[] = $skin->linkKnown(
+                               $fromObj,
+                               wfMsgHtml( 'brokenredirects-delete' ),
+                               array(),
+                               array( 'action' => 'delete' )
+                       );
                }
 
+               $out .= wfMsg( 'parentheses', $wgLang->pipeList( $links ) );
                $out .= " {$arr} {$to}";
                return $out;
        }