From: Trevor Parscal Date: Mon, 6 Jul 2009 21:22:40 +0000 (+0000) Subject: Fixed bugs in the data structure of the result of buildNavigationUrls including inter... X-Git-Tag: 1.31.0-rc.0~41091 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=0d0a41ddcfa71727c540286792a4d9d3a3877268;p=lhc%2Fweb%2Fwiklou.git Fixed bugs in the data structure of the result of buildNavigationUrls including internationalized messages as keys (#19304), lack of documentation for the SkinTemplateNavigation hook (#19522) and an issue with an XML ID being ca-main_talk rather than ca-talk mentioned in #19471 --- diff --git a/docs/hooks.txt b/docs/hooks.txt index 85b4963d8b..30934fcc43 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -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 diff --git a/skins/Vector.php b/skins/Vector.php index 5f7b42c127..c910c993e0 100644 --- a/skins/Vector.php +++ b/skins/Vector.php @@ -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'] =