Wikibase
MediaWiki Wikibase extension
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, UserLanguageLookup $userLanguageLookup, ContentLanguages $termsLanguages, EntityRevisionLookup $entityRevisionLookup, LanguageNameLookup $languageNameLookup, OutputPageEntityIdReader $outputPageEntityIdReader, EntityFactory $entityFactory, $cookiePrefix, OutputPageEditability $editability, $isExternallyRendered, UserPreferredContentLanguagesLookup $userPreferredTermsLanguages, OutputPageEntityViewChecker $entityViewChecker, LanguageFallbackChainFactory $languageFallbackChainFactory, LoggerInterface $logger=null)
 
 onOutputPageBeforeHTML ( $out, &$html)
 Called when pushing HTML from the ParserOutput into OutputPage. More...
 

Static Public Member Functions

static factory (Language $contentLanguage, HttpRequestFactory $httpRequestFactory, IBufferingStatsdDataFactory $statsdDataFactory, EntityContentFactory $entityContentFactory, EntityFactory $entityFactory, EntityIdParser $entityIdParser, LanguageFallbackChainFactory $languageFallbackChainFactory, LoggerInterface $logger, SettingsArray $settings, ContentLanguages $termsLanguages)
 

Private Member Functions

 replacePlaceholders (OutputPage $out, $html)
 
 addJsUserLanguages (OutputPage $out)
 
 getEntity (OutputPage $out)
 
 needsRealEntity (OutputPage $out)
 
 getPlaceholderExpander (EntityDocument $entity, OutputPage $out)
 
 getLocallyRenderedEntityViewPlaceholderExpander (EntityDocument $entity, OutputPage $out)
 
 getExternallyRenderedEntityViewPlaceholderExpander (OutputPage $out)
 
 getEntityTermsListHtml (OutputPage $out)
 
 showOrHideEditLinks (OutputPage $out, $html)
 
 getEntityId (OutputPage $out)
 

Private Attributes

 $httpRequestFactory
 
 $statsDataFactory
 
 $repoSettings
 
 $templateFactory
 
 $userLanguageLookup
 
 $termsLanguages
 
 $entityRevisionLookup
 
 $languageNameLookup
 
 $outputPageEntityIdReader
 
 $entityFactory
 
 $cookiePrefix
 
 $editability
 
 $isExternallyRendered
 
 $userPreferredTermsLanguages
 
 $entityViewChecker
 
 $languageFallbackChainFactory
 
 $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,
UserLanguageLookup  $userLanguageLookup,
ContentLanguages  $termsLanguages,
EntityRevisionLookup  $entityRevisionLookup,
LanguageNameLookup  $languageNameLookup,
OutputPageEntityIdReader  $outputPageEntityIdReader,
EntityFactory  $entityFactory,
  $cookiePrefix,
OutputPageEditability  $editability,
  $isExternallyRendered,
UserPreferredContentLanguagesLookup  $userPreferredTermsLanguages,
OutputPageEntityViewChecker  $entityViewChecker,
LanguageFallbackChainFactory  $languageFallbackChainFactory,
LoggerInterface  $logger = null 
)

Member Function Documentation

◆ addJsUserLanguages()

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

◆ factory()

static Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::factory ( Language  $contentLanguage,
HttpRequestFactory  $httpRequestFactory,
IBufferingStatsdDataFactory  $statsdDataFactory,
EntityContentFactory  $entityContentFactory,
EntityFactory  $entityFactory,
EntityIdParser  $entityIdParser,
LanguageFallbackChainFactory  $languageFallbackChainFactory,
LoggerInterface  $logger,
SettingsArray  $settings,
ContentLanguages  $termsLanguages 
)
static
Returns
self

◆ getEntity()

Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::getEntity ( OutputPage  $out)
private
Parameters
OutputPage$out
Returns
EntityDocument|null

◆ getEntityId()

Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::getEntityId ( OutputPage  $out)
private
Parameters
OutputPage$out
Returns
EntityId|null

◆ 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
Parameters
EntityDocument$entity
OutputPage$out
Returns
EntityViewPlaceholderExpander

◆ getPlaceholderExpander()

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

◆ needsRealEntity()

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

◆ 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,
  $html 
)
private
Parameters
OutputPage$out
string$html
Returns
string

◆ showOrHideEditLinks()

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

Member Data Documentation

◆ $cookiePrefix

Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::$cookiePrefix
private

◆ $editability

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

◆ $entityFactory

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

◆ $entityRevisionLookup

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

◆ $entityViewChecker

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

◆ $httpRequestFactory

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

◆ $isExternallyRendered

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

◆ $languageFallbackChainFactory

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

◆ $languageNameLookup

Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::$languageNameLookup
private

◆ $logger

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

◆ $outputPageEntityIdReader

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

◆ $repoSettings

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

◆ $statsDataFactory

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

◆ $templateFactory

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

◆ $termsLanguages

Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::$termsLanguages
private

◆ $userLanguageLookup

Wikibase\Repo\Hooks\OutputPageBeforeHTMLHookHandler::$userLanguageLookup
private

◆ $userPreferredTermsLanguages

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

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