(bug 17000) Special:RevisionDelete now checks if the database is locked before trying...
[lhc/web/wiklou.git] / includes / specials / SpecialAllpages.php
index afe6738..5da23f2 100644 (file)
@@ -11,15 +11,15 @@ class SpecialAllpages extends IncludableSpecialPage {
         */
        protected $maxPerPage = 345;
 
-    /**
-     * Maximum number of pages to show on single index subpage.
-     */
-    protected $maxLineCount = 200;
+       /**
+        * Maximum number of pages to show on single index subpage.
+        */
+       protected $maxLineCount = 200;
 
-    /**
-     * Maximum number of chars to show for an entry.
-     */
-    protected $maxPageLength = 70;
+       /**
+        * Maximum number of chars to show for an entry.
+        */
+       protected $maxPageLength = 70;
 
        /**
         * Determines, which message describes the input field 'nsfrom'.
@@ -153,10 +153,9 @@ class SpecialAllpages extends IncludableSpecialPage {
                        $done = false;
                        while( !$done ) {
                                // Fetch the last title of this chunk and the first of the next
-                               $chunk = is_null( $lastTitle )
-                                       ? ''
-                                       : 'page_title >= ' . $dbr->addQuotes( $lastTitle );
-                               $chunk = array($chunk);
+                               $chunk = ( $lastTitle === false )
+                                       ? array()
+                                       : array( 'page_title >= ' . $dbr->addQuotes( $lastTitle ) );
                                $res = $dbr->select( 'page', /* FROM */
                                        'page_title', /* WHAT */
                                        array_merge($where,$chunk),
@@ -193,7 +192,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                        if( !empty($lines) ) {
                                $this->showChunk( $namespace, $lines[0], $lines[count($lines)-1] );
                        } else {
-                               $wgOut->addHtml( $this->namespaceForm( $namespace, $from, $to ) );
+                               $wgOut->addHTML( $this->namespaceForm( $namespace, $from, $to ) );
                        }
                        return;
                }
@@ -218,17 +217,18 @@ class SpecialAllpages extends IncludableSpecialPage {
                                $out2 .= '<tr valign="top"><td>' . $nsForm;
                                $out2 .= '</td><td align="' . $align . '" style="font-size: smaller; margin-bottom: 1em;">' .
                                        $wgUser->getSkin()->makeKnownLinkObj( $this->getTitle(), wfMsgHtml ( 'allpages' ) );
-                               $out2 .= "</td></tr></table><hr />";
+                               $out2 .= "</td></tr></table>";
                        } else {
-                               $out2 = $nsForm . '<hr />';
+                               $out2 = $nsForm;
                        }
                }
-               $wgOut->addHtml( $out2 . $out );
+               $wgOut->addHTML( $out2 . $out );
        }
 
        /**
-        * @todo Document
-        * @param string $from
+        * Show a line of "ABC to DEF" ranges of articles
+        * @param string $inpoint Lower limit of pagenames
+        * @param string $outpout Upper limit of pagenames
         * @param integer $namespace (Default NS_MAIN)
         */
        function showline( $inpoint, $outpoint, $namespace = NS_MAIN ) {
@@ -328,8 +328,6 @@ class SpecialAllpages extends IncludableSpecialPage {
                        }
                }
 
-               $separator = wfMsgExt( 'pipe-separator' , 'escapenoentities' );
-
                if ( $this->including() ) {
                        $out2 = '';
                } else {
@@ -384,7 +382,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                                        . ( $namespace ? '&namespace=' . $namespace : '' );
                                $prevLink = $sk->makeKnownLinkObj( $self,
                                        wfMsgHTML( 'prevpage', htmlspecialchars( $pt ) ), $q );
-                               $out2 .= $separator . $prevLink;
+                               $out2 .= ' | ' . $prevLink;
                        }
 
                        if( $n == $this->maxPerPage && $s = $res->fetchObject() ) {
@@ -394,19 +392,19 @@ class SpecialAllpages extends IncludableSpecialPage {
                                        . ( $namespace ? '&namespace=' . $namespace : '' );
                                $nextLink = $sk->makeKnownLinkObj( $self,
                                        wfMsgHtml( 'nextpage', htmlspecialchars( $t->getText() ) ), $q );
-                               $out2 .= $separator . $nextLink;
+                               $out2 .= ' | ' . $nextLink;
                        }
-                       $out2 .= "</td></tr></table><hr />";
+                       $out2 .= "</td></tr></table>";
                }
 
-               $wgOut->addHtml( $out2 . $out );
+               $wgOut->addHTML( $out2 . $out );
                if( isset($prevLink) or isset($nextLink) ) {
-                       $wgOut->addHtml( '<hr /><p style="font-size: smaller; float: ' . $align . '">' );
+                       $wgOut->addHTML( '<hr /><p style="font-size: smaller; float: ' . $align . '">' );
                        if( isset( $prevLink ) ) {
                                $wgOut->addHTML( $prevLink );
                        }
                        if( isset( $prevLink ) && isset( $nextLink ) ) {
-                               $wgOut->addHTML( $separator );
+                               $wgOut->addHTML( ' | ' );
                        }
                        if( isset( $nextLink ) ) {
                                $wgOut->addHTML( $nextLink );