r52806 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52805‎ | r52806 | r52807 >
Date:21:22, 6 July 2009
Author:tparscal
Status:ok
Tags:
Comment:
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
Modified paths:
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/skins/Vector.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/Vector.php
@@ -63,7 +63,7 @@
6464 'actions' => array(),
6565 'variants' => array()
6666 );
67 -
 67+
6868 // Detects parameters
6969 $action = $wgRequest->getVal( 'action', 'view' );
7070 $section = $wgRequest->getVal( 'section' );
@@ -79,11 +79,16 @@
8080 $isTalk = $this->mTitle->isTalkPage();
8181
8282 // Generates XML IDs from namespace names
83 - $subjectId = $wgContLang->lc( $this->mTitle->getSubjectNsText() );
 83+ $subjectId = $wgContLang->lc($wgCanonicalNamespaceNames[MWNamespace::getSubject($this->mTitle->getNamespace())]);
 84+
8485 if ( $subjectId == '' ) {
8586 $subjectId = 'main';
8687 }
87 - $talkId = "{$subjectId}_talk";
 88+ if ( $subjectId == 'main' ) {
 89+ $talkId = 'talk';
 90+ } else {
 91+ $talkId = "{$subjectId}_talk";
 92+ }
8893 $currentId = $isTalk ? $talkId : $subjectId;
8994
9095 // Adds namespace links
@@ -93,7 +98,7 @@
9499 $links['namespaces'][$talkId] = $this->tabAction(
95100 $talkPage, 'vector-namespace-talk', $isTalk, '', true
96101 );
97 -
 102+
98103 // Adds view view link
99104 if ( $this->mTitle->exists() ) {
100105 $links['views']['view'] = $this->tabAction(
@@ -103,7 +108,7 @@
104109 }
105110
106111 wfProfileIn( __METHOD__ . '-edit' );
107 -
 112+
108113 // Checks if user can...
109114 if (
110115 // edit the current page
@@ -396,7 +401,7 @@
397402 $this->data['view_urls'] = $nav['views'];
398403 $this->data['action_urls'] = $nav['actions'];
399404 $this->data['variant_urls'] = $nav['variants'];
400 -
 405+
401406 // Build additional attributes for personal_urls
402407 foreach ( $this->data['personal_urls'] as $key => $item) {
403408 $this->data['personal_urls'][$key]['attributes'] =
Index: trunk/phase3/docs/hooks.txt
@@ -1254,6 +1254,10 @@
12551255 [See http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/examples/Content_action.php
12561256 for an example]
12571257
 1258+'SkinTemplateNavigation': Alter the structured navigation links in SkinTemplates
 1259+&$links: Structured navigation links
 1260+This is used to alter the navigation for skins which use buildNavigationUrls such as Vector.
 1261+
12581262 'SkinTemplateOutputPageBeforeExec': Before SkinTemplate::outputPage()
12591263 starts page output
12601264 &$sktemplate: SkinTemplate object
@@ -1530,7 +1534,7 @@
15311535
15321536 'UserLoginMailPassword': Block users from emailing passwords
15331537 $name: the username to email the password of.
1534 -&$error: out-param ��the error message to return.
 1538+&$error: out-param ��the error message to return.
15351539
15361540 'UserLogout': before a user logs out
15371541 $user: the user object that is about to be logged out

Status & tagging log