Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7438410
FootnoteMarkFormatter.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
FootnoteMarkFormatter.php
View Options
<?php
namespace
Cite
;
use
MediaWiki\Parser\Sanitizer
;
/**
* Footnote markers in the context of the Cite extension are the numbers in the article text, e.g.
* [1], that can be hovered or clicked to be able to read the attached footnote.
*
* @license GPL-2.0-or-later
*/
class
FootnoteMarkFormatter
{
private
AnchorFormatter
$anchorFormatter
;
private
MarkSymbolRenderer
$markSymbolRenderer
;
private
ReferenceMessageLocalizer
$messageLocalizer
;
public
function
__construct
(
AnchorFormatter
$anchorFormatter
,
MarkSymbolRenderer
$markSymbolRenderer
,
ReferenceMessageLocalizer
$messageLocalizer
)
{
$this
->
anchorFormatter
=
$anchorFormatter
;
$this
->
markSymbolRenderer
=
$markSymbolRenderer
;
$this
->
messageLocalizer
=
$messageLocalizer
;
}
/**
* Generates the clickable <sup>[1]</sup> wikitext snippets for the numeric footnote markers
* in an article.
*
* @param ReferenceStackItem $ref
* @return string Wikitext
*/
public
function
linkRef
(
ReferenceStackItem
$ref
):
string
{
$label
=
$this
->
markSymbolRenderer
->
makeLabel
(
$ref
->
group
,
$ref
->
numberInGroup
,
$ref
->
subrefIndex
);
return
$this
->
messageLocalizer
->
msg
(
'cite_reference_link'
,
$this
->
anchorFormatter
->
backLinkTarget
(
$ref
->
name
,
$ref
->
globalId
,
$ref
->
count
),
$this
->
anchorFormatter
->
jumpLink
(
$ref
->
name
,
$ref
->
globalId
),
Sanitizer
::
safeEncodeAttribute
(
$label
)
)->
plain
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 14:31 (6 h, 22 m ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
5d/a6/109f976ad8b9fd2b9f45875f96de
Default Alt Text
FootnoteMarkFormatter.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment