Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Client\RepoItemLinkGenerator Class Reference

Public Member Functions

 __construct (NamespaceChecker $namespaceChecker, RepoLinker $repoLinker, EntityIdParser $entityIdParser, $langLinkSiteGroup, $siteGlobalId)
 
 getLink (IContextSource $context, $action, $hasLangLinks, ?array $noExternalLangLinks, $prefixedId)
 

Private Member Functions

 canHaveLink (Title $title, $action, ?array $noExternalLangLinks)
 
 isSuppressed (?array $noExternalLangLinks)
 
 getEditLinksLink (IContextSource $context, EntityId $entityId)
 
 getAddLinksLink (IContextSource $context, ?EntityId $entityId)
 Links to the item or Special:NewItem on the repo.
 
 getNewItemUrl (Title $title)
 
 getEntityUrl (EntityId $entityId)
 
 formatLink (array $linkAttribs, $action, $text)
 

Private Attributes

 $namespaceChecker
 
 $repoLinker
 
 $entityIdParser
 
 $langLinkSiteGroup
 
 $siteGlobalId
 

Detailed Description

Author
Katie Filbert < aude..nosp@m.wiki.nosp@m.@gmai.nosp@m.l.co.nosp@m.m >
Marius Hoch < hoo@o.nosp@m.nlin.nosp@m.e.de >

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Client\RepoItemLinkGenerator::__construct ( NamespaceChecker $namespaceChecker,
RepoLinker $repoLinker,
EntityIdParser $entityIdParser,
$langLinkSiteGroup,
$siteGlobalId )
Parameters
NamespaceChecker$namespaceChecker
RepoLinker$repoLinker
EntityIdParser$entityIdParser
string$langLinkSiteGroup
string$siteGlobalId

Member Function Documentation

◆ canHaveLink()

Wikibase\Client\RepoItemLinkGenerator::canHaveLink ( Title $title,
$action,
?array $noExternalLangLinks )
private
Parameters
Title$title
string$action
string[] | null$noExternalLangLinks
Returns
bool

◆ formatLink()

Wikibase\Client\RepoItemLinkGenerator::formatLink ( array $linkAttribs,
$action,
$text )
private
Parameters
array$linkAttribs
string$action
string$text
Returns
string HTML

◆ getAddLinksLink()

Wikibase\Client\RepoItemLinkGenerator::getAddLinksLink ( IContextSource $context,
?EntityId $entityId )
private

Links to the item or Special:NewItem on the repo.

The link might get overwritten by the JavaScript add links widget.

Parameters
IContextSource$context
EntityId | null$entityIdEntity which $title is linked to
Returns
string HTML

◆ getEditLinksLink()

Wikibase\Client\RepoItemLinkGenerator::getEditLinksLink ( IContextSource $context,
EntityId $entityId )
private
Parameters
IContextSource$context
EntityId$entityId
Returns
string HTML

◆ getEntityUrl()

Wikibase\Client\RepoItemLinkGenerator::getEntityUrl ( EntityId $entityId)
private
Parameters
EntityId$entityId
Returns
string HTML unsafe

◆ getLink()

Wikibase\Client\RepoItemLinkGenerator::getLink ( IContextSource $context,
$action,
$hasLangLinks,
?array $noExternalLangLinks,
$prefixedId )
Parameters
IContextSource$context
string$action
bool$hasLangLinks
string[] | null$noExternalLangLinks
string | null$prefixedId
Returns
string|null HTML or null for no link

◆ getNewItemUrl()

Wikibase\Client\RepoItemLinkGenerator::getNewItemUrl ( Title $title)
private
Parameters
Title$title
Returns
string

◆ isSuppressed()

Wikibase\Client\RepoItemLinkGenerator::isSuppressed ( ?array $noExternalLangLinks)
private
Parameters
string[] | null$noExternalLangLinks
Returns
bool

Member Data Documentation

◆ $entityIdParser

Wikibase\Client\RepoItemLinkGenerator::$entityIdParser
private

◆ $langLinkSiteGroup

Wikibase\Client\RepoItemLinkGenerator::$langLinkSiteGroup
private

◆ $namespaceChecker

Wikibase\Client\RepoItemLinkGenerator::$namespaceChecker
private

◆ $repoLinker

Wikibase\Client\RepoItemLinkGenerator::$repoLinker
private

◆ $siteGlobalId

Wikibase\Client\RepoItemLinkGenerator::$siteGlobalId
private

The documentation for this class was generated from the following file: