Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5944163
WikibaseEntitySelector.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
WikibaseEntitySelector.php
View Options
<?php
namespace
MediaWiki\Extension\Math\Widget
;
use
MediaWiki\Logger\LoggerFactory
;
use
OOUI\SearchInputWidget
;
class
WikibaseEntitySelector
extends
SearchInputWidget
{
/** @var string */
protected
$paramType
=
'item'
;
// This should be \Wikimedia\ParamValidator\ParamValidator::PARAM_TYPE of the target API
private
const
ALLOWED_TYPES
=
[
'entity-schema'
,
'form'
,
'item'
,
'lexeme'
,
'property'
,
'sense'
];
public
function
__construct
(
array
$config
=
[]
)
{
// @phan-suppress-next-line PhanUndeclaredStaticMethod https://github.com/phan/phan/issues/5044
parent
::
__construct
(
$config
);
$paramType
=
$config
[
'paramType'
]
??
false
;
if
(
$paramType
)
{
if
(
in_array
(
$paramType
,
self
::
ALLOWED_TYPES
,
true
)
)
{
$this
->
paramType
=
$paramType
;
}
else
{
LoggerFactory
::
getInstance
(
'Math'
)->
warning
(
'Invalid type'
,
[
$paramType
]
);
}
}
$this
->
addClasses
(
[
'mw-math-widget-wb-entity-selector'
]
);
}
protected
function
getJavaScriptClassName
():
string
{
return
'mw.widgets.MathWbEntitySelector'
;
}
/** @inheritDoc */
public
function
getConfig
(
&
$config
)
{
$config
[
'paramType'
]
=
$this
->
paramType
;
return
parent
::
getConfig
(
$config
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 2 2026, 18:21 (6 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
b4/3f/e66e9897f33204de19d908af018d
Default Alt Text
WikibaseEntitySelector.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment