Index: trunk/phase3/includes/ChangeTags.php |
— | — | @@ -147,17 +147,24 @@ |
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
151 | | - * If $fullForm is set to false, then it returns an array of (label, form). |
152 | | - * If $fullForm is true, it returns an entire form. |
| 151 | + * Build a text box to select a change tag |
| 152 | + * |
| 153 | + * @param $selected String: tag to select by default |
| 154 | + * @param $fullForm Boolean: |
| 155 | + * - if false, then it returns an array of (label, form). |
| 156 | + * - if true, it returns an entire form around the selector. |
| 157 | + * @param $title Title object to send the form to. |
| 158 | + * Used when, and only when $fullForm is true. |
| 159 | + * @return String or array: |
| 160 | + * - if $fullForm is false: Array with |
| 161 | + * - if $fullForm is true: String, html fragment |
153 | 162 | */ |
154 | | - static function buildTagFilterSelector( $selected='', $fullForm = false /* used to put a full form around the selector */ ) { |
| 163 | + public static function buildTagFilterSelector( $selected='', $fullForm = false, Title $title = null ) { |
155 | 164 | global $wgUseTagFilter; |
156 | 165 | |
157 | 166 | if ( !$wgUseTagFilter || !count( self::listDefinedTags() ) ) |
158 | 167 | return $fullForm ? '' : array(); |
159 | 168 | |
160 | | - global $wgTitle; |
161 | | - |
162 | 169 | $data = array( wfMsgExt( 'tag-filter', 'parseinline' ), Xml::input( 'tagfilter', 20, $selected ) ); |
163 | 170 | |
164 | 171 | if ( !$fullForm ) { |
— | — | @@ -166,8 +173,8 @@ |
167 | 174 | |
168 | 175 | $html = implode( ' ', $data ); |
169 | 176 | $html .= "\n" . Xml::element( 'input', array( 'type' => 'submit', 'value' => wfMsg( 'tag-filter-submit' ) ) ); |
170 | | - $html .= "\n" . Html::hidden( 'title', $wgTitle-> getPrefixedText() ); |
171 | | - $html = Xml::tags( 'form', array( 'action' => $wgTitle->getLocalURL(), 'method' => 'get' ), $html ); |
| 177 | + $html .= "\n" . Html::hidden( 'title', $title-> getPrefixedText() ); |
| 178 | + $html = Xml::tags( 'form', array( 'action' => $title->getLocalURL(), 'method' => 'get' ), $html ); |
172 | 179 | |
173 | 180 | return $html; |
174 | 181 | } |