Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7492034
CitizenComponentMenu.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
837 B
Referenced Files
None
Subscribers
None
CitizenComponentMenu.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
MediaWiki\Skins\Citizen\Components
;
use
Countable
;
/**
* CitizenComponentMenu component
*/
class
CitizenComponentMenu
implements
CitizenComponent
,
Countable
{
public
function
__construct
(
private
readonly
array
$data
)
{
}
/**
* Counts how many items the menu has.
*/
public
function
count
():
int
{
$items
=
$this
->
data
[
'array-list-items'
]
??
null
;
if
(
$items
)
{
return
count
(
$items
);
}
$htmlItems
=
$this
->
data
[
'html-items'
]
??
''
;
return
substr_count
(
$htmlItems
,
'<li'
);
}
public
function
getTemplateData
():
array
{
return
$this
->
data
+
[
'class'
=>
''
,
'label'
=>
''
,
'html-tooltip'
=>
''
,
'label-class'
=>
''
,
'html-before-portal'
=>
''
,
'html-items'
=>
''
,
'html-after-portal'
=>
''
,
'array-list-items'
=>
null
,
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Nov 23, 19:48 (6 d, 5 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
fe/15/c23c5b3daecf1c06c8bfc556301e
Default Alt Text
CitizenComponentMenu.php (837 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment