Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5979793
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, Oct 3, 21:05 (5 d, 13 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
c3/93/9242e72d327778aea0ec6118060e
Default Alt Text
HTMLToggleSwitchField.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment