Added support for whitelists for reading and writing articles and for
[lhc/web/wiklou.git] / includes / SpecialWantedpages.php
index 3f84ce3..3dab5de 100644 (file)
@@ -1,34 +1,25 @@
 <?
-global $IP;
-include_once ( "$IP/LogPage.php" ) ;
+
+include_once ( "LogPage.php" ) ;
 
 function wfSpecialWantedpages()
 {
        global $wgUser, $wgOut, $wgLang, $wgTitle;
-       global $limit, $offset; # From query string
        $fname = "wfSpecialWantedpages";
 
        # Cache
        $vsp = $wgLang->getValidSpecialPages() ;
-       $mw = $vsp["Wantedpages"] ;
-       $mw = str_replace ( " " , "_" , $mw ) ; # DBKEY
-       $log = new LogPage ( $mw ) ;
-       $log->mUpdateRecentChanges = false ;
+       $log = new LogPage( $vsp["Wantedpages"] );
+       $log->mUpdateRecentChanges = false;
 
        $wgOut->setRobotpolicy( "noindex,nofollow" );
        global $wgMiserMode;
        if ( $wgMiserMode ) {
-               $s = "=== " . wfMsg( "perfdisabled" ) . " ===\n" ;
-               $s .= $log->getContent() ;
-               $wgOut->addWikiText ( $s ) ;
+               $log->showAsDisabledPage();
                return;
        }
 
-       if ( ! $limit ) {
-               $limit = $wgUser->getOption( "rclimit" );
-               if ( ! $limit ) { $limit = 50; }
-       }
-       if ( ! $offset ) { $offset = 0; }
+       list( $limit, $offset ) = wfCheckLimits();
 
        $cache = "" ; # To be saved, eventually
 
@@ -66,9 +57,7 @@ function wfSpecialWantedpages()
 
        # Saving cache
        if ( $offset > 0 OR $limit < 50 ) return ; #Not suitable
-       $log->mContent = $cache ;
-       $log->mContentLoaded = true ;
-       $log->saveContent() ;
+       $log->replaceContent( $s );
 }
 
 ?>