r88558 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88557‎ | r88558 | r88559 >
Date:00:52, 22 May 2011
Author:reedy
Status:ok
Tags:
Comment:
Make "filter" appear on any variant of user/status

Added new form to do the clear in
Modified paths:
  • /trunk/extensions/CodeReview/ui/CodeRevisionAuthorView.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeRevisionListView.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeRevisionStatusView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/ui/CodeRevisionAuthorView.php
@@ -5,7 +5,6 @@
66 parent::__construct( $repo );
77 $this->mAuthor = $author;
88 $this->mUser = $this->mRepo->authorWikiUser( $author );
9 - $this->mAppliedFilter = wfMsg( 'code-revfilter-cr_author', $author );
109 }
1110
1211 function getPager() {
Index: trunk/extensions/CodeReview/ui/CodeRevisionListView.php
@@ -25,7 +25,21 @@
2626
2727 $this->mAuthor = $wgRequest->getText( 'author' );
2828 $this->mStatus = $wgRequest->getText( 'status' );
29 - $this->mAppliedFilter = null;
 29+
 30+ $filters = array();
 31+ if ( $this->mAuthor ) {
 32+ $filters[] = wfMsg( 'code-revfilter-cr_author', $this->mAuthor );
 33+ }
 34+ if ( $this->mStatus ) {
 35+ $filters[] = wfMsg( 'code-revfilter-cr_status', $this->mStatus );
 36+ }
 37+
 38+ if ( count( $filters) ) {
 39+ global $wgLang;
 40+ $this->mAppliedFilter = $wgLang->listToText( $filters );
 41+ } else {
 42+ $this->mAppliedFilter = null;
 43+ }
3044 }
3145
3246 /**
@@ -70,7 +84,7 @@
7185 $revCount = $this->getRevCount( $dbr );
7286
7387 $pager = $this->getPager();
74 - $pathForm = $this->showForm( $pager->getHiddenFields( array( 'path' ) ) );
 88+ $pathForm = $this->showForm( $pager );
7589
7690 // Build batch change interface as needed
7791 $this->batchForm = $wgUser->isAllowed( 'codereview-set-status' ) ||
@@ -182,32 +196,34 @@
183197 }
184198
185199 /**
186 - * @param $hidden string
 200+ * @param $pager SvnTablePager
187201 *
188202 * @return string
189203 */
190 - function showForm( $hidden = '' ) {
 204+ function showForm( $pager ) {
191205 global $wgScript;
192206
193 - $ret = Xml::openElement( 'form', array( 'action' => $wgScript, 'method' => 'get' ) ) .
194 - "<fieldset><legend>" . wfMsgHtml( 'code-pathsearch-legend' ) . "</legend>" .
 207+ $ret = "<fieldset><legend>" . wfMsgHtml( 'code-pathsearch-legend' ) . "</legend>" .
195208 '<table width="100%"><tr><td>' .
 209+ Xml::openElement( 'form', array( 'action' => $wgScript, 'method' => 'get' ) ) .
196210 Xml::inputlabel( wfMsg( "code-pathsearch-path" ), 'path', 'path', 55, $this->getPathsAsString() ) .
197211 '&#160;' . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) .
 212+ $pager->getHiddenFields( array( 'path' ) ) .
 213+ Xml::closeElement( 'form' ) .
198214 '</td>';
199215
200216 if ( strlen( $this->mAppliedFilter ) ) {
201217 $ret .= '<td>' .
 218+ Xml::openElement( 'form', array( 'action' => $pager->getTitle()->getLocalURL(), 'method' => 'get' ) ) .
202219 Xml::label( wfMsg( 'code-pathsearch-filter' ), 'revFilter' ) . '&#160;<strong>' .
203220 Xml::span( $this->mAppliedFilter, '' ) . '</strong>&#160;' .
204221 Xml::submitButton( wfMsg( 'code-revfilter-clear' ) ) .
 222+ Xml::closeElement( 'form' ) .
205223 '</td>';
206224 }
207225
208 - $ret .= $hidden;
 226+ $ret .= "</tr></table></fieldset>" ;
209227
210 - $ret .= "</tr></table></fieldset></form>" ;
211 -
212228 return $ret;
213229 }
214230
Index: trunk/extensions/CodeReview/ui/CodeRevisionStatusView.php
@@ -4,7 +4,6 @@
55 function __construct( $repo, $status ) {
66 parent::__construct( $repo );
77 $this->mStatus = $status;
8 - $this->mAppliedFilter = wfMsg( 'code-revfilter-cr_status', $status );
98 }
109
1110 function getPager() {

Status & tagging log