Wikibase
MediaWiki Wikibase extension
Wikibase\View\SimpleEntityTermsView Class Reference

Generates HTML to display the terms of an entity. More...

+ Inheritance diagram for Wikibase\View\SimpleEntityTermsView:
+ Collaboration diagram for Wikibase\View\SimpleEntityTermsView:

Public Member Functions

 __construct (HtmlTermRenderer $htmlTermRenderer, LabelDescriptionLookup $labelDescriptionLookup, TemplateFactory $templateFactory, EditSectionGenerator $sectionEditLinkGenerator, TermsListView $termsListView, LocalizedTextProvider $textProvider)
 
 getHtml ( $mainLanguageCode, TermList $labels, TermList $descriptions, AliasGroupList $aliasGroups=null, EntityId $entityId=null)
 
 getTitleHtml (EntityId $entityId=null)
 

Protected Member Functions

 getHeadingHtml ( $languageCode, EntityId $entityId=null, AliasGroupList $aliasGroups=null)
 
 getTermsLanguageCodes ( $mainLanguageCode, TermList $labels, TermList $descriptions, AliasGroupList $aliasGroups=null)
 
 getHtmlForLabelDescriptionAliasesEditSection ( $languageCode, EntityId $entityId=null)
 

Private Member Functions

 getDescriptionHtml (Term $description=null)
 
 getHtmlForAliases ( $languageCode, AliasGroupList $aliasGroups)
 

Private Attributes

 $htmlTermRenderer
 
 $labelDescriptionLookup
 
 $templateFactory
 
 $sectionEditLinkGenerator
 
 $termsListView
 
 $textProvider
 

Additional Inherited Members

- Public Attributes inherited from Wikibase\View\EntityTermsView
const TERMS_EDIT_SPECIAL_PAGE = 'SetLabelDescriptionAliases'
 

Detailed Description

Generates HTML to display the terms of an entity.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\View\SimpleEntityTermsView::__construct ( HtmlTermRenderer  $htmlTermRenderer,
LabelDescriptionLookup  $labelDescriptionLookup,
TemplateFactory  $templateFactory,
EditSectionGenerator  $sectionEditLinkGenerator,
TermsListView  $termsListView,
LocalizedTextProvider  $textProvider 
)

Member Function Documentation

◆ getDescriptionHtml()

Wikibase\View\SimpleEntityTermsView::getDescriptionHtml ( Term  $description = null)
private
Parameters
Term | null$description
Returns
string HTML

◆ getHeadingHtml()

Wikibase\View\SimpleEntityTermsView::getHeadingHtml (   $languageCode,
EntityId  $entityId = null,
AliasGroupList  $aliasGroups = null 
)
protected

◆ getHtml()

Wikibase\View\SimpleEntityTermsView::getHtml (   $mainLanguageCode,
TermList  $labels,
TermList  $descriptions,
AliasGroupList  $aliasGroups = null,
EntityId  $entityId = null 
)
Parameters
string$mainLanguageCodeDesired language of the label, description and aliases in the title and header section. Not necessarily identical to the interface language.
TermList$labels
TermList$descriptions
AliasGroupList | null$aliasGroups
EntityId | null$entityIdthe id of the entity
Returns
string HTML

Implements Wikibase\View\EntityTermsView.

Reimplemented in Wikibase\Repo\ParserOutput\PlaceholderEmittingEntityTermsView.

◆ getHtmlForAliases()

Wikibase\View\SimpleEntityTermsView::getHtmlForAliases (   $languageCode,
AliasGroupList  $aliasGroups 
)
private
Parameters
string$languageCodeThe language of the aliases
AliasGroupList$aliasGroupsthe list of alias groups to render
Returns
string HTML

◆ getHtmlForLabelDescriptionAliasesEditSection()

Wikibase\View\SimpleEntityTermsView::getHtmlForLabelDescriptionAliasesEditSection (   $languageCode,
EntityId  $entityId = null 
)
protected
Parameters
string$languageCodeThe language for which terms should be edited
EntityId | null$entityId
Returns
string HTML

◆ getTermsLanguageCodes()

Wikibase\View\SimpleEntityTermsView::getTermsLanguageCodes (   $mainLanguageCode,
TermList  $labels,
TermList  $descriptions,
AliasGroupList  $aliasGroups = null 
)
protected
Parameters
string$mainLanguageCodeDesired language of the label, description and aliases in the title and header section. Not necessarily identical to the interface language.
TermList$labels
TermList$descriptions
AliasGroupList | null$aliasGroups
Returns
string[]

◆ getTitleHtml()

Wikibase\View\SimpleEntityTermsView::getTitleHtml ( EntityId  $entityId = null)
Parameters
EntityId | null$entityId
Returns
string HTML

Implements Wikibase\View\EntityTermsView.

Member Data Documentation

◆ $htmlTermRenderer

Wikibase\View\SimpleEntityTermsView::$htmlTermRenderer
private

◆ $labelDescriptionLookup

Wikibase\View\SimpleEntityTermsView::$labelDescriptionLookup
private

◆ $sectionEditLinkGenerator

Wikibase\View\SimpleEntityTermsView::$sectionEditLinkGenerator
private

◆ $templateFactory

Wikibase\View\SimpleEntityTermsView::$templateFactory
private

◆ $termsListView

Wikibase\View\SimpleEntityTermsView::$termsListView
private

◆ $textProvider

Wikibase\View\SimpleEntityTermsView::$textProvider
private

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