r76849 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76848‎ | r76849 | r76850 >
Date:23:30, 16 November 2010
Author:reedy
Status:ok (Comments)
Tags:
Comment:
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) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/ui/CodeRevisionListView.php
@@ -30,7 +30,8 @@
3131 return;
3232 }
3333
34 - $this->showForm();
 34+ $pathForm = $this->showForm();
 35+ $wgOut->addHTML( $pathForm );
3536
3637 // Get the total count across all pages
3738 $dbr = wfGetDB( DB_SLAVE );
@@ -61,10 +62,12 @@
6263 ( $this->batchForm ? $this->buildBatchInterface( $pager ) : "" ) .
6364 Xml::closeElement( 'form' )
6465 );
 66+
 67+ $wgOut->addHTML( $pathForm );
6568 }
6669
6770 function doBatchChange() {
68 - global $wgRequest;
 71+ global $wgRequest, $wgUser, $wgOut;
6972
7073 $revisions = $wgRequest->getArray( 'wpRevisionSelected' );
7174 $removeTags = $wgRequest->getVal( 'wpRemoveTag' );
@@ -79,7 +82,6 @@
8083 $revObjects[] = CodeRevision::newFromRow( $this->mRepo, $row );
8184 }
8285
83 - global $wgUser;
8486 if ( $wgUser->isAllowed( 'codereview-add-tag' ) &&
8587 $addTags || $removeTags ) {
8688 $addTags = array_map( 'trim', explode( ",", $addTags ) );
@@ -106,7 +108,6 @@
107109 }
108110 }
109111
110 - global $wgOut;
111112 $wgOut->redirect( $this->getPager()->getTitle()->getFullURL( $fields ) );
112113 }
113114
@@ -142,34 +143,37 @@
143144 return $changeInterface;
144145 }
145146
146 - function showForm( $path = '' ) {
147 - global $wgOut, $wgScript;
 147+ /**
 148+ * @return string
 149+ */
 150+ function showForm() {
 151+ global $wgScript;
148152 if ( $this->mAuthor ) {
149153 $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/author/' . $this->mAuthor );
150154 } else {
151155 $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/path' );
152156 }
153 - $wgOut->addHTML(
154 - Xml::openElement( 'form', array( 'action' => $wgScript, 'method' => 'get' ) ) .
 157+
 158+ $ret = Xml::openElement( 'form', array( 'action' => $wgScript, 'method' => 'get' ) ) .
155159 "<fieldset><legend>" . wfMsgHtml( 'code-pathsearch-legend' ) . "</legend>" .
156160 '<table width="100%"><tr><td>' .
157161 Xml::inputlabel( wfMsg( "code-pathsearch-path" ), 'path', 'path', 55, $this->mPath ) .
158162 '&#160;' . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) .
159 - '</td>'
160 - );
 163+ '</td>';
 164+
161165 if ( strlen( $this->mAppliedFilter ) ) {
162 - $wgOut->addHTML(
163 - '<td>' .
 166+ $ret .= '<td>' .
164167 Xml::label( wfMsg( 'code-pathsearch-filter' ), 'revFilter' ) . '&#160;<strong>' .
165168 Xml::span( $this->mAppliedFilter, '' ) . '</strong>&#160;' .
166169 Xml::submitButton( wfMsg( 'code-revfilter-clear' ) ) .
167170 '</td>' .
168 - Html::hidden( 'title', SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() ) )
169 - );
 171+ Html::hidden( 'title', SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() ) );
170172 } else {
171 - $wgOut->addHTML( Html::hidden( 'title', $special->getPrefixedDBKey() ) );
 173+ $ret .= Html::hidden( 'title', $special->getPrefixedDBKey() ) ;
172174 }
173 - $wgOut->addHTML( "</tr></table></fieldset>" . Xml::closeElement( 'form' ) );
 175+ $ret .= "</tr></table></fieldset>" ;
 176+
 177+ return $ret;
174178 }
175179
176180 function getPager() {

Follow-up revisions

RevisionCommit summaryAuthorDate
r76853More of (bug 25899) Show header and footer stuff at both places...reedy23:36, 16 November 2010
r76857Last (bug 25899) Show header and footer stuff at both places...reedy23:46, 16 November 2010
r77324Fix indenting from r76849, restore fixme removed in r77314...reedy12:05, 26 November 2010

Comments

#Comment by Nikerabbit (talk | contribs)   07:51, 26 November 2010

Wrong indentation near line 30.

Status & tagging log