Index: trunk/extensions/CodeReview/ui/CodeRevisionListView.php |
— | — | @@ -30,7 +30,8 @@ |
31 | 31 | return; |
32 | 32 | } |
33 | 33 | |
34 | | - $this->showForm(); |
| 34 | + $pathForm = $this->showForm(); |
| 35 | + $wgOut->addHTML( $pathForm ); |
35 | 36 | |
36 | 37 | // Get the total count across all pages |
37 | 38 | $dbr = wfGetDB( DB_SLAVE ); |
— | — | @@ -61,10 +62,12 @@ |
62 | 63 | ( $this->batchForm ? $this->buildBatchInterface( $pager ) : "" ) . |
63 | 64 | Xml::closeElement( 'form' ) |
64 | 65 | ); |
| 66 | + |
| 67 | + $wgOut->addHTML( $pathForm ); |
65 | 68 | } |
66 | 69 | |
67 | 70 | function doBatchChange() { |
68 | | - global $wgRequest; |
| 71 | + global $wgRequest, $wgUser, $wgOut; |
69 | 72 | |
70 | 73 | $revisions = $wgRequest->getArray( 'wpRevisionSelected' ); |
71 | 74 | $removeTags = $wgRequest->getVal( 'wpRemoveTag' ); |
— | — | @@ -79,7 +82,6 @@ |
80 | 83 | $revObjects[] = CodeRevision::newFromRow( $this->mRepo, $row ); |
81 | 84 | } |
82 | 85 | |
83 | | - global $wgUser; |
84 | 86 | if ( $wgUser->isAllowed( 'codereview-add-tag' ) && |
85 | 87 | $addTags || $removeTags ) { |
86 | 88 | $addTags = array_map( 'trim', explode( ",", $addTags ) ); |
— | — | @@ -106,7 +108,6 @@ |
107 | 109 | } |
108 | 110 | } |
109 | 111 | |
110 | | - global $wgOut; |
111 | 112 | $wgOut->redirect( $this->getPager()->getTitle()->getFullURL( $fields ) ); |
112 | 113 | } |
113 | 114 | |
— | — | @@ -142,34 +143,37 @@ |
143 | 144 | return $changeInterface; |
144 | 145 | } |
145 | 146 | |
146 | | - function showForm( $path = '' ) { |
147 | | - global $wgOut, $wgScript; |
| 147 | + /** |
| 148 | + * @return string |
| 149 | + */ |
| 150 | + function showForm() { |
| 151 | + global $wgScript; |
148 | 152 | if ( $this->mAuthor ) { |
149 | 153 | $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/author/' . $this->mAuthor ); |
150 | 154 | } else { |
151 | 155 | $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/path' ); |
152 | 156 | } |
153 | | - $wgOut->addHTML( |
154 | | - Xml::openElement( 'form', array( 'action' => $wgScript, 'method' => 'get' ) ) . |
| 157 | + |
| 158 | + $ret = Xml::openElement( 'form', array( 'action' => $wgScript, 'method' => 'get' ) ) . |
155 | 159 | "<fieldset><legend>" . wfMsgHtml( 'code-pathsearch-legend' ) . "</legend>" . |
156 | 160 | '<table width="100%"><tr><td>' . |
157 | 161 | Xml::inputlabel( wfMsg( "code-pathsearch-path" ), 'path', 'path', 55, $this->mPath ) . |
158 | 162 | ' ' . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . |
159 | | - '</td>' |
160 | | - ); |
| 163 | + '</td>'; |
| 164 | + |
161 | 165 | if ( strlen( $this->mAppliedFilter ) ) { |
162 | | - $wgOut->addHTML( |
163 | | - '<td>' . |
| 166 | + $ret .= '<td>' . |
164 | 167 | Xml::label( wfMsg( 'code-pathsearch-filter' ), 'revFilter' ) . ' <strong>' . |
165 | 168 | Xml::span( $this->mAppliedFilter, '' ) . '</strong> ' . |
166 | 169 | Xml::submitButton( wfMsg( 'code-revfilter-clear' ) ) . |
167 | 170 | '</td>' . |
168 | | - Html::hidden( 'title', SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() ) ) |
169 | | - ); |
| 171 | + Html::hidden( 'title', SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() ) ); |
170 | 172 | } else { |
171 | | - $wgOut->addHTML( Html::hidden( 'title', $special->getPrefixedDBKey() ) ); |
| 173 | + $ret .= Html::hidden( 'title', $special->getPrefixedDBKey() ) ; |
172 | 174 | } |
173 | | - $wgOut->addHTML( "</tr></table></fieldset>" . Xml::closeElement( 'form' ) ); |
| 175 | + $ret .= "</tr></table></fieldset>" ; |
| 176 | + |
| 177 | + return $ret; |
174 | 178 | } |
175 | 179 | |
176 | 180 | function getPager() { |