Wikibase
MediaWiki Wikibase extension
|
Handler for the HtmlPageLinkRendererEnd hook, used to change the default link text of links to wikibase Entity pages to the respective entity's label. More...
Public Member Functions | |
onHtmlPageLinkRendererEnd ( $linkRenderer, $target, $isKnown, &$text, &$extraAttribs, &$ret) | |
Special page handling where we want to display meaningful link labels instead of just the items ID. More... | |
__construct (EntityExistenceChecker $entityExistenceChecker, EntityIdParser $entityIdParser, TermLookup $termLookup, EntityNamespaceLookup $entityNamespaceLookup, InterwikiLookup $interwikiLookup, EntityLinkFormatterFactory $linkFormatterFactory, SpecialPageFactory $specialPageFactory, LanguageFallbackChainFactory $languageFallbackChainFactory, EntityUrlLookup $entityUrlLookup, LinkTargetEntityIdLookup $linkTargetEntityIdLookup, ?string $federatedPropertiesSourceScriptUrl, bool $federatedPropertiesEnabled) | |
doHtmlPageLinkRendererEnd (LinkRenderer $linkRenderer, Title $target, &$text, array &$customAttribs, RequestContext $context, &$html=null) | |
Static Public Member Functions | |
static | factory (InterwikiLookup $interwikiLookup, SpecialPageFactory $specialPageFactory, EntityExistenceChecker $entityExistenceChecker, EntityIdParser $entityIdParser, EntityLinkFormatterFactory $entityLinkFormatterFactory, EntityNamespaceLookup $entityNamespaceLookup, EntityUrlLookup $entityUrlLookup, LanguageFallbackChainFactory $languageFallbackChainFactory, LinkTargetEntityIdLookup $linkTargetEntityIdLookup, SettingsArray $repoSettings, TermLookup $termLookup) |
Private Member Functions | |
federatedPropsDegradedDoHtmlPageLinkRendererEnd (LinkTarget $linkTarget, &$text, array &$customAttribs) | |
Hook handling logic for the HtmlPageLinkRendererEnd hook in case federated properties are enabled, but access to the source wiki failed. More... | |
internalDoHtmlPageLinkRendererEnd (LinkRenderer $linkRenderer, Title $target, &$text, array &$customAttribs, RequestContext $context, &$html=null) | |
Parts of the hook handling logic for the HtmlPageLinkRendererEnd hook that potentially interact with entity storage. More... | |
removeNewClass (string $classes) | |
Remove the new class from a space separated list of classes. More... | |
termFallbackToTermData (TermFallback $term=null) | |
parseForeignEntityId (LinkTarget $target) | |
extractForeignIdString (LinkTarget $linkTarget) | |
Should be given an already confirmed valid interwiki link that uses Special:EntityPage to link to an entity on a remote Wikibase. More... | |
extractForeignIdStringMainNs (LinkTarget $linkTarget) | |
extractForeignIdStringSpecialNs (LinkTarget $linkTarget) | |
isApiRequest () | |
Whether this is an API request. More... | |
shouldConvert (?Title $currentTitle, RequestContext $context) | |
Whether we should try to convert links on this page. More... | |
getLabelDescriptionLookup (RequestContext $context) | |
Handler for the HtmlPageLinkRendererEnd hook, used to change the default link text of links to wikibase Entity pages to the respective entity's label.
This is used mainly for listings on special pages or for edit summaries, where it is useful to see pages listed by label rather than their entity ID.
Label lookups are relatively expensive if done repeatedly for individual labels. If possible, labels should be pre-loaded and buffered for later use via the HtmlPageLinkRendererEnd hook.
Wikibase\Repo\Hooks\HtmlPageLinkRendererEndHookHandler::__construct | ( | EntityExistenceChecker | $entityExistenceChecker, |
EntityIdParser | $entityIdParser, | ||
TermLookup | $termLookup, | ||
EntityNamespaceLookup | $entityNamespaceLookup, | ||
InterwikiLookup | $interwikiLookup, | ||
EntityLinkFormatterFactory | $linkFormatterFactory, | ||
SpecialPageFactory | $specialPageFactory, | ||
LanguageFallbackChainFactory | $languageFallbackChainFactory, | ||
EntityUrlLookup | $entityUrlLookup, | ||
LinkTargetEntityIdLookup | $linkTargetEntityIdLookup, | ||
?string | $federatedPropertiesSourceScriptUrl, | ||
bool | $federatedPropertiesEnabled | ||
) |
Wikibase\Repo\Hooks\HtmlPageLinkRendererEndHookHandler::doHtmlPageLinkRendererEnd | ( | LinkRenderer | $linkRenderer, |
Title | $target, | ||
& | $text, | ||
array & | $customAttribs, | ||
RequestContext | $context, | ||
& | $html = null |
||
) |
LinkRenderer | $linkRenderer | |
Title | $target | |
HtmlArmor | string | null | &$text | |
array | &$customAttribs | |
RequestContext | $context | |
string | null | &$html |
|
private |
Should be given an already confirmed valid interwiki link that uses Special:EntityPage to link to an entity on a remote Wikibase.
|
private |
|
private |
|
static |
|
private |
Hook handling logic for the HtmlPageLinkRendererEnd hook in case federated properties are enabled, but access to the source wiki failed.
Title | $linkTarget | |
HtmlArmor | string | null | &$text | |
array | &$customAttribs |
|
private |
|
private |
Parts of the hook handling logic for the HtmlPageLinkRendererEnd hook that potentially interact with entity storage.
LinkRenderer | $linkRenderer | |
Title | $target | |
HtmlArmor | string | null | &$text | |
array | &$customAttribs | |
RequestContext | $context | |
string | null | &$html |
|
private |
Whether this is an API request.
Wikibase\Repo\Hooks\HtmlPageLinkRendererEndHookHandler::onHtmlPageLinkRendererEnd | ( | $linkRenderer, | |
$target, | |||
$isKnown, | |||
& | $text, | ||
& | $extraAttribs, | ||
& | $ret | ||
) |
Special page handling where we want to display meaningful link labels instead of just the items ID.
This is only handling special pages right now and gets disabled in normal pages.
LinkRenderer | $linkRenderer | |
LinkTarget | $target | |
bool | $isKnown | |
HtmlArmor | string | null | &$text | |
array | &$extraAttribs | |
string | null | &$ret |
|
private |
LinkTarget | $target |
|
private |
Remove the new class from a space separated list of classes.
string | $classes |
|
private |
Whether we should try to convert links on this page.
This caches that result within a static variable, thus it can't change (except in phpunit tests).
Title | null | $currentTitle | |
RequestContext | $context |
|
private |
TermFallback | null | $term |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |