From: Florian Date: Thu, 16 Jul 2015 20:21:58 +0000 (+0200) Subject: Implement OOUI version of tag filter in ChangeTags X-Git-Tag: 1.31.0-rc.0~10685^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles_versions%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=commitdiff_plain;h=daeece7316d42a9fafdadb46b0b5de930dd9c8b7;p=lhc%2Fweb%2Fwiklou.git Implement OOUI version of tag filter in ChangeTags Change-Id: I51a40eb091cfe28f67168c17ff92fbb72270a893 --- diff --git a/includes/changetags/ChangeTags.php b/includes/changetags/ChangeTags.php index 1e26caa019..bf8386f33b 100644 --- a/includes/changetags/ChangeTags.php +++ b/includes/changetags/ChangeTags.php @@ -613,12 +613,14 @@ class ChangeTags { * @param string $selected Tag to select by default * @param bool $fullForm Affects return value, see below * @param Title $title Title object to send the form to. Used only if $fullForm is true. + * @param bool $ooui Use an OOUI TextInputWidget as selector instead of a non-OOUI input field + * You need to call OutputPage::enableOOUI() yourself. * @return string|array * - if $fullForm is false: an array of (label, selector). * - if $fullForm is true: HTML of entire form built around the selector. */ public static function buildTagFilterSelector( $selected = '', - $fullForm = false, Title $title = null + $fullForm = false, Title $title = null, $ooui = false ) { global $wgUseTagFilter; @@ -631,14 +633,24 @@ class ChangeTags { 'label', array( 'for' => 'tagfilter' ), wfMessage( 'tag-filter' )->parse() - ), - Xml::input( + ) + ); + + if ( $ooui ) { + $data[] = new OOUI\TextInputWidget( array( + 'id' => 'tagfilter', + 'name' => 'tagfilter', + 'value' => $selected, + 'classes' => 'mw-tagfilter-input', + ) ); + } else { + $data[] = Xml::input( 'tagfilter', 20, $selected, array( 'class' => 'mw-tagfilter-input mw-ui-input mw-ui-input-inline', 'id' => 'tagfilter' ) - ) - ); + ); + } if ( !$fullForm ) { return $data;