Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler Class Reference

Handler for the "OutputPageBeforeHTML" hook. More...

+ Inheritance diagram for Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler:
+ Collaboration diagram for Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler:

Public Member Functions

 __construct (HttpRequestFactory $httpRequestFactory, IBufferingStatsdDataFactory $statsdDataFactory, SettingsArray $repoSettings, TemplateFactory $templateFactory, EntityRevisionLookup $entityRevisionLookup, LanguageNameLookupFactory $languageNameLookupFactory, OutputPageEntityIdReader $outputPageEntityIdReader, EntityFactory $entityFactory, OutputPageEditability $editability, $isExternallyRendered, UserPreferredContentLanguagesLookup $userPreferredTermsLanguages, OutputPageEntityViewChecker $entityViewChecker, LanguageFallbackChainFactory $languageFallbackChainFactory, UserOptionsLookup $userOptionsLookup, LanguageDirectionalityLookup $languageDirectionalityLookup, ?LoggerInterface $logger=null)
 
 onOutputPageBeforeHTML ( $out, &$html)
 Called when pushing HTML from the ParserOutput into OutputPage.
 

Static Public Member Functions

static factory (Language $contentLanguage, HttpRequestFactory $httpRequestFactory, IBufferingStatsdDataFactory $statsdDataFactory, UserOptionsLookup $userOptionsLookup, EntityContentFactory $entityContentFactory, EntityFactory $entityFactory, EntityIdParser $entityIdParser, EntityRevisionLookup $entityRevisionLookup, LanguageDirectionalityLookup $languageDirectionalityLookup, LanguageFallbackChainFactory $languageFallbackChainFactory, LanguageNameLookupFactory $languageNameLookupFactory, LoggerInterface $logger, SettingsArray $settings, ContentLanguages $termsLanguages)
 

Private Member Functions

 replacePlaceholders (OutputPage $out, string $html)
 
 getEntity (OutputPage $out)
 
 getPlaceholderExpander (EntityDocument $entity, OutputPage $out)
 
 getLocallyRenderedEntityViewPlaceholderExpander (EntityDocument $entity, OutputPage $out)
 
 getTermsLanguages (array $userPreferredTermsLanguages, EntityDocument $entity, array $entityTermsListHtml)
 Get the term languages to use for the current user and entity.
 
 getExternallyRenderedEntityViewPlaceholderExpander (OutputPage $out)
 
 getEntityTermsListHtml (OutputPage $out)
 
 showOrHideEditLinks (OutputPage $out, string $html)
 
 getEntityId (OutputPage $out)
 

Private Attributes

HttpRequestFactory $httpRequestFactory
 
IBufferingStatsdDataFactory $statsDataFactory
 
SettingsArray $repoSettings
 
TemplateFactory $templateFactory
 
EntityRevisionLookup $entityRevisionLookup
 
LanguageNameLookupFactory $languageNameLookupFactory
 
OutputPageEntityIdReader $outputPageEntityIdReader
 
EntityFactory $entityFactory
 
OutputPageEditability $editability
 
bool $isExternallyRendered
 
UserPreferredContentLanguagesLookup $userPreferredTermsLanguages
 
OutputPageEntityViewChecker $entityViewChecker
 
LanguageFallbackChainFactory $languageFallbackChainFactory
 
LanguageDirectionalityLookup $languageDirectionalityLookup
 
UserOptionsLookup $userOptionsLookup
 
LoggerInterface $logger
 

Detailed Description

Handler for the "OutputPageBeforeHTML" hook.

Author
Marius Hoch < hoo@o.nosp@m.nlin.nosp@m.e.de >

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::__construct ( HttpRequestFactory $httpRequestFactory,
IBufferingStatsdDataFactory $statsdDataFactory,
SettingsArray $repoSettings,
TemplateFactory $templateFactory,
EntityRevisionLookup $entityRevisionLookup,
LanguageNameLookupFactory $languageNameLookupFactory,
OutputPageEntityIdReader $outputPageEntityIdReader,
EntityFactory $entityFactory,
OutputPageEditability $editability,
$isExternallyRendered,
UserPreferredContentLanguagesLookup $userPreferredTermsLanguages,
OutputPageEntityViewChecker $entityViewChecker,
LanguageFallbackChainFactory $languageFallbackChainFactory,
UserOptionsLookup $userOptionsLookup,
LanguageDirectionalityLookup $languageDirectionalityLookup,
?LoggerInterface $logger = null )

Member Function Documentation

◆ factory()

static Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::factory ( Language $contentLanguage,
HttpRequestFactory $httpRequestFactory,
IBufferingStatsdDataFactory $statsdDataFactory,
UserOptionsLookup $userOptionsLookup,
EntityContentFactory $entityContentFactory,
EntityFactory $entityFactory,
EntityIdParser $entityIdParser,
EntityRevisionLookup $entityRevisionLookup,
LanguageDirectionalityLookup $languageDirectionalityLookup,
LanguageFallbackChainFactory $languageFallbackChainFactory,
LanguageNameLookupFactory $languageNameLookupFactory,
LoggerInterface $logger,
SettingsArray $settings,
ContentLanguages $termsLanguages )
static

◆ getEntity()

Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::getEntity ( OutputPage $out)
private

◆ getEntityId()

Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::getEntityId ( OutputPage $out)
private

◆ getEntityTermsListHtml()

Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::getEntityTermsListHtml ( OutputPage $out)
private

◆ getExternallyRenderedEntityViewPlaceholderExpander()

Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::getExternallyRenderedEntityViewPlaceholderExpander ( OutputPage $out)
private

◆ getLocallyRenderedEntityViewPlaceholderExpander()

Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::getLocallyRenderedEntityViewPlaceholderExpander ( EntityDocument $entity,
OutputPage $out )
private

◆ getPlaceholderExpander()

Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::getPlaceholderExpander ( EntityDocument $entity,
OutputPage $out )
private

◆ getTermsLanguages()

Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::getTermsLanguages ( array $userPreferredTermsLanguages,
EntityDocument $entity,
array $entityTermsListHtml )
private

Get the term languages to use for the current user and entity.

◆ onOutputPageBeforeHTML()

Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::onOutputPageBeforeHTML ( $out,
& $html )

Called when pushing HTML from the ParserOutput into OutputPage.

Used to expand any placeholders in the OutputPage's 'wb-placeholders' property in the HTML.

Parameters
OutputPage$out
string&$htmlthe HTML to mangle

◆ replacePlaceholders()

Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::replacePlaceholders ( OutputPage $out,
string $html )
private

◆ showOrHideEditLinks()

Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::showOrHideEditLinks ( OutputPage $out,
string $html )
private

Member Data Documentation

◆ $editability

OutputPageEditability Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::$editability
private

◆ $entityFactory

EntityFactory Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::$entityFactory
private

◆ $entityRevisionLookup

EntityRevisionLookup Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::$entityRevisionLookup
private

◆ $entityViewChecker

OutputPageEntityViewChecker Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::$entityViewChecker
private

◆ $httpRequestFactory

HttpRequestFactory Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::$httpRequestFactory
private

◆ $isExternallyRendered

bool Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::$isExternallyRendered
private

◆ $languageDirectionalityLookup

LanguageDirectionalityLookup Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::$languageDirectionalityLookup
private

◆ $languageFallbackChainFactory

LanguageFallbackChainFactory Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::$languageFallbackChainFactory
private

◆ $languageNameLookupFactory

LanguageNameLookupFactory Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::$languageNameLookupFactory
private

◆ $logger

LoggerInterface Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::$logger
private

◆ $outputPageEntityIdReader

OutputPageEntityIdReader Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::$outputPageEntityIdReader
private

◆ $repoSettings

SettingsArray Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::$repoSettings
private

◆ $statsDataFactory

IBufferingStatsdDataFactory Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::$statsDataFactory
private

◆ $templateFactory

TemplateFactory Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::$templateFactory
private

◆ $userOptionsLookup

UserOptionsLookup Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::$userOptionsLookup
private

◆ $userPreferredTermsLanguages

UserPreferredContentLanguagesLookup Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::$userPreferredTermsLanguages
private

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