Pass OutputPage to SkinTemplateGetLanguageLink hook.
authordaniel <daniel.kinzler@wikimedia.de>
Tue, 9 Sep 2014 10:34:24 +0000 (12:34 +0200)
committerdaniel <daniel.kinzler@wikimedia.de>
Tue, 9 Sep 2014 10:56:43 +0000 (12:56 +0200)
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
docs/hooks.txt
includes/skins/SkinTemplate.php

index 74521c3..e13654e 100644 (file)
@@ -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
index ec2cc78..9ac2271 100644 (file)
@@ -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:
index 93845aa..b66862b 100644 (file)
@@ -200,7 +200,7 @@ class SkinTemplate extends Skin {
                                );
                                wfRunHooks(
                                        'SkinTemplateGetLanguageLink',
-                                       array( &$languageLink, $languageLinkTitle, $this->getTitle() )
+                                       array( &$languageLink, $languageLinkTitle, $this->getTitle(), $this->getOutput() )
                                );
                                $languageLinks[] = $languageLink;
                        }