X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fwidget%2FUsersMultiselectWidget.php;h=066a2f3870be050d65ad5a11c51ecd560c61bb2d;hb=249454d777242108dbb61fbb32aa11cde6d4ea5e;hp=68cdad6627c6276efadc8a44024155bcee8d515d;hpb=bd483a4d37118b8e81d75cfaf7d5d39bb2a59e18;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/widget/UsersMultiselectWidget.php b/includes/widget/UsersMultiselectWidget.php index 68cdad6627..066a2f3870 100644 --- a/includes/widget/UsersMultiselectWidget.php +++ b/includes/widget/UsersMultiselectWidget.php @@ -2,46 +2,19 @@ namespace MediaWiki\Widget; -use OOUI\MultilineTextInputWidget; - /** * Widget to select multiple users. * * @copyright 2017 MediaWiki Widgets Team and others; see AUTHORS.txt * @license MIT */ -class UsersMultiselectWidget extends \OOUI\Widget { - - protected $usersArray = []; - protected $inputName = null; - protected $inputPlaceholder = null; +class UsersMultiselectWidget extends TagMultiselectWidget { /** * @param array $config Configuration options - * - array $config['users'] Array of usernames to use as preset data - * - array $config['placeholder'] Placeholder message for input - * - array $config['name'] Name attribute (used in forms) */ public function __construct( array $config = [] ) { parent::__construct( $config ); - - // Properties - if ( isset( $config['default'] ) ) { - $this->usersArray = $config['default']; - } - if ( isset( $config['name'] ) ) { - $this->inputName = $config['name']; - } - if ( isset( $config['placeholder'] ) ) { - $this->inputPlaceholder = $config['placeholder']; - } - - $textarea = new MultilineTextInputWidget( [ - 'name' => $this->inputName, - 'value' => implode( "\n", $this->usersArray ), - 'rows' => 25, - ] ); - $this->prependContent( $textarea ); } protected function getJavaScriptClassName() { @@ -49,17 +22,6 @@ class UsersMultiselectWidget extends \OOUI\Widget { } public function getConfig( &$config ) { - if ( $this->usersArray !== null ) { - $config['selected'] = $this->usersArray; - } - if ( $this->inputName !== null ) { - $config['name'] = $this->inputName; - } - if ( $this->inputPlaceholder !== null ) { - $config['placeholder'] = $this->inputPlaceholder; - } - - $config['$overlay'] = true; return parent::getConfig( $config ); }