Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6009620
CitizenComponentPageSidebar.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
CitizenComponentPageSidebar.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
MediaWiki\Skins\Citizen\Components
;
use
MediaWiki\Title\Title
;
use
MessageLocalizer
;
/**
* CitizenComponentPageSidebar component
*/
class
CitizenComponentPageSidebar
implements
CitizenComponent
{
public
function
__construct
(
private
readonly
MessageLocalizer
$localizer
,
private
readonly
Title
$title
,
private
readonly
array
$lastModifiedData
)
{
}
private
function
getLastModData
():
array
{
$lastModifiedData
=
$this
->
lastModifiedData
;
$timestamp
=
$this
->
lastModifiedData
[
'timestamp'
];
if
(
$timestamp
===
null
)
{
return
[];
}
$items
=
[
'item-id'
=>
'lm-time'
,
'item-class'
=>
'mw-list-item'
,
'array-links'
=>
[
'array-attributes'
=>
[
[
'key'
=>
'id'
,
'value'
=>
'citizen-lastmod-relative'
],
[
'key'
=>
'href'
,
'value'
=>
$this
->
title
->
getLocalURL
(
[
'diff'
=>
''
]
)
],
[
'key'
=>
'title'
,
'value'
=>
trim
(
$lastModifiedData
[
'text'
]
)
],
[
'key'
=>
'data-timestamp'
,
'value'
=>
wfTimestamp
(
TS_UNIX
,
$lastModifiedData
[
'timestamp'
]
)
]
],
'icon'
=>
'history'
,
'text'
=>
$lastModifiedData
[
'date'
]
]
];
// TODO: We should not use CitizenComponentMenu here, but a custom component
$menu
=
new
CitizenComponentMenu
(
[
'id'
=>
'citizen-sidebar-lastmod'
,
'label'
=>
$this
->
localizer
->
msg
(
'citizen-page-info-lastmod'
),
'array-list-items'
=>
$items
]
);
return
$menu
->
getTemplateData
();
}
public
function
getTemplateData
():
array
{
return
[
'data-page-sidebar-lastmod'
=>
$this
->
getLastModData
()
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 4 2026, 09:28 (5 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
70/e0/3fc28e5d0bb5dfebcddf734dd226
Default Alt Text
CitizenComponentPageSidebar.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment