Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4090745
CitizenComponentSearchBox.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
CitizenComponentSearchBox.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
MediaWiki\Skins\Citizen\Components
;
use
MediaWiki\Registration\ExtensionRegistry
;
use
MediaWiki\Skin\SkinComponentUtils
;
use
MessageLocalizer
;
/**
* CitizenComponentSearchBox component
*/
class
CitizenComponentSearchBox
implements
CitizenComponent
{
public
function
__construct
(
private
readonly
MessageLocalizer
$localizer
,
private
readonly
ExtensionRegistry
$extensionRegistry
,
private
readonly
array
$searchBoxData
)
{
}
/**
* Get the keyboard hint data
*/
private
function
getKeyboardHintData
():
array
{
$data
=
[];
// There is probably a cleaner way to handle this
$map
=
[
'↑ ↓'
=>
$this
->
localizer
->
msg
(
"citizen-search-keyhint-select"
)->
text
(),
'/'
=>
$this
->
localizer
->
msg
(
"citizen-search-keyhint-open"
)->
text
(),
'Esc'
=>
$this
->
localizer
->
msg
(
"citizen-search-keyhint-exit"
)->
text
()
];
foreach
(
$map
as
$key
=>
$label
)
{
$keyhint
=
new
CitizenComponentKeyboardHint
(
$label
,
$key
);
$data
[]
=
$keyhint
->
getTemplateData
();
}
return
$data
;
}
/**
* Get the footer message
*/
private
function
getFooterMessage
():
string
{
$isCirrusSearchExtensionEnabled
=
$this
->
extensionRegistry
->
isLoaded
(
'CirrusSearch'
);
$searchBackend
=
$isCirrusSearchExtensionEnabled
?
'cirrussearch'
:
'mediawiki'
;
return
$this
->
localizer
->
msg
(
'citizen-search-poweredby'
,
$this
->
localizer
->
msg
(
"citizen-search-poweredby-$searchBackend"
)
)->
text
();
}
public
function
getTemplateData
():
array
{
$searchBoxData
=
$this
->
searchBoxData
+
[
'array-keyboard-hint'
=>
$this
->
getKeyboardHintData
(),
'msg-citizen-search-footer'
=>
$this
->
getFooterMessage
(),
'msg-citizen-search-toggle-shortcut'
=>
'[/]'
,
'html-random-href'
=>
SkinComponentUtils
::
makeSpecialUrl
(
'Randompage'
)
];
return
$searchBoxData
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Aug 18 2026, 11:16 (5 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
33/28/2f482dfb58c046ed41b8f21e7b9a
Default Alt Text
CitizenComponentSearchBox.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment