MediaWiki REL1_33
|
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. | |
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. | |
formatTemplate (LinkTarget $target) | |
Builds an item for an individual template. | |
getRestrictionsText (array $restrictions) | |
If the page is protected, get the relevant text for those restrictions. | |
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 164 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 $template, $type, as, execute(), and formatTemplate().
|
private |
Builds an item for an individual template.
LinkTarget | $target |
Definition at line 109 of file TemplatesOnThisPageFormatter.php.
References buildEditLink(), and getRestrictionsText().
Referenced by format().
|
private |
If the page is protected, get the relevant text for those restrictions.
array | $restrictions |
Definition at line 128 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().