r60829 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60828‎ | r60829 | r60830 >
Date:03:34, 8 January 2010
Author:mah
Status:ok (Comments)
Tags:
Comment:
Follow up r60798 & r60785
Re-introduce specialpageattributes and add an explanation in the comments why it should be different than userlangattributes. Also add comments explaining exactly what is going with the special attributes and why. Clean up warnings.
Modified paths:
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/skins/Modern.php (modified) (history)
  • /trunk/phase3/skins/MonoBook.php (modified) (history)
  • /trunk/phase3/skins/Vector.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/MonoBook.php
@@ -81,7 +81,7 @@
8282 class="mediawiki <?php $this->text('dir'); $this->text('capitalizeallnouns') ?> <?php $this->text('pageclass') ?> <?php $this->text('skinnameclass') ?>">
8383 <div id="globalWrapper">
8484 <div id="column-content">
85 - <div id="content" <?php $this->html("userlangattributes") ?>>
 85+ <div id="content" <?php $this->html("specialpageattributes") ?>>
8686 <a id="top"></a>
8787 <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
8888 <h1 id="firstHeading" class="firstHeading"><?php $this->html('title') ?></h1>
Index: trunk/phase3/skins/Modern.php
@@ -113,7 +113,7 @@
114114 <!-- contentholder does nothing by default, but it allows users to style the text inside
115115 the content area without affecting the meaning of 'em' in #mw_content, which is used
116116 for the margins -->
117 - <div id="mw_contentholder" <?php $this->html("userlangattributes") ?>>
 117+ <div id="mw_contentholder" <?php $this->html("specialpageattributes") ?>>
118118 <div class='mw-topboxes'>
119119 <div id="mw-js-message" style="display:none;" <?php $this->html('userlangattributes')?>></div>
120120 <div class="mw-topbox" id="siteSub"><?php $this->msg('tagline') ?></div>
Index: trunk/phase3/skins/Vector.php
@@ -463,7 +463,7 @@
464464 <div id="page-base" class="noprint"></div>
465465 <div id="head-base" class="noprint"></div>
466466 <!-- content -->
467 - <div id="content" <?php $this->html('userlangattributes') ?>>
 467+ <div id="content" <?php $this->html('specialpageattributes') ?>>
468468 <a id="top"></a>
469469 <div id="mw-js-message" style="display:none;" <?php $this->html('userlangattributes') ?>></div>
470470 <?php if ( $this->data['sitenotice'] ): ?>
Index: trunk/phase3/includes/SkinTemplate.php
@@ -304,8 +304,27 @@
305305 $tpl->setRef( 'userpage', $this->userpage );
306306 $tpl->setRef( 'userpageurl', $this->userpageUrlDetails['href'] );
307307 $tpl->set( 'userlang', $wgLang->getCode() );
308 - $tpl->set( 'userlangattributes', 'lang="' . $wgLang->getCode() . '" xml:lang="' . $wgLang->getCode() . '" dir="' . $wgLang->getDir() . '"');
309308
 309+ // Users can have their language set differently than the
 310+ // content of the wiki. For these users, tell the web browser
 311+ // that interface elements are in a different language.
 312+ $tpl->set( 'userlangattributes', '');
 313+ $tpl->set( 'specialpageattributes', '');
 314+
 315+ $code = $wgLang->getCode();
 316+ $dir = $wgLang->getDir();
 317+ if ( $code !== $wgContLang->getCode() || $dir !== $wgContLang->getDir() ) {
 318+ $attrs = "lang='$lang' xml:lang='$lang' dir='$dir'";
 319+
 320+ $tpl->set( 'userlangattributes', $attrs );
 321+
 322+ // The content of SpecialPages should be presented in the
 323+ // user's language. Content of regular pages should not be touched.
 324+ if($this->mTitle->isSpecialPage()) {
 325+ $tpl->set( 'specialpageattributes', $attrs );
 326+ }
 327+ }
 328+
310329 $newtalks = $wgUser->getNewMessageLinks();
311330
312331 if( count( $newtalks ) == 1 && $newtalks[0]['wiki'] === wfWikiID() ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r60833follow up r60829...mah08:49, 8 January 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r60785added preliminary labels for using the new datatype for multi-valued properti...mkroetzsch09:02, 7 January 2010
r60786Make LTR wgLang do the right thing on RTL wgContLang wikis. See bug 6100 and...mah09:32, 7 January 2010
r60798Per Raymond's comment on r60735: capitalise "Username" and "Password"ialex18:55, 7 January 2010

Comments

#Comment by Raymond (talk | contribs)   08:32, 8 January 2010

Seen at translatewiki:

PHP Notice: Undefined variable: lang in /var/www/w/includes/SkinTemplate.php on line 317

#Comment by MarkAHershberger (talk | contribs)   08:49, 8 January 2010
  • sigh* fixed. I promise I'll have E_STRICT working by next week.

Status & tagging log