Convert SpecialListusers to subclass SpecialPage. Only two left now!
[lhc/web/wiklou.git] / includes / specials / SpecialAllpages.php
index 3393914..64c1db5 100644 (file)
@@ -20,7 +20,7 @@
  * @file
  * @ingroup SpecialPage
  */
+
 /**
  * Implements Special:Allpages
  *
@@ -71,11 +71,12 @@ class SpecialAllpages extends IncludableSpecialPage {
 
                $namespaces = $wgContLang->getNamespaces();
 
-               $wgOut->setPagetitle( 
+               $wgOut->setPagetitle(
                        ( $namespace > 0 && in_array( $namespace, array_keys( $namespaces) ) ) ?
                        wfMsg( 'allinnamespace', str_replace( '_', ' ', $namespaces[$namespace] ) ) :
                        wfMsg( 'allarticles' )
                );
+               $wgOut->addModuleStyles( 'mediawiki.special' );
 
                if( isset($par) ) {
                        $this->showChunk( $namespace, $par, $to );
@@ -96,7 +97,7 @@ class SpecialAllpages extends IncludableSpecialPage {
        function namespaceForm( $namespace = NS_MAIN, $from = '', $to = '' ) {
                global $wgScript;
                $t = $this->getTitle();
-       
+
                $out  = Xml::openElement( 'div', array( 'class' => 'namespaceoptions' ) );
                $out .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) );
                $out .= Html::hidden( 'title', $t->getPrefixedText() );
@@ -301,7 +302,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                $n = 0;
 
                if ( !$fromList || !$toList ) {
-                       $out = wfMsgWikiHtml( 'allpagesbadtitle' );
+                       $out = wfMsgExt( 'allpagesbadtitle', 'parse' );
                } elseif ( !in_array( $namespace, array_keys( $namespaces ) ) ) {
                        // Show errormessage and reset to NS_MAIN
                        $out = wfMsgExt( 'allpages-bad-ns', array( 'parseinline' ), $namespace );
@@ -373,7 +374,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                                        'page_title',
                                        array( 'page_namespace' => $namespace, 'page_title < '.$dbr->addQuotes($from) ),
                                        __METHOD__,
-                                       array( 'ORDER BY' => 'page_title DESC', 
+                                       array( 'ORDER BY' => 'page_title DESC',
                                                'LIMIT' => $this->maxPerPage, 'OFFSET' => ($this->maxPerPage - 1 )
                                        )
                                );
@@ -409,7 +410,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                                                                $nsForm .
                                                        '</td>
                                                        <td class="mw-allpages-nav">' .
-                                                               $sk->link( $self, wfMsgHtml ( 'allpages' ), array(), array(), 'known' );
+                                                               $sk->link( $self, wfMsgHtml ( 'allpages' ) );
 
                        # Do we put a previous link ?
                        if( isset( $prevTitle ) &&  $pt = $prevTitle->getText() ) {
@@ -420,7 +421,7 @@ class SpecialAllpages extends IncludableSpecialPage {
 
                                $prevLink = $sk->linkKnown(
                                        $self,
-                                       htmlspecialchars( wfMsg( 'prevpage', $pt ) ),
+                                       wfMessage( 'prevpage', $pt )->escaped(),
                                        array(),
                                        $query
                                );
@@ -437,7 +438,7 @@ class SpecialAllpages extends IncludableSpecialPage {
 
                                $nextLink = $sk->linkKnown(
                                        $self,
-                                       htmlspecialchars( wfMsg( 'nextpage', $t->getText() ) ),
+                                       wfMessage( 'nextpage', $t->getText() )->escaped(),
                                        array(),
                                        $query
                                );
@@ -447,19 +448,17 @@ class SpecialAllpages extends IncludableSpecialPage {
                }
 
                $wgOut->addHTML( $out2 . $out );
-               if( isset($prevLink) or isset($nextLink) ) {
-                       $wgOut->addHTML( '<hr /><p class="mw-allpages-nav">' );
-                       if( isset( $prevLink ) ) {
-                               $wgOut->addHTML( $prevLink );
-                       }
-                       if( isset( $prevLink ) && isset( $nextLink ) ) {
-                               $wgOut->addHTML( wfMsgExt( 'pipe-separator' , 'escapenoentities' ) );
-                       }
-                       if( isset( $nextLink ) ) {
-                               $wgOut->addHTML( $nextLink );
-                       }
-                       $wgOut->addHTML( '</p>' );
 
+               $links = array();
+               if ( isset( $prevLink ) ) $links[] = $prevLink;
+               if ( isset( $nextLink ) ) $links[] = $nextLink;
+
+               if ( count( $links ) ) {
+                       $wgOut->addHTML(
+                               Html::element( 'hr' ) .
+                               Html::rawElement( 'div', array( 'class' => 'mw-allpages-nav' ),
+                                       $wgLang->pipeList( $links )
+                               ) );
                }
 
        }