From 27593136bb2eae6d1d0c406f32d90af343f43830 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 9 Sep 2014 12:34:24 +0200 Subject: [PATCH] Pass OutputPage to SkinTemplateGetLanguageLink hook. Hook handlers should have access to the OutputPage object, so they can use information stored there for generating language links. This is needed to allow efficient generation of "badges" by the Wikibase extension. Change-Id: Ic479e2fa5cc3a4d663e478858caee2742e6805b9 --- RELEASE-NOTES-1.24 | 1 + docs/hooks.txt | 5 +++-- includes/skins/SkinTemplate.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES-1.24 b/RELEASE-NOTES-1.24 index 74521c3f17..e13654e4fc 100644 --- a/RELEASE-NOTES-1.24 +++ b/RELEASE-NOTES-1.24 @@ -449,6 +449,7 @@ changes to languages because of Bugzilla reports. called unconditionally. * TablePager::getBody() is now 'final' and can't be overridden in subclasses. * TablePager::getBody() is deprecated, use getBodyOutput() or getFullOutput(). +* Added $outputPage parameter to the SkinTemplateGetLanguageLink hook. * log_page for move log entries store the original page ID, rather than that of the new redirect page. This is not retroactive. * LCStoreAccel was removed. $wgLocalisationCacheConf can no longer be set to diff --git a/docs/hooks.txt b/docs/hooks.txt index ec2cc785fd..9ac2271d54 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -2330,8 +2330,9 @@ $nav_urls: array of tabs which the actual html is constructed. &$languageLink: array containing data about the link. The following keys can be modified: href, text, title, class, lang, hreflang. Each of them is a string. -$languageLinkTitle: Title object belonging to the external language link -$title: Title object of the page the link belongs to +$languageLinkTitle: Title object belonging to the external language link. +$title: Title object of the page the link belongs to. +$outputPage: The OutputPage object the links are built from. To alter the structured navigation links in SkinTemplates, there are three hooks called in different spots: diff --git a/includes/skins/SkinTemplate.php b/includes/skins/SkinTemplate.php index 93845aa24f..b66862b828 100644 --- a/includes/skins/SkinTemplate.php +++ b/includes/skins/SkinTemplate.php @@ -200,7 +200,7 @@ class SkinTemplate extends Skin { ); wfRunHooks( 'SkinTemplateGetLanguageLink', - array( &$languageLink, $languageLinkTitle, $this->getTitle() ) + array( &$languageLink, $languageLinkTitle, $this->getTitle(), $this->getOutput() ) ); $languageLinks[] = $languageLink; } -- 2.20.1