Rights log changes:
[lhc/web/wiklou.git] / includes / SpecialNewpages.php
index 2a7db04..cdf1b10 100644 (file)
@@ -5,11 +5,6 @@
  * @subpackage SpecialPage
  */
 
-/**
- *
- */
-require_once( 'QueryPage.php' );
-
 /**
  *
  * @package MediaWiki
@@ -75,8 +70,10 @@ class NewPagesPage extends QueryPage {
                global $wgLang, $wgContLang, $wgUser, $wgUseRCPatrol;
                $u = $result->user;
                $ut = $result->user_text;
+               $dirmark = $wgContLang->getDirMark(); // To keep text in correct order
 
-               $length = wfMsgHtml( 'nbytes', htmlspecialchars( $wgLang->formatNum( $result->length ) ) );
+               $length = wfMsgExt( 'nbytes', array('parsemag', 'escape'),
+                       $wgLang->formatNum( $result->length ) );
                $d = $wgLang->timeanddate( $result->timestamp, true );
 
                # Since there is no diff link, we need to give users a way to
@@ -88,10 +85,12 @@ class NewPagesPage extends QueryPage {
                        $link = $skin->makeKnownLink( $ns . ':' . $result->title, '' );
                }
 
-               $userTools = $skin->userLink( $u, $ut ) . $skin->userToolLinks( $u, $ut );
+               $userLink = $skin->userLink( $u, $ut );
+               $userTools = $skin->userToolLinks( $u, $ut );
 
-               $s = "{$d} {$link} ({$length}) . . {$userTools}";
-               $s .= $skin->commentBlock( $result->comment );
+               $s = "{$d} {$dirmark}{$link} {$dirmark}({$length}) . . " .
+                       "{$dirmark}{$userLink}{$dirmark}{$userTools}";
+               $s .= $dirmark . $skin->commentBlock( $result->comment );
                return $s;
        }
 
@@ -106,6 +105,47 @@ class NewPagesPage extends QueryPage {
                }
                return parent::feedItemDesc( $row );
        }
+       
+       /**
+        * Show a namespace selection form for filtering
+        *
+        * @return string
+        */     
+       function getPageHeader() {
+               $thisTitle = Title::makeTitle( NS_SPECIAL, $this->getName() );
+               $form  = wfOpenElement( 'form', array(
+                       'method' => 'post',
+                       'action' => $thisTitle->getLocalUrl() ) );
+               $form .= wfElement( 'label', array( 'for' => 'namespace' ),
+                       wfMsg( 'namespace' ) ) . ' ';
+               $form .= HtmlNamespaceSelector( $this->namespace );
+               # Preserve the offset and limit
+               $form .= wfElement( 'input', array(
+                       'type' => 'hidden',
+                       'name' => 'offset',
+                       'value' => $this->offset ) );
+               $form .= wfElement( 'input', array(
+                       'type' => 'hidden',
+                       'name' => 'limit',
+                       'value' => $this->limit ) );
+               $form .= wfElement( 'input', array(
+                       'type' => 'submit',
+                       'name' => 'submit',
+                       'id' => 'submit',
+                       'value' => wfMsg( 'allpagessubmit' ) ) );
+               $form .= wfCloseElement( 'form' );
+               return( $form );
+       }
+       
+       /**
+        * Link parameters
+        *
+        * @return array
+        */
+       function linkParameters() {
+               return( array( 'namespace' => $this->namespace ) );
+       }
+       
 }
 
 /**
@@ -136,13 +176,17 @@ function wfSpecialNewpages($par, $specialPage) {
                                }
                        }
                }
+       } else {
+               if( $ns = $wgRequest->getInt( 'namespace', 0 ) )
+                       $namespace = $ns;
        }
+       
        if ( ! isset( $shownavigation ) )
                $shownavigation = ! $specialPage->including();
 
        $npp = new NewPagesPage( $namespace );
 
-       if ( ! $npp->doFeed( $wgRequest->getVal( 'feed' ) ) )
+       if ( ! $npp->doFeed( $wgRequest->getVal( 'feed' ), $limit ) )
                $npp->doQuery( $offset, $limit, $shownavigation );
 }