MediaWiki REL1_35
|
Class that generates HTML links for pages. More...
Public Member Functions | |
__construct (TitleFormatter $titleFormatter, LinkCache $linkCache, NamespaceInfo $nsInfo, SpecialPageFactory $specialPageFactory, HookContainer $hookContainer) | |
getExpandURLs () | |
getForceArticlePath () | |
getLinkClasses (LinkTarget $target) | |
Return the CSS classes of a known link. | |
getStubThreshold () | |
makeBrokenLink (LinkTarget $target, $text=null, array $extraAttribs=[], array $query=[]) | |
makeKnownLink (LinkTarget $target, $text=null, array $extraAttribs=[], array $query=[]) | |
makeLink (LinkTarget $target, $text=null, array $extraAttribs=[], array $query=[]) | |
makePreloadedLink (LinkTarget $target, $text=null, $classes='', array $extraAttribs=[], array $query=[]) | |
If you have already looked up the proper CSS classes using LinkRenderer::getLinkClasses() or some other method, use this to avoid looking it up again. | |
normalizeTarget (LinkTarget $target) | |
Normalizes the provided target. | |
setExpandURLs ( $expand) | |
setForceArticlePath ( $force) | |
setRunLegacyBeginHook ( $run) | |
setStubThreshold ( $threshold) | |
Private Member Functions | |
buildAElement (LinkTarget $target, $text, array $attribs, $isKnown) | |
Builds the final element. | |
getLegacyOptions ( $isKnown) | |
Get the options in the legacy format. | |
getLinkText (LinkTarget $target) | |
getLinkURL (LinkTarget $target, array $query=[]) | |
mergeAttribs ( $defaults, $attribs) | |
Merges two sets of attributes. | |
runBeginHook (LinkTarget $target, &$text, &$extraAttribs, &$query, $isKnown) | |
runLegacyBeginHook (LinkTarget $target, &$text, &$extraAttribs, &$query, $isKnown) | |
Private Attributes | |
string bool int | $expandUrls = false |
A PROTO_* constant or false. | |
bool | $forceArticlePath = false |
Whether to force the pretty article path. | |
HookContainer | $hookContainer |
HookRunner | $hookRunner |
LinkCache | $linkCache |
NamespaceInfo | $nsInfo |
bool | $runLegacyBeginHook = true |
Whether to run the legacy Linker hooks. | |
SpecialPageFactory | $specialPageFactory |
int | $stubThreshold = 0 |
TitleFormatter | $titleFormatter |
Class that generates HTML links for pages.
Definition at line 43 of file LinkRenderer.php.
MediaWiki\Linker\LinkRenderer::__construct | ( | TitleFormatter | $titleFormatter, |
LinkCache | $linkCache, | ||
NamespaceInfo | $nsInfo, | ||
SpecialPageFactory | $specialPageFactory, | ||
HookContainer | $hookContainer | ||
) |
|
private |
Builds the final element.
LinkTarget | $target | |
string | HtmlArmor | $text | |
array | $attribs | |
bool | $isKnown |
Definition at line 393 of file LinkRenderer.php.
References $title, and MediaWiki\Linker\LinkRenderer\getLegacyOptions().
Referenced by MediaWiki\Linker\LinkRenderer\makeBrokenLink(), and MediaWiki\Linker\LinkRenderer\makePreloadedLink().
MediaWiki\Linker\LinkRenderer::getExpandURLs | ( | ) |
Definition at line 144 of file LinkRenderer.php.
References MediaWiki\Linker\LinkRenderer\$expandUrls.
MediaWiki\Linker\LinkRenderer::getForceArticlePath | ( | ) |
Definition at line 130 of file LinkRenderer.php.
References MediaWiki\Linker\LinkRenderer\$forceArticlePath.
|
private |
Get the options in the legacy format.
bool | $isKnown | Whether the link is known or broken |
Definition at line 193 of file LinkRenderer.php.
References MediaWiki\Linker\LinkRenderer\$stubThreshold, PROTO_HTTP, and PROTO_HTTPS.
Referenced by MediaWiki\Linker\LinkRenderer\buildAElement(), and MediaWiki\Linker\LinkRenderer\runLegacyBeginHook().
MediaWiki\Linker\LinkRenderer::getLinkClasses | ( | LinkTarget | $target | ) |
Return the CSS classes of a known link.
LinkTarget | $target |
Definition at line 503 of file LinkRenderer.php.
References MediaWiki\Linker\LinkTarget\getNamespace().
Referenced by MediaWiki\Linker\LinkRenderer\makeKnownLink().
|
private |
LinkTarget | $target |
Definition at line 422 of file LinkRenderer.php.
References MediaWiki\Linker\LinkTarget\getFragment(), and MediaWiki\Linker\LinkTarget\hasFragment().
Referenced by MediaWiki\Linker\LinkRenderer\makeBrokenLink(), and MediaWiki\Linker\LinkRenderer\makePreloadedLink().
|
private |
Definition at line 433 of file LinkRenderer.php.
References $title, and wfAppendQuery().
Referenced by MediaWiki\Linker\LinkRenderer\makeBrokenLink(), and MediaWiki\Linker\LinkRenderer\makePreloadedLink().
MediaWiki\Linker\LinkRenderer::getStubThreshold | ( | ) |
Definition at line 158 of file LinkRenderer.php.
References MediaWiki\Linker\LinkRenderer\$stubThreshold.
MediaWiki\Linker\LinkRenderer::makeBrokenLink | ( | LinkTarget | $target, |
$text = null , |
|||
array | $extraAttribs = [] , |
||
array | $query = [] |
||
) |
LinkTarget | $target | |
-taint | $target | none |
string | HtmlArmor | null | $text | |
array | $extraAttribs | |
array | $query |
Definition at line 342 of file LinkRenderer.php.
References MediaWiki\Linker\LinkRenderer\buildAElement(), MediaWiki\Linker\LinkTarget\createFragmentTarget(), MediaWiki\Linker\LinkRenderer\getLinkText(), MediaWiki\Linker\LinkRenderer\getLinkURL(), MediaWiki\Linker\LinkTarget\getNamespace(), MediaWiki\Linker\LinkTarget\hasFragment(), MediaWiki\Linker\LinkRenderer\mergeAttribs(), MediaWiki\Linker\LinkRenderer\normalizeTarget(), NS_SPECIAL, MediaWiki\Linker\LinkRenderer\runBeginHook(), and wfMessage().
Referenced by AllMessagesTablePager\formatValue(), and MediaWiki\Linker\LinkRenderer\makeLink().
MediaWiki\Linker\LinkRenderer::makeKnownLink | ( | LinkTarget | $target, |
$text = null , |
|||
array | $extraAttribs = [] , |
||
array | $query = [] |
||
) |
LinkTarget | $target | |
string | HtmlArmor | null | $text | |
array | $extraAttribs | |
array | $query |
Definition at line 313 of file LinkRenderer.php.
References MediaWiki\Linker\LinkRenderer\getLinkClasses(), MediaWiki\Linker\LinkTarget\isExternal(), and MediaWiki\Linker\LinkRenderer\makePreloadedLink().
Referenced by AllMessagesTablePager\formatValue(), ProtectedPagesPager\formatValue(), BlockListPager\formatValue(), BlockLogFormatter\getActionLinks(), DeleteLogFormatter\getActionLinks(), ProtectLogFormatter\getActionLinks(), TraditionalImageGallery\getCaptionHtml(), Article\getRedirectHeaderHtml(), ImagePage\imageDupes(), ImagePage\imageLinks(), HistoryPager\lastLink(), MediaWiki\Linker\LinkRenderer\makeLink(), and ImagePage\openShowImage().
MediaWiki\Linker\LinkRenderer::makeLink | ( | LinkTarget | $target, |
$text = null , |
|||
array | $extraAttribs = [] , |
||
array | $query = [] |
||
) |
LinkTarget | $target | |
string | HtmlArmor | null | $text | |
array | $extraAttribs | |
array | $query |
Definition at line 176 of file LinkRenderer.php.
References $title, MediaWiki\Linker\LinkRenderer\makeBrokenLink(), and MediaWiki\Linker\LinkRenderer\makeKnownLink().
Referenced by ProtectedPagesPager\formatValue(), ProtectLogFormatter\getActionLinks(), Article\getRedirectHeaderHtml(), and BlockListPager\getRestrictionListHTML().
MediaWiki\Linker\LinkRenderer::makePreloadedLink | ( | LinkTarget | $target, |
$text = null , |
|||
$classes = '' , |
|||
array | $extraAttribs = [] , |
||
array | $query = [] |
||
) |
If you have already looked up the proper CSS classes using LinkRenderer::getLinkClasses() or some other method, use this to avoid looking it up again.
LinkTarget | $target | |
string | HtmlArmor | null | $text | |
string | $classes | CSS classes to add |
array | $extraAttribs | |
array | $query |
Definition at line 279 of file LinkRenderer.php.
References MediaWiki\Linker\LinkRenderer\buildAElement(), MediaWiki\Linker\LinkRenderer\getLinkText(), MediaWiki\Linker\LinkRenderer\getLinkURL(), MediaWiki\Linker\LinkRenderer\mergeAttribs(), MediaWiki\Linker\LinkRenderer\normalizeTarget(), and MediaWiki\Linker\LinkRenderer\runBeginHook().
Referenced by MediaWiki\Linker\LinkRenderer\makeKnownLink().
|
private |
Merges two sets of attributes.
array | $defaults | |
array | $attribs |
Definition at line 480 of file LinkRenderer.php.
Referenced by MediaWiki\Linker\LinkRenderer\makeBrokenLink(), and MediaWiki\Linker\LinkRenderer\makePreloadedLink().
MediaWiki\Linker\LinkRenderer::normalizeTarget | ( | LinkTarget | $target | ) |
Normalizes the provided target.
Definition at line 459 of file LinkRenderer.php.
References MediaWiki\Linker\LinkTarget\getDBkey(), MediaWiki\Linker\LinkTarget\getFragment(), MediaWiki\Linker\LinkTarget\getNamespace(), SpecialPage\getTitleValueFor(), MediaWiki\Linker\LinkTarget\isExternal(), and NS_SPECIAL.
Referenced by MediaWiki\Linker\LinkRenderer\makeBrokenLink(), and MediaWiki\Linker\LinkRenderer\makePreloadedLink().
|
private |
Definition at line 209 of file LinkRenderer.php.
References MediaWiki\Linker\LinkRenderer\runLegacyBeginHook().
Referenced by MediaWiki\Linker\LinkRenderer\makeBrokenLink(), and MediaWiki\Linker\LinkRenderer\makePreloadedLink().
|
private |
Definition at line 221 of file LinkRenderer.php.
References $title, MediaWiki\MediaWikiServices\getInstance(), MediaWiki\Linker\LinkRenderer\getLegacyOptions(), and MediaWiki\Linker\LinkRenderer\runLegacyBeginHook().
Referenced by MediaWiki\Linker\LinkRenderer\runBeginHook(), MediaWiki\Linker\LinkRenderer\runLegacyBeginHook(), and MediaWiki\Linker\LinkRenderer\setRunLegacyBeginHook().
MediaWiki\Linker\LinkRenderer::setExpandURLs | ( | $expand | ) |
string | bool | int | $expand | A PROTO_* constant or false |
Definition at line 137 of file LinkRenderer.php.
MediaWiki\Linker\LinkRenderer::setForceArticlePath | ( | $force | ) |
bool | $force |
Definition at line 123 of file LinkRenderer.php.
MediaWiki\Linker\LinkRenderer::setRunLegacyBeginHook | ( | $run | ) |
bool | $run |
Definition at line 165 of file LinkRenderer.php.
References MediaWiki\Linker\LinkRenderer\runLegacyBeginHook().
MediaWiki\Linker\LinkRenderer::setStubThreshold | ( | $threshold | ) |
int | $threshold |
Definition at line 151 of file LinkRenderer.php.
|
private |
A PROTO_* constant or false.
Definition at line 57 of file LinkRenderer.php.
Referenced by MediaWiki\Linker\LinkRenderer\getExpandURLs().
|
private |
Whether to force the pretty article path.
Definition at line 50 of file LinkRenderer.php.
Referenced by MediaWiki\Linker\LinkRenderer\getForceArticlePath().
|
private |
Definition at line 87 of file LinkRenderer.php.
Referenced by MediaWiki\Linker\LinkRenderer\__construct().
|
private |
Definition at line 90 of file LinkRenderer.php.
|
private |
Definition at line 72 of file LinkRenderer.php.
Referenced by MediaWiki\Linker\LinkRenderer\__construct().
|
private |
Definition at line 77 of file LinkRenderer.php.
Referenced by MediaWiki\Linker\LinkRenderer\__construct().
|
private |
Whether to run the legacy Linker hooks.
Definition at line 84 of file LinkRenderer.php.
|
private |
Definition at line 95 of file LinkRenderer.php.
Referenced by MediaWiki\Linker\LinkRenderer\__construct().
|
private |
Definition at line 62 of file LinkRenderer.php.
Referenced by MediaWiki\Linker\LinkRenderer\getLegacyOptions(), and MediaWiki\Linker\LinkRenderer\getStubThreshold().
|
private |
Definition at line 67 of file LinkRenderer.php.
Referenced by MediaWiki\Linker\LinkRenderer\__construct().