Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4064311
ComplexTitleInputWidget.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
ComplexTitleInputWidget.php
View Options
<?php
namespace
MediaWiki\Widget
;
use
OOUI\Widget
;
/**
* Complex title input widget.
*
* @copyright 2011-2015 MediaWiki Widgets Team and others; see AUTHORS.txt
* @license MIT
*/
class
ComplexTitleInputWidget
extends
Widget
{
/** @var array */
protected
$config
;
/** @var NamespaceInputWidget|null */
protected
$namespace
=
null
;
/** @var TitleInputWidget|null */
protected
$title
=
null
;
/**
* Like TitleInputWidget, but the namespace has to be input through a separate dropdown field.
*
* @param array $config Configuration options
* - array $config['namespace'] Configuration for the NamespaceInputWidget dropdown
* with list of namespaces
* - array $config['title'] Configuration for the TitleInputWidget text field
* @phan-param array{namespace?:array,title?:array} $config
*/
public
function
__construct
(
array
$config
=
[]
)
{
// Configuration initialization
$config
=
array_merge
(
[
'namespace'
=>
[],
'title'
=>
[],
],
$config
);
parent
::
__construct
(
$config
);
// Properties
$this
->
config
=
$config
;
$this
->
namespace
=
new
NamespaceInputWidget
(
$config
[
'namespace'
]
);
$this
->
title
=
new
TitleInputWidget
(
array_merge
(
$config
[
'title'
],
[
'relative'
=>
true
,
'namespace'
=>
$config
[
'namespace'
][
'value'
]
??
null
,
]
)
);
// Initialization
$this
->
addClasses
(
[
'mw-widget-complexTitleInputWidget'
]
)
->
appendContent
(
$this
->
namespace
,
$this
->
title
);
}
/** @inheritDoc */
protected
function
getJavaScriptClassName
()
{
return
'mw.widgets.ComplexTitleInputWidget'
;
}
/** @inheritDoc */
public
function
getConfig
(
&
$config
)
{
$config
[
'namespace'
]
=
$this
->
config
[
'namespace'
];
$config
[
'namespace'
][
'dropdown'
][
'$overlay'
]
=
true
;
$config
[
'title'
]
=
$this
->
config
[
'title'
];
$config
[
'title'
][
'$overlay'
]
=
true
;
return
parent
::
getConfig
(
$config
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Aug 16 2026, 13:49 (11 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
af/26/899d259ff49c0a10247ece6fd2e4
Default Alt Text
ComplexTitleInputWidget.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment