MediaWiki REL1_34
|
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 (LinkTarget $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 31 of file TemplatesOnThisPageFormatter.php.
TemplatesOnThisPageFormatter::__construct | ( | IContextSource | $context, |
LinkRenderer | $linkRenderer | ||
) |
IContextSource | $context | |
LinkRenderer | $linkRenderer |
Definition at line 47 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.
LinkTarget | $titleObj |
Definition at line 165 of file TemplatesOnThisPageFormatter.php.
References getPermissionManager().
Referenced by formatTemplate().
TemplatesOnThisPageFormatter::format | ( | array | $templates, |
$type = false , |
|||
$more = null |
|||
) |
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 63 of file TemplatesOnThisPageFormatter.php.
References $type, and formatTemplate().
|
private |
Builds an item for an individual template.
LinkTarget | $target |
Definition at line 110 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 129 of file TemplatesOnThisPageFormatter.php.
Referenced by formatTemplate().
|
private |
Definition at line 36 of file TemplatesOnThisPageFormatter.php.
Referenced by __construct().
|
private |
Definition at line 41 of file TemplatesOnThisPageFormatter.php.
Referenced by __construct().