http://www.mediawiki.org/wiki/Special:Code/MediaWiki/76849

Revision: 76849
Author:   reedy
Date:     2010-11-16 23:30:48 +0000 (Tue, 16 Nov 2010)
Log Message:
-----------
More of (bug 25899) Show header and footer stuff at both places

Path now shown at top and bottom

Minor related refactorings

Modified Paths:
--------------
    trunk/extensions/CodeReview/ui/CodeRevisionListView.php

Modified: trunk/extensions/CodeReview/ui/CodeRevisionListView.php
===================================================================
--- trunk/extensions/CodeReview/ui/CodeRevisionListView.php     2010-11-16 
23:21:36 UTC (rev 76848)
+++ trunk/extensions/CodeReview/ui/CodeRevisionListView.php     2010-11-16 
23:30:48 UTC (rev 76849)
@@ -30,7 +30,8 @@
                        return;
                }
 
-               $this->showForm();
+               $pathForm = $this->showForm();
+           $wgOut->addHTML( $pathForm );
 
                // Get the total count across all pages
                $dbr = wfGetDB( DB_SLAVE );
@@ -61,10 +62,12 @@
                        ( $this->batchForm ? $this->buildBatchInterface( $pager 
) : "" ) .
                        Xml::closeElement( 'form' )
                );
+
+           $wgOut->addHTML( $pathForm );
        }
 
        function doBatchChange() {
-               global $wgRequest;
+               global $wgRequest, $wgUser, $wgOut;
 
                $revisions = $wgRequest->getArray( 'wpRevisionSelected' );
                $removeTags = $wgRequest->getVal( 'wpRemoveTag' );
@@ -79,7 +82,6 @@
                        $revObjects[] = CodeRevision::newFromRow( $this->mRepo, 
$row );
                }
 
-               global $wgUser;
                if ( $wgUser->isAllowed( 'codereview-add-tag' ) &&
                                $addTags || $removeTags ) {
                        $addTags = array_map( 'trim', explode( ",", $addTags ) 
);
@@ -106,7 +108,6 @@
                        }
                }
 
-               global $wgOut;
                $wgOut->redirect( $this->getPager()->getTitle()->getFullURL( 
$fields ) );
        }
 
@@ -142,34 +143,37 @@
                return $changeInterface;
        }
 
-       function showForm( $path = '' ) {
-               global $wgOut, $wgScript;
+       /**
+        * @return string
+        */
+       function showForm() {
+               global $wgScript;
                if ( $this->mAuthor ) {
                        $special = SpecialPage::getTitleFor( 'Code', 
$this->mRepo->getName() . '/author/' . $this->mAuthor );
                } else {
                        $special = SpecialPage::getTitleFor( 'Code', 
$this->mRepo->getName() . '/path' );
                }
-               $wgOut->addHTML(
-                       Xml::openElement( 'form', array( 'action' => $wgScript, 
'method' => 'get' ) ) .
+
+               $ret = Xml::openElement( 'form', array( 'action' => $wgScript, 
'method' => 'get' ) ) .
                        "<fieldset><legend>" . wfMsgHtml( 
'code-pathsearch-legend' ) . "</legend>" .
                                '<table width="100%"><tr><td>' .
                                Xml::inputlabel( wfMsg( "code-pathsearch-path" 
), 'path', 'path', 55, $this->mPath ) .
                                '&#160;' . Xml::submitButton( wfMsg( 
'allpagessubmit' ) ) .
-                               '</td>'
-               );
+                               '</td>';
+
                if ( strlen( $this->mAppliedFilter ) ) {
-                       $wgOut->addHTML(
-                               '<td>' .
+                       $ret .= '<td>' .
                                Xml::label( wfMsg( 'code-pathsearch-filter' ), 
'revFilter' ) . '&#160;<strong>' .
                                Xml::span( $this->mAppliedFilter, '' ) . 
'</strong>&#160;' .
                                Xml::submitButton( wfMsg( 
'code-revfilter-clear' ) ) .
                                '</td>' .
-                               Html::hidden( 'title', 
SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() ) )
-                       );
+                               Html::hidden( 'title', 
SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() ) );
                } else {
-                       $wgOut->addHTML( Html::hidden( 'title', 
$special->getPrefixedDBKey() ) );
+                       $ret .= Html::hidden( 'title', 
$special->getPrefixedDBKey() ) ;
                }
-               $wgOut->addHTML( "</tr></table></fieldset>" . 
Xml::closeElement( 'form' ) );
+               $ret .= "</tr></table></fieldset>" ;
+
+           return $ret;
        }
 
        function getPager() {


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to