Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\View\ToolbarEditSectionGenerator Class Reference

Generates HTML for a section edit link. More...

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

Public Member Functions

 __construct (SpecialPageLinker $specialPageLinker, TemplateFactory $templateFactory, LocalizedTextProvider $textProvider)
 
 getSiteLinksEditSection (EntityId $entityId=null)
 Returns HTML allowing to edit site links.
 
 getLabelDescriptionAliasesEditSection ( $languageCode, EntityId $entityId=null)
 Returns HTML allowing to edit the section containing label, description and aliases.
 
 getAddStatementToGroupSection (PropertyId $propertyId, EntityId $entityId=null)
 Returns HTML allowing to add a statement to a statementgroup.
 
 getStatementEditSection (Statement $statement)
 Returns HTML allowing to edit a statement.
 

Static Public Member Functions

static enableSectionEditLinks ( $text, $isEditable)
 

Private Member Functions

 getHtmlForEditSection ( $specialPageName, array $specialPageUrlParams)
 Returns a toolbar with an edit link.
 
 getToolbarContainer ( $content)
 
 getEditUrl ( $specialPageName, array $specialPageUrlParams)
 Get the Url to an edit special page.
 
 getToolbarButton ( $cssClassSuffix, $buttonLabel, $editUrl=null)
 

Private Attributes

 $specialPageLinker
 
 $templateFactory
 
 $textProvider
 

Detailed Description

Generates HTML for a section edit link.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\View\ToolbarEditSectionGenerator::__construct ( SpecialPageLinker $specialPageLinker,
TemplateFactory $templateFactory,
LocalizedTextProvider $textProvider )

Member Function Documentation

◆ enableSectionEditLinks()

static Wikibase\View\ToolbarEditSectionGenerator::enableSectionEditLinks ( $text,
$isEditable )
static
Parameters
string$text
bool$isEditable
Returns
string

◆ getAddStatementToGroupSection()

Wikibase\View\ToolbarEditSectionGenerator::getAddStatementToGroupSection ( PropertyId $propertyId,
EntityId $entityId = null )

Returns HTML allowing to add a statement to a statementgroup.

Parameters
PropertyId$propertyIdThe property of the statement group
EntityId | null$entityIdThe id of the entity on which to add a statement
Returns
string HTML

Implements Wikibase\View\EditSectionGenerator.

◆ getEditUrl()

Wikibase\View\ToolbarEditSectionGenerator::getEditUrl ( $specialPageName,
array $specialPageUrlParams )
private

Get the Url to an edit special page.

Parameters
string$specialPageNameThe special page to link to
string[]$specialPageUrlParamsAdditional URL params for the special page
Returns
string|null

◆ getHtmlForEditSection()

Wikibase\View\ToolbarEditSectionGenerator::getHtmlForEditSection ( $specialPageName,
array $specialPageUrlParams )
private

Returns a toolbar with an edit link.

In JavaScript, an enhanced toolbar will be initialized on top of the generated HTML.

Parameters
string$specialPageNamethe special page for the button
string[]$specialPageUrlParamsAdditional URL params for the special page
Returns
string

◆ getLabelDescriptionAliasesEditSection()

Wikibase\View\ToolbarEditSectionGenerator::getLabelDescriptionAliasesEditSection ( $languageCode,
EntityId $entityId = null )

Returns HTML allowing to edit the section containing label, description and aliases.

Parameters
string$languageCode
EntityId | null$entityId
Returns
string

Implements Wikibase\View\EditSectionGenerator.

◆ getSiteLinksEditSection()

Wikibase\View\ToolbarEditSectionGenerator::getSiteLinksEditSection ( EntityId $entityId = null)

Returns HTML allowing to edit site links.

Parameters
EntityId | null$entityId
Returns
string HTML

Implements Wikibase\View\EditSectionGenerator.

◆ getStatementEditSection()

Wikibase\View\ToolbarEditSectionGenerator::getStatementEditSection ( Statement $statement)

Returns HTML allowing to edit a statement.

Parameters
Statement$statement
Returns
string HTML

Implements Wikibase\View\EditSectionGenerator.

◆ getToolbarButton()

Wikibase\View\ToolbarEditSectionGenerator::getToolbarButton ( $cssClassSuffix,
$buttonLabel,
$editUrl = null )
private
Parameters
string$cssClassSuffix
string$buttonLabelthe text to show on the toolbar button link
string | null$editUrl
Returns
string

◆ getToolbarContainer()

Wikibase\View\ToolbarEditSectionGenerator::getToolbarContainer ( $content)
private

Member Data Documentation

◆ $specialPageLinker

Wikibase\View\ToolbarEditSectionGenerator::$specialPageLinker
private

◆ $templateFactory

Wikibase\View\ToolbarEditSectionGenerator::$templateFactory
private

◆ $textProvider

Wikibase\View\ToolbarEditSectionGenerator::$textProvider
private

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