MediaWiki
1.32.5
|
Handles formatting for the "templates used on this page" lists. More...
Public Member Functions | |
__construct (IContextSource $context, LinkRenderer $linkRenderer) | |
format (array $templates, $type=false, $more=null) | |
Make an HTML list of templates, and then add a "More..." link at the bottom. More... | |
Private Member Functions | |
buildEditLink (Title $titleObj) | |
Return a link to the edit page, with the text saying "view source" if the user can't edit the page. More... | |
formatTemplate (LinkTarget $target) | |
Builds an item for an individual template. More... | |
getRestrictionsText (array $restrictions) | |
If the page is protected, get the relevant text for those restrictions. More... | |
Private Attributes | |
IContextSource | $context |
LinkRenderer | $linkRenderer |
Handles formatting for the "templates used on this page" lists.
Formerly known as Linker::formatTemplates()
Definition at line 30 of file TemplatesOnThisPageFormatter.php.
TemplatesOnThisPageFormatter::__construct | ( | IContextSource | $context, |
LinkRenderer | $linkRenderer | ||
) |
IContextSource | $context | |
LinkRenderer | $linkRenderer |
Definition at line 46 of file TemplatesOnThisPageFormatter.php.
References $context, and $linkRenderer.
|
private |
Return a link to the edit page, with the text saying "view source" if the user can't edit the page.
Title | $titleObj |
Definition at line 168 of file TemplatesOnThisPageFormatter.php.
References Title\quickUserCan().
Referenced by formatTemplate().
Make an HTML list of templates, and then add a "More..." link at the bottom.
If $more is null, do not add a "More..." link. If $more is a LinkTarget, make a link to that title and use it. If $more is a string, directly paste it in as the link (escaping needs to be done manually).
LinkTarget[] | $templates | |
string | bool | $type | 'preview' if a preview, 'section' if a section edit, false if neither |
LinkTarget | string | null | $more | An escaped link for "More..." of the templates |
Definition at line 62 of file TemplatesOnThisPageFormatter.php.
References $batch, $template, $title, $type, as, captcha-old\count, formatTemplate(), and Html\rawElement().
|
private |
Builds an item for an individual template.
LinkTarget | $target |
Definition at line 113 of file TemplatesOnThisPageFormatter.php.
References buildEditLink(), getRestrictionsText(), and Title\newFromLinkTarget().
Referenced by format().
|
private |
If the page is protected, get the relevant text for those restrictions.
array | $restrictions |
Definition at line 132 of file TemplatesOnThisPageFormatter.php.
References as.
Referenced by formatTemplate().
|
private |
Definition at line 35 of file TemplatesOnThisPageFormatter.php.
Referenced by __construct().
|
private |
Definition at line 40 of file TemplatesOnThisPageFormatter.php.
Referenced by __construct().