protected
[lhc/web/wiklou.git] / includes / SpecialNewpages.php
index 741aad1..617c055 100644 (file)
@@ -8,61 +8,70 @@
 /**
  * Start point
  */
-function wfSpecialNewPages( $par, $specialPage ) {
-       $page = new NewPagesPage( $specialPage );
-       $page->execute( $par );
+function wfSpecialNewPages( $par, $sp ) {
+       $page = new NewPagesForm();
+
+       $page->showList( $par, $sp->including() );
 }
 
 /**
  * implements Special:Newpages
  * @addtogroup SpecialPage
  */
-class NewPagesPage extends QueryPage {
-
-       protected $options = array();
-       protected $nondefaults = array();
-       protected $specialPage;
-
-       public function __construct( $specialPage=null ) {
-               $this->specialPage = $specialPage;
-       }
+class NewPagesForm {
+       /**
+        * Show a form for filtering namespace and username
+        *
+        * @param string $par
+        * @param bool $including true if the page is being included with {{Special:Newpages}}
+        * @return string
+        */
+       public function showList( $par, $including ) {
+               global $wgScript, $wgLang, $wgGroupPermissions, $wgRequest, $wgUser, $wgOut;
+               $sk = $wgUser->getSkin();
+               $self = SpecialPage::getTitleFor( 'NewPages' );
 
-       public function execute( $par ) {
-               global $wgRequest, $wgLang;
+               // show/hide links
+               $showhide = array( wfMsgHtml( 'show' ), wfMsgHtml( 'hide' ) );
 
-               $shownavigation = is_object( $this->specialPage ) && !$this->specialPage->including();
+               $hidelinks = array();
 
-               $defaults = array(
-                       /* bool */ 'hideliu' => false,
-                       /* bool */ 'hidepatrolled' => false,
-                       /* bool */ 'hidebots' => false,
-                       /* text */ 'namespace' => "0",
-                       /* text */ 'username' => '',
-                       /* int  */ 'offset' => 0,
-                       /* int  */ 'limit' => 50,
-               );
-               
-               if( $shownavigation ) {
-                       // Some hopefully reasonable limits...
-                       $max = array(
-                               /* int */ 'offset' => 20000,
-                               /* int */ 'limit' => 500,
-                       );
-               } else {
-                       // Embedded? Be a lot more strict...
-                       $max = array(
-                               /* int */ 'offset' => 0,
-                               /* int */ 'limit' => 200,
-                       );
+               if ( $wgGroupPermissions['*']['createpage'] === true ) {
+                       $hidelinks['hideliu'] = 'rcshowhideliu';
+               }
+               if ( $wgUser->useNPPatrol() ) {
+                       $hidelinks['hidepatrolled'] = 'rcshowhidepatr';
                }
+               $hidelinks['hidebots'] = 'rcshowhidebots';
 
+               $defaults = array(
+            /* bool */ 'hideliu' => false,
+            /* bool */ 'hidepatrolled' => false,
+            /* bool */ 'hidebots' => false,
+            /* text */ 'namespace' => "0",
+            /* text */ 'username' => '',
+            /* int  */ 'offset' => 0,
+            /* int  */ 'limit' => 50,
+        );
                $options = $defaults;
 
+               // Override all values from requests, if specified
+               foreach ( $defaults as $v => $t ) {
+                       if ( is_bool($t) ) {
+                               $options[$v] = $wgRequest->getBool( $v, $options[$v] );
+                       } elseif( is_int($t) ) {
+                               $options[$v] = $wgRequest->getInt( $v, $options[$v] );
+                       } elseif( is_string($t) ) {
+                               $options[$v] = $wgRequest->getText( $v, $options[$v] );
+                       }
+               }
+
+               $shownav = !$including;
                if ( $par ) {
                        $bits = preg_split( '/\s*,\s*/', trim( $par ) );
                        foreach ( $bits as $bit ) {
                                if ( 'shownav' == $bit )
-                                       $shownavigation = true;
+                                       $shownav = true;
                                if ( 'hideliu' === $bit )
                                        $options['hideliu'] = true;
                                if ( 'hidepatrolled' == $bit )
@@ -86,131 +95,101 @@ class NewPagesPage extends QueryPage {
                        }
                }
 
-               // Override all values from requests, if specified
-               foreach ( $defaults as $v => $t ) {
-                       if ( is_bool($t) ) {
-                               $options[$v] = $wgRequest->getBool( $v, $options[$v] );
-                       } elseif( is_int($t) ) {
-                               $options[$v] = $wgRequest->getInt( $v, $options[$v] );
-                       } elseif( is_string($t) ) {
-                               $options[$v] = $wgRequest->getText( $v, $options[$v] );
+               // hack disable
+               $options['username'] = '';
+               
+               if( !$including ){
+                       $wgOut->setSyndicated( true );
+                       $wgOut->setFeedAppendQuery( "namespace={$options['namespace']}&username={$options['username']}" );
+
+                       $feedType = $wgRequest->getVal( 'feed' );
+                       if( $feedType ) {
+                               wfProfileOut( __METHOD__ );
+                               return $this->feed( $feedType, $options );
                        }
-               }
 
-               // Validate limit and offset params
-               if ( $options['limit'] <= 0 ) {
-                       $options['limit'] = $defaults['limit'];
-               }
-               if ( $options['limit'] > $max['limit'] ) {
-                       $options['limit'] = $max['limit'];
-               }
-
-               if ( $options['offset'] < 0 ) {
-                       $options['offset'] = $defaults['offset'];
-               }
-               if ( $options['offset'] > $max['offset'] ) {
-                       $options['offset'] = $max['offset'];
-               }
-
-               $nondefaults = array();
-               foreach ( $options as $v => $t ) {
-                       if ( $v === 'offset' ) continue; # Reset offset if parameters change
-                       wfAppendToArrayIfNotDefault( $v, $t, $defaults, $nondefaults );
-               }
-
-               # bind to class
-               $this->options = $options;
-               $this->nondefaults = $nondefaults;
-
-               if ( !$this->doFeed( $wgRequest->getVal( 'feed' ), $options['limit'] ) ) {
-                       $this->doQuery( $options['offset'], $options['limit'], $shownavigation );
-               }
-       }
-
-       function linkParameters() {
-               $nondefaults = $this->nondefaults;
-               // QueryPage seems to handle limit and offset itself
-               if ( isset( $nondefaults['limit'] ) ) {
-                       unset($nondefaults['limit']);
-               }
-               return $nondefaults;
-       }
-
-       function getName() {
-               return 'Newpages';
-       }
+                       $nondefaults = array();
+               foreach ( $options as $v => $t ) {
+                   if ( $v === 'offset' ) continue; # Reset offset if parameters change
+                   wfAppendToArrayIfNotDefault( $v, $t, $defaults, $nondefaults );
+               }
+
+                       $links = array();
+                       foreach ( $hidelinks as $key => $msg ) {
+                               $reversed = 1 - $options[$key];
+                               $link = $sk->makeKnownLinkObj( $self, $showhide[$reversed],
+                                       wfArrayToCGI( array( $key => $reversed ), $nondefaults )
+                               );
+                               $links[$key] = wfMsgHtml( $msg, $link );
+                       }
 
-       function isExpensive() {
-               # Indexed on RC, and will *not* work with querycache yet.
-               return false;
-       }
+                       $hl = implode( ' | ', $links );
 
-       function makeUserWhere( $db ) {
-               global $wgGroupPermissions;
-               $conds = array();
-               if ($this->options['hidepatrolled']) {
-                       $conds['rc_patrolled'] = 0;
-               }
-               if ($this->options['hidebots']) {
-                       $conds['rc_bot'] = 0;
-               }
-               if ($wgGroupPermissions['*']['createpage'] == true && $this->options['hideliu']) {
-                       $conds['rc_user'] = 0;
-               } else {
-                       $title = Title::makeTitleSafe( NS_USER, $this->options['username'] );
-                       if( $title ) {
-                               $conds['rc_user_text'] = $title->getText();
+                       // Store query values in hidden fields so that form submission doesn't lose them
+                       $hidden = array();
+                       foreach ( $nondefaults as $key => $value ) {
+                               if ( $key === 'namespace' ) continue;
+                               if ( $key === 'username' ) continue;
+                               $hidden[] = Xml::hidden( $key, $value );
                        }
+                       $hidden = implode( "\n", $hidden );
+
+                       $form = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) .
+                               Xml::hidden( 'title', $self->getPrefixedDBkey() ) .
+                               Xml::openElement( 'fieldset' ) .
+                               Xml::element( 'legend', null, wfMsg( 'newpages' ) ) .
+                               Xml::openElement( 'table', array( 'id' => 'mw-newpages-table' ) ) .
+                               "<tr>
+                                       <td class='mw-label'>" .
+                                               Xml::label( wfMsg( 'namespace' ), 'namespace' ) .
+                                       "</td>
+                                       <td class='mw-input'>" .
+                                               Xml::namespaceSelector( $options['namespace'], 'all' ) .
+                                       "</td>
+                               </tr>
+                               <!--
+                               <tr>
+                                       <td class='mw-label'>" .
+                                               Xml::label( wfMsg( 'newpages-username' ), 'mw-np-username' ) .
+                                       "</td>
+                                       <td class='mw-input'>" .
+                                               Xml::input( 'username', 30, $options['username'], array( 'id' => 'mw-np-username' ) ) .
+                                       "</td>
+                               </tr>
+                               -->
+                               <tr> <td></td>
+                                       <td class='mw-submit'>" .
+                                               Xml::submitButton( wfMsg( 'allpagessubmit' ) ) .
+                                       "</td>
+                               </tr>" .
+                               "<tr>
+                                       <td></td>
+                                       <td class='mw-input'>" .
+                                               $hl .
+                                       "</td>
+                               </tr>" .
+                               Xml::closeElement( 'table' ) .
+                               Xml::closeElement( 'fieldset' ) .
+                               $hidden .
+                               Xml::closeElement( 'form' );
+
+                       $wgOut->addHTML( $form );
                }
-               return $conds;
-       }
 
-       function getSQL() {
-               global $wgUser, $wgUseNPPatrol, $wgUseRCPatrol;
-               $usepatrol = ( $wgUseNPPatrol || $wgUseRCPatrol ) ? 1 : 0;
-               $dbr = wfGetDB( DB_SLAVE );
-               list( $recentchanges, $page ) = $dbr->tableNamesN( 'recentchanges', 'page' );
-
-               $conds = array();
-               $conds['rc_new'] = 1;
-               if ( $this->options['namespace'] !== 'all' ) {
-                       $conds['rc_namespace'] = intval( $this->options['namespace'] );
-               }
-               $conds['page_is_redirect'] = 0;
-               $conds += $this->makeUserWhere( $dbr );
-               $condstext = $dbr->makeList( $conds, LIST_AND );
-
-               # FIXME: text will break with compression
-               return
-                       "SELECT 'Newpages' as type,
-                               rc_namespace AS namespace,
-                               rc_title AS title,
-                               rc_cur_id AS cur_id,
-                               rc_user AS \"user\",
-                               rc_user_text AS user_text,
-                               rc_comment as \"comment\",
-                               rc_timestamp AS timestamp,
-                               rc_timestamp AS value,
-                               '{$usepatrol}' as usepatrol,
-                               rc_patrolled AS patrolled,
-                               rc_id AS rcid,
-                               page_len as length,
-                               page_latest as rev_id
-                       FROM $recentchanges,$page
-                       WHERE rc_cur_id=page_id AND $condstext";
-       }
+               $pager = new NewPagesPager( $this, array(), $options['namespace'], $options['hideliu'],
+                       $options['hidepatrolled'], $options['hidebots'], $options['username'] );
+               $pager->mLimit = $options['limit'];
+               $pager->mOffset = $options['offset'];
 
-       function preprocessResults( $db, $res ) {
-               # Do a batch existence check on the user and talk pages
-               $linkBatch = new LinkBatch();
-               while( $row = $db->fetchObject( $res ) ) {
-                       $linkBatch->add( NS_USER, $row->user_text );
-                       $linkBatch->add( NS_USER_TALK, $row->user_text );
+               if( $pager->getNumRows() ) {
+                       $wgOut->addHTML(
+                               ( $shownav ? $pager->getNavigationBar() : '' ) .
+                               $pager->getBody() .
+                               ( $shownav ? $pager->getNavigationBar() : '' )
+                       );
+               } else {
+                       $wgOut->addHTML( Xml::element( 'p', null, wfMsg( 'specialpage-empty' ) ) );
                }
-               $linkBatch->execute();
-               # Seek to start
-               if( $db->numRows( $res ) > 0 )
-                       $db->dataSeek( $res, 0 );
        }
 
        /**
@@ -220,19 +199,27 @@ class NewPagesPage extends QueryPage {
         * @param $result Result row
         * @return string
         */
-       function formatResult( $skin, $result ) {
-               global $wgLang, $wgContLang;
+       public function formatRow( $result ) {
+               global $wgLang, $wgContLang, $wgUser;
                $dm = $wgContLang->getDirMark();
 
-               $title = Title::makeTitleSafe( $result->namespace, $result->title );
-               $time = $wgLang->timeAndDate( $result->timestamp, true );
-               $plink = $skin->makeKnownLinkObj( $title, '', $this->patrollable( $result ) ? 'rcid=' . $result->rcid : '' );
-               $hist = $skin->makeKnownLinkObj( $title, wfMsgHtml( 'hist' ), 'action=history' );
-               $length = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ), $wgLang->formatNum( htmlspecialchars( $result->length ) ) );
-               $ulink = $skin->userLink( $result->user, $result->user_text ) . ' ' . $skin->userToolLinks( $result->user, $result->user_text );
-               $comment = $skin->commentBlock( $result->comment );
+               static $skin=null;
 
-               return "{$time} {$dm}{$plink} ({$hist}) {$dm}[{$length}] {$dm}{$ulink} {$comment}";
+               if( is_null( $skin ) )
+                       $skin = $wgUser->getSkin();
+
+               $title = Title::makeTitleSafe( $result->rc_namespace, $result->rc_title );
+               $time = $wgLang->timeAndDate( $result->rc_timestamp, true );
+               $plink = $skin->makeKnownLinkObj( $title, '', $this->patrollable( $result ) ? 'rcid=' . $result->rc_id : '' );
+               $hist = $skin->makeKnownLinkObj( $title, wfMsgHtml( 'hist' ), 'action=history' );
+               $length = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ),
+                       $wgLang->formatNum( htmlspecialchars( $result->length ) ) );
+               $ulink = $skin->userLink( $result->rc_user, $result->rc_user_text ) . ' ' .
+                       $skin->userToolLinks( $result->rc_user, $result->rc_user_text );
+               $comment = $skin->commentBlock( $result->rc_comment );
+               $css = $this->patrollable( $result ) ? 'not-patrolled' : '';
+
+               return "<li class='$css'>{$time} {$dm}{$plink} ({$hist}) {$dm}[{$length}] {$dm}{$ulink} {$comment}</li>\n";
        }
 
        /**
@@ -241,97 +228,186 @@ class NewPagesPage extends QueryPage {
         * @param $result Result row
         * @return bool
         */
-       function patrollable( $result ) {
-               global $wgUser, $wgUseRCPatrol, $wgUseNPPatrol;
-               return ( $wgUseRCPatrol || $wgUseNPPatrol )
-                       && $wgUser->isAllowed( 'patrol' )
-                       && !$result->patrolled;
+       protected function patrollable( $result ) {
+               global $wgUser;
+               return ( $wgUser->useNPPatrol() && !$result->rc_patrolled );
        }
 
-       function feedItemDesc( $row ) {
-               if( isset( $row->rev_id ) ) {
-                       $revision = Revision::newFromId( $row->rev_id );
-                       if( $revision ) {
-                               return '<p>' . htmlspecialchars( wfMsg( 'summary' ) ) . ': ' .
-                                       htmlspecialchars( $revision->getComment() ) . "</p>\n<hr />\n<div>" .
-                                       nl2br( htmlspecialchars( $revision->getText() ) ) . "</div>";
+       /**
+        * Output a subscription feed listing recent edits to this page.
+        * @param string $type
+        */
+       protected function feed( $type, $options ) {
+               require_once 'SpecialRecentchanges.php';
+
+               global $wgFeed, $wgFeedClasses;
+
+               if ( !$wgFeed ) {
+                       global $wgOut;
+                       $wgOut->addWikiMsg( 'feed-unavailable' );
+                       return;
+               }
+
+               if( !isset( $wgFeedClasses[$type] ) ) {
+                       global $wgOut;
+                       $wgOut->addWikiMsg( 'feed-invalid' );
+                       return;
+               }
+
+               $self = SpecialPage::getTitleFor( 'NewPages' );
+               $feed = new $wgFeedClasses[$type](
+                       $this->feedTitle(),
+                       wfMsg( 'tagline' ),
+                       $self->getFullUrl() );
+
+               $pager = new NewPagesPager( $this, array(), $options['namespace'], $options['hideliu'],
+                       $options['hidepatrolled'], $options['hidebots'], $options['username'] );
+
+               $feed->outHeader();
+               if( $pager->getNumRows() > 0 ) {
+                       while( $row = $pager->mResult->fetchObject() ) {
+                               $feed->outItem( $this->feedItem( $row ) );
                        }
                }
-               return parent::feedItemDesc( $row );
+               $feed->outFooter();
+       }
+
+       protected function feedTitle() {
+               global $wgContLanguageCode, $wgSitename;
+               $page = SpecialPage::getPage( 'Newpages' );
+               $desc = $page->getDescription();
+               return "$wgSitename - $desc [$wgContLanguageCode]";
+       }
+
+       protected function feedItem( $row ) {
+               $title = Title::MakeTitle( intval( $row->rc_namespace ), $row->rc_title );
+               if( $title ) {
+                       $date = $row->rc_timestamp;
+                       $comments = $this->stripComment( $row->rc_comment );
+
+                       return new FeedItem(
+                               $title->getPrefixedText(),
+                               $this->feedItemDesc( $row ),
+                               $title->getFullURL(),
+                               $date,
+                               $this->feedItemAuthor( $row ),
+                               $comments);
+               } else {
+                       return NULL;
+               }
        }
 
        /**
-        * Show a form for filtering namespace and username
-        *
-        * @return string
+        * Quickie hack... strip out wikilinks to more legible form from the comment.
         */
-       function getPageHeader() {
-               global $wgScript, $wgContLang, $wgGroupPermissions, $wgUser, $wgUseRCPatrol, $wgUseNPPatrol;
-               $sk = $wgUser->getSkin();
-               $align = $wgContLang->isRTL() ? 'left' : 'right';
-               $self = SpecialPage::getTitleFor( $this->getName() );
+       protected function stripComment( $text ) {
+               return preg_replace( '/\[\[([^]]*\|)?([^]]+)\]\]/', '\2', $text );
+       }
 
-               // show/hide links
-               $showhide = array( wfMsgHtml( 'show' ), wfMsgHtml( 'hide' ));
+       protected function feedItemAuthor( $row ) {
+               return isset( $row->rc_user_text ) ? $row->rc_user_text : '';
+       }
 
-               $hidelinks = array();
+       protected function feedItemDesc( $row ) {
+               $revision = Revision::newFromId( $row->rev_id );
+               if( $revision ) {
+                       return '<p>' . htmlspecialchars( wfMsg( 'summary' ) ) . ': ' .
+                               htmlspecialchars( $revision->getComment() ) . "</p>\n<hr />\n<div>" .
+                               nl2br( htmlspecialchars( $revision->getText() ) ) . "</div>";
+               }
+               return '';
+       }
+}
 
-               if ( $wgGroupPermissions['*']['createpage'] === true ) {
-                       $hidelinks['hideliu'] = 'rcshowhideliu';
+/**
+ * @addtogroup Pager
+ */
+class NewPagesPager extends ReverseChronologicalPager {
+       private $hideliu, $hidepatrolled, $hidebots, $namespace, $user, $spTitle;
+
+       function __construct( $form, $conds=array(), $namespace, $hliu=false, $hpatrolled=false, $hbots=1, $user='' ) {
+               parent::__construct();
+               $this->mForm = $form;
+               $this->mConds = $conds;
+
+               $this->namespace = ($namespace === "all") ? false : intval($namespace);
+               $this->user = $user;
+
+               $this->hideliu = (bool)$hliu;
+               $this->hidepatrolled = (bool)$hpatrolled;
+               $this->hidebots = (bool)$hbots;
+       }
+
+       function getTitle(){
+               if( !isset( $this->spTitle ) )
+                       $this->spTitle = SpecialPage::getTitleFor( 'Newpages' );
+               return $this->spTitle;
+       }
+
+       function getQueryInfo() {
+               $conds = $this->mConds;
+               $conds['rc_new'] = 1;
+               if( $this->namespace !== false ) {
+                       $conds['rc_namespace'] = $this->namespace;
+                       $rcIndexes = array( 'new_name_timestamp' );
+               } else {
+                       $rcIndexes = array( 'rc_timestamp' );
                }
-               if ( $wgUseNPPatrol || $wgUseRCPatrol ) {
-                       $hidelinks['hidepatrolled'] = 'rcshowhidepatr';
+               $conds[] = 'page_id = rc_cur_id';
+               $conds['page_is_redirect'] = 0;
+
+               global $wgGroupPermissions, $wgUser;
+               # If anons cannot make new pages, don't query for it!
+               if( $wgGroupPermissions['*']['createpage'] && $this->hideliu ) {
+                       $conds['rc_user'] = 0;
+               } else {
+                       $title = Title::makeTitleSafe( NS_USER, $this->user );
+                       if( $title ) {
+                               $conds['rc_user_text'] = $title->getText();
+                       }
+               }
+               # If this user cannot see patrolled edits or they are off, don't do dumb queries!
+               if( $this->hidepatrolled && $wgUser->useNPPatrol() ) {
+                       $conds['rc_patrolled'] = 0;
+               }
+               if( $this->hidebots ) {
+                       $conds['rc_bot'] = 0;
                }
-               $hidelinks['hidebots'] = 'rcshowhidebots';
 
-               $links = array();
-               foreach ( $hidelinks as $key => $msg ) {
-                       $reversed = 1-$this->options[$key];
-                       $link = $sk->makeKnownLinkObj( $self, $showhide[$reversed],
-                               wfArrayToCGI( array( $key => $reversed ), $this->nondefaults )
-                       );
-                       $links[$key] = wfMsgHtml( $msg, $link );
+               if( $this->user ) {
+                       $conds['rc_user_text'] = $this->user;
                }
 
-               $hl = implode( ' | ', $links );
+               return array(
+                       'tables' => array( 'recentchanges', 'page' ),
+                       'fields' => 'rc_namespace,rc_title, rc_cur_id, rc_user,rc_user_text,rc_comment,
+                               rc_timestamp,rc_patrolled,rc_id,page_len as length, page_latest as rev_id',
+                       'conds' => $conds,
+                       'options' => array( 'USE INDEX' => array('recentchanges' => $rcIndexes) )
+               );
+       }
+
+       function getIndexField() {
+               return 'rc_timestamp';
+       }
+
+       function formatRow( $row ) {
+               return $this->mForm->formatRow( $row );
+       }
 
-               // Store query values in hidden fields so that form submission doesn't lose them
-               $hidden = array();
-               foreach ( $this->nondefaults as $key => $value ) {
-                       if ( $key === 'namespace' ) continue;
-                       if ( $key === 'username' ) continue;
-                       $hidden[] = Xml::hidden( $key, $value );
+       function getStartBody() {
+               # Do a batch existence check on pages
+               $linkBatch = new LinkBatch();
+               while( $row = $this->mResult->fetchObject() ) {
+                       $linkBatch->add( NS_USER, $row->rc_user_text );
+                       $linkBatch->add( NS_USER_TALK, $row->rc_user_text );
+                       $linkBatch->add( $row->rc_namespace, $row->rc_title );
                }
-               $hidden = implode( "\n", $hidden );
-
-               $form = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) .
-                       Xml::hidden( 'title', $self->getPrefixedDBkey() ) .
-                       Xml::openElement( 'table' ) .
-                       "<tr>
-                               <td align=\"$align\">" .
-                                       Xml::label( wfMsg( 'namespace' ), 'namespace' ) .
-                               "</td>
-                               <td>" .
-                                       Xml::namespaceSelector( $this->options['namespace'], 'all' ) .
-                               "</td>
-                       </tr>
-                       <tr>
-                               <td align=\"$align\">" .
-                                       Xml::label( wfMsg( 'newpages-username' ), 'mw-np-username' ) .
-                               "</td>
-                               <td>" .
-                                       Xml::input( 'username', 30, $this->options['username'], array( 'id' => 'mw-np-username' ) ) .
-                               "</td>
-                       </tr>
-                       <tr> <td></td>
-                               <td>" .
-                                       Xml::submitButton( wfMsg( 'allpagessubmit' ) ) .
-                               "</td>
-                       </tr>" .
-                       "<tr><td></td><td>" . $hl . "</td></tr>" .
-                       Xml::closeElement( 'table' ) .
-                       $hidden .
-                       Xml::closeElement( 'form' );
-               return $form;
+               $linkBatch->execute();
+               return "<ul>";
+       }
+
+       function getEndBody() {
+               return "</ul>";
        }
 }