http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89570

Revision: 89570
Author:   robin
Date:     2011-06-06 15:24:34 +0000 (Mon, 06 Jun 2011)
Log Message:
-----------
Fixing one thing breaks another one.. I hope this doesn't break anything :)

Modified Paths:
--------------
    trunk/extensions/WikimediaIncubator/IncubatorTest.php
    trunk/extensions/WikimediaIncubator/SpecialViewUserLang.php

Modified: trunk/extensions/WikimediaIncubator/IncubatorTest.php
===================================================================
--- trunk/extensions/WikimediaIncubator/IncubatorTest.php       2011-06-06 
15:15:43 UTC (rev 89569)
+++ trunk/extensions/WikimediaIncubator/IncubatorTest.php       2011-06-06 
15:24:34 UTC (rev 89570)
@@ -125,15 +125,16 @@
        */
        static function displayPrefix( $project = '', $code = '' ) {
                global $wgUser, $wmincPref;
-               if ( ($project && $code) || self::isContentProject() ) {
+               $projectvalue = ( $project ? $project : 
$wgUser->getOption($wmincPref . '-project') );
+               $codevalue = ( $code ? $code : $wgUser->getOption($wmincPref . 
'-code') );
+               if ( self::isContentProject( $projectvalue ) ) {
                        // if parameters are set OR it falls back to user pref 
and
                        // he has a content project pref set  -> return the 
prefix
-                       return 'W' . ( $project ? $project : 
$wgUser->getOption($wmincPref . '-project') ) .
-                               '/' . ( $code ? $code : 
$wgUser->getOption($wmincPref . '-code') ); // return the prefix
+                       return 'W' . $projectvalue . '/' . $codevalue; // 
return the prefix
                } else {
                        // fall back to user pref with NO content pref set
                        // -> still provide the value (probably 'none' or 'inc')
-                       return $wgUser->getOption($wmincPref . '-project');
+                       return $projectvalue;
                }
        }
 

Modified: trunk/extensions/WikimediaIncubator/SpecialViewUserLang.php
===================================================================
--- trunk/extensions/WikimediaIncubator/SpecialViewUserLang.php 2011-06-06 
15:15:43 UTC (rev 89569)
+++ trunk/extensions/WikimediaIncubator/SpecialViewUserLang.php 2011-06-06 
15:24:34 UTC (rev 89570)
@@ -75,11 +75,10 @@
                        // show error if a user with that name does not exist
                        $wgOut->addHTML( Xml::span( wfMsg( 
'wminc-userdoesnotexist', $target ), 'error' ) );
                } else {
-                       $prefix = IncubatorTest::displayPrefix(
-                               $user->getOption( $wmincPref . '-project' ),
-                               $user->getOption( $wmincPref . '-code' )
-                       );
-                       if ( IncubatorTest::isContentProject() ) {
+                       $userproject = $user->getOption( $wmincPref . 
'-project' );
+                       $usercode = $user->getOption( $wmincPref . '-code' );
+                       $prefix = IncubatorTest::displayPrefix( $userproject, 
$usercode );
+                       if ( IncubatorTest::isContentProject( $userproject ) ) {
                                $testwiki = $sk->link( Title::newFromText( 
$prefix ) );
                        } elseif ( $prefix == $wmincProjectSite['short'] ) {
                                $testwiki = htmlspecialchars( 
$wmincProjectSite['name'] );


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to