Add SkinTemplateNavigation::SpecialPage and SkinTemplateNavigation::Universal hooks...
authorDaniel Friesen <dantman@users.mediawiki.org>
Fri, 31 Dec 2010 17:48:07 +0000 (17:48 +0000)
committerDaniel Friesen <dantman@users.mediawiki.org>
Fri, 31 Dec 2010 17:48:07 +0000 (17:48 +0000)
docs/hooks.txt
skins/Vector.php

index 2b3a9db..ea09f90 100644 (file)
@@ -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.
index 0ce3991..4181e01 100644 (file)
@@ -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;