Fixed bugs in the data structure of the result of buildNavigationUrls including inter...
[lhc/web/wiklou.git] / skins / Vector.php
index 93df526..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,13 +79,18 @@ 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
                        $links['namespaces'][$subjectId] = $this->tabAction(
                                $subjectPage, 'vector-namespace-' . $subjectId, !$isTalk, '', true
@@ -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
@@ -292,7 +297,10 @@ class SkinVector extends SkinTemplate {
                                        );
                                }
                        }
-
+                       
+                       // This is instead of SkinTemplateTabs - which uses a flat array
+                       wfRunHooks( 'SkinTemplateNavigation', array( &$this, &$links ) );
+               
                // If it's not content, it's got to be a special page
                } else {
                        $links['namespaces']['special'] = array(
@@ -393,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'] = 
@@ -569,7 +577,7 @@ class VectorTemplate extends QuickTemplate {
                                <!-- variants -->
                                <?php if ( count( $this->data['variant_urls'] ) > 0 ): ?>
                                <div id="variants">
-                                       <h5><div class="icon"><span><?php $this->msg('variants') ?></span></div></h5>
+                                       <h5><span><?php $this->msg('variants') ?></span><a href="#">&nbsp;</a></h5>
                                        <div class="menu">
                                                <ul <?php $this->html('userlangattributes') ?>>
                                                        <?php foreach ($this->data['variant_urls'] as $key => $link ): ?>