Utility for expanding placeholders left in the HTML.
More...
|
| __construct (TemplateFactory $templateFactory, User $user, EntityDocument $entity, array $termsLanguages, LanguageDirectionalityLookup $languageDirectionalityLookup, LanguageNameLookup $languageNameLookup, LocalizedTextProvider $textProvider, UserOptionsLookup $userOptionsLookup, $cookiePrefix, array $termsListItems=[]) |
|
| getHtmlForPlaceholder ( $name) |
| Callback for expanding placeholders to HTML, for use as a callback passed to with TextInjector::inject(). More...
|
|
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()
- Parameters
-
TemplateFactory | $templateFactory | |
User | $user | the current user |
EntityDocument | $entity | |
string[] | $termsLanguages | |
LanguageDirectionalityLookup | $languageDirectionalityLookup | |
LanguageNameLookup | $languageNameLookup | |
LocalizedTextProvider | $textProvider | |
UserOptionsLookup | $userOptionsLookup | |
string | $cookiePrefix | |
string[] | $termsListItems | |
◆ expandPlaceholder()
Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::expandPlaceholder |
( |
|
$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.
- Parameters
-
- Returns
- string
◆ 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
◆ $cookiePrefix
Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::$cookiePrefix |
|
private |
◆ $entity
Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::$entity |
|
private |
◆ $languageDirectionalityLookup
Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::$languageDirectionalityLookup |
|
private |
◆ $languageNameLookup
Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::$languageNameLookup |
|
private |
◆ $templateFactory
Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::$templateFactory |
|
private |
◆ $termsLanguages
Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::$termsLanguages |
|
private |
◆ $termsListItems
Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::$termsListItems |
|
private |
◆ $textProvider
Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::$textProvider |
|
private |
◆ $user
Wikibase\Repo\ParserOutput\PlaceholderExpander\EntityViewPlaceholderExpander::$user |
|
private |
◆ $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: