Utility for expanding placeholders left in the HTML.
More...
|
| __construct (TemplateFactory $templateFactory, UserIdentity $user, EntityDocument $entity, array $termsLanguages, LanguageDirectionalityLookup $languageDirectionalityLookup, LanguageNameLookup $languageNameLookup, LocalizedTextProvider $textProvider, UserOptionsLookup $userOptionsLookup, LanguageFallbackChainFactory $languageFallbackChainFactory, bool $mulEnabled, array $termsListItems=[]) |
|
| getHtmlForPlaceholder ( $name) |
| Callback for expanding placeholders to HTML, for use as a callback passed to with TextInjector::inject().
|
|
Utility for expanding placeholders left in the HTML.
This is used to inject any non-cacheable information into the HTML that was cached as part of the ParserOutput.
- Copyright
- GPL-2.0-or-later
- Author
- Daniel Kinzler
-
Adrian Heine adria.nosp@m.n.he.nosp@m.ine@w.nosp@m.ikim.nosp@m.edia..nosp@m.de
◆ __construct()
Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::__construct |
( |
TemplateFactory | $templateFactory, |
|
|
UserIdentity | $user, |
|
|
EntityDocument | $entity, |
|
|
array | $termsLanguages, |
|
|
LanguageDirectionalityLookup | $languageDirectionalityLookup, |
|
|
LanguageNameLookup | $languageNameLookup, |
|
|
LocalizedTextProvider | $textProvider, |
|
|
UserOptionsLookup | $userOptionsLookup, |
|
|
LanguageFallbackChainFactory | $languageFallbackChainFactory, |
|
|
bool | $mulEnabled, |
|
|
array | $termsListItems = [] ) |
- Parameters
-
TemplateFactory | $templateFactory | |
UserIdentity | $user | the current user |
EntityDocument | $entity | |
string[] | $termsLanguages | |
LanguageDirectionalityLookup | $languageDirectionalityLookup | |
LanguageNameLookup | $languageNameLookup | |
LocalizedTextProvider | $textProvider | |
UserOptionsLookup | $userOptionsLookup | |
LanguageFallbackChainFactory | $languageFallbackChainFactory | |
bool | $mulEnabled | |
string[] | $termsListItems | |
◆ expandPlaceholder()
Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::expandPlaceholder |
( |
string | $name | ) |
|
|
private |
Dispatch the expansion of placeholders based on the name.
- Note
- This encodes knowledge about which placeholders are used by EntityView with what intended meaning.
◆ getHtmlForPlaceholder()
Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::getHtmlForPlaceholder |
( |
| $name | ) |
|
Callback for expanding placeholders to HTML, for use as a callback passed to with TextInjector::inject().
- Note
- This delegates to expandPlaceholder, which encapsulates knowledge about the meaning of each placeholder name, as used by EntityView.
- Parameters
-
string | $name | the name (or kind) of placeholder; determines how the expansion is done. |
- Returns
- string HTML to be substituted for the placeholder in the output.
Implements Wikibase\Repo\ParserOutput\PlaceholderExpander\PlaceholderExpander.
◆ isInitiallyCollapsed()
Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::isInitiallyCollapsed |
( |
| ) |
|
|
private |
- Returns
- bool If the terms list should be initially collapsed for the current user.
◆ renderTermBox()
Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::renderTermBox |
( |
| ) |
|
|
private |
Generates HTML of the term box, to be injected into the entity page.
- Exceptions
-
- Returns
- string HTML
◆ $entity
EntityDocument Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::$entity |
|
private |
◆ $languageDirectionalityLookup
◆ $languageFallbackChainFactory
◆ $languageNameLookup
LanguageNameLookup Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::$languageNameLookup |
|
private |
◆ $mulEnabled
bool Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::$mulEnabled |
|
private |
◆ $templateFactory
TemplateFactory Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::$templateFactory |
|
private |
◆ $termsLanguages
array Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::$termsLanguages |
|
private |
◆ $termsListItems
array Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::$termsListItems |
|
private |
◆ $textProvider
LocalizedTextProvider Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::$textProvider |
|
private |
◆ $user
UserIdentity Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::$user |
|
private |
◆ $userOptionsLookup
UserOptionsLookup Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::$userOptionsLookup |
|
private |
◆ INITIALLY_COLLAPSED_SETTING_NAME
const Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::INITIALLY_COLLAPSED_SETTING_NAME = 'wikibase-entitytermsview-showEntitytermslistview' |
The documentation for this class was generated from the following file: