Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5965972
VectorComponentMenu.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
921 B
Referenced Files
None
Subscribers
None
VectorComponentMenu.php
View Options
<?php
namespace
MediaWiki\Skins\Vector\Components
;
use
Countable
;
/**
* VectorComponentMenu component
*/
class
VectorComponentMenu
implements
VectorComponent
,
Countable
{
/** @var array */
private
$data
;
/**
* @param array $data
*/
public
function
__construct
(
array
$data
)
{
$this
->
data
=
$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
Sat, Oct 3, 11:19 (6 d, 57 m ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
dc/be/c0ef55dfa6167e61b9b00180377c
Default Alt Text
VectorComponentMenu.php (921 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment