Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5967127
ActionFieldLayout.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
ActionFieldLayout.php
View Options
<?php
namespace
OOUI
;
/**
* Layout made of a field, button and optional label.
*/
class
ActionFieldLayout
extends
FieldLayout
{
/**
* Button widget to be laid out.
*
* @var Widget
*/
protected
$buttonWidget
;
/**
* @var Tag
*/
protected
$button
;
/**
* @var Tag
*/
protected
$input
;
/**
* @param Widget $fieldWidget Field widget
* @param ButtonWidget|ButtonInputWidget $buttonWidget Field widget
* @param array $config Configuration options
* @suppress PhanTypeMismatchDefault Overloaded method
*/
public
function
__construct
(
$fieldWidget
,
$buttonWidget
=
false
,
array
$config
=
[]
)
{
// Allow passing positional parameters inside the config array
if
(
is_array
(
$fieldWidget
)
&&
isset
(
$fieldWidget
[
'fieldWidget'
]
)
)
{
$config
=
$fieldWidget
;
[
'fieldWidget'
=>
$fieldWidget
,
'buttonWidget'
=>
$buttonWidget
]
=
$config
;
}
// Parent constructor
parent
::
__construct
(
$fieldWidget
,
$config
);
// Properties
$this
->
buttonWidget
=
$buttonWidget
;
$this
->
button
=
new
Tag
(
'span'
);
$this
->
input
=
$this
->
isFieldInline
()
?
new
Tag
(
'span'
)
:
new
Tag
(
'div'
);
// Initialization
$this
->
addClasses
(
[
'oo-ui-actionFieldLayout'
]
);
$this
->
button
->
addClasses
(
[
'oo-ui-actionFieldLayout-button'
]
)
->
appendContent
(
$this
->
buttonWidget
);
$this
->
input
->
addClasses
(
[
'oo-ui-actionFieldLayout-input'
]
)
->
appendContent
(
$this
->
fieldWidget
);
$this
->
field
->
clearContent
()
->
appendContent
(
$this
->
input
,
$this
->
button
);
}
/** @inheritDoc */
public
function
getConfig
(
&
$config
)
{
$config
[
'buttonWidget'
]
=
$this
->
buttonWidget
;
return
parent
::
getConfig
(
$config
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 12:09 (3 d, 11 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
52/38/6a90ee121784b0de310cdf9dceed
Default Alt Text
ActionFieldLayout.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment