Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7447435
CitizenComponentMenu.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
871 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
array
$data
)
{
}
/**
* Counts how many items the menu has.
*
* @return int
*/
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'
);
}
/**
* @inheritDoc
*/
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
Sun, Nov 22, 19:09 (1 d, 11 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
26/f4/720fc5c5a24354c98ebc55d790d8
Default Alt Text
CitizenComponentMenu.php (871 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment