Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1429315
ExpiryInputWidget.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
ExpiryInputWidget.php
View Options
<?php
namespace
MediaWiki\Widget
;
use
OOUI\Widget
;
/**
* Expiry widget.
*
* Allows the user to toggle between a precise time or enter a relative time,
* regardless, the value comes in as a relative time.
*
* @copyright 2018 MediaWiki Widgets Team and others; see AUTHORS.txt
* @license MIT
*/
class
ExpiryInputWidget
extends
Widget
{
/**
* @var Widget
*/
protected
$relativeInput
;
/**
* @var bool
*/
protected
$required
;
/**
* @param Widget $relativeInput
* @param array $options Configuration options
*/
public
function
__construct
(
Widget
$relativeInput
,
array
$options
=
[]
)
{
parent
::
__construct
(
$options
);
$this
->
required
=
$options
[
'required'
]
??
false
;
// Properties
$this
->
relativeInput
=
$relativeInput
;
$this
->
relativeInput
->
addClasses
(
[
'mw-widget-ExpiryWidget-relative'
]
);
// Initialization
$this
->
addClasses
(
[
'mw-widget-ExpiryWidget'
,
'mw-widget-ExpiryWidget-hasDatePicker'
]
)
->
appendContent
(
$this
->
relativeInput
);
}
/** @inheritDoc */
protected
function
getJavaScriptClassName
()
{
return
'mw.widgets.ExpiryWidget'
;
}
/**
* @inheritDoc
*/
public
function
getConfig
(
&
$config
)
{
$config
[
'required'
]
=
$this
->
required
;
$config
[
'relativeInput'
]
=
[];
$this
->
relativeInput
->
getConfig
(
$config
[
'relativeInput'
]
);
return
parent
::
getConfig
(
$config
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 17:25 (9 h, 12 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
e2/fe/920c92fc4cd43901966fa6e17252
Default Alt Text
ExpiryInputWidget.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment