*/
protected $relativeInput;
- /**
- * @var bool
- */
- protected $noDatePicker;
-
/**
* @var bool
*/
* @param array $options Configuration options
*/
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 = $options['required'] ?? false;
// Properties
$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 );
}
}
/**
- * {@inheritdoc}
+ * @inheritDoc
*/
public function getConfig( &$config ) {
- $config['noDatePicker'] = $this->noDatePicker;
$config['required'] = $this->required;
$config['relativeInput'] = [];
$this->relativeInput->getConfig( $config['relativeInput'] );