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 (Title $title, $action, $hasLangLinks, ?array $noExternalLangLinks, $prefixedId)
 

Private Member Functions

 canHaveLink (Title $title, $action, array $noExternalLangLinks=null)
 
 isSuppressed (array $noExternalLangLinks=null)
 
 getEditLinksLink (EntityId $entityId)
 
 getAddLinksLink (Title $title, EntityId $entityId=null)
 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 = null )
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 ( Title $title,
EntityId $entityId = null )
private

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

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

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

◆ getEditLinksLink()

Wikibase\Client\RepoItemLinkGenerator::getEditLinksLink ( EntityId $entityId)
private
Parameters
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 ( Title $title,
$action,
$hasLangLinks,
?array $noExternalLangLinks,
$prefixedId )
Parameters
Title$title
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 = null)
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: