*/
$wgActorTableSchemaMigrationStage = SCHEMA_COMPAT_OLD;
-/**
- * Temporary option to disable the date picker from the Expiry Widget.
- *
- * @since 1.32
- * @deprecated 1.32
- * @var bool
- */
-$wgExpiryWidgetNoDatePicker = false;
-
/**
* change_tag table schema migration stage.
*
*/
protected $relativeInput;
- /**
- * @var bool
- */
- protected $noDatePicker;
-
/**
* @var bool
*/
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}
*/
public function getConfig( &$config ) {
- $config['noDatePicker'] = $this->noDatePicker;
$config['required'] = $this->required;
$config['relativeInput'] = [];
$this->relativeInput->getConfig( $config['relativeInput'] );
// Parent constructor
mw.widgets.ExpiryWidget.parent.call( this, config );
- // If the wiki does not want the date picker, then initialize the relative
- // field and exit.
- if ( config.noDatePicker ) {
- this.relativeField.on( 'change', function ( event ) {
- // Emit a change event for this widget.
- this.emit( 'change', event );
- }.bind( this ) );
-
- // Initialization
- this.$element
- .addClass( 'mw-widget-ExpiryWidget' )
- .append(
- this.relativeField.$element
- );
-
- return;
- }
-
// Properties
this.inputSwitch = new OO.ui.ButtonSelectWidget( {
tabIndex: -1,