Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1432179
HTMLToggleSwitchField.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
HTMLToggleSwitchField.php
View Options
<?php
namespace
MediaWiki\HTMLForm\Field
;
use
MediaWiki\Widget\ToggleSwitchWidget
;
class
HTMLToggleSwitchField
extends
HTMLCheckField
{
/**
* Get the OOUI version of this field.
*
* @since 1.41
* @param string $value
* @return ToggleSwitchWidget
*/
public
function
getInputOOUI
(
$value
)
{
if
(
!
empty
(
$this
->
mParams
[
'invert'
]
)
)
{
$value
=
!
$value
;
}
$attr
=
$this
->
getTooltipAndAccessKeyOOUI
();
$attr
[
'id'
]
=
$this
->
mID
;
$attr
[
'name'
]
=
$this
->
mName
;
$attr
+=
\OOUI\Element
::
configFromHtmlAttributes
(
$this
->
getAttributes
(
[
'disabled'
,
'tabindex'
]
)
);
if
(
$this
->
mClass
!==
''
)
{
$attr
[
'classes'
]
=
[
$this
->
mClass
];
}
// For the underlaying CheckboxInputWidget
$attr
[
'selected'
]
=
$value
;
$attr
[
'value'
]
=
'1'
;
return
new
ToggleSwitchWidget
(
$attr
);
}
/**
* @inheritDoc
*/
protected
function
shouldInfuseOOUI
()
{
// Always infuse, as we want a toggle widget when JS is enabled.
return
true
;
}
protected
function
getOOUIModules
()
{
return
[
'mediawiki.widgets.ToggleSwitchWidget'
];
}
}
/** @deprecated class alias since 1.42 */
class_alias
(
HTMLToggleSwitchField
::
class
,
'HTMLToggleSwitchField'
);
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 21:30 (1 d, 8 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
a4/6c/ab86e2951136efb3ffa4f98303d7
Default Alt Text
HTMLToggleSwitchField.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment