X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fwidget%2FExpiryInputWidget.php;h=289cc85ba4abf10e22a534faadb8506c9eb6a83e;hb=7bf88845c9c6fdb469ab75c674bbffb037ccb8f2;hp=7395df1ce76bf7f23159c6decfc814d2fb7570a2;hpb=43c128e4e30c7386c4d534ff2ef1f6ec84f5605f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/widget/ExpiryInputWidget.php b/includes/widget/ExpiryInputWidget.php index 7395df1ce7..289cc85ba4 100644 --- a/includes/widget/ExpiryInputWidget.php +++ b/includes/widget/ExpiryInputWidget.php @@ -20,11 +20,6 @@ class ExpiryInputWidget extends Widget { */ protected $relativeInput; - /** - * @var bool - */ - protected $noDatePicker; - /** * @var bool */ @@ -37,26 +32,20 @@ class ExpiryInputWidget extends Widget { public function __construct( Widget $relativeInput, array $options = [] ) { $config = \RequestContext::getMain()->getConfig(); - $options['noDatePicker'] = $config->get( 'ExpiryWidgetNoDatePicker' ); - parent::__construct( $options ); - $this->noDatePicker = $options['noDatePicker']; - $this->required = isset( $options['required'] ) ? $options['required'] : false; + $this->required = $options['required'] ?? false; // Properties $this->relativeInput = $relativeInput; $this->relativeInput->addClasses( [ 'mw-widget-ExpiryWidget-relative' ] ); // Initialization - $classes = [ - 'mw-widget-ExpiryWidget', - ]; - if ( $options['noDatePicker'] === false ) { - $classes[] = 'mw-widget-ExpiryWidget-hasDatePicker'; - } $this - ->addClasses( $classes ) + ->addClasses( [ + 'mw-widget-ExpiryWidget', + 'mw-widget-ExpiryWidget-hasDatePicker' + ] ) ->appendContent( $this->relativeInput ); } @@ -68,7 +57,6 @@ class ExpiryInputWidget extends Widget { * {@inheritdoc} */ public function getConfig( &$config ) { - $config['noDatePicker'] = $this->noDatePicker; $config['required'] = $this->required; $config['relativeInput'] = []; $this->relativeInput->getConfig( $config['relativeInput'] );