From 9893840edc0405f3ea4b3e883ae1fdf7023d3a8d Mon Sep 17 00:00:00 2001 From: Daniel Friesen Date: Fri, 31 Dec 2010 17:48:07 +0000 Subject: [PATCH] Add SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation::Universal hooks to match the content_actions based hooks that vector based hooks are missing. --- docs/hooks.txt | 5 ++++- skins/Vector.php | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index 2b3a9db6eb..ea09f90a2d 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1499,7 +1499,10 @@ $nav_urls: array of tabs [See http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/examples/Content_action.php for an example] -'SkinTemplateNavigation': Alter the structured navigation links in SkinTemplates +Alter the structured navigation links in SkinTemplates, there are three of these hooks called in different spots. +'SkinTemplateNavigation': Called on content pages before variants have been added +'SkinTemplateNavigation::SpecialPage': Called on special pages before variands have been added +'SkinTemplateNavigation::Universal': Called on both content and special pages after variants have been added &$sktemplate: SkinTemplate object &$links: Structured navigation links This is used to alter the navigation for skins which use buildNavigationUrls such as Vector. diff --git a/skins/Vector.php b/skins/Vector.php index 0ce3991784..4181e01833 100644 --- a/skins/Vector.php +++ b/skins/Vector.php @@ -305,6 +305,8 @@ class SkinVector extends SkinTemplate { 'text' => wfMsg( 'nstab-special' ), 'href' => $wgRequest->getRequestURL() ); + // Equiv to SkinTemplateBuildContentActionUrlsAfterSpecialPage + wfRunHooks( 'SkinTemplateNavigation::SpecialPage', array( &$this, &$links ) ); } // Gets list of language variants @@ -331,6 +333,9 @@ class SkinVector extends SkinTemplate { } } + // Equiv to SkinTemplateContentActions + wfRunHooks( 'SkinTemplateNavigation::Universal', array( &$this, &$links ) ); + wfProfileOut( __METHOD__ ); return $links; -- 2.20.1