Fixed bugs in the data structure of the result of buildNavigationUrls including inter...
authorTrevor Parscal <tparscal@users.mediawiki.org>
Mon, 6 Jul 2009 21:22:40 +0000 (21:22 +0000)
committerTrevor Parscal <tparscal@users.mediawiki.org>
Mon, 6 Jul 2009 21:22:40 +0000 (21:22 +0000)
docs/hooks.txt
skins/Vector.php

index 85b4963..30934fc 100644 (file)
@@ -1254,6 +1254,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
+&$links: Structured navigation links
+This is used to alter the navigation for skins which use buildNavigationUrls such as Vector.
+
 'SkinTemplateOutputPageBeforeExec': Before SkinTemplate::outputPage()
 starts page output
 &$sktemplate: SkinTemplate object
@@ -1530,7 +1534,7 @@ $template: SimpleTemplate instance for the form
 
 'UserLoginMailPassword': Block users from emailing passwords
 $name: the username to email the password of.
-&$error: out-param ÐÊthe error message to return.
+&$error: out-param ��the error message to return.
 
 'UserLogout': before a user logs out
 $user: the user object that is about to be logged out
index 5f7b42c..c910c99 100644 (file)
@@ -63,7 +63,7 @@ class SkinVector extends SkinTemplate {
                        'actions' => array(),
                        'variants' => array()
                );
-
+               
                // Detects parameters
                $action = $wgRequest->getVal( 'action', 'view' );
                $section = $wgRequest->getVal( 'section' );
@@ -79,11 +79,16 @@ class SkinVector extends SkinTemplate {
                        $isTalk = $this->mTitle->isTalkPage();
 
                        // Generates XML IDs from namespace names
-                       $subjectId = $wgContLang->lc( $this->mTitle->getSubjectNsText() );
+                       $subjectId = $wgContLang->lc($wgCanonicalNamespaceNames[MWNamespace::getSubject($this->mTitle->getNamespace())]);
+                       
                        if ( $subjectId == '' ) {
                                $subjectId = 'main';
                        }
-                       $talkId = "{$subjectId}_talk";
+                       if ( $subjectId == 'main' ) {
+                               $talkId = 'talk';
+                       } else {
+                               $talkId = "{$subjectId}_talk";
+                       }
                        $currentId = $isTalk ? $talkId : $subjectId;
                        
                        // Adds namespace links
@@ -93,7 +98,7 @@ class SkinVector extends SkinTemplate {
                        $links['namespaces'][$talkId] = $this->tabAction(
                                $talkPage, 'vector-namespace-talk', $isTalk, '', true
                        );
-
+                       
                        // Adds view view link
                        if ( $this->mTitle->exists() ) {
                                $links['views']['view'] = $this->tabAction(
@@ -103,7 +108,7 @@ class SkinVector extends SkinTemplate {
                        }
                        
                        wfProfileIn( __METHOD__ . '-edit' );
-
+                       
                        // Checks if user can...
                        if (
                                // edit the current page
@@ -396,7 +401,7 @@ class VectorTemplate extends QuickTemplate {
                $this->data['view_urls'] = $nav['views'];
                $this->data['action_urls'] = $nav['actions'];
                $this->data['variant_urls'] = $nav['variants'];
-
+               
                // Build additional attributes for personal_urls
                foreach ( $this->data['personal_urls'] as $key => $item) {
                        $this->data['personal_urls'][$key]['attributes'] =