[MediaWiki-CVS] SVN: [70624] trunk/extensions/SocialProfile/UserProfile/SpecialUploadAvatar .php

2010-08-07 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/70624

Revision: 70624
Author:   ashley
Date: 2010-08-07 12:15:23 + (Sat, 07 Aug 2010)

Log Message:
---
SocialProfile: improve docs, mark one private function as such and remove one 
unused global

Modified Paths:
--
trunk/extensions/SocialProfile/UserProfile/SpecialUploadAvatar.php

Modified: trunk/extensions/SocialProfile/UserProfile/SpecialUploadAvatar.php
===
--- trunk/extensions/SocialProfile/UserProfile/SpecialUploadAvatar.php  
2010-08-07 11:47:37 UTC (rev 70623)
+++ trunk/extensions/SocialProfile/UserProfile/SpecialUploadAvatar.php  
2010-08-07 12:15:23 UTC (rev 70624)
@@ -1,8 +1,9 @@
 ?php
 /**
- * A special page for uploading Avatars
- * This page is a big hack -- its just the image upload page with some changes 
to
- * upload the actual avatar files.  The avatars are not held as MediaWiki 
images, but
+ * A special page for uploading avatars
+ * This page is a big hack -- it's just the image upload page with some changes
+ * to upload the actual avatar files.
+ * The avatars are not held as MediaWiki images, but
  * rather based on the user_id and in multiple sizes
  *
  * Requirements: Need writable directory $wgUploadPath/avatars
@@ -60,10 +61,11 @@
 
/**
 * Show some text and linkage on successful upload.
-* @access private
+*
+* @param $ext String: file extension (gif, jpg or png)
 */
-   function showSuccess( $ext ) {
-   global $wgUser, $wgOut, $wgContLang, $wgDBname, $wgUploadPath, 
$wgUploadAvatarInRecentChanges;
+   private function showSuccess( $ext ) {
+   global $wgUser, $wgOut, $wgDBname, $wgUploadPath, 
$wgUploadAvatarInRecentChanges;
 
$log = new LogPage( wfMsgForContent( 'user-profile-picture-log' 
) );
if ( !$wgUploadAvatarInRecentChanges ) {
@@ -121,8 +123,10 @@
 * Displays the main upload form, optionally with a highlighted
 * error message up at the top.
 *
-* @param string $msg as HTML
-* @access private
+* @param $msg String: error message as HTML
+* @param $sessionKey String: session key in case this is a stashed 
upload
+* @param $hideIgnoreWarning Boolean: whether to hide ignore warning 
check box
+* @return HTML output
 */
protected function getUploadForm( $message = '', $sessionKey = '', 
$hideIgnoreWarning = false ) {
global $wgOut, $wgUser, $wgLang, $wgUploadDirectory, 
$wgRequest, $wgUseCopyrightUpload;
@@ -212,6 +216,13 @@
return $output;
}
 
+   /**
+* Gets an avatar image with the specified size
+*
+* @param $size String: size of the image ('s' for small, 'm' for 
medium,
+* 'ml' for medium-large and 'l' for large)
+* @return String: full img HTML tag
+*/
function getAvatar( $size ) {
global $wgUser, $wgDBname, $wgUploadDirectory, $wgUploadPath;
$files = glob( $wgUploadDirectory . '/avatars/' . $wgDBname . 
'_' . $wgUser-getID() . '_' . $size . * );



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [70625] trunk/extensions/SocialProfile/UserProfile/SpecialRemoveAvatar .php

2010-08-07 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/70625

Revision: 70625
Author:   ashley
Date: 2010-08-07 12:27:38 + (Sat, 07 Aug 2010)

Log Message:
---
SocialProfile: fix PHP notice (Notice: Undefined offset: 0 in 
..\extensions\SocialProfile\UserProfile\SpecialRemoveAvatar.php on line 126), 
expand docs and mark functions as private

Modified Paths:
--
trunk/extensions/SocialProfile/UserProfile/SpecialRemoveAvatar.php

Modified: trunk/extensions/SocialProfile/UserProfile/SpecialRemoveAvatar.php
===
--- trunk/extensions/SocialProfile/UserProfile/SpecialRemoveAvatar.php  
2010-08-07 12:15:23 UTC (rev 70624)
+++ trunk/extensions/SocialProfile/UserProfile/SpecialRemoveAvatar.php  
2010-08-07 12:27:38 UTC (rev 70625)
@@ -1,5 +1,10 @@
 ?php
-
+/**
+ * A special page for privileged users to remove other users' avatars.
+ *
+ * @file
+ * @ingroup Extensions
+ */
 class RemoveAvatar extends SpecialPage {
 
/**
@@ -19,25 +24,25 @@
 
$this-title = SpecialPage::getTitleFor( 'RemoveAvatar' );
 
-   # If the user isn't logged in, display an error
+   // If the user isn't logged in, display an error
if ( !$wgUser-isLoggedIn() ) {
$this-displayRestrictionError();
return;
}
 
-   # If the user doesn't have 'avatarremove' permission, display 
an error
+   // If the user doesn't have 'avatarremove' permission, display 
an error
if ( !$wgUser-isAllowed( 'avatarremove' ) ) {
$this-displayRestrictionError();
return;
}
 
-   # Show a message if the database is in read-only mode
+   // Show a message if the database is in read-only mode
if ( wfReadOnly() ) {
$wgOut-readOnlyPage();
return;
}
 
-   # If user is blocked, s/he doesn't need to access this page
+   // If user is blocked, s/he doesn't need to access this page
if ( $wgUser-isBlocked() ) {
$wgOut-blockedPage();
return;
@@ -82,10 +87,11 @@
 
/**
 * Show the form for retrieving a user's current avatar
+* @return HTML
 */
-   function showUserForm() {
-   $output = 'form method=get name=avatar action='
-   . Xml::hidden( 'title', $this-getTitle() ) .
+   private function showUserForm() {
+   $output = 'form method=get name=avatar action=' .
+   Xml::hidden( 'title', $this-getTitle() ) .
'b' . wfMsg( 'username' ) . '/b
input type=text name=user /
input type=submit value=' . wfMsg( 'search' 
) . ' /
@@ -95,8 +101,10 @@
 
/**
 * Shows the requested user's current avatar and the button for 
deleting it
+*
+* @param $user_name String: name of the user whose avatars we want to 
delete
 */
-   function showUserAvatar( $user_name ) {
+   private function showUserAvatar( $user_name ) {
$user_name = str_replace( '_', ' ', $user_name ); // replace 
underscores with spaces
$user_id = User::idFromName( $user_name );
 
@@ -115,15 +123,17 @@
/**
 * Deletes all of the requested user's avatar images from the filesystem
 *
-* @param $id Int: user ID
-* @param $size Int: size of the avatar image to delete (small, medium 
or large).
+* @param $id Integer: user ID
+* @param $size String: size of the avatar image to delete (small, 
medium or large).
 *  Doesn't really matter since we're just going to 
blast 'em all.
 */
-   function deleteImage( $id, $size ) {
+   private function deleteImage( $id, $size ) {
global $wgUploadDirectory, $wgDBname, $wgMemc;
$avatar = new wAvatar( $id, $size );
$files = glob( $wgUploadDirectory . '/avatars/' . $wgDBname . 
'_' . $id .  '_' . $size . * );
+   wfSuppressWarnings();
$img = basename( $files[0] );
+   wfRestoreWarnings();
if ( $img  $img[0] ) {
unlink( $wgUploadDirectory . '/avatars/' . $img );
}



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [70626] trunk/extensions/SocialProfile/UserProfile/ SpecialUpdateProfile.php

2010-08-07 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/70626

Revision: 70626
Author:   ashley
Date: 2010-08-07 12:43:53 + (Sat, 07 Aug 2010)

Log Message:
---
SocialProfile: fix a bunch of PHP notices about undefined variables

Modified Paths:
--
trunk/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php

Modified: trunk/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php
===
--- trunk/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php 
2010-08-07 12:27:38 UTC (rev 70625)
+++ trunk/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php 
2010-08-07 12:43:53 UTC (rev 70626)
@@ -346,10 +346,10 @@
$websites = $s-up_websites;
}
 
-   if ( !$location_country ) {
+   if ( !isset( $location_country ) ) {
$location_country = wfMsgForContent( 
'user-profile-default-country' );
}
-   if ( !$hometown_country ) {
+   if ( !isset( $hometown_country ) ) {
$hometown_country = wfMsgForContent( 
'user-profile-default-country' );
}
 
@@ -398,16 +398,16 @@
$form .= 'div class=profile-update
p class=profile-update-title' . wfMsg( 
'user-profile-personal-location' ) . '/p
p class=profile-update-unit-left' . wfMsg( 
'user-profile-personal-city' ) . '/p
-   p class=profile-update-unitinput type=text 
size=25 name=location_city id=location_city value=' . $location_city . 
' //p
+   p class=profile-update-unitinput type=text 
size=25 name=location_city id=location_city value=' . ( isset( 
$location_city ) ? $location_city : '' ) . ' //p
div class=cleared/div
p class=profile-update-unit-left 
id=location_state_label' . wfMsg( 'user-profile-personal-country' ) . '/p';
$form .= 'p class=profile-update-unit';
$form .= 'span id=location_state_form';
$form .= /span
script type=\text/javascript\
-   displaySection(\location_state\,\ . 
$location_country . \,\ . $location_state . \)
+   displaySection(\location_state\,\ . 
$location_country . \,\ . ( isset( $location_state ) ? $location_state : '' 
) . \);
/script;
-   $form .= select name=\location_country\ 
id=\location_country\ 
onhhange=\displaySection('location_state',this.value,'')\option/option;
+   $form .= select name=\location_country\ 
id=\location_country\ 
onchange=\displaySection('location_state',this.value,'')\option/option;
 
foreach ( $countries as $country ) {
$form .= option value=\{$country}\ . ( ( $country 
== $location_country ) ? ' selected=selected' : '' ) . ;
@@ -423,14 +423,14 @@
$form .= 'div class=profile-update
p class=profile-update-title' . wfMsg( 
'user-profile-personal-hometown' ) . '/p
p class=profile-update-unit-left' . wfMsg( 
'user-profile-personal-city' ) . '/p
-   p class=profile-update-unitinput type=text 
size=25 name=hometown_city id=hometown_city value=' . $hometown_city . 
' //p
+   p class=profile-update-unitinput type=text 
size=25 name=hometown_city id=hometown_city value=' . ( isset( 
$hometown_city ) ? $hometown_city : '' ) . ' //p
div class=cleared/div
p class=profile-update-unit-left 
id=hometown_state_label' . wfMsg( 'user-profile-personal-country' ) . '/p
p class=profile-update-unit';
$form .= 'span id=hometown_state_form';
$form .= /span
script type=\text/javascript\
-   displaySection(\hometown_state\,\ . 
$hometown_country . \,\ . $hometown_state . \)
+   displaySection(\hometown_state\,\ . 
$hometown_country . \,\ . ( isset( $hometown_state ) ? $hometown_state : '' 
) . \);
/script;
$form .= select name=\hometown_country\ 
id=\hometown_country\ 
onchange=\displaySection('hometown_state',this.value,'')\option/option;
 
@@ -448,7 +448,7 @@
$form .= 'div class=profile-update
p class=profile-update-title' . wfMsg( 
'user-profile-personal-birthday' ) . '/p
p class=profile-update-unit-left' . wfMsg( 
'user-profile-personal-birthdate' ) . '/p
-   p class=profile-update-unitinput type=text 
size=25 name=birthday id=birthday value=' . $birthday . ' //p
+   p class=profile-update-unitinput

[MediaWiki-CVS] SVN: [69872] trunk/phase3/includes/Interwiki.php

2010-07-25 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/69872

Revision: 69872
Author:   ashley
Date: 2010-07-25 15:50:23 + (Sun, 25 Jul 2010)

Log Message:
---
coding style tweaks to Interwiki.php

Modified Paths:
--
trunk/phase3/includes/Interwiki.php

Modified: trunk/phase3/includes/Interwiki.php
===
--- trunk/phase3/includes/Interwiki.php 2010-07-25 12:01:13 UTC (rev 69871)
+++ trunk/phase3/includes/Interwiki.php 2010-07-25 15:50:23 UTC (rev 69872)
@@ -7,7 +7,8 @@
 /**
  * The interwiki class
  * All information is loaded on creation when called by Interwiki::fetch( 
$prefix ).
- * All work is done on slave, because this should *never* change (except 
during schema updates etc, which arent wiki-related)
+ * All work is done on slave, because this should *never* change (except during
+ * schema updates etc, which aren't wiki-related)
  */
 class Interwiki {
 
@@ -17,11 +18,11 @@
 
protected $mPrefix, $mURL, $mAPI, $mWikiID, $mLocal, $mTrans;
 
-   public function __construct( $prefix = null, $url = '', $api = '', 
$wikiid = '', $local = 0, $trans = 0 ) {
+   public function __construct( $prefix = null, $url = '', $api = '', 
$wikiId = '', $local = 0, $trans = 0 ) {
$this-mPrefix = $prefix;
$this-mURL = $url;
$this-mAPI = $api;
-   $this-mWikiID = $wikiid;
+   $this-mWikiID = $wikiId;
$this-mLocal = $local;
$this-mTrans = $trans;
}
@@ -63,7 +64,7 @@
}
if( self::CACHE_LIMIT  count( self::$smCache ) = 
self::CACHE_LIMIT ) {
reset( self::$smCache );
-   unset( self::$smCache[ key( self::$smCache ) ] );
+   unset( self::$smCache[key( self::$smCache )] );
}
self::$smCache[$prefix] = $iw;
return $iw;
@@ -109,7 +110,7 @@
$db = CdbReader::open( $wgInterwikiCache );
}
/* Resolve site name */
-   if( $wgInterwikiScopes=3  !$site ) {
+   if( $wgInterwikiScopes = 3  !$site ) {
$site = $db-get( '__sites:' . wfWikiID() );
if ( $site == '' ) {
$site = $wgInterwikiFallbackSite;
@@ -125,8 +126,9 @@
if ( $value == ''  $wgInterwikiScopes = 2 ) {
$value = $db-get( __global:{$prefix} );
}
-   if ( $value == 'undef' )
+   if ( $value == 'undef' ) {
$value = '';
+   }
 
return $value;
}
@@ -155,7 +157,12 @@
__METHOD__ ) );
$iw = Interwiki::loadFromArray( $row );
if ( $iw ) {
-   $mc = array( 'iw_url' = $iw-mURL, 'iw_api' = 
$iw-mAPI, 'iw_local' = $iw-mLocal, 'iw_trans' = $iw-mTrans );
+   $mc = array(
+   'iw_url' = $iw-mURL,
+   'iw_api' = $iw-mAPI,
+   'iw_local' = $iw-mLocal,
+   'iw_trans' = $iw-mTrans
+   );
$wgMemc-add( $key, $mc, $wgInterwikiExpiry );
return $iw;
}
@@ -177,7 +184,7 @@
$iw-mTrans = $mc['iw_trans'];
$iw-mAPI = isset( $mc['iw_api'] ) ? $mc['iw_api'] : '';
$iw-mWikiID = isset( $mc['iw_wikiid'] ) ? 
$mc['iw_wikiid'] : '';
-   
+
return $iw;
}
return false;
@@ -185,7 +192,7 @@
 
/**
 * Get the URL for a particular title (or with $1 if no title given)
-* 
+*
 * @param $title String: what text to put for the article name
 * @return String: the URL
 */
@@ -199,19 +206,19 @@
 
/**
 * Get the API URL for this wiki
-* 
+*
 * @return String: the URL
 */
-   public function getAPI( ) {
+   public function getAPI() {
return $this-mAPI;
}
 
/**
 * Get the DB name for this wiki
-* 
+*
 * @return String: the DB name
 */
-   public function getWikiID( ) {
+   public function getWikiID() {
return $this-mWikiID;
}
 



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [69873] trunk/phase3/includes/Title.php

2010-07-25 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/69873

Revision: 69873
Author:   ashley
Date: 2010-07-25 15:53:22 + (Sun, 25 Jul 2010)

Log Message:
---
coding style tweaks to Title.php

Modified Paths:
--
trunk/phase3/includes/Title.php

Modified: trunk/phase3/includes/Title.php
===
--- trunk/phase3/includes/Title.php 2010-07-25 15:50:23 UTC (rev 69872)
+++ trunk/phase3/includes/Title.php 2010-07-25 15:53:22 UTC (rev 69873)
@@ -93,10 +93,11 @@
public static function newFromDBkey( $key ) {
$t = new Title();
$t-mDbkeyform = $key;
-   if ( $t-secureAndSplit() )
+   if ( $t-secureAndSplit() ) {
return $t;
-   else
+   } else {
return null;
+   }
}
 
/**
@@ -352,11 +353,13 @@
public static function newFromRedirectArray( $text ) {
global $wgMaxRedirects;
// are redirects disabled?
-   if ( $wgMaxRedirects  1 )
+   if ( $wgMaxRedirects  1 ) {
return null;
+   }
$title = self::newFromRedirectInternal( $text );
-   if ( is_null( $title ) )
+   if ( is_null( $title ) ) {
return null;
+   }
// recursive check to follow double redirects
$recurse = $wgMaxRedirects;
$titles = array( $title );
@@ -428,11 +431,15 @@
public static function nameOf( $id ) {
$dbr = wfGetDB( DB_SLAVE );
 
-   $s = $dbr-selectRow( 'page',
+   $s = $dbr-selectRow(
+   'page',
array( 'page_namespace', 'page_title' ),
array( 'page_id' = $id ),
-   __METHOD__ );
-   if ( $s === false ) { return null; }
+   __METHOD__
+   );
+   if ( $s === false ) {
+   return null;
+   }
 
$n = self::makeName( $s-page_namespace, $s-page_title );
return $n;
@@ -522,8 +529,9 @@
 * @return \type{\bool} TRUE if this is transcludable
 */
public function isTrans() {
-   if ( $this-mInterwiki == '' )
+   if ( $this-mInterwiki == '' ) {
return false;
+   }
 
return Interwiki::fetch( $this-mInterwiki )-isTranscludable();
}
@@ -535,8 +543,9 @@
 * @return \type{\string} the DB name
 */
public function getTransWikiID() {
-   if ( $this-mInterwiki == '' )
+   if ( $this-mInterwiki == '' ) {
return false;
+   }
 
return Interwiki::fetch( $this-mInterwiki )-getWikiID();
}
@@ -745,8 +754,9 @@
 
$parts = explode( '/', $this-getText() );
# Don't discard the real title if there's no subpage involved
-   if ( count( $parts )  1 )
-   unset( $parts[ count( $parts ) - 1 ] );
+   if ( count( $parts )  1 ) {
+   unset( $parts[count( $parts ) - 1] );
+   }
return implode( '/', $parts );
}
 
@@ -760,7 +770,7 @@
return( $this-mTextform );
}
$parts = explode( '/', $this-mTextform );
-   return( $parts[ count( $parts ) - 1 ] );
+   return( $parts[count( $parts ) - 1] );
}
 
/**
@@ -812,7 +822,7 @@
$url = $wgServer . $url;
}
} else {
-   $baseUrl = $interwiki-getURL( );
+   $baseUrl = $interwiki-getURL();
 
$namespace = wfUrlencode( $this-getNsText() );
if ( $namespace != '' ) {
@@ -853,8 +863,9 @@
// internal links should point to same variant as current page 
(only anonymous users)
if ( !$variant  $wgContLang-hasVariants()  
!$wgUser-isLoggedIn() ) {
$pref = $wgContLang-getPreferredVariant( false );
-   if ( $pref != $wgContLang-getCode() )
+   if ( $pref != $wgContLang-getCode() ) {
$variant = $pref;
+   }
}
 
if ( $this-isExternal() ) {
@@ -890,7 +901,9 @@
$action = urldecode( $matches[2] );
if ( isset( $wgActionPaths[$action] ) ) 
{
$query = $matches[1];
-   if ( isset( $matches[4] ) ) 
$query .= $matches[4

[MediaWiki-CVS] SVN: [69794] trunk/extensions/RSS/RSS.php

2010-07-23 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/69794

Revision: 69794
Author:   ashley
Date: 2010-07-23 15:28:57 + (Fri, 23 Jul 2010)

Log Message:
---
RSS: wfLoadExtensionMessages() is not needed for 1.16/trunk

Modified Paths:
--
trunk/extensions/RSS/RSS.php

Modified: trunk/extensions/RSS/RSS.php
===
--- trunk/extensions/RSS/RSS.php2010-07-23 15:26:27 UTC (rev 69793)
+++ trunk/extensions/RSS/RSS.php2010-07-23 15:28:57 UTC (rev 69794)
@@ -161,17 +161,14 @@
 
# Check for errors.
if ( empty( $rss ) ) {
-   wfLoadExtensionMessages( 'RSS' );
return wfMsg( 'rss-empty', $url );
}
 
if ( $rss-ERROR ) {
-   wfLoadExtensionMessages( 'RSS' );
return 'div' . wfMsg( 'rss-error', $url, $rss-ERROR ) . 
'/div';
}
 
if ( !is_array( $rss-items ) ) {
-   wfLoadExtensionMessages( 'RSS' );
return 'div' . wfMsg( 'rss-empty', $url ) . '/div';
}
 



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [69547] trunk/extensions/DPLforum/DPLforum.php

2010-07-19 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/69547

Revision: 69547
Author:   ashley
Date: 2010-07-19 14:03:11 + (Mon, 19 Jul 2010)

Log Message:
---
DPLforum: PHP 5.3+ compatibility fix

Modified Paths:
--
trunk/extensions/DPLforum/DPLforum.php

Modified: trunk/extensions/DPLforum/DPLforum.php
===
--- trunk/extensions/DPLforum/DPLforum.php  2010-07-19 14:00:51 UTC (rev 
69546)
+++ trunk/extensions/DPLforum/DPLforum.php  2010-07-19 14:03:11 UTC (rev 
69547)
@@ -66,7 +66,7 @@
return true;
 }
 
-function parseForum( $input, $argv, $parser ) {
+function parseForum( $input, $argv, $parser ) {
$f = new DPLForum();
return $f-parse( $input, $parser );
 }



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [69549] trunk/extensions/SocialProfile

2010-07-19 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/69549

Revision: 69549
Author:   ashley
Date: 2010-07-19 14:27:33 + (Mon, 19 Jul 2010)

Log Message:
---
SocialProfile: reapplying ^demon's r66934 - wfLoadExtensionMessages() is a 
no-op in 1.16 and trunk, and we require at least 1.16

Modified Paths:
--
trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManager.php
trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManagerLogo.php
trunk/extensions/SocialProfile/SystemGifts/SpecialViewSystemGift.php
trunk/extensions/SocialProfile/SystemGifts/SpecialViewSystemGifts.php
trunk/extensions/SocialProfile/SystemGifts/UserSystemGiftsClass.php
trunk/extensions/SocialProfile/UserActivity/SiteActivityHook.php
trunk/extensions/SocialProfile/UserActivity/UserActivity.body.php
trunk/extensions/SocialProfile/UserBoard/SpecialSendBoardBlast.php
trunk/extensions/SocialProfile/UserBoard/SpecialUserBoard.php
trunk/extensions/SocialProfile/UserBoard/UserBoardClass.php
trunk/extensions/SocialProfile/UserGifts/SpecialGiftManager.php
trunk/extensions/SocialProfile/UserGifts/SpecialGiftManagerLogo.php
trunk/extensions/SocialProfile/UserGifts/SpecialGiveGift.php
trunk/extensions/SocialProfile/UserGifts/SpecialRemoveGift.php
trunk/extensions/SocialProfile/UserGifts/SpecialRemoveMasterGift.php
trunk/extensions/SocialProfile/UserGifts/SpecialViewGift.php
trunk/extensions/SocialProfile/UserGifts/SpecialViewGifts.php
trunk/extensions/SocialProfile/UserGifts/UserGiftsClass.php

trunk/extensions/SocialProfile/UserProfile/SpecialPopulateExistingUsersProfiles.php
trunk/extensions/SocialProfile/UserProfile/SpecialRemoveAvatar.php
trunk/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php
trunk/extensions/SocialProfile/UserProfile/SpecialUploadAvatar.php
trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php

trunk/extensions/SocialProfile/UserRelationship/Relationship_AjaxFunctions.php
trunk/extensions/SocialProfile/UserRelationship/SpecialAddRelationship.php

trunk/extensions/SocialProfile/UserRelationship/SpecialRemoveRelationship.php

trunk/extensions/SocialProfile/UserRelationship/SpecialViewRelationshipRequests.php
trunk/extensions/SocialProfile/UserRelationship/SpecialViewRelationships.php
trunk/extensions/SocialProfile/UserRelationship/UserRelationshipClass.php
trunk/extensions/SocialProfile/UserStats/TopFansByStat.php
trunk/extensions/SocialProfile/UserStats/TopFansRecent.php
trunk/extensions/SocialProfile/UserStats/TopUsers.php
trunk/extensions/SocialProfile/UserStats/UserStatsClass.php

trunk/extensions/SocialProfile/UserSystemMessages/UserSystemMessagesClass.php
trunk/extensions/SocialProfile/UserWelcome/UserWelcome.php

Modified: 
trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManager.php
===
--- trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManager.php 
2010-07-19 14:05:57 UTC (rev 69548)
+++ trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManager.php 
2010-07-19 14:27:33 UTC (rev 69549)
@@ -16,7 +16,6 @@
 */
public function execute( $par ) {
global $wgUser, $wgOut, $wgRequest, $wgScriptPath, 
$wgSystemGiftsScripts;
-   wfLoadExtensionMessages( 'SystemGifts' );
 
$wgOut-setPageTitle( wfMsg( 'systemgiftmanager' ) );
 

Modified: 
trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManagerLogo.php
===
--- trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManagerLogo.php 
2010-07-19 14:05:57 UTC (rev 69548)
+++ trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManagerLogo.php 
2010-07-19 14:27:33 UTC (rev 69549)
@@ -405,7 +405,6 @@
 */
function showSuccess( $status ) {
global $wgUser, $wgOut, $wgUploadPath, $wgScriptPath, $wgLang;
-   wfLoadExtensionMessages( 'SystemGifts' );
$ext = 'jpg';
 
$output = 'h2' . wfMsg( 'ga-uploadsuccess' ) . '/h2';
@@ -457,7 +456,6 @@
 */
function uploadError( $error ) {
global $wgOut;
-   wfLoadExtensionMessages( 'SystemGifts' );
$sub = wfMsg( 'uploadwarning' );
$wgOut-addHTML( h2{$sub}/h2\n );
$wgOut-addHTML( h4 class='error'{$error}/h4\n );
@@ -534,7 +532,6 @@
function mainUploadForm( $msg = '' ) {
global $wgOut, $wgUser, $wgLang, $wgUploadDirectory, $wgRequest;
global $wgUseCopyrightUpload;
-   wfLoadExtensionMessages( 'SystemGifts' );
 
$cols = intval( $wgUser-getOption( 'cols' ) );
$ew = $wgUser-getOption( 'editwidth' );

Modified: trunk/extensions/SocialProfile/SystemGifts

[MediaWiki-CVS] SVN: [69427] trunk/phase3/skins/common/ajaxwatch.js

2010-07-16 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/69427

Revision: 69427
Author:   ashley
Date: 2010-07-16 14:57:30 + (Fri, 16 Jul 2010)

Log Message:
---
ajaxwatch.js: coding style tweaks

Modified Paths:
--
trunk/phase3/skins/common/ajaxwatch.js

Modified: trunk/phase3/skins/common/ajaxwatch.js
===
--- trunk/phase3/skins/common/ajaxwatch.js  2010-07-16 14:04:54 UTC (rev 
69426)
+++ trunk/phase3/skins/common/ajaxwatch.js  2010-07-16 14:57:30 UTC (rev 
69427)
@@ -1,88 +1,87 @@
 /**
  * Animate watch/unwatch links to use asynchronous API requests to
- * watch pages, rather than clicking on links.  Requires JQuery.  
+ * watch pages, rather than clicking on links. Requires jQuery.
  * Uses jsMsg() from wikibits.js.
  */
 
-if( typeof wgAjaxWatch === undefined || !wgAjaxWatch ) {
+if( typeof wgAjaxWatch === 'undefined' || !wgAjaxWatch ) {
var wgAjaxWatch = {
-   watchMsg: Watch,
-   unwatchMsg: Unwatch,
-   watchingMsg: Watching...,
-   unwatchingMsg: Unwatching...,
-   'tooltip-ca-watchMsg': Add this page to your watchlist,
-   'tooltip-ca-unwatchMsg': Remove this page from your watchlist
+   watchMsg: 'Watch',
+   unwatchMsg: 'Unwatch',
+   watchingMsg: 'Watching...',
+   unwatchingMsg: 'Unwatching...',
+   'tooltip-ca-watchMsg': 'Add this page to your watchlist',
+   'tooltip-ca-unwatchMsg': 'Remove this page from your watchlist'
};
 }
 
 wgAjaxWatch.setLinkText = function( $link, action ) {
-   if( action == 'watch' || action == 'unwatch' ){
+   if( action == 'watch' || action == 'unwatch' ) {
// save the accesskey from the title
-   var keyCommand = $link.attr('title').match( /\[.*?\]$/ ) 
-   ? $link.attr('title').match( /\[.*?\]$/ )[0]
+   var keyCommand = $link.attr( 'title' ).match( /\[.*?\]$/ )
+   ? $link.attr( 'title' ).match( /\[.*?\]$/ )[0]
: '';
-   $link.attr( 'title', wgAjaxWatch['tooltip-ca-'+action+'Msg']+' 
'+keyCommand );
+   $link.attr( 'title', wgAjaxWatch['tooltip-ca-' + action + 
'Msg'] + ' ' + keyCommand );
}
-   if( $link.data('icon') ) {
-   $link.attr( 'alt', wgAjaxWatch[action+'Msg'] );
+   if( $link.data( 'icon' ) ) {
+   $link.attr( 'alt', wgAjaxWatch[action + 'Msg'] );
if ( action == 'watching' || action == 'unwatching' ) {
$link.addClass( 'loading' );
} else {
$link.removeClass( 'loading' );
}
} else {
-   $link.html( wgAjaxWatch[action+'Msg'] );
+   $link.html( wgAjaxWatch[action + 'Msg'] );
}
 };
 
 wgAjaxWatch.processResult = function( response ) {
response = response.watch;
-   var $link = $j(this); 
-   // To ensure we set the same status for all watch links with the 
+   var $link = $j( this );
+   // To ensure we set the same status for all watch links with the
// same target we trigger a custom event on *all* watch links.
-   if( response.watched !== undefined ){
+   if( response.watched !== undefined ) {
wgAjaxWatch.$links.trigger( 'mw-ajaxwatch', [response.title, 
'watch'] );
-   } else if ( response.unwatched !== undefined ){
+   } else if ( response.unwatched !== undefined ) {
wgAjaxWatch.$links.trigger( 'mw-ajaxwatch', [response.title, 
'unwatch'] );
} else {
// Either we got an error code or it just plain broke.
-   window.location.href = $link.attr('href');
+   window.location.href = $link.attr( 'href' );
return;
}
-   
+
jsMsg( response.message, 'watch' );
-   
-   // Bug 12395 - update the watch checkbox on edit pages when the 
+
+   // Bug 12395 - update the watch checkbox on edit pages when the
// page is watched or unwatched via the tab.
-   if( response.watched !== undefined ){
-   $j(#wpWatchthis).attr( 'checked', '1' );
+   if( response.watched !== undefined ) {
+   $j( '#wpWatchthis' ).attr( 'checked', '1' );
} else {
-   $j(#wpWatchthis).removeAttr( 'checked' );
+   $j( '#wpWatchthis' ).removeAttr( 'checked' );
}
 };
 
-$j(document).ready( function(){
+$j( document ).ready( function() {
var $links = $j( '.mw-watchlink a, a.mw-watchlink' );
-   //BC with older skins
+   // BC with older skins
$links = $links
.add( $j( '#ca-watch a, #ca-unwatch a, a#mw-unwatch-link1' ) )
.add( $j( 'a#mw-unwatch-link2, a#mw-watch-link2, 
a#mw-watch-link1' ) );
// allowing people to add

[MediaWiki-CVS] SVN: [69071] trunk/phase3/skins

2010-07-05 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/69071

Revision: 69071
Author:   ashley
Date: 2010-07-05 20:40:09 + (Mon, 05 Jul 2010)

Log Message:
---
cleanup to CSS files (spaces - tabs for indentation, trimmed trailing spaces, 
updated a few comments)

Modified Paths:
--
trunk/phase3/skins/modern/main.css
trunk/phase3/skins/modern/print.css
trunk/phase3/skins/modern/rtl.css
trunk/phase3/skins/monobook/IE50Fixes.css
trunk/phase3/skins/monobook/IE55Fixes.css
trunk/phase3/skins/monobook/IE60Fixes.css
trunk/phase3/skins/monobook/IE70Fixes.css
trunk/phase3/skins/monobook/main.css
trunk/phase3/skins/monobook/rtl.css

Modified: trunk/phase3/skins/modern/main.css
===
--- trunk/phase3/skins/modern/main.css  2010-07-05 20:31:01 UTC (rev 69070)
+++ trunk/phase3/skins/modern/main.css  2010-07-05 20:40:09 UTC (rev 69071)
@@ -69,7 +69,8 @@
 }
 
 #p-personal li {
-   display: block; float: left;
+   display: block;
+   float: left;
height: 1.5em;
margin: 0 0 0 0;
vertical-align: middle;
@@ -301,27 +302,27 @@
 }
 
 a {
-text-decoration: none;
-color: #003366;
-background: none;
+   text-decoration: none;
+   color: #003366;
+   background: none;
 }
 a:visited {
-color: #5a3696;
+   color: #5a3696;
 }
 a:active {
-color: #faa700;
+   color: #faa700;
 }
 a:hover {
-text-decoration: underline;
+   text-decoration: underline;
 }
 a.stub {
-color: #772233;
+   color: #772233;
 }
 a.new {
-color: #ba;
+   color: #ba;
 }
 a.new:visited {
-color: #a55858;
+   color: #a55858;
 }
 
 span.editsection {
@@ -402,33 +403,33 @@
 
 #mw_content a.external,
 #mw_content a[href ^=gopher://;] {
-background: url(external.png) center right no-repeat;
-padding-right: 13px;
+   background: url(external.png) center right no-repeat;
+   padding-right: 13px;
 }
 #mw_content a[href ^=https://;],
 .link-https {
-background: url(lock_icon.gif) center right no-repeat;
-padding-right: 16px;
+   background: url(lock_icon.gif) center right no-repeat;
+   padding-right: 16px;
 }
 #mw_content a[href ^=mailto:;],
 .link-mailto {
-background: url(mail_icon.gif) center right no-repeat;
-padding-right: 18px;
+   background: url(mail_icon.gif) center right no-repeat;
+   padding-right: 18px;
 }
 #mw_content a[href ^=news://;] {
-background: url(news_icon.png) center right no-repeat;
-padding-right: 18px;
+   background: url(news_icon.png) center right no-repeat;
+   padding-right: 18px;
 }
 #mw_content a[href ^=ftp://;],
 .link-ftp {
-background: url(file_icon.gif) center right no-repeat;
-padding-right: 18px;
+   background: url(file_icon.gif) center right no-repeat;
+   padding-right: 18px;
 }
 #mw_content a[href ^=irc://],
 #mw_content a.extiw[href ^=irc://],
 .link-irc {
-background: url(discussionitem_icon.gif) center right no-repeat;
-padding-right: 18px;
+   background: url(discussionitem_icon.gif) center right no-repeat;
+   padding-right: 18px;
 }
 
 #mw_content a.external[href $=.ogg], #mw_content a.external[href $=.OGG],
@@ -438,23 +439,23 @@
 #mw_content a.external[href $=.wav], #mw_content a.external[href $=.WAV],
 #mw_content a.external[href $=.wma], #mw_content a.external[href $=.WMA],
 .link-audio {
-background: url(audio.png) center right no-repeat;
-padding-right: 13px;
+   background: url(audio.png) center right no-repeat;
+   padding-right: 13px;
 }
 #mw_content a.external[href $=.ogm], #mw_content a.external[href $=.OGM],
 #mw_content a.external[href $=.avi], #mw_content a.external[href $=.AVI],
 #mw_content a.external[href $=.mpeg], #mw_content a.external[href $=.MPEG],
 #mw_content a.external[href $=.mpg], #mw_content a.external[href $=.MPG],
 .link-video {
-background: url(video.png) center right no-repeat;
-padding-right: 13px;
+   background: url(video.png) center right no-repeat;
+   padding-right: 13px;
 }
 #mw_content a.external[href $=.pdf], #mw_content a.external[href $=.PDF],
 #mw_content a.external[href *=.pdf#], #mw_content a.external[href *=.PDF#],
 #mw_content a.external[href *=.pdf?], #mw_content a.external[href *=.PDF?],
 .link-document {
-background: url(document.png) center right no-repeat;
-padding-right: 12px;
+   background: url(document.png) center right no-repeat;
+   padding-right: 12px;
 }
 
 /* images */
@@ -727,40 +728,40 @@
 }
 
 div#searchTargetHide {
-   float:right;
-   border:solid 1px black;
-   background:gainsboro;
-   padding:2px;
+   float: right;
+   border: solid 1px black;
+   background: gainsboro;
+   padding: 2px;
 }
 
 div.multipageimagenavbox {
-   border: solid 1px

[MediaWiki-CVS] SVN: [69072] trunk/phase3

2010-07-05 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/69072

Revision: 69072
Author:   ashley
Date: 2010-07-05 20:45:20 + (Mon, 05 Jul 2010)

Log Message:
---
removed TablePager CSS from Modern's main.css as shared.css already contains 
that and Modern includes shared.css. Also merged two .TablePager rules into one 
in shared.css and updated comments

Modified Paths:
--
trunk/phase3/includes/DefaultSettings.php
trunk/phase3/skins/common/shared.css
trunk/phase3/skins/modern/main.css

Modified: trunk/phase3/includes/DefaultSettings.php
===
--- trunk/phase3/includes/DefaultSettings.php   2010-07-05 20:40:09 UTC (rev 
69071)
+++ trunk/phase3/includes/DefaultSettings.php   2010-07-05 20:45:20 UTC (rev 
69072)
@@ -1547,7 +1547,7 @@
  * to ensure that client-side caches do not keep obsolete copies of global
  * styles.
  */
-$wgStyleVersion = '293';
+$wgStyleVersion = '294';
 
 /**
  * This will cache static pages for non-logged-in users to reduce

Modified: trunk/phase3/skins/common/shared.css
===
--- trunk/phase3/skins/common/shared.css2010-07-05 20:40:09 UTC (rev 
69071)
+++ trunk/phase3/skins/common/shared.css2010-07-05 20:45:20 UTC (rev 
69072)
@@ -669,22 +669,20 @@
 }
 
 /*
-  Table pager (e.g. Special:Imagelist)
-  - remove underlines from the navigation link
-  - collapse borders
-  - set the borders to outsets (similar to Special:Allmessages)
-  - remove line wrapping for all td and th, set background color
-  - restore line wrapping for the last two table cells (description and size)
+   Table pager (e.g. Special:ListFiles)
+   - remove underlines from the navigation link
+   - collapse borders
+   - set the borders to outsets (similar to Special:AllMessages)
+   - remove line wrapping for all td and th, set background color
+   - restore line wrapping for the last two table cells (description and 
size)
 */
 .TablePager {
min-width: 80%;
+   border-collapse: collapse;
 }
 .TablePager_nav a {
text-decoration: none;
 }
-.TablePager {
-   border-collapse: collapse;
-}
 .TablePager, .TablePager td, .TablePager th {
border: 1px solid #aa;
padding: 0 0.15em 0 0.15em;

Modified: trunk/phase3/skins/modern/main.css
===
--- trunk/phase3/skins/modern/main.css  2010-07-05 20:40:09 UTC (rev 69071)
+++ trunk/phase3/skins/modern/main.css  2010-07-05 20:45:20 UTC (rev 69072)
@@ -755,29 +755,6 @@
text-align: center;
 }
 
-/*
-   Table pager (e.g. Special:ListFiles)
-   - remove underlines from the navigation link
-   - collapse borders
-   - set the borders to outsets (similar to Special:AllMessages)
-   - remove line wrapping for all td and th, set background color
-   - restore line wrapping for the last two table cells (description and 
size)
-*/
-.TablePager_nav a { text-decoration: none; }
-.TablePager { border-collapse: collapse; }
-.TablePager, .TablePager td, .TablePager th {
-   border: 1px solid #aa;
-   padding: 0 0.15em 0 0.15em;
-}
-.TablePager th { background-color: #ff; }
-.TablePager td { background-color: #ff; }
-.TablePager tr:hover td { background-color: #ff; }
-
-.imagelist td, .imagelist th { white-space: nowrap; }
-.imagelist .TablePager_col_links { background-color: #ff; }
-.imagelist .TablePager_col_img_description { white-space: normal; }
-.imagelist th.TablePager_sort { background-color: #ff; }
-
 .templatesUsed { margin-top: 1.5em; }
 
 .mw-summary-preview {



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [68562] trunk/phase3

2010-06-25 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/68562

Revision: 68562
Author:   ashley
Date: 2010-06-25 13:38:30 + (Fri, 25 Jun 2010)

Log Message:
---
remove unused classes for article validation from Monobook's and Modern's main 
CSS files, related to old Special:Validate feature. This reverts Magnus' r9552.

Modified Paths:
--
trunk/phase3/includes/DefaultSettings.php
trunk/phase3/skins/modern/main.css
trunk/phase3/skins/monobook/main.css

Modified: trunk/phase3/includes/DefaultSettings.php
===
--- trunk/phase3/includes/DefaultSettings.php   2010-06-25 13:33:39 UTC (rev 
68561)
+++ trunk/phase3/includes/DefaultSettings.php   2010-06-25 13:38:30 UTC (rev 
68562)
@@ -1548,7 +1548,7 @@
  * to ensure that client-side caches do not keep obsolete copies of global
  * styles.
  */
-$wgStyleVersion = '291';
+$wgStyleVersion = '292';
 
 /**
  * This will cache static pages for non-logged-in users to reduce

Modified: trunk/phase3/skins/modern/main.css
===
--- trunk/phase3/skins/modern/main.css  2010-06-25 13:33:39 UTC (rev 68561)
+++ trunk/phase3/skins/modern/main.css  2010-06-25 13:38:30 UTC (rev 68562)
@@ -695,30 +695,6 @@
font-weight: bold;
 }
 
-/* Classes for article validation */
-
-table.revisionform_default {
-   border: 1px solid #00;
-}
-
-table.revisionform_focus {
-   border: 1px solid #00;
-   background-color:#00BBFF;
-}
-
-tr.revision_tr_default {
-   background-color:#EE;
-}
-
-tr.revision_tr_first {
-   background-color:#DD;
-}
-
-p.revision_saved {
-   color: green;
-   font-weight:bold;
-}
-
 /* noarticletext */
 div.noarticletext {
border: 1px solid #ccc;

Modified: trunk/phase3/skins/monobook/main.css
===
--- trunk/phase3/skins/monobook/main.css2010-06-25 13:33:39 UTC (rev 
68561)
+++ trunk/phase3/skins/monobook/main.css2010-06-25 13:38:30 UTC (rev 
68562)
@@ -1162,30 +1162,6 @@
font-weight: bold;
 }
 
-/* Classes for article validation */
-
-table.revisionform_default {
-   border: 1px solid #00;
-}
-
-table.revisionform_focus {
-   border: 1px solid #00;
-   background-color:#00BBFF;
-}
-
-tr.revision_tr_default {
-   background-color:#EE;
-}
-
-tr.revision_tr_first {
-   background-color:#DD;
-}
-
-p.revision_saved {
-   color: green;
-   font-weight:bold;
-}
-
 /* noarticletext */
 div.noarticletext {
border: 1px solid #ccc;



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [68271] trunk/extensions/SocialProfile

2010-06-19 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/68271

Revision: 68271
Author:   ashley
Date: 2010-06-19 12:55:41 + (Sat, 19 Jun 2010)

Log Message:
---
SocialProfile: version 1.5 -- YUI dependency removed, now uses jQuery. also 
added almost-but-not-quite-working Renameuser integration code (commented out 
for now)

Modified Paths:
--
trunk/extensions/SocialProfile/SocialProfile.php
trunk/extensions/SocialProfile/UserBoard/BoardBlast.js
trunk/extensions/SocialProfile/UserGifts/UserGifts.js
trunk/extensions/SocialProfile/UserRelationship/UserRelationship.js

Removed Paths:
-
trunk/extensions/SocialProfile/YUI/

Modified: trunk/extensions/SocialProfile/SocialProfile.php
===
--- trunk/extensions/SocialProfile/SocialProfile.php2010-06-19 12:16:36 UTC 
(rev 68270)
+++ trunk/extensions/SocialProfile/SocialProfile.php2010-06-19 12:55:41 UTC 
(rev 68271)
@@ -3,13 +3,14 @@
  * Protect against register_globals vulnerabilities.
  * This line must be present before any global variable is referenced.
  */
-if ( !defined( 'MEDIAWIKI' ) )
+if ( !defined( 'MEDIAWIKI' ) ) {
die();
+}
 
 /**
  * This is the *main* (but certainly not the only) loader file for 
SocialProfile extension.
  *
- * For more info about SocialProfile, please see the README file that was 
included with SocialProfile.
+ * For more info about SocialProfile, please see 
http://www.mediawiki.org/wiki/Extension:SocialProfile.
  */
 $dir = dirname( __FILE__ ) . '/';
 
@@ -93,7 +94,7 @@
'path' = __FILE__,
'name' = 'SocialProfile',
'author' = array( 'Aaron Wright', 'David Pean', 'Jack Phoenix' ),
-   'version' = '1.4',
+   'version' = '1.5',
'url' = 'http://www.mediawiki.org/wiki/Extension:SocialProfile',
'description' = 'A set of Social Tools for MediaWiki',
 );
@@ -190,7 +191,6 @@
 $wgUserRelationshipScripts = 
$wgScriptPath/extensions/SocialProfile/UserRelationship;
 
 // Loader files
-require_once( $IP/extensions/SocialProfile/YUI/YUI.php ); // YUI stand-alone 
library
 require_once( {$wgUserProfileDirectory}/UserProfile.php ); // Profile page 
configuration loader file
 require_once( $IP/extensions/SocialProfile/UserGifts/Gifts.php ); // 
UserGifts (user-to-user gifting functionality) loader file
 require_once( $IP/extensions/SocialProfile/SystemGifts/SystemGifts.php ); // 
SystemGifts (awards functionality) loader file
@@ -216,4 +216,49 @@
$wgExtNewTables[] = array( 'user_system_messages', 
$dir/UserSystemMessages/user_system_messages.sql );
}
return true;
-}
\ No newline at end of file
+}
+
+/*
+// For Renameuser extension
+$wgHooks['RenameUserSQL'][] = 'efSystemGiftsOnUserRename';
+$wgHooks['RenameUserSQL'][] = 'efUserBoardOnUserRename';
+$wgHooks['RenameUserSQL'][] = 'efUserGiftsOnUserRename';
+$wgHooks['RenameUserSQL'][] = 'efUserRelationshipOnUserRename';
+$wgHooks['RenameUserSQL'][] = 'efUserStatsOnUserRename';
+$wgHooks['RenameUserSQL'][] = 'efUserSystemMessagesOnUserRename';
+
+function efSystemGiftsOnUserRename( $renameUserSQL ) {
+   $renameUserSQL-tables['user_system_gift'] = array( 'sg_user_name', 
'sg_user_id' );
+   return true;
+}
+
+function efUserBoardOnUserRename( $renameUserSQL ) {
+   $renameUserSQL-tables['user_board'] = array( 'ub_user_name_from', 
'ub_user_id_from' );
+   return true;
+}
+
+function efUserGiftsOnUserRename( $renameUserSQL ) {
+   $renameUserSQL-tables['user_gift'] = array( 'ug_user_name_to', 
'ug_user_id_to' );
+   $renameUserSQL-tables['gift'] = array( 'gift_creator_user_name', 
'gift_creator_user_id' );
+   return true;
+}
+
+function efUserRelationshipOnUserRename( $renameUserSQL ) {
+   // fixme This sucks and only updates half of the rows...wtf?
+   $renameUserSQL-tables['user_relationship'] = array( 
'r_user_name_relation', 'r_user_id_relation' );
+   $renameUserSQL-tables['user_relationship'] = array( 'r_user_name', 
'r_user_id' );
+   // /fixme
+   $renameUserSQL-tables['user_relationship_request'] = array( 
'ur_user_name_from', 'ur_user_id_from' );
+   return true;
+}
+
+function efUserStatsOnUserRename( $renameUserSQL ) {
+   $renameUserSQL-tables['user_stats'] = array( 'stats_user_name', 
'stats_user_id' );
+   return true;
+}
+
+function efUserSystemMessagesOnUserRename( $renameUserSQL ) {
+   $renameUserSQL-tables['user_system_messages'] = array( 'um_user_name', 
'um_user_id' );
+   return true;
+}
+*/
\ No newline at end of file

Modified: trunk/extensions/SocialProfile/UserBoard/BoardBlast.js
===
--- trunk/extensions/SocialProfile/UserBoard/BoardBlast.js  2010-06-19 
12:16:36 UTC (rev 68270)
+++ trunk/extensions/SocialProfile/UserBoard/BoardBlast.js  2010-06-19 
12:55:41 UTC (rev 68271)
@@ -1,27 +1,27 @@
 function toggle_user( user_id

[MediaWiki-CVS] SVN: [68260] trunk/extensions/SocialProfile/UserBoard

2010-06-18 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/68260

Revision: 68260
Author:   ashley
Date: 2010-06-19 03:11:55 + (Sat, 19 Jun 2010)

Log Message:
---
SocialProfile: cleanup to UserBoard

Modified Paths:
--
trunk/extensions/SocialProfile/UserBoard/SpecialUserBoard.php
trunk/extensions/SocialProfile/UserBoard/UserBoardClass.php

Modified: trunk/extensions/SocialProfile/UserBoard/SpecialUserBoard.php
===
--- trunk/extensions/SocialProfile/UserBoard/SpecialUserBoard.php   
2010-06-18 23:31:39 UTC (rev 68259)
+++ trunk/extensions/SocialProfile/UserBoard/SpecialUserBoard.php   
2010-06-19 03:11:55 UTC (rev 68260)
@@ -251,7 +251,7 @@
option value=1' . wfMsg( 
'userboard_private' ) . '/option
/select
p
-   textarea name=message id=message 
cols=63 rows=4//textarea
+   textarea name=message id=message 
cols=63 rows=4/textarea
 
div 
class=user-page-message-box-button
input type=button value=' . 
wfMsg( 'userboard_sendbutton' ) . ' class=site-button 
onclick=javascript:send_message(); /
@@ -260,9 +260,9 @@
/div';
} else {
$login_link = SpecialPage::getTitleFor( 
'Userlogin' );
-   $output .= 'div class=user-page-message-form
-   ' . wfMsg( 
'userboard_loggedout', $login_link-escapeFullURL() ) . '
-   /div';
+   $output .= 'div 
class=user-page-message-form'
+   . wfMsg( 'userboard_loggedout', 
$login_link-escapeFullURL() ) .
+   '/div';
}
}
$output .= 'div id=user-page-board';
@@ -284,14 +284,12 @@
}
if ( $wgUser-getName() == 
$ub_message['user_name'] || $wgUser-isAllowed( 'userboard-delete' ) ) {
$delete_link = span 
class=\user-board-red\
-   a href=\javascript:void(0);\ 
onclick=\javascript:delete_message({$ub_message[id]})\ . wfMsg( 
'userboard_delete' ) . /a
-   /span;
+   a href=\javascript:void(0);\ 
onclick=\javascript:delete_message({$ub_message['id']})\ . wfMsg( 
'userboard_delete' ) . '/a
+   /span';
}
if ( $ub_message['type'] == 1 ) {
$ub_message_type_label = '(' . wfMsg( 
'userboard_private' ) . ')';
}
-   // global $max_link_text_length;
-   // $max_link_text_length = 75;
 
// had global function to cut link text if too 
long and no breaks
// $ub_message_text = preg_replace_callback( 
/(a[^]*)(.*?)(\/a)/i, 'cut_link_text', $ub_message['message_text'] );
@@ -299,16 +297,16 @@
 
$output .= div class=\user-board-message\ 
style=\width:550px\
div class=\user-board-message-from\
-   a 
href=\{$user-escapeFullURL()}\ 
title=\{$ub_message[user_name_from]}}\{$ub_message[user_name_from]} /a 
{$ub_message_type_label}
+   a 
href=\{$user-escapeFullURL()}\ 
title=\{$ub_message['user_name_from']}}\{$ub_message['user_name_from']} /a 
{$ub_message_type_label}
/div
-   div class=\user-board-message-time\
-. wfMsgHtml( 
'userboard_posted_ago', $b-getTimeAgo( $ub_message['timestamp'] ) ) . 
-   /div
+   div class=\user-board-message-time\
+   . wfMsgHtml( 
'userboard_posted_ago', $b-getTimeAgo( $ub_message['timestamp'] ) ) .
+   /div
div 
class=\user-board-message-content\
div 
class=\user-board-message-image\
-   a 
href=\{$user-escapeFullURL()}\ 
title=\{$ub_message[user_name_from]}\{$avatar-getAvatarURL()}/a
+   a 
href=\{$user

[MediaWiki-CVS] SVN: [68089] trunk/extensions/PagedTiffHandler

2010-06-15 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/68089

Revision: 68089
Author:   ashley
Date: 2010-06-15 17:35:46 + (Tue, 15 Jun 2010)

Log Message:
---
PagedTiffHandler: trim trailing spaces

Modified Paths:
--
trunk/extensions/PagedTiffHandler/PagedTiffHandler.image.php
trunk/extensions/PagedTiffHandler/PagedTiffHandler.php
trunk/extensions/PagedTiffHandler/PagedTiffHandler_body.php
trunk/extensions/PagedTiffHandler/TiffReader.php

Modified: trunk/extensions/PagedTiffHandler/PagedTiffHandler.image.php
===
--- trunk/extensions/PagedTiffHandler/PagedTiffHandler.image.php
2010-06-15 17:33:44 UTC (rev 68088)
+++ trunk/extensions/PagedTiffHandler/PagedTiffHandler.image.php
2010-06-15 17:35:46 UTC (rev 68089)
@@ -29,25 +29,25 @@
 class PagedTiffImage {
protected $_meta = null;
protected $mFilename;
-   
+
function __construct( $filename ) {
$this-mFilename = $filename;
}
-   
+
/**
 * Called by MimeMagick functions.
 */
public function isValid() {
return count( $this-retrieveMetaData() );
}
-   
+
/**
 * Returns an array that corresponds to the native PHP function 
getimagesize().
 */
public function getImageSize() {
$data = $this-retrieveMetaData();
$size = $this-getPageSize( $data, 1 );
-   
+
if ( $size ) {
$width = $size['width'];
$height = $size['height'];
@@ -56,7 +56,7 @@
}
return false;
}
-   
+
/**
 * Returns an array with width and height of the tiff page.
 */
@@ -69,7 +69,7 @@
}
return false;
}
-   
+
/**
 * Reads metadata of the tiff file via shell command and returns an 
associative array.
 * layout:
@@ -81,17 +81,17 @@
 */
public function retrieveMetaData() {
global $wgImageMagickIdentifyCommand, $wgTiffExivCommand, 
$wgTiffUseExiv, $wgMemc, $wgTiffErrorCacheTTL;
-   
+
$imgKey = wfMemcKey( 'PagedTiffHandler-ThumbnailGeneration', 
$this-mFilename );
$isCached = $wgMemc-get( $imgKey );
if ( $isCached ) {
return - 1;
}
$wgMemc-add( $imgKey, 1, $wgTiffErrorCacheTTL );
-   
+
if ( $this-_meta === null ) {
if ( $wgImageMagickIdentifyCommand ) {
-   
+
wfProfileIn( 'PagedTiffImage::retrieveMetaData' 
);
/**
 * ImageMagick is used in order to get the 
basic metadata of embedded files.
@@ -100,7 +100,7 @@
$cmd = wfEscapeShellArg( 
$wgImageMagickIdentifyCommand ) .
' -format 
[BEGIN]page=%p\nalpha=%A\nalpha2=%r\nheight=%h\nwidth=%w\ndepth=%z[END] ' .
wfEscapeShellArg( $this-mFilename ) . 
' 21';
-   
+
wfProfileIn( 'identify' );
wfDebug( __METHOD__ . : $cmd\n );
$dump = wfShellExec( $cmd, $retval );
@@ -110,23 +110,23 @@
}
$this-_meta = $this-convertDumpToArray( $dump 
);
$this-_meta['exif'] = array();
-   
+
if ( $wgTiffUseExiv ) {
$cmd = wfEscapeShellArg( 
$wgTiffExivCommand ) .
' -u -psix -Pnt ' . // read 
EXIF, XMP, IPTC as name-tag = interpreted data -ignore unknown fields
// exiv2-doc @link 
http://www.exiv2.org/sample.html
# # the linux version of exiv2 
has a bug an this command doesn't work on it. ^SU
wfEscapeShellArg( 
$this-mFilename );
-   
+
wfRunHooks( 
'PagedTiffHandlerExivCommand', array( $cmd, $this-mFilename ) );
-   
+
wfProfileIn( 'exiv2' );
wfDebug( __METHOD__ . : $cmd\n );
$dump = wfShellExec( $cmd, $retval );
wfProfileOut( 'exiv2' );
$result = array();
preg_match_all( '/(\w+)\s+(.+)/', 
$dump, $result, PREG_SET_ORDER );
-   
+
foreach ( $result as $data

[MediaWiki-CVS] SVN: [68090] trunk/extensions/SocialProfile

2010-06-15 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/68090

Revision: 68090
Author:   ashley
Date: 2010-06-15 17:41:40 + (Tue, 15 Jun 2010)

Log Message:
---
SocialProfile: remove awardsmanage and giftadmin groups. sysop and staff groups 
have those rights, that should be enough. any site wanting to have separate 
awardsmanage/giftadmin groups can recreate them in LocalSettings.php

Modified Paths:
--
trunk/extensions/SocialProfile/SystemGifts/SystemGifts.php
trunk/extensions/SocialProfile/UserGifts/Gifts.php

Modified: trunk/extensions/SocialProfile/SystemGifts/SystemGifts.php
===
--- trunk/extensions/SocialProfile/SystemGifts/SystemGifts.php  2010-06-15 
17:35:46 UTC (rev 68089)
+++ trunk/extensions/SocialProfile/SystemGifts/SystemGifts.php  2010-06-15 
17:41:40 UTC (rev 68090)
@@ -1,7 +1,6 @@
 ?php
 
 $wgAvailableRights[] = 'awardsmanage';
-$wgGroupPermissions['awardsmanage']['awardsmanage'] = true;
 $wgGroupPermissions['staff']['awardsmanage'] = true;
 $wgGroupPermissions['sysop']['awardsmanage'] = true;
 

Modified: trunk/extensions/SocialProfile/UserGifts/Gifts.php
===
--- trunk/extensions/SocialProfile/UserGifts/Gifts.php  2010-06-15 17:35:46 UTC 
(rev 68089)
+++ trunk/extensions/SocialProfile/UserGifts/Gifts.php  2010-06-15 17:41:40 UTC 
(rev 68090)
@@ -1,7 +1,6 @@
 ?php
 
 $wgAvailableRights[] = 'giftadmin';
-$wgGroupPermissions['giftadmin']['giftadmin'] = true;
 $wgGroupPermissions['staff']['giftadmin'] = true;
 $wgGroupPermissions['sysop']['giftadmin'] = true;
 
@@ -47,7 +46,7 @@
'name' = 'GiftManager',
'version' = '1.0',
'description' = 'Adds a special page to administrate available gifts 
and add new ones',
-   'author' = 'Wikia New York Team',
+   'author' = array( 'Aaron Wright', 'David Pean' ),
'url' = 'http://www.mediawiki.org/wiki/Extension:SocialProfile'
 );
 
@@ -55,7 +54,7 @@
'name' = 'GiftManagerLogo',
'version' = '1.0',
'description' = 'Adds a special page to upload new gift images',
-   'author' = 'Wikia New York Team',
+   'author' = array( 'Aaron Wright', 'David Pean' ),
'url' = 'http://www.mediawiki.org/wiki/Extension:SocialProfile'
 );
 
@@ -63,7 +62,7 @@
'name' = 'GiveGift',
'version' = '1.0',
'description' = 'Adds a special page to give out gifts to your 
friends/foes',
-   'author' = 'Wikia New York Team',
+   'author' = array( 'Aaron Wright', 'David Pean' ),
'url' = 'http://www.mediawiki.org/wiki/Extension:SocialProfile'
 );
 
@@ -71,27 +70,27 @@
'name' = 'RemoveGift',
'version' = '1.0',
'description' = 'Adds a special page to remove gifts',
-   'author' = 'Wikia New York Team',
+   'author' = array( 'Aaron Wright', 'David Pean' ),
'url' = 'http://www.mediawiki.org/wiki/Extension:SocialProfile'
 );
 $wgExtensionCredits['specialpage'][] = array(
'name' = 'RemoveMasterGift',
'version' = '1.0',
'description' = 'Adds a special page to delete gifts from the 
database',
-   'author' = 'Wikia New York Team',
+   'author' = array( 'Aaron Wright', 'David Pean' ),
'url' = 'http://www.mediawiki.org/wiki/Extension:SocialProfile'
 );
 $wgExtensionCredits['specialpage'][] = array(
'name' = 'ViewGift',
'version' = '1.0',
'description' = 'Adds a special page to view given gifts',
-   'author' = 'Wikia New York Team',
+   'author' = array( 'Aaron Wright', 'David Pean' ),
'url' = 'http://www.mediawiki.org/wiki/Extension:SocialProfile'
 );
 $wgExtensionCredits['specialpage'][] = array(
'name' = 'ViewGifts',
'version' = '1.0',
'description' = 'Adds a special page to view given gifts',
-   'author' = 'Wikia New York Team',
+   'author' = array( 'Aaron Wright', 'David Pean' ),
'url' = 'http://www.mediawiki.org/wiki/Extension:SocialProfile'
 );



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [67974] trunk/extensions/FormatEmail/FormatEmail.php

2010-06-13 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67974

Revision: 67974
Author:   ashley
Date: 2010-06-14 01:48:07 + (Mon, 14 Jun 2010)

Log Message:
---
FormatEmail: killed ugly  unnecessary extension function 
(wfLoadExtensionMessages() is a no-op in trunk, but I moved the call to it to 
wfFormatEmail), tweaked spacing, added version number

Modified Paths:
--
trunk/extensions/FormatEmail/FormatEmail.php

Modified: trunk/extensions/FormatEmail/FormatEmail.php
===
--- trunk/extensions/FormatEmail/FormatEmail.php2010-06-14 01:36:58 UTC 
(rev 67973)
+++ trunk/extensions/FormatEmail/FormatEmail.php2010-06-14 01:48:07 UTC 
(rev 67974)
@@ -1,41 +1,39 @@
 ?php
-if ( ! defined( 'MEDIAWIKI' ) )
-   die();
-
-/*...@+
+/**
  * Allows custom headers/footers to be added to user to user emails.
  *
  * @file
  * @ingroup Extensions
- *
- * @link http://www.mediawiki.org/wiki/Extension:FormatEmail Documentation
- *
+ * @version 1.0
  * @author Travis Derouin tra...@wikihow.com
  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
+ * @link http://www.mediawiki.org/wiki/Extension:FormatEmail Documentation
  */
 
-$wgExtensionFunctions[] = 'wfFormatEmailInit';
+if ( !defined( 'MEDIAWIKI' ) ) {
+   die();
+}
 
+// Extension credits that will show up on Special:Version
 $wgExtensionCredits['other'][] = array(
'path' = __FILE__,
'name' = 'FormatEmail',
+   'version' = '1.0',
'author' = 'Travis Derouin',
'descriptionmsg' = 'email-desc',
'url' = 'http://www.mediawiki.org/wiki/Extension:FormatEmail',
 );
 
-$dir = dirname(__FILE__) . '/';
+$dir = dirname( __FILE__ ) . '/';
 $wgExtensionMessagesFiles['EmailUser'] = $dir . 'FormatEmail.i18n.php';
 
 $wgHooks['EmailUser'][] = 'wfFormatEmail';
 
-function wfFormatEmailInit() {
-   wfLoadExtensionMessages( 'EmailUser' );
-}
-
-function wfFormatEmail ($to, $from, $subject, $text ) {
+function wfFormatEmail( $to, $from, $subject, $text ) {
global $wgUser;
+   wfLoadExtensionMessages( 'EmailUser' );
$ul = $wgUser-getUserPage();
-   $text = wfMsg('email_header') . $text . 
wfMsg('email_footer',$wgUser-getName(), $ul-getFullURL());
+   $text = wfMsg( 'email_header' ) . $text .
+   wfMsg( 'email_footer', $wgUser-getName(), 
$ul-getFullURL() );
return true;
 }



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [67640] trunk/phase3/skins/Vector.php

2010-06-08 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67640

Revision: 67640
Author:   ashley
Date: 2010-06-08 16:55:19 + (Tue, 08 Jun 2010)

Log Message:
---
follow-up to r67631: add semicolon back

Modified Paths:
--
trunk/phase3/skins/Vector.php

Modified: trunk/phase3/skins/Vector.php
===
--- trunk/phase3/skins/Vector.php   2010-06-08 16:50:38 UTC (rev 67639)
+++ trunk/phase3/skins/Vector.php   2010-06-08 16:55:19 UTC (rev 67640)
@@ -35,7 +35,7 @@
// wait for the CSS file to load before fetching the HTC file.
$out-addScript(
'!--[if lt IE 7]style 
type=text/cssbody{behavior:url(' .
-   htmlspecialchars($wgLocalStylePath) .
+   htmlspecialchars( $wgLocalStylePath ) .
'/vector/csshover.htc)}/style![endif]--'
);
}
@@ -70,7 +70,7 @@
 * @private
 */
function buildNavigationUrls() {
-   global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, 
$wgArticle
+   global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, 
$wgArticle;
global $wgDisableLangConversion, $wgVectorUseIconWatch;
 
wfProfileIn( __METHOD__ );



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [67641] trunk/phase3/skins/Vector.php

2010-06-08 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67641

Revision: 67641
Author:   ashley
Date: 2010-06-08 17:03:25 + (Tue, 08 Jun 2010)

Log Message:
---
Vector:
*trim trailing spaces
*consistent capitalization for getLocalURL (it's defined as public function 
getLocalURL in Title.php, line 818)
*minor spacing tweaks

Modified Paths:
--
trunk/phase3/skins/Vector.php

Modified: trunk/phase3/skins/Vector.php
===
--- trunk/phase3/skins/Vector.php   2010-06-08 16:55:19 UTC (rev 67640)
+++ trunk/phase3/skins/Vector.php   2010-06-08 17:03:25 UTC (rev 67641)
@@ -8,8 +8,9 @@
  * @ingroup Skins
  */
 
-if( !defined( 'MEDIAWIKI' ) )
+if( !defined( 'MEDIAWIKI' ) ) {
die( -1 );
+}
 
 /**
  * SkinTemplate class for Vector skin
@@ -27,7 +28,7 @@
 */
public function initPage( OutputPage $out ) {
global $wgLocalStylePath;
-   
+
parent::initPage( $out );
 
// Append CSS which includes IE only behavior fixes for hover 
support -
@@ -41,14 +42,13 @@
}
 
/**
-* Load skin and user css files in the correct order
+* Load skin and user CSS files in the correct order
 * fixes bug 22916
 * @param $out OutputPage object
 */
-
function setupSkinUserCss( OutputPage $out ){
global $wgVectorExtraStyles;
-   
+
parent::setupSkinUserCss( $out );
 
// Append skin-specific styles
@@ -88,7 +88,6 @@
 
// Checks if page is some kind of content
if( $this-iscontent ) {
-
// Gets page objects for the related namespaces
$subjectPage = $this-mTitle-getSubjectPage();
$talkPage = $this-mTitle-getTalkPage();
@@ -151,7 +150,7 @@
? wfMsg( 'vector-view-edit' )
: wfMsg( 'vector-view-create' ),
'href' =
-   $this-mTitle-getLocalUrl( 
$this-editUrlOptions() )
+   $this-mTitle-getLocalURL( 
$this-editUrlOptions() )
);
// Checks if this is a current rev of talk page 
and we should show a new
// section link
@@ -163,7 +162,7 @@
$links['views']['addsection'] = 
array(
'class' = 'collapsible 
' . ( $section == 'new' ? 'selected' : false ),
'text' = wfMsg( 
'vector-action-addsection' ),
-   'href' = 
$this-mTitle-getLocalUrl(
+   'href' = 
$this-mTitle-getLocalURL(

'action=editsection=new'
)
);
@@ -176,7 +175,7 @@
'class' = ( $action == 'edit' ) ? 
'selected' : false,
'text' = wfMsg( 
'vector-view-viewsource' ),
'href' =
-   $this-mTitle-getLocalUrl( 
$this-editUrlOptions() )
+   $this-mTitle-getLocalURL( 
$this-editUrlOptions() )
);
}
wfProfileOut( __METHOD__ . '-edit' );
@@ -187,17 +186,17 @@
if ( $this-mTitle-exists() ) {
// Adds history view link
$links['views']['history'] = array(
-   'class' = 'collapsible ' . ( ($action 
== 'history') ? 'selected' : false ),
+   'class' = 'collapsible ' . ( ( $action 
== 'history' ) ? 'selected' : false ),
'text' = wfMsg( 'vector-view-history' 
),
-   'href' = $this-mTitle-getLocalUrl( 
'action=history' ),
+   'href' = $this-mTitle-getLocalURL( 
'action=history' ),
'rel' = 'archives',
);
 
if( $wgUser-isAllowed( 'delete' ) ) {
$links['actions']['delete'] = array(
-   'class' = ($action == 
'delete') ? 'selected' : false,
+   'class' = ( $action == 
'delete' ) ? 'selected' : false

[MediaWiki-CVS] SVN: [67472] trunk/extensions/SocialProfile/UserActivity

2010-06-06 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67472

Revision: 67472
Author:   ashley
Date: 2010-06-06 17:41:22 + (Sun, 06 Jun 2010)

Log Message:
---
SocialProfile: ignore log actions (user rights, block, etc.) in siteactivity 
tag. Blocking a user is not the same thing as editing their user page, 
obviously.

Modified Paths:
--
trunk/extensions/SocialProfile/UserActivity/UserActivity.body.php
trunk/extensions/SocialProfile/UserActivity/UserActivityClass.php

Modified: trunk/extensions/SocialProfile/UserActivity/UserActivity.body.php
===
--- trunk/extensions/SocialProfile/UserActivity/UserActivity.body.php   
2010-06-06 16:29:09 UTC (rev 67471)
+++ trunk/extensions/SocialProfile/UserActivity/UserActivity.body.php   
2010-06-06 17:41:22 UTC (rev 67472)
@@ -22,8 +22,6 @@
 
$wgOut-setPageTitle( wfMsg( 'useractivity-title' ) );
 
-   $this_title = SpecialPage::getTitleFor( 'UserActivity' );
-
$output = '';
 
$rel_type = $wgRequest-getVal( 'rel_type' );
@@ -94,7 +92,7 @@
$typeIcon = UserActivity::getTypeIcon( 
$item['type'] );
$output .= div 
class=\user-home-activity{$border_fix}\
img 
src=\{$wgScriptPath}/extensions/SocialProfile/images/ . $typeIcon . \ 
alt=\\ border=\0\ /
-   {$item[data]}
+   {$item['data']}
/div;
$x++;
}

Modified: trunk/extensions/SocialProfile/UserActivity/UserActivityClass.php
===
--- trunk/extensions/SocialProfile/UserActivity/UserActivityClass.php   
2010-06-06 16:29:09 UTC (rev 67471)
+++ trunk/extensions/SocialProfile/UserActivity/UserActivityClass.php   
2010-06-06 17:41:22 UTC (rev 67472)
@@ -77,7 +77,8 @@
 
$sql = SELECT UNIX_TIMESTAMP(rc_timestamp) AS item_date, 
rc_title,
rc_user, rc_user_text, rc_comment, rc_id, 
rc_minor, rc_new,
-   rc_namespace, rc_cur_id, rc_this_oldid, 
rc_last_oldid
+   rc_namespace, rc_cur_id, rc_this_oldid, 
rc_last_oldid,
+   rc_log_action
FROM {$dbr-tableName( 'recentchanges' )}
{$rel_sql} {$user_sql}
ORDER BY rc_id DESC LIMIT 0, . $this-item_max;
@@ -85,7 +86,9 @@
 
foreach ( $res as $row ) {
// Special pages aren't editable, so ignore them
-   if ( $row-rc_namespace == NS_SPECIAL ) {
+   // And blocking a vandal should not be counted as 
editing said
+   // vandal's user page...
+   if ( $row-rc_namespace == NS_SPECIAL || 
$row-rc_log_action != null ) {
continue;
}
$title = Title::makeTitle( $row-rc_namespace, 
$row-rc_title );



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [67473] trunk/extensions/SocialProfile

2010-06-06 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67473

Revision: 67473
Author:   ashley
Date: 2010-06-06 18:06:12 + (Sun, 06 Jun 2010)

Log Message:
---
SocialProfile: remove last YUI bits from UserProfilePage.js and clean up that 
file

Modified Paths:
--
trunk/extensions/SocialProfile/UserProfile/UserProfilePage.js

Added Paths:
---
trunk/extensions/SocialProfile/images/ajax-loader-white.gif

Modified: trunk/extensions/SocialProfile/UserProfile/UserProfilePage.js
===
--- trunk/extensions/SocialProfile/UserProfile/UserProfilePage.js   
2010-06-06 17:41:22 UTC (rev 67472)
+++ trunk/extensions/SocialProfile/UserProfile/UserProfilePage.js   
2010-06-06 18:06:12 UTC (rev 67473)
@@ -3,17 +3,16 @@
  */
 var posted = 0;
 function send_message() {
-   if( document.getElementById('message').value  !posted ) {
+   var userTo = document.getElementById( 'user_name_to' ).value;
+   var encMsg = encodeURIComponent( document.getElementById( 'message' 
).value );
+   var msgType = document.getElementById( 'message_type' ).value;
+   if( document.getElementById( 'message' ).value  !posted ) {
posted = 1;
sajax_request_type = 'POST';
-   sajax_do_call( 'wfSendBoardMessage', [
-   document.getElementById('user_name_to').value,
-   encodeURIComponent( 
document.getElementById('message').value ),
-   document.getElementById('message_type').value,
-   10 ], function( originalRequest ) {
-   
document.getElementById('user-page-board').innerHTML = 
originalRequest.responseText;
+   sajax_do_call( 'wfSendBoardMessage', [ userTo, encMsg, msgType, 
10 ], function( request ) {
+   document.getElementById( 'user-page-board' 
).innerHTML = request.responseText;
posted = 0;
-   document.getElementById('message').value = '';
+   document.getElementById( 'message' ).value = '';
}
);
}
@@ -22,7 +21,7 @@
 function delete_message( id ) {
if( confirm( 'Are you sure you want to delete this message?' ) ) {
sajax_request_type = 'POST';
-   sajax_do_call( 'wfDeleteBoardMessage', [ id ], function( 
originalRequest ) {
+   sajax_do_call( 'wfDeleteBoardMessage', [ id ], function( 
request ) {
window.location.reload();
} );
}
@@ -39,9 +38,9 @@
 }
 
 function uploadError( message ) {
-   document.getElementById('mini-gallery-' + replaceID).innerHTML = 
oldHtml;
-   document.getElementById('upload-frame-errors').innerHTML = message;
-   document.getElementById('imageUpload-frame').src = 
'index.php?title=Special:MiniAjaxUploadwpThumbWidth=75';
+   document.getElementById( 'mini-gallery-' + replaceID ).innerHTML = 
oldHtml;
+   document.getElementById( 'upload-frame-errors' ).innerHTML = message;
+   document.getElementById( 'imageUpload-frame' ).src = 
'index.php?title=Special:MiniAjaxUploadwpThumbWidth=75';
 
document.getElementById( 'upload-container' ).style.display = 'block';
document.getElementById( 'upload-container' ).style.visibility = 
'visible';
@@ -56,14 +55,14 @@
 function completeImageUpload() {
document.getElementById( 'upload-frame-errors' ).style.display = 'none';
document.getElementById( 'upload-frame-errors' ).style.visibility = 
'hidden';
-   document.getElementById('upload-frame-errors').innerHTML = '';
-   oldHtml = document.getElementById('mini-gallery-' + 
replaceID).innerHTML;
+   document.getElementById( 'upload-frame-errors' ).innerHTML = '';
+   oldHtml = document.getElementById( 'mini-gallery-' + replaceID 
).innerHTML;
 
for( x = 7; x  0; x-- ) {
-   document.getElementById('mini-gallery-' + ( x ) ).innerHTML =
-   document.getElementById('mini-gallery-' + ( x - 1 ) 
).innerHTML.replace( 'slideShowLink(' + ( x - 1 ) + ')','slideShowLink(' + ( x 
) + ')' );
+   document.getElementById( 'mini-gallery-' + ( x ) ).innerHTML =
+   document.getElementById( 'mini-gallery-' + ( x - 1 ) 
).innerHTML.replace( 'slideShowLink(' + ( x - 1 ) + ')','slideShowLink(' + ( x 
) + ')' );
}
-   document.getElementById('mini-gallery-0').innerHTML = 'aimg 
height=75 width=75 
src=http://images.wikia.com/common/wikiany/images/ajax-loader-white.gif; 
alt= //a';
+   document.getElementById( 'mini-gallery-0' ).innerHTML = 'aimg 
height=75 width=75 src=' + wgServer + wgScriptPath + 
'/extensions/SocialProfile/images/ajax-loader-white.gif alt= //a';
 
if( document.getElementById( 'no-pictures-containers

[MediaWiki-CVS] SVN: [67474] trunk/extensions/SocialProfile/install.settings

2010-06-06 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67474

Revision: 67474
Author:   ashley
Date: 2010-06-06 18:08:58 + (Sun, 06 Jun 2010)

Log Message:
---
SocialProfile: remove install.settings file

Removed Paths:
-
trunk/extensions/SocialProfile/install.settings

Deleted: trunk/extensions/SocialProfile/install.settings
===
--- trunk/extensions/SocialProfile/install.settings 2010-06-06 18:06:12 UTC 
(rev 67473)
+++ trunk/extensions/SocialProfile/install.settings 2010-06-06 18:08:58 UTC 
(rev 67474)
@@ -1,3 +0,0 @@
-require_once( {{path}}/SocialProfile.php );
-$wgExtraNamespaces[NS_USER_PROFILE] = User_profile;
-$wgExtraNamespaces[NS_USER_WIKI] = UserWiki;



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [67475] trunk/extensions/SocialProfile/UserBoard/SpecialSendBoardBlast .php

2010-06-06 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67475

Revision: 67475
Author:   ashley
Date: 2010-06-06 18:34:37 + (Sun, 06 Jun 2010)

Log Message:
---
SocialProfile: some minor tweaks to Special:SendBoardBlast

Modified Paths:
--
trunk/extensions/SocialProfile/UserBoard/SpecialSendBoardBlast.php

Modified: trunk/extensions/SocialProfile/UserBoard/SpecialSendBoardBlast.php
===
--- trunk/extensions/SocialProfile/UserBoard/SpecialSendBoardBlast.php  
2010-06-06 18:08:58 UTC (rev 67474)
+++ trunk/extensions/SocialProfile/UserBoard/SpecialSendBoardBlast.php  
2010-06-06 18:34:37 UTC (rev 67475)
@@ -79,10 +79,10 @@
h2' . wfMsg( 'boardblaststep1' ) . '/h2
form method=post name=blast action=
input type=hidden name=ids 
id=ids /
-   div class=blast-message-text
-   ' . wfMsg( 
'boardblastprivatenote' ) . '
-   /div
-   textarea name=message id=message 
cols=63 rows=4//textarea
+   div class=blast-message-text'
+   . wfMsg( 
'boardblastprivatenote' ) .
+   '/div
+   textarea name=message id=message 
cols=63 rows=4/textarea
/form
/div
div class=blast-nav
@@ -112,12 +112,12 @@
$per_row = 3;
if ( count( $relationships )  0 ) {
foreach ( $relationships as $relationship ) {
-   $output .= div class=\blast- . ( ( 
$relationship['type'] == 1 ) ? 'friend' : 'foe' ) . -unselected\ 
id=\user-{$relationship[user_id]}\ 
onclick=\javascript:toggle_user({$relationship[user_id]})\
-   {$relationship[user_name]}
+   $output .= 'div class=blast-' . ( ( 
$relationship['type'] == 1 ) ? 'friend' : 'foe' ) . -unselected\ 
id=\user-{$relationship['user_id']}\ 
onclick=\javascript:toggle_user({$relationship['user_id']})\
+   {$relationship['user_name']}
/div;
-   if ( $x == count( $relationships ) || 
$x != 1  $x % $per_row == 0 ) {
-   $output .= 'div 
class=cleared/div';
-   }
+   if ( $x == count( $relationships ) || $x != 1 
 $x % $per_row == 0 ) {
+   $output .= 'div 
class=cleared/div';
+   }
$x++;
}
} else {



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [67063] trunk/phase3/maintenance/Maintenance.php

2010-05-30 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67063

Revision: 67063
Author:   ashley
Date: 2010-05-30 10:08:13 + (Sun, 30 May 2010)

Log Message:
---
coding style  doxygen tweaks

Modified Paths:
--
trunk/phase3/maintenance/Maintenance.php

Modified: trunk/phase3/maintenance/Maintenance.php
===
--- trunk/phase3/maintenance/Maintenance.php2010-05-30 09:26:02 UTC (rev 
67062)
+++ trunk/phase3/maintenance/Maintenance.php2010-05-30 10:08:13 UTC (rev 
67063)
@@ -110,10 +110,10 @@
 * Add a parameter to the script. Will be displayed on --help
 * with the associated description
 *
-* @param $name String The name of the param (help, version, etc)
-* @param $description String The description of the param to show on 
--help
-* @param $required boolean Is the param required?
-* @param $withArg Boolean Is an argument required with this option?
+* @param $name String: the name of the param (help, version, etc)
+* @param $description String: the description of the param to show on 
--help
+* @param $required Boolean: is the param required?
+* @param $withArg Boolean: is an argument required with this option?
 */
protected function addOption( $name, $description, $required = false, 
$withArg = false ) {
$this-mParams[$name] = array( 'desc' = $description, 
'require' = $required, 'withArg' = $withArg );
@@ -121,8 +121,8 @@
 
/**
 * Checks to see if a particular param exists.
-* @param $name String The name of the param
-* @return boolean
+* @param $name String: the name of the param
+* @return Boolean
 */
protected function hasOption( $name ) {
return isset( $this-mOptions[$name] );
@@ -130,9 +130,9 @@
 
/**
 * Get an option, or return the default
-* @param $name String The name of the param
-* @param $default mixed Anything you want, default null
-* @return mixed
+* @param $name String: the name of the param
+* @param $default Mixed: anything you want, default null
+* @return Mixed
 */
protected function getOption( $name, $default = null ) {
if ( $this-hasOption( $name ) ) {
@@ -146,9 +146,9 @@
 
/**
 * Add some args that are needed
-* @param $arg String Name of the arg, like 'start'
-* @param $description String Short description of the arg
-* @param $required Boolean Is this required?
+* @param $arg String: name of the arg, like 'start'
+* @param $description String: short description of the arg
+* @param $required Boolean: is this required?
 */
protected function addArg( $arg, $description, $required = true ) {
$this-mArgList[] = array(
@@ -160,8 +160,8 @@
 
/**
 * Does a given argument exist?
-* @param $argId int The integer value (from zero) for the arg
-* @return boolean
+* @param $argId Integer: the integer value (from zero) for the arg
+* @return Boolean
 */
protected function hasArg( $argId = 0 ) {
return isset( $this-mArgs[$argId] );
@@ -169,8 +169,8 @@
 
/**
 * Get an argument.
-* @param $argId int The integer value (from zero) for the arg
-* @param $default mixed The default if it doesn't exist
+* @param $argId Integer: the integer value (from zero) for the arg
+* @param $default Mixed: the default if it doesn't exist
 * @return mixed
 */
protected function getArg( $argId = 0, $default = null ) {
@@ -179,7 +179,7 @@
 
/**
 * Set the batch size.
-* @param $s int The number of operations to do in a batch
+* @param $s Integer: the number of operations to do in a batch
 */
protected function setBatchSize( $s = 0 ) {
$this-mBatchSize = $s;
@@ -195,17 +195,19 @@
 
/**
 * Return input from stdin.
-* @param $length int The number of bytes to read. If null,
+* @param $length Integer: the number of bytes to read. If null,
 *just return the handle. Maintenance::STDIN_ALL returns
 *the full length
-* @return mixed
+* @return Mixed
 */
protected function getStdin( $len = null ) {
-   if ( $len == Maintenance::STDIN_ALL )
+   if ( $len == Maintenance::STDIN_ALL ) {
return file_get_contents( 'php://stdin' );
+   }
$f = fopen( 'php://stdin', 'rt' );
-   if ( !$len )
+   if ( !$len ) {
return $f;
+   }
$input = fgets( $f, $len );
fclose( $f

[MediaWiki-CVS] SVN: [67059] trunk/phase3/includes/SiteStats.php

2010-05-29 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67059

Revision: 67059
Author:   ashley
Date: 2010-05-29 23:45:02 + (Sat, 29 May 2010)

Log Message:
---
coding style  doxygen tweaks

Modified Paths:
--
trunk/phase3/includes/SiteStats.php

Modified: trunk/phase3/includes/SiteStats.php
===
--- trunk/phase3/includes/SiteStats.php 2010-05-29 23:21:25 UTC (rev 67058)
+++ trunk/phase3/includes/SiteStats.php 2010-05-29 23:45:02 UTC (rev 67059)
@@ -104,23 +104,27 @@
 */
static function admins() {
wfDeprecated(__METHOD__);
-   return self::numberingroup('sysop');
+   return self::numberingroup( 'sysop' );
}
 
/**
 * Find the number of users in a given user group.
-* @param string $group Name of group
-* @return int
+* @param $group String: name of group
+* @return Integer
 */
-   static function numberingroup($group) {
+   static function numberingroup( $group ) {
if ( !isset( self::$groupMemberCounts[$group] ) ) {
global $wgMemc;
$key = wfMemcKey( 'SiteStats', 'groupcounts', $group );
$hit = $wgMemc-get( $key );
if ( !$hit ) {
$dbr = wfGetDB( DB_SLAVE );
-   $hit = $dbr-selectField( 'user_groups', 
'COUNT(*)',
-   array( 'ug_group' = $group ), 
__METHOD__ );
+   $hit = $dbr-selectField(
+   'user_groups',
+   'COUNT(*)',
+   array( 'ug_group' = $group ),
+   __METHOD__
+   );
$wgMemc-set( $key, $hit, 3600 );
}
self::$groupMemberCounts[$group] = $hit;
@@ -131,9 +135,9 @@
static function jobs() {
if ( !isset( self::$jobs ) ) {
$dbr = wfGetDB( DB_SLAVE );
-   self::$jobs = $dbr-estimateRowCount('job');
+   self::$jobs = $dbr-estimateRowCount( 'job' );
/* Zero rows still do single row read for row that 
doesn't exist, but people are annoyed by that */
-   if (self::$jobs == 1) {
+   if ( self::$jobs == 1 ) {
self::$jobs = 0;
}
}
@@ -144,7 +148,12 @@
wfProfileIn( __METHOD__ );
if( !isset( self::$pageCount[$ns] ) ) {
$dbr = wfGetDB( DB_SLAVE );
-   $pageCount[$ns] = (int)$dbr-selectField( 'page', 
'COUNT(*)', array( 'page_namespace' = $ns ), __METHOD__ );
+   $pageCount[$ns] = (int)$dbr-selectField(
+   'page',
+   'COUNT(*)',
+   array( 'page_namespace' = $ns ),
+   __METHOD__
+   );
}
wfProfileOut( __METHOD__ );
return $pageCount[$ns];
@@ -163,7 +172,7 @@
foreach( array( 'total_views', 'total_edits', 'good_articles',
'total_pages', 'users', 'admins', 'images' ) as $member ) {
if(
-  $row-{ss_$member}  20
+   $row-{ss_$member}  20
or $row-{ss_$member}  0
) {
return false;
@@ -225,16 +234,25 @@
}
 
public static function cacheUpdate( $dbw ) {
-   $dbr = wfGetDB( DB_SLAVE, array( 'SpecialStatistics', 'vslow') 
);
+   $dbr = wfGetDB( DB_SLAVE, array( 'SpecialStatistics', 'vslow' ) 
);
# Get non-bot users than did some recent action other than 
making accounts.
# If account creation is included, the number gets inflated 
~20+ fold on enwiki.
-   $activeUsers = $dbr-selectField( 'recentchanges', 'COUNT( 
DISTINCT rc_user_text )',
-   array( 'rc_user != 0', 'rc_bot' = 0, rc_log_type != 
'newusers' OR rc_log_type IS NULL ),
-   __METHOD__ );
-   $dbw-update( 'site_stats',
-   array( 'ss_active_users' = intval($activeUsers) ),
-   array( 'ss_row_id' = 1 ), __METHOD__
+   $activeUsers = $dbr-selectField(
+   'recentchanges',
+   'COUNT( DISTINCT rc_user_text )',
+   array(
+   'rc_user != 0',
+   'rc_bot' = 0

[MediaWiki-CVS] SVN: [67006] trunk/extensions/StringFunctions/StringFunctions.php

2010-05-28 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/67006

Revision: 67006
Author:   ashley
Date: 2010-05-28 13:16:40 + (Fri, 28 May 2010)

Log Message:
---
StringFunctions: coding style cleanup + added check for MediaWiki environment

Modified Paths:
--
trunk/extensions/StringFunctions/StringFunctions.php

Modified: trunk/extensions/StringFunctions/StringFunctions.php
===
--- trunk/extensions/StringFunctions/StringFunctions.php2010-05-28 
11:43:05 UTC (rev 67005)
+++ trunk/extensions/StringFunctions/StringFunctions.php2010-05-28 
13:16:40 UTC (rev 67006)
@@ -96,13 +96,17 @@
 
 */
 
+if ( !defined( 'MEDIAWIKI' ) ) {
+   die();
+}
+
 $wgExtensionCredits['parserhook'][] = array(
-   'path'= __FILE__,
-   'name'= 'StringFunctions',
-   'version' = '2.0.3', // Nov 30, 2008
-   'descriptionmsg'  = 'stringfunctions-desc',
-   'author'  = array('Ross McClure', 'Juraj Simlovic'),
-   'url' = 
'http://www.mediawiki.org/wiki/Extension:StringFunctions',
+   'path' = __FILE__,
+   'name' = 'StringFunctions',
+   'version' = '2.0.3', // Nov 30, 2008
+   'author' = array( 'Ross McClure', 'Juraj Simlovic' ),
+   'url' = 'http://www.mediawiki.org/wiki/Extension:StringFunctions',
+   'descriptionmsg' = 'stringfunctions-desc',
 );
 
 $dir = dirname( __FILE__ ) . '/';
@@ -112,40 +116,40 @@
 
 $wgHooks['LanguageGetMagic'][] = 'wfStringFunctionsLanguageGetMagic';
 
-function wfStringFunctions ( ) {
+function wfStringFunctions() {
global $wgParser, $wgExtStringFunctions;
global $wgStringFunctionsLimitSearch;
global $wgStringFunctionsLimitReplace;
global $wgStringFunctionsLimitPad;
 
-   $wgExtStringFunctions = new ExtStringFunctions ( );
-   $wgStringFunctionsLimitSearch  =  30;
-   $wgStringFunctionsLimitReplace =  30;
+   $wgExtStringFunctions = new ExtStringFunctions();
+   $wgStringFunctionsLimitSearch  = 30;
+   $wgStringFunctionsLimitReplace = 30;
$wgStringFunctionsLimitPad = 100;
 
-   $wgParser-setFunctionHook('len',  
array($wgExtStringFunctions,'runLen'  ));
-   $wgParser-setFunctionHook('pos',  
array($wgExtStringFunctions,'runPos'  ));
-   $wgParser-setFunctionHook('rpos', 
array($wgExtStringFunctions,'runRPos' ));
-   $wgParser-setFunctionHook('sub',  
array($wgExtStringFunctions,'runSub'  ));
-   $wgParser-setFunctionHook('pad',  
array($wgExtStringFunctions,'runPad'  ));
-   $wgParser-setFunctionHook('replace',  
array($wgExtStringFunctions,'runReplace'  ));
-   $wgParser-setFunctionHook('explode',  
array($wgExtStringFunctions,'runExplode'  ));
-   
$wgParser-setFunctionHook('urlencode',array($wgExtStringFunctions,'runUrlEncode'));
-   
$wgParser-setFunctionHook('urldecode',array($wgExtStringFunctions,'runUrlDecode'));
+   $wgParser-setFunctionHook( 'len', array( $wgExtStringFunctions, 
'runLen' ) );
+   $wgParser-setFunctionHook( 'pos', array( $wgExtStringFunctions, 
'runPos' ) );
+   $wgParser-setFunctionHook( 'rpos', array( $wgExtStringFunctions, 
'runRPos' ) );
+   $wgParser-setFunctionHook( 'sub', array( $wgExtStringFunctions, 
'runSub' ) );
+   $wgParser-setFunctionHook( 'pad', array( $wgExtStringFunctions, 
'runPad' ) );
+   $wgParser-setFunctionHook( 'replace', array( $wgExtStringFunctions, 
'runReplace' ) );
+   $wgParser-setFunctionHook( 'explode', array( $wgExtStringFunctions, 
'runExplode' ) );
+   $wgParser-setFunctionHook( 'urlencode', array( $wgExtStringFunctions, 
'runUrlEncode' ) );
+   $wgParser-setFunctionHook( 'urldecode', array( $wgExtStringFunctions, 
'runUrlDecode' ) );
 }
 
-function wfStringFunctionsLanguageGetMagic( $magicWords, $langCode = en ) {
+function wfStringFunctionsLanguageGetMagic( $magicWords, $langCode = 'en' ) {
switch ( $langCode ) {
default:
-   $magicWords['len']  = array ( 0, 'len' );
-   $magicWords['pos']  = array ( 0, 'pos' );
-   $magicWords['rpos'] = array ( 0, 'rpos' );
-   $magicWords['sub']  = array ( 0, 'sub' );
-   $magicWords['pad']  = array ( 0, 'pad' );
-   $magicWords['replace']  = array ( 0, 'replace' );
-   $magicWords['explode']  = array ( 0, 'explode' );
-   $magicWords['urlencode']= array ( 0, 'urlencode' );
-   $magicWords['urldecode']= array ( 0, 'urldecode' );
+   $magicWords['len']  = array( 0, 'len' );
+   $magicWords['pos']  = array( 0, 'pos' );
+   $magicWords['rpos'] = array( 0, 'rpos' );
+   $magicWords['sub']  = array( 0, 'sub' );
+   $magicWords['pad']  = array( 0

[MediaWiki-CVS] SVN: [66746] trunk/phase3/includes/OutputPage.php

2010-05-22 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/66746

Revision: 66746
Author:   ashley
Date: 2010-05-22 11:47:56 + (Sat, 22 May 2010)

Log Message:
---
trim trailing spaces

Modified Paths:
--
trunk/phase3/includes/OutputPage.php

Modified: trunk/phase3/includes/OutputPage.php
===
--- trunk/phase3/includes/OutputPage.php2010-05-22 08:53:38 UTC (rev 
66745)
+++ trunk/phase3/includes/OutputPage.php2010-05-22 11:47:56 UTC (rev 
66746)
@@ -988,7 +988,7 @@
}
 
/**
-* Add wikitext with a custom Title object and 
+* Add wikitext with a custom Title object and
 *
 * @param $text String: wikitext
 * @param $title Title object
@@ -1304,13 +1304,13 @@
 */
public function getXVO() {
$cvCookies = $this-getCacheVaryCookies();
-   
+
$cookiesOption = array();
foreach ( $cvCookies as $cookieName ) {
$cookiesOption[] = 'string-contains=' . $cookieName;
}
$this-addVaryHeader( 'Cookie', $cookiesOption );
-   
+
$headers = array();
foreach( $this-mVaryHeader as $header = $option ) {
$newheader = $header;
@@ -1319,7 +1319,7 @@
$headers[] = $newheader;
}
$xvo = 'X-Vary-Options: ' . implode( ',', $headers );
-   
+
return $xvo;
}
 
@@ -1554,7 +1554,7 @@
) );
}
}
-   
+
if ( $wgJQueryOnEveryPage ) {
$this-includeJQuery();
}
@@ -2035,8 +2035,8 @@
public function addReturnTo( $title, $query=array(), $text=null ) {
global $wgUser;
$this-addLink( array( 'rel' = 'next', 'href' = 
$title-getFullUrl() ) );
-   $link = wfMsgHtml( 
-   'returnto', 
+   $link = wfMsgHtml(
+   'returnto',
$wgUser-getSkin()-link( $title, $text, array(), 
$query )
);
$this-addHTML( p id=\mw-returnto\{$link}/p\n );
@@ -2581,7 +2581,7 @@
 
/**
 * Include jQuery core. Use this to avoid loading it multiple times
-* before we get a usable script loader. 
+* before we get a usable script loader.
 *
 * @param $modules Array: list of jQuery modules which should be loaded
 * @return Array: the list of modules which were not loaded.



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [66748] trunk/phase3/includes/OutputPage.php

2010-05-22 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/66748

Revision: 66748
Author:   ashley
Date: 2010-05-22 12:18:22 + (Sat, 22 May 2010)

Log Message:
---
*coding style cleanup (added braces, spacing tweaks etc.)
*removed some unused globals

Modified Paths:
--
trunk/phase3/includes/OutputPage.php

Modified: trunk/phase3/includes/OutputPage.php
===
--- trunk/phase3/includes/OutputPage.php2010-05-22 11:58:46 UTC (rev 
66747)
+++ trunk/phase3/includes/OutputPage.php2010-05-22 12:18:22 UTC (rev 
66748)
@@ -1,6 +1,7 @@
 ?php
-if ( ! defined( 'MEDIAWIKI' ) )
+if ( !defined( 'MEDIAWIKI' ) ) {
die( 1 );
+}
 
 /**
  * @todo document
@@ -54,10 +55,11 @@
 
private $mIndexPolicy = 'index';
private $mFollowPolicy = 'follow';
-   private $mVaryHeader = array( 'Accept-Encoding' = 
array('list-contains=gzip'),
- 'Cookie' = 
null );
+   private $mVaryHeader = array(
+   'Accept-Encoding' = array( 'list-contains=gzip' ),
+   'Cookie' = null
+   );
 
-
/**
 * Constructor
 * Initialise private variables
@@ -98,7 +100,6 @@
$this-mStatusCode = $statusCode;
}
 
-
/**
 * Add a new meta tag
 * To add an http-equiv meta tag, precede the name with http:
@@ -147,7 +148,6 @@
$haveMeta = true;
}
 
-
/**
 * Add raw HTML to the list of scripts (including \script\ tag, etc.)
 *
@@ -189,7 +189,7 @@
if( substr( $file, 0, 1 ) == '/' || preg_match( 
'#^[a-z]*://#i', $file ) ) {
$path = $file;
} else {
-   $path =  {$wgStylePath}/common/{$file};
+   $path = {$wgStylePath}/common/{$file};
}
$this-addScript( Html::linkedScript( wfAppendQuery( $path, 
$wgStyleVersion ) ) );
}
@@ -274,7 +274,6 @@
return $this-mArticleBodyOnly;
}
 
-
/**
 * checkLastModified tells the client to use the client-cached page if
 * possible. If sucessful, the OutputPage is disabled so that
@@ -351,7 +350,7 @@
# Not modified
# Give a 304 response code and disable body output
wfDebug( __METHOD__ . : NOT MODIFIED, $info\n, false );
-   ini_set('zlib.output_compression', 0);
+   ini_set( 'zlib.output_compression', 0 );
$wgRequest-response()-header( HTTP/1.1 304 Not Modified );
$this-sendCacheControl();
$this-disable();
@@ -374,7 +373,6 @@
$this-mLastModified = wfTimestamp( TS_RFC2822, $timestamp );
}
 
-
/**
 * Set the robot policy for the page: 
http://www.robotstxt.org/meta.html
 *
@@ -386,10 +384,10 @@
public function setRobotPolicy( $policy ) {
$policy = Article::formatRobotPolicy( $policy );
 
-   if( isset( $policy['index'] ) ){
+   if( isset( $policy['index'] ) ) {
$this-setIndexPolicy( $policy['index'] );
}
-   if( isset( $policy['follow'] ) ){
+   if( isset( $policy['follow'] ) ) {
$this-setFollowPolicy( $policy['follow'] );
}
}
@@ -422,7 +420,6 @@
}
}
 
-
/**
 * Set the new value of the action text, this will be added to the
 * HTML title, separated from it with  - .
@@ -473,7 +470,7 @@
$nameWithTags = Sanitizer::normalizeCharReferences( 
Sanitizer::removeHTMLtags( $name ) );
$this-mPagetitle = $nameWithTags;
 
-   $taction =  $this-getPageTitleActionText();
+   $taction = $this-getPageTitleActionText();
if( !empty( $taction ) ) {
$name .= ' - '.$taction;
}
@@ -542,7 +539,6 @@
return $this-mSubtitle;
}
 
-
/**
 * Set the page as printable, i.e. it'll be displayed with with all
 * print styles included
@@ -560,7 +556,6 @@
return $this-mPrintable;
}
 
-
/**
 * Disable output completely, i.e. calling output() will have no effect
 */
@@ -577,7 +572,6 @@
return $this-mDoNothing;
}
 
-
/**
 * Show an add new section link?
 *
@@ -596,7 +590,6 @@
return $this-mHideNewSectionLink;
}
 
-
/**
 * Add or remove feed links in the page header
 * This is mainly kept for backward compatibility, see 
OutputPage::addFeedLink()
@@ -721,7 +714,6 @@
return $this-mIsArticleRelated;
}
 
-
/**
 * Add new language links
 *
@@ -751,7 +743,6

[MediaWiki-CVS] SVN: [66538] trunk/phase3/skins/common

2010-05-16 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/66538

Revision: 66538
Author:   ashley
Date: 2010-05-16 16:31:13 + (Sun, 16 May 2010)

Log Message:
---
*spaces - tabs for indentation
*trimmed trailing spaces
*made cologneblue.css readable
*no functional changes

Modified Paths:
--
trunk/phase3/skins/common/cologneblue.css
trunk/phase3/skins/common/commonPrint.css
trunk/phase3/skins/common/common_rtl.css
trunk/phase3/skins/common/diff.css

Modified: trunk/phase3/skins/common/cologneblue.css
===
--- trunk/phase3/skins/common/cologneblue.css   2010-05-16 16:30:04 UTC (rev 
66537)
+++ trunk/phase3/skins/common/cologneblue.css   2010-05-16 16:31:13 UTC (rev 
66538)
@@ -1,101 +1,210 @@
-body { margin: 0px; padding: 0px; color: black; }
-#specialform { display: inline; }
-#content { top: 0; margin: 0; padding: 0; }
+body {
+   margin: 0px;
+   padding: 0px;
+   color: black;
+}
+
+#specialform {
+   display: inline;
+}
+
+#content {
+   top: 0;
+   margin: 0;
+   padding: 0;
+}
+
 #mw-data-after-content {
- font-family: Verdana, Arial, sans-serif;
- color: black;
- font-size: 8pt;
+   font-family: Verdana, Arial, sans-serif;
+   color: black;
+   font-size: 8pt;
 }
-#topbar { padding: 0px; }
+
+#topbar {
+   padding: 0px;
+}
+
 #powersearch {
-  background: #DDEEFF; border-style: solid; border-width: 1px; padding: 2px;
+   background: #DDEEFF;
+   border-style: solid;
+   border-width: 1px;
+   padding: 2px;
 }
+
 #quickbar {
- width: 140px; top: 18ex; padding: 2px; visibility: visible; z-index: 99;
+   width: 140px;
+   top: 18ex;
+   padding: 2px;
+   visibility: visible;
+   z-index: 99;
 }
+
 #article, #article td, #article th, #article p {
- font-family: Verdana, Arial, sans-serif;
- font-size: 10pt; color: black;
+   font-family: Verdana, Arial, sans-serif;
+   font-size: 10pt;
+   color: black;
 }
+
 #article p {
- padding-top: 0; padding-bottom: 0;
- margin-top: 1ex; margin-bottom: 0;
+   padding-top: 0;
+   padding-bottom: 0;
+   margin-top: 1ex;
+   margin-bottom: 0;
 }
-p, pre, td, th, li, dd, dt { line-height: 12pt; }
-textarea { overflow: auto; }
 
-#footer { padding: 4px; }
-#footer form { display: inline; }
+p, pre, td, th, li, dd, dt {
+   line-height: 12pt;
+}
+
+textarea {
+   overflow: auto;
+}
+
+#footer {
+   padding: 4px;
+}
+
+#footer form {
+   display: inline;
+}
+
 #sitetitle {
- font-family: Times, serif;
- color: white;
- font-weight: normal; font-size: 32pt;
- line-height: 32pt;
+   font-family: Times, serif;
+   color: white;
+   font-weight: normal;
+   font-size: 32pt;
+   line-height: 32pt;
 }
+
 td.top {
- background-color: #6688AA; color: white;
- margin-top: 4px; margin-bottom: 4px;
- padding-top: 0; padding-bottom: 0;
- text-transform: uppercase;
- font-family: Verdana, Arial, sans-serif; font-size: 8pt;
+   background-color: #6688AA;
+   color: white;
+   margin-top: 4px;
+   margin-bottom: 4px;
+   padding-top: 0;
+   padding-bottom: 0;
+   text-transform: uppercase;
+   font-family: Verdana, Arial, sans-serif;
+   font-size: 8pt;
 }
+
 td.top a {
- font-family: Verdana, Arial, sans-serif;
- background-color: #6688AA; color: white;
- text-decoration: none; font-size: 10pt;
+   font-family: Verdana, Arial, sans-serif;
+   background-color: #6688AA;
+   color: white;
+   text-decoration: none;
+   font-size: 10pt;
 }
+
 td.bottom {
- font-family: Verdana, Arial, sans-serif;
- font-size: 10pt;
- padding: 0;
+   font-family: Verdana, Arial, sans-serif;
+   font-size: 10pt;
+   padding: 0;
 }
+
 #pagestats {
- font-family: Verdana, Arial, sans-serif;
- color: black;
- font-size: 9pt;
+   font-family: Verdana, Arial, sans-serif;
+   color: black;
+   font-size: 9pt;
 }
+
 #sitesub {
- font-family: Verdana, Arial, sans-serif;
- font-size: 9pt; font-weight: bold;
- color: black;
- padding-top: 0;
+   font-family: Verdana, Arial, sans-serif;
+   font-size: 9pt; font-weight: bold;
+   color: black;
+   padding-top: 0;
 }
+
 #quickbar {
- font-family: Verdana, Arial, sans-serif;
- font-size: 8pt; font-weight: bold; line-height: 9.5pt;
- text-decoration: none;
- color: black;
- padding: 0; margin-top: 0;
+   font-family: Verdana, Arial, sans-serif;
+   font-size: 8pt;
+   font-weight: bold;
+   line-height: 9.5pt;
+   text-decoration: none;
+   color: black;
+   padding: 0;
+   margin-top: 0;
 }
-#quickbar a { color: #446688; }
 
+#quickbar a {
+   color: #446688;
+}
+
 #quickbar h6 {
- font-family: Verdana, Arial, sans-serif;
- font-size: 10pt; font-weight: bold; line-height: 12pt;
- text-decoration: none;
- color: #66;
- padding: 0; margin-bottom: 2px; margin-top: 6px;
+   font-family: Verdana

[MediaWiki-CVS] SVN: [66540] trunk/phase3/skins/common

2010-05-16 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/66540

Revision: 66540
Author:   ashley
Date: 2010-05-16 16:55:14 + (Sun, 16 May 2010)

Log Message:
---
follow-up to r66538: more of the same

Modified Paths:
--
trunk/phase3/skins/common/nostalgia.css
trunk/phase3/skins/common/oldshared.css
trunk/phase3/skins/common/shared.css
trunk/phase3/skins/common/wikiprintable.css
trunk/phase3/skins/common/wikistandard.css

Modified: trunk/phase3/skins/common/nostalgia.css
===
--- trunk/phase3/skins/common/nostalgia.css 2010-05-16 16:37:34 UTC (rev 
66539)
+++ trunk/phase3/skins/common/nostalgia.css 2010-05-16 16:55:14 UTC (rev 
66540)
@@ -2,16 +2,47 @@
/* Background color is set separately on page type */
color: black;
 }
-#specialform { display: inline; }
+
+#specialform {
+   display: inline;
+}
+
 #powersearch {
-  background: #DDEEFF; border-style: solid; border-width: 1px; padding: 2px;
+   background: #DDEEFF;
+   border-style: solid;
+   border-width: 1px;
+   padding: 2px;
 }
-a.interwiki, a.external { color: #3366BB; }
-a.printable { text-decoration: underline; }
-a.stub { color:#772233; text-decoration:none; }
-h1.pagetitle { padding-top: 0; margin-top: 0; padding-bottom: 0; 
margin-bottom: 0; }
-h2, h3, h4, h5, h6 { margin-bottom: 0; }
-textarea { overflow: auto; }
-p.subtitle { padding-top: 0; margin-top: 0; }
 
+a.interwiki, a.external {
+   color: #3366BB;
+}
 
+a.printable {
+   text-decoration: underline;
+}
+
+a.stub {
+   color: #772233;
+   text-decoration: none;
+}
+
+h1.pagetitle {
+   padding-top: 0;
+   margin-top: 0;
+   padding-bottom: 0;
+   margin-bottom: 0;
+}
+
+h2, h3, h4, h5, h6 {
+   margin-bottom: 0;
+}
+
+textarea {
+   overflow: auto;
+}
+
+p.subtitle {
+   padding-top: 0;
+   margin-top: 0;
+}

Modified: trunk/phase3/skins/common/oldshared.css
===
--- trunk/phase3/skins/common/oldshared.css 2010-05-16 16:37:34 UTC (rev 
66539)
+++ trunk/phase3/skins/common/oldshared.css 2010-05-16 16:55:14 UTC (rev 
66540)
@@ -12,7 +12,9 @@
 h3 { font-size: 1.17em; }
 h5 { font-size: .83em; }
 h6 { font-size: .75em; }
-h1, h2, h3, h4, h5, h6 { font-weight: bolder }
+h1, h2, h3, h4, h5, h6 {
+   font-weight: bolder;
+}
 
 /* Now the custom parts */
 
@@ -20,32 +22,47 @@
 .editsection {
font-weight: normal;
 }
-h1 .editsection { font-size: 50% }
-h2 .editsection { font-size: 66.7% }
-h3 .editsection { font-size: 85.5% }
-h5 .editsection { font-size: 120% }
-h6 .editsection { font-size: 133% }
+h1 .editsection { font-size: 50%; }
+h2 .editsection { font-size: 66.7%; }
+h3 .editsection { font-size: 85.5%; }
+h5 .editsection { font-size: 120%; }
+h6 .editsection { font-size: 133%; }
 
 #footer { clear: both }
 /* images */
-div.floatright { float: right; clear: right; margin: 0 0 1em 1em; }
-div.floatright p { font-style: italic; }
-div.floatleft { float: left; clear: left; margin: 0.3em 0.5em 0.5em 0; }
-div.floatleft p { font-style: italic; }
+div.floatright {
+   float: right;
+   clear: right;
+   margin: 0 0 1em 1em;
+}
 
+div.floatright p {
+   font-style: italic;
+}
 
+div.floatleft {
+   float: left;
+   clear: left;
+   margin: 0.3em 0.5em 0.5em 0;
+}
+
+div.floatleft p {
+   font-style: italic;
+}
+
+
 /* Print-specific things to hide */
 .printfooter {
-display: none;
+   display: none;
 }
 
 /* table standards */
 table.rimage {
-float:right;
-margin-left:1em;
-margin-bottom:1em;
-text-align:center;
-font-size:smaller;
+   float: right;
+   margin-left: 1em;
+   margin-bottom: 1em;
+   text-align: center;
+   font-size: smaller;
 }
 
 /* thumbnails */
@@ -137,7 +154,6 @@
font-size: 94%;
 }
 
-
 .error {
color: red;
font-size: larger;
@@ -148,77 +164,88 @@
clear: both;
 }
 #preftoc {
-float: left;
-margin: 1em 1em 1em 1em;
-width: 13em;
+   float: left;
+   margin: 1em 1em 1em 1em;
+   width: 13em;
 }
-#preftoc li { border: 1px solid White; }
+#preftoc li {
+   border: 1px solid White;
+}
 #preftoc li.selected {
-background-color:#f9f9f9;
-border:1px dashed #aa;
+   background-color:#f9f9f9;
+   border:1px dashed #aa;
 }
 #preftoc a,
 #preftoc a:active {
-display: block;
-color: #005189;
+   display: block;
+   color: #005189;
 }
 .mw-prefs-buttons {
-clear: left;
-float: left;
-margin-top: 1em;
+   clear: left;
+   float: left;
+   margin-top: 1em;
 }
 div.htmlform-tip {
-font-size: 94%;
-margin-top: 0.4em;
-color: #666;
+   font-size: 94%;
+   margin-top: 0.4em;
+   color: #666;
 }
-fieldset.prefsection { margin-top: 1em }
-fieldset.operaprefsection

[MediaWiki-CVS] SVN: [66462] trunk/phase3/includes/parser/Parser.php

2010-05-15 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/66462

Revision: 66462
Author:   ashley
Date: 2010-05-15 10:35:54 + (Sat, 15 May 2010)

Log Message:
---
Parser.php: trim trailing spaces

Modified Paths:
--
trunk/phase3/includes/parser/Parser.php

Modified: trunk/phase3/includes/parser/Parser.php
===
--- trunk/phase3/includes/parser/Parser.php 2010-05-15 08:25:35 UTC (rev 
66461)
+++ trunk/phase3/includes/parser/Parser.php 2010-05-15 10:35:54 UTC (rev 
66462)
@@ -516,7 +516,7 @@
/**
 * Process the wikitext for the ?preload= feature. (bug 5210)
 *
-* noinclude, includeonly etc. are parsed as for template 
transclusion, 
+* noinclude, includeonly etc. are parsed as for template 
transclusion,
 * comments, templates, arguments, tags hooks and parser functions are 
untouched.
 */
public function getPreloadText( $text, $title, $options ) {
@@ -524,7 +524,7 @@
$this-clearState();
$this-setOutputType( self::OT_PLAIN );
$this-mOptions = $options;
-   $this-setTitle( $title ); 
+   $this-setTitle( $title );
 
$flags = PPFrame::NO_ARGS | PPFrame::NO_TEMPLATES;
$dom = $this-preprocessToDom( $text, self::PTD_FOR_INCLUSION );
@@ -1163,12 +1163,12 @@
}
# Count the number of occurrences of 
bold and italics mark-ups.
# We are not counting sequences of five 
apostrophes.
-   if ( strlen( $arr[$i] ) == 2 ) { 
+   if ( strlen( $arr[$i] ) == 2 ) {
$numitalics++;
-   } elseif ( strlen( $arr[$i] ) == 3 ) { 
+   } elseif ( strlen( $arr[$i] ) == 3 ) {
$numbold++;
-   } elseif ( strlen( $arr[$i] ) == 5 ) { 
-   $numitalics++; 
+   } elseif ( strlen( $arr[$i] ) == 5 ) {
+   $numitalics++;
$numbold++;
}
}
@@ -1193,7 +1193,7 @@
$firstspace = 
$i;
}
} elseif ( $x2 === ' ') {
-   if ( 
$firstsingleletterword == -1 ) { 
+   if ( 
$firstsingleletterword == -1 ) {

$firstsingleletterword = $i;
}
} else {
@@ -1613,10 +1613,10 @@
# [[Image:Foo.jpg|[http://example.com desc]]] 
- having three ] in a row fucks up,
# the real problem is with the $e1 regex
# See bug 1300.
-   # 
+   #
# Still some problems for cases where the ] is 
meant to be outside punctuation,
# and no image is in sight. See bug 2095.
-   # 
+   #
if ( $text !== '' 
substr( $m[3], 0, 1 ) === ']' 
strpos( $text, '[' ) !== false
@@ -1827,7 +1827,7 @@
wfProfileIn( __METHOD__.-always_known );
# Some titles, such as valid special pages or files in 
foreign repos, should
# be shown as bluelinks even though they're not 
included in the page table
-   # 
+   #
# FIXME: isAlwaysKnown() can be expensive for file 
links; we should really do
# batch file existence checks for NS_FILE and NS_MEDIA
if ( $iw == ''  $nt-isAlwaysKnown() ) {
@@ -1928,18 +1928,18 @@
/**
 * getCommon() returns the length of the longest common substring
 * of both arguments, starting at the beginning of both.
-* @private 
-*/ 
+* @private
+*/
function getCommon( $st1, $st2 ) {
$fl = strlen( $st1 );
$shorter = strlen( $st2 );
-   if ( $fl  $shorter ) { 
-   $shorter = $fl; 
+   if ( $fl

[MediaWiki-CVS] SVN: [66463] trunk/phase3/includes/json/FormatJson.php

2010-05-15 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/66463

Revision: 66463
Author:   ashley
Date: 2010-05-15 10:39:41 + (Sat, 15 May 2010)

Log Message:
---
coding style tweaks

Modified Paths:
--
trunk/phase3/includes/json/FormatJson.php

Modified: trunk/phase3/includes/json/FormatJson.php
===
--- trunk/phase3/includes/json/FormatJson.php   2010-05-15 10:35:54 UTC (rev 
66462)
+++ trunk/phase3/includes/json/FormatJson.php   2010-05-15 10:39:41 UTC (rev 
66463)
@@ -1,29 +1,31 @@
 ?php
-/*
- * simple wrapper for json_econde and json_decode that falls back on 
Services_JSON class
+/**
+ * Simple wrapper for json_econde and json_decode that falls back on 
Services_JSON class
  */
-if( !(defined( 'MEDIAWIKI' ) ) ) {
+if ( !defined( 'MEDIAWIKI' ) ) {
die( 1 );
 }
 
 class FormatJson {
-   public static function encode($value, $isHtml=false){
+   public static function encode( $value, $isHtml = false ) {
// Some versions of PHP have a broken json_encode, see PHP bug
// 46944. Test encoding an affected character (U+2) to
// avoid this.
-   if (!function_exists('json_encode') || $isHtml || 
strtolower(json_encode(\xf0\xa0\x80\x80)) != '\ud840\udc00') {
+   if ( !function_exists( 'json_encode' ) || $isHtml || 
strtolower( json_encode( \xf0\xa0\x80\x80 ) ) != '\ud840\udc00' ) {
$json = new Services_JSON();
-   return $json-encode($value, $isHtml) ;
+   return $json-encode( $value, $isHtml );
} else {
-   return json_encode($value);
+   return json_encode( $value );
}
}
-   public static function decode( $value, $assoc=false ){
-   if (!function_exists('json_decode') ) {
+
+   public static function decode( $value, $assoc = false ) {
+   if ( !function_exists( 'json_decode' ) ) {
$json = new Services_JSON();
$jsonDec = $json-decode( $value );
-   if( $assoc )
+   if( $assoc ) {
$jsonDec = wfObjectToArray( $jsonDec );
+   }
return $jsonDec;
} else {
return json_decode( $value, $assoc );



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [65759] trunk/extensions/CodeReview/api

2010-05-01 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/65759

Revision: 65759
Author:   ashley
Date: 2010-05-01 19:26:16 + (Sat, 01 May 2010)

Log Message:
---
CodeReview: coding style tweaks for API modules

Modified Paths:
--
trunk/extensions/CodeReview/api/ApiCodeComments.php
trunk/extensions/CodeReview/api/ApiCodeDiff.php
trunk/extensions/CodeReview/api/ApiCodeTestUpload.php
trunk/extensions/CodeReview/api/ApiCodeUpdate.php

Modified: trunk/extensions/CodeReview/api/ApiCodeComments.php
===
--- trunk/extensions/CodeReview/api/ApiCodeComments.php 2010-05-01 19:24:56 UTC 
(rev 65758)
+++ trunk/extensions/CodeReview/api/ApiCodeComments.php 2010-05-01 19:26:16 UTC 
(rev 65759)
@@ -1,11 +1,11 @@
 ?php
 
-/*
+/**
  * Created on Oct 29, 2008
  *
  * API for MediaWiki 1.8+
  *
- * Copyright (C) 2008 Bryan Tong Minh bryan.tongm...@gmail.com
+ * Copyright © 2008 Bryan Tong Minh bryan.tongm...@gmail.com
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -35,19 +35,23 @@
$this-dieUsage( 'You don\'t have permission to view 
code comments', 'permissiondenied' );
}
$params = $this-extractRequestParams();
-   if ( is_null( $params['repo'] ) )
+   if ( is_null( $params['repo'] ) ) {
$this-dieUsageMsg( array( 'missingparam', 'repo' ) );
+   }
$this-props = array_flip( $params['prop'] );
-   if ( isset( $this-props['revision'] ) )
+   if ( isset( $this-props['revision'] ) ) {
$this-setWarning( 'ccprop=revision has been deprecated 
in favor of ccprop=status' );
+   }
 
$listview = new CodeCommentsListView( $params['repo'] );
-   if ( is_null( $listview-getRepo() ) )
+   if ( is_null( $listview-getRepo() ) ) {
$this-dieUsage( Invalid repo ``{$params['repo']}'', 
'invalidrepo' );
+   }
$pager = $listview-getPager();
 
-   if ( !is_null( $params['start'] ) )
+   if ( !is_null( $params['start'] ) ) {
$pager-setOffset( $this-getDB()-timestamp( 
$params['start'] ) );
+   }
$limit = $params['limit'];
$pager-setLimit( $limit );
 
@@ -78,36 +82,41 @@
 
private function formatRow( $row ) {
$item = array();
-   if ( isset( $this-props['revid'] ) )
+   if ( isset( $this-props['revid'] ) ) {
$item['revid'] = $row-cc_rev_id;
-   if ( isset( $this-props['timestamp'] ) )
+   }
+   if ( isset( $this-props['timestamp'] ) ) {
$item['timestamp'] = wfTimestamp( TS_ISO_8601, 
$row-cc_timestamp );
-   if ( isset( $this-props['user'] ) )
+   }
+   if ( isset( $this-props['user'] ) ) {
$item['user'] = $row-cc_user_text;
-   if ( isset( $this-props['revision'] ) || isset( 
$this-props['status'] ) )
+   }
+   if ( isset( $this-props['revision'] ) || isset( 
$this-props['status'] ) ) {
$item['status'] = $row-cr_status;
-   if ( isset( $this-props['text'] ) )
+   }
+   if ( isset( $this-props['text'] ) ) {
ApiResult::setContent( $item, $row-cc_text );
+   }
return $item;
}
 
public function getAllowedParams() {
-   return array (
+   return array(
'repo' = null,
-   'limit' = array (
-   ApiBase :: PARAM_DFLT = 10,
-   ApiBase :: PARAM_TYPE = 'limit',
-   ApiBase :: PARAM_MIN = 1,
-   ApiBase :: PARAM_MAX = ApiBase :: LIMIT_BIG1,
-   ApiBase :: PARAM_MAX2 = ApiBase :: LIMIT_BIG2
+   'limit' = array(
+   ApiBase::PARAM_DFLT = 10,
+   ApiBase::PARAM_TYPE = 'limit',
+   ApiBase::PARAM_MIN = 1,
+   ApiBase::PARAM_MAX = ApiBase::LIMIT_BIG1,
+   ApiBase::PARAM_MAX2 = ApiBase::LIMIT_BIG2
),
'start' = array(
-   ApiBase :: PARAM_TYPE = 'timestamp'
+   ApiBase::PARAM_TYPE = 'timestamp'
),
-   'prop' = array (
-   ApiBase :: PARAM_ISMULTI = true,
-   ApiBase :: PARAM_DFLT

[MediaWiki-CVS] SVN: [65717] trunk/phase3/maintenance/tests/selenium

2010-04-30 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/65717

Revision: 65717
Author:   ashley
Date: 2010-04-30 22:06:13 + (Fri, 30 Apr 2010)

Log Message:
---
follow-up to r65715: convert spaces to tabs for indentation, as per our coding 
standards. no functional changes.

Modified Paths:
--
trunk/phase3/maintenance/tests/selenium/Selenium.php
trunk/phase3/maintenance/tests/selenium/SeleniumTestCase.php
trunk/phase3/maintenance/tests/selenium/SeleniumTestConsoleLogger.php
trunk/phase3/maintenance/tests/selenium/SeleniumTestHTMLLogger.php
trunk/phase3/maintenance/tests/selenium/SeleniumTestListener.php
trunk/phase3/maintenance/tests/selenium/SeleniumTestSuite.php

Modified: trunk/phase3/maintenance/tests/selenium/Selenium.php
===
--- trunk/phase3/maintenance/tests/selenium/Selenium.php2010-04-30 
21:57:26 UTC (rev 65716)
+++ trunk/phase3/maintenance/tests/selenium/Selenium.php2010-04-30 
22:06:13 UTC (rev 65717)
@@ -11,50 +11,50 @@
 
 class Selenium extends Testing_Selenium
 {
-protected static $_instance = null;
-public $isStarted = false;
-public static function getInstance()
-{
-global $wgSeleniumTestsBrowsers, $wgSeleniumTestsSeleniumHost, 
$wgSeleniumTestsUseBrowser;
-if (null === self::$_instance)
-{
-self::$_instance = new 
self($wgSeleniumTestsBrowsers[$wgSeleniumTestsUseBrowser], 
$wgSeleniumTestsSeleniumHost);
-}
-return self::$_instance;
-}
+   protected static $_instance = null;
+   public $isStarted = false;
+   public static function getInstance()
+   {
+   global $wgSeleniumTestsBrowsers, $wgSeleniumTestsSeleniumHost, 
$wgSeleniumTestsUseBrowser;
+   if (null === self::$_instance)
+   {
+   self::$_instance = new 
self($wgSeleniumTestsBrowsers[$wgSeleniumTestsUseBrowser], 
$wgSeleniumTestsSeleniumHost);
+   }
+   return self::$_instance;
+   }
 
-public function start()
-{
-global $wgSeleniumTestsBrowsers, $wgSeleniumTestsSeleniumHost;
-parent::start();
-$this-isStarted = true;
-}
+   public function start()
+   {
+   global $wgSeleniumTestsBrowsers, $wgSeleniumTestsSeleniumHost;
+   parent::start();
+   $this-isStarted = true;
+   }
 
-public function stop()
-{
-parent::stop();
-$this-isStarted = false;
-}
+   public function stop()
+   {
+   parent::stop();
+   $this-isStarted = false;
+   }
 
-public function login()
-{
-global $wgSeleniumTestsWikiUser, $wgSeleniumTestsWikiPassword, 
$wgSeleniumTestsWikiUrl;
+   public function login()
+   {
+   global $wgSeleniumTestsWikiUser, $wgSeleniumTestsWikiPassword, 
$wgSeleniumTestsWikiUrl;
 
-
$this-open($wgSeleniumTestsWikiUrl.'/index.php?title=Special:Userlogin');
-$this-type(wpName1, $wgSeleniumTestsWikiUser);
-$this-type(wpPassword1, $wgSeleniumTestsWikiPassword);
-$this-click(//inp...@id='wpLoginAttempt']);
-$value = $this-doCommand('assertTitle', array('Anmeldung 
erfolgreich*'));
-}
+   
$this-open($wgSeleniumTestsWikiUrl.'/index.php?title=Special:Userlogin');
+   $this-type(wpName1, $wgSeleniumTestsWikiUser);
+   $this-type(wpPassword1, $wgSeleniumTestsWikiPassword);
+   $this-click(//inp...@id='wpLoginAttempt']);
+   $value = $this-doCommand('assertTitle', array('Anmeldung 
erfolgreich*'));
+   }
 
-public function loadPage($title, $action)
-{
-global $wgSeleniumTestsWikiUrl;
-
$this-open($wgSeleniumTestsWikiUrl.'/index.php?title='.$title.'action='.$action);
-}
+   public function loadPage($title, $action)
+   {
+   global $wgSeleniumTestsWikiUrl;
+   
$this-open($wgSeleniumTestsWikiUrl.'/index.php?title='.$title.'action='.$action);
+   }
 
-// Prevent external cloning
-protected function __clone() {}
-// Prevent external construction
-//protected function __construct() {}
+   // Prevent external cloning
+   protected function __clone() {}
+   // Prevent external construction
+   //protected function __construct() {}
 }

Modified: trunk/phase3/maintenance/tests/selenium/SeleniumTestCase.php
===
--- trunk/phase3/maintenance/tests/selenium/SeleniumTestCase.php
2010-04-30 21:57:26 UTC (rev 65716)
+++ trunk/phase3/maintenance/tests/selenium/SeleniumTestCase.php
2010-04-30 22:06:13 UTC (rev 65717)
@@ -6,37 +6,37 @@
 
 class SeleniumTestCase extends PHPUnit_Framework_TestCase 
//PHPUnit_Extensions_SeleniumTestCase
 {
-protected $selenium;
+   protected $selenium;
 
-public

[MediaWiki-CVS] SVN: [65718] trunk/phase3/maintenance/tests

2010-04-30 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/65718

Revision: 65718
Author:   ashley
Date: 2010-04-30 22:21:36 + (Fri, 30 Apr 2010)

Log Message:
---
more follow-up to r65715: coding style tweaks, etc.

Modified Paths:
--
trunk/phase3/maintenance/tests/RunSeleniumTests.php
trunk/phase3/maintenance/tests/selenium/Selenium.php
trunk/phase3/maintenance/tests/selenium/SeleniumTestCase.php
trunk/phase3/maintenance/tests/selenium/SeleniumTestConsoleLogger.php
trunk/phase3/maintenance/tests/selenium/SeleniumTestHTMLLogger.php
trunk/phase3/maintenance/tests/selenium/SeleniumTestListener.php
trunk/phase3/maintenance/tests/selenium/SeleniumTestSuite.php

Modified: trunk/phase3/maintenance/tests/RunSeleniumTests.php
===
--- trunk/phase3/maintenance/tests/RunSeleniumTests.php 2010-04-30 22:06:13 UTC 
(rev 65717)
+++ trunk/phase3/maintenance/tests/RunSeleniumTests.php 2010-04-30 22:21:36 UTC 
(rev 65718)
@@ -1,49 +1,50 @@
 ?php
- /**
-  * Copyright (C) Wikimedia Deuschland, 2009
-  * Authors Hallo Welt! Medienwerkstatt GmbH
-  * Authors Markus Glaser
-  *
-  * This program is free software; you can redistribute it and/or modify
-  * it under the terms of the GNU General Public License as published by
-  * the Free Software Foundation; either version 2 of the License, or
-  * (at your option) any later version.
-  *
-  * This program is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-  * GNU General Public License for more details.
-  *
-  * You should have received a copy of the GNU General Public License along
-  * with this program; if not, write to the Free Software Foundation, Inc.,
-  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  * http://www.gnu.org/copyleft/gpl.html
-  *
-  */
+/**
+ * @file
+ * @ingroup Maintenance
+ * @copyright Copyright © Wikimedia Deuschland, 2009
+ * @author Hallo Welt! Medienwerkstatt GmbH
+ * @author Markus Glaser
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ */
 
-define( MEDIAWIKI, true );
-define( SELENIUMTEST, true);
+define( 'MEDIAWIKI', true );
+define( 'SELENIUMTEST', true );
 
-//command line only
+// Command line only
 $wgSeleniumTestsRunMode = 'cli';
 if( $wgSeleniumTestsRunMode == 'cli'  php_sapi_name() != 'cli' ) {
echo 'Must be run from the command line.';
die( -1 );
 }
-//include path and installation instructions
+// include path and installation instructions
 
-//URL: http://localhost/tests/RunSeleniumTests.php
-//set_include_path(get_include_path() . PATH_SEPARATOR . './PEAR/');
+// URL: http://localhost/tests/RunSeleniumTests.php
+//set_include_path( get_include_path() . PATH_SEPARATOR . './PEAR/' );
 
 // Hostname of selenium server
-$wgSeleniumTestsSeleniumHost  = http://localhost;;
+$wgSeleniumTestsSeleniumHost = 'http://localhost';
 
 // URL of the wiki to be tested.
-$wgSeleniumTestsWikiUrl   = 'http://localhost';
+$wgSeleniumTestsWikiUrl = 'http://localhost';
 
 // Wiki login. Used by Selenium to log onto the wiki
-$wgSeleniumTestsWikiUser  = WikiSysop;
-$wgSeleniumTestsWikiPassword  = password;
+$wgSeleniumTestsWikiUser  = 'WikiSysop';
+$wgSeleniumTestsWikiPassword  = 'password';
 
 // Common browsers on Windows platform
 // Use the *chrome handler in order to be able to test file uploads
@@ -69,12 +70,16 @@
 require_once 'selenium/SeleniumTestCase.php';
 
 $result = new PHPUnit_Framework_TestResult;
-switch ($wgSeleniumTestsRunMode) {
-case 'html' : $logger = new SeleniumTestHTMLLogger; break;
-case 'cli'  : $logger = new SeleniumTestConsoleLogger; break;
+switch ( $wgSeleniumTestsRunMode ) {
+   case 'html':
+   $logger = new SeleniumTestHTMLLogger;
+   break;
+   case 'cli':
+   $logger = new SeleniumTestConsoleLogger;
+   break;
 }
-$result-addListener(new SeleniumTestListener($logger));
 
+$result-addListener( new SeleniumTestListener( $logger ) );
 
 $wgSeleniumTestSuites = array();
 
@@ -82,12 +87,11 @@
 #include_once 'your tests';
 
 // Here, you can

[MediaWiki-CVS] SVN: [65526] trunk/extensions/SocialProfile/UserProfile/UserProfile.i18n. php

2010-04-25 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/65526

Revision: 65526
Author:   ashley
Date: 2010-04-25 20:26:38 + (Sun, 25 Apr 2010)

Log Message:
---
SocialProfile: some tweaks to Finnish (fi) translations

Modified Paths:
--
trunk/extensions/SocialProfile/UserProfile/UserProfile.i18n.php

Modified: trunk/extensions/SocialProfile/UserProfile/UserProfile.i18n.php
===
--- trunk/extensions/SocialProfile/UserProfile/UserProfile.i18n.php 
2010-04-25 19:23:39 UTC (rev 65525)
+++ trunk/extensions/SocialProfile/UserProfile/UserProfile.i18n.php 
2010-04-25 20:26:38 UTC (rev 65526)
@@ -3332,7 +3332,6 @@
 /** Finnish (Suomi)
  * @author Cimon Avaro
  * @author Crt
- * @author Jack Phoenix
  * @author Jack Phoenix j...@countervandalism.net
  * @author Str4nd
  */
@@ -3359,13 +3358,13 @@
'user-stats-title' = 'Tilastot',
'user-stats-edits' = '{{PLURAL:$1|Muokkaus|Muokkauksia}}',
'user-stats-votes' = '{{PLURAL:$1|Ääni|Ääniä}}',
-   'user-stats-comments' = '{{PLURAL:$1|Kommentti|Kommenttia}}',
-   'user-stats-recruits' = '{{PLURAL:$1|Rekrytoitu|Rekrytoitua}}',
+   'user-stats-comments' = '{{PLURAL:$1|Kommentti|Kommentteja}}',
+   'user-stats-recruits' = '{{PLURAL:$1|Rekrytoitu|Rekrytoituja}}',
'other-info-title' = 'Muut tiedot',
'user-friends-title' = 'Ystävät',
'user-foes-title' = 'Viholliset',
'other-info-movies' = 'Elokuvat',
-   'other-info-tv' = 'tv',
+   'other-info-tv' = 'TV',
'other-info-music' = 'Musiikki',
'other-info-books' = 'Kirjat',
'other-info-video-games' = 'Videopelit',



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [64755] trunk/phase3/languages/Language.php

2010-04-08 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/64755

Revision: 64755
Author:   ashley
Date: 2010-04-08 20:19:03 + (Thu, 08 Apr 2010)

Log Message:
---
coding style tweaks (spacing, braces, etc.) to Language.php

Modified Paths:
--
trunk/phase3/languages/Language.php

Modified: trunk/phase3/languages/Language.php
===
--- trunk/phase3/languages/Language.php 2010-04-08 19:38:02 UTC (rev 64754)
+++ trunk/phase3/languages/Language.php 2010-04-08 20:19:03 UTC (rev 64755)
@@ -13,18 +13,18 @@
 
 # Read language names
 global $wgLanguageNames;
-require_once( dirname(__FILE__) . '/Names.php' ) ;
+require_once( dirname( __FILE__ ) . '/Names.php' );
 
 global $wgInputEncoding, $wgOutputEncoding;
 
 /**
  * These are always UTF-8, they exist only for backwards compatibility
  */
-$wgInputEncoding= UTF-8;
-$wgOutputEncoding  = UTF-8;
+$wgInputEncoding= 'UTF-8';
+$wgOutputEncoding  = 'UTF-8';
 
 if( function_exists( 'mb_strtoupper' ) ) {
-   mb_internal_encoding('UTF-8');
+   mb_internal_encoding( 'UTF-8' );
 }
 
 /**
@@ -34,19 +34,19 @@
  */
 class FakeConverter {
var $mLang;
-   function FakeConverter($langobj) {$this-mLang = $langobj;}
-   function autoConvertToAllVariants($text) {return $text;}
-   function convert($t, $i) {return $t;}
+   function FakeConverter( $langobj ) { $this-mLang = $langobj; }
+   function autoConvertToAllVariants( $text ) { return $text; }
+   function convert( $t, $i ) { return $t; }
function getVariants() { return array( $this-mLang-getCode() ); }
function getPreferredVariant() { return $this-mLang-getCode(); }
function getConvRuleTitle() { return false; }
-   function findVariantLink($l, $n, $ignoreOtherCond = false) {}
-   function getExtraHashOptions() {return '';}
-   function getParsedTitle() {return '';}
-   function markNoConversion($text, $noParse=false) {return $text;}
-   function convertCategoryKey( $key ) {return $key; }
-   function convertLinkToAllVariants($text){ return array( 
$this-mLang-getCode() = $text); }
-   function armourMath($text){ return $text; }
+   function findVariantLink( $l, $n, $ignoreOtherCond = false ) {}
+   function getExtraHashOptions() { return ''; }
+   function getParsedTitle() { return ''; }
+   function markNoConversion( $text, $noParse = false ) { return $text; }
+   function convertCategoryKey( $key ) { return $key; }
+   function convertLinkToAllVariants( $text ) { return array( 
$this-mLang-getCode() = $text ); }
+   function armourMath( $text ) { return $text; }
 }
 
 /**
@@ -149,10 +149,10 @@
$class = 'Language' . str_replace( '-', '_', ucfirst( 
$code ) );
// Preload base classes to work around APC/PHP5 bug
if ( file_exists( 
$IP/languages/classes/$class.deps.php ) ) {
-   
include_once($IP/languages/classes/$class.deps.php);
+   include_once( 
$IP/languages/classes/$class.deps.php );
}
if ( file_exists( $IP/languages/classes/$class.php ) 
) {
-   
include_once($IP/languages/classes/$class.php);
+   include_once( 
$IP/languages/classes/$class.php );
}
}
 
@@ -160,7 +160,7 @@
throw new MWException( Language fallback loop detected 
when creating class $class\n );
}
 
-   if( ! class_exists( $class ) ) {
+   if( !class_exists( $class ) ) {
$fallback = Language::getFallbackFor( $code );
++$recursionLevel;
$lang = Language::newFromCode( $fallback );
@@ -185,7 +185,7 @@
}
 
function __construct() {
-   $this-mConverter = new FakeConverter($this);
+   $this-mConverter = new FakeConverter( $this );
// Set the code to the name of the descendant
if ( get_class( $this ) == 'Language' ) {
$this-mCode = 'en';
@@ -273,8 +273,8 @@
 */
function getFormattedNamespaces() {
$ns = $this-getNamespaces();
-   foreach($ns as $k = $v) {
-   $ns[$k] = strtr($v, '_', ' ');
+   foreach( $ns as $k = $v ) {
+   $ns[$k] = strtr( $v, '_', ' ' );
}
return $ns;
}
@@ -303,7 +303,7 @@
 */
function getFormattedNsText( $index ) {
$ns = $this-getNsText( $index );
-   return strtr($ns, '_', ' ');
+   return strtr( $ns, '_', ' ' );
}
 
/**
@@ -315,7 +315,7 @@
 * @return mixed An integer if $text is a valid value otherwise false

[MediaWiki-CVS] SVN: [64531] trunk/phase3/includes/parser/Parser.php

2010-04-02 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/64531

Revision: 64531
Author:   ashley
Date: 2010-04-02 20:56:11 + (Fri, 02 Apr 2010)

Log Message:
---
documentation tweak

Modified Paths:
--
trunk/phase3/includes/parser/Parser.php

Modified: trunk/phase3/includes/parser/Parser.php
===
--- trunk/phase3/includes/parser/Parser.php 2010-04-02 20:43:00 UTC (rev 
64530)
+++ trunk/phase3/includes/parser/Parser.php 2010-04-02 20:56:11 UTC (rev 
64531)
@@ -4227,7 +4227,7 @@
/**
 * Create an HTML-style tag, e.g. yourtagspecial text/yourtag
 * The callback should have the following form:
-*function myParserHook( $text, $params, $parser ) { ... }
+*function myParserHook( $text, $params, $parser ) { ... }
 *
 * Transform and return $text. Use $parser for any required context, 
e.g. use
 * $parser-getTitle() and $parser-getOptions() not $wgTitle or 
$wgOut-mParserOptions



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [64500] trunk/extensions/PackageForce

2010-04-01 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/64500

Revision: 64500
Author:   ashley
Date: 2010-04-01 20:34:53 + (Thu, 01 Apr 2010)

Log Message:
---
PackageForce:
*spacing tweaks
*removed unused globals
*added braces where appropriate
*trimmed whitespace
*docs

Modified Paths:
--
trunk/extensions/PackageForce/PackageForce.i18n.php
trunk/extensions/PackageForce/PackageForce.php
trunk/extensions/PackageForce/PackageForce.sql

Modified: trunk/extensions/PackageForce/PackageForce.i18n.php
===
--- trunk/extensions/PackageForce/PackageForce.i18n.php 2010-04-01 20:34:44 UTC 
(rev 64499)
+++ trunk/extensions/PackageForce/PackageForce.i18n.php 2010-04-01 20:34:53 UTC 
(rev 64500)
@@ -1,25 +1,34 @@
 ?php
+/**
+ * Internationalization file for Package Force extension.
+ *
+ * @file
+ * @ingroup Extensions
+ */
 
 $messages = array();
 
+/** English
+ * @author Svip
+ */
 $messages['en'] = array(
-   'packageforce'  = 'PackageForce',
+   'packageforce' = 'PackageForce',
'packageforceadmin' = 'PackageForceAdmin',
-   'pf-desc'   = 'Creating a special page to download 
packages of useful templates/etc..',
-   'pf-only-admins-allowed'= 'This page is only for users with 
the \'packageforce-admin\'-right.',
-   
+   'pf-desc' = 'Creating a special page to download packages of useful 
templates/etc.',
+   'pf-only-admins-allowed' = 'This page is only for users with the 
\'packageforce-admin\'-right.',
+
/* admin links */
'pf-admin-menu-default' = 'Default',
'pf-admin-menu-unsortedtemplates' = 'Templates not yet sorted',
-   'pf-admin-link-view-documentation'  = 'View documentations tied to 
page.',
-   'pf-admin-link-editlink-page'   =  'Edit page',
-   'pf-admin-link-approve' =  'Approve page',
-   
+   'pf-admin-link-view-documentation' = 'View documentations tied to 
page.',
+   'pf-admin-link-editlink-page' = 'Edit page',
+   'pf-admin-link-approve' = 'Approve page',
+
/* table headers */
-   'pf-header-documentation'   = 'Documentation',
-   'pf-header-in_packages' = 'Packages',
-   'pf-header-edit'= 'Edit link',
-   'pf-header-type'= 'Type of page',
-   'pf-header-page_title'  = 'Title',
-   'pf-header-approve' = 'Approve',
+   'pf-header-documentation' = 'Documentation',
+   'pf-header-in_packages' = 'Packages',
+   'pf-header-edit' = 'Edit link',
+   'pf-header-type' = 'Type of page',
+   'pf-header-page_title' = 'Title',
+   'pf-header-approve' = 'Approve',
 );

Modified: trunk/extensions/PackageForce/PackageForce.php
===
--- trunk/extensions/PackageForce/PackageForce.php  2010-04-01 20:34:44 UTC 
(rev 64499)
+++ trunk/extensions/PackageForce/PackageForce.php  2010-04-01 20:34:53 UTC 
(rev 64500)
@@ -1,33 +1,44 @@
 ?php
+/**
+ * Package Force extension - creates a special page to download packages of
+ * useful templates etc.
+ *
+ * @file
+ * @ingroup Extensions
+ * @version 0.1
+ * @author Svip svip[ at ]diku[ dot ]dk
+ * @copyright Copyright © 2010 Svip
+ * @link http://www.mediawiki.org/wiki/Extension:PackageForce Documentation
+ */
 
-# Alert the user that this is not a valid entry point to MediaWiki if 
+# Alert the user that this is not a valid entry point to MediaWiki if
 # they try to access the special pages file directly.
-if (!defined('MEDIAWIKI')) {
-echo EOT
+if ( !defined( 'MEDIAWIKI' ) ) {
+   echo EOT
 This is not a valid entry point, mister!
 
 TRY CATCH AGAIN, EXCEPTION BOY
 EOT;
-exit( 1 );
+   exit( 1 );
 }
 
-
+// Extension credits that will show up on Special:Version
 $wgExtensionCredits['specialpage'][] = array(
-   'path'= __FILE__,
-   'name'= 'Package Force',
-   'author'  = array( 'Svip' ),
-   'url' = 'http://www.mediawiki.org/wiki/Extension:PackageForce',
-   'description' = 'Creating a special page to download packages of 
useful templates/etc..',
+   'path' = __FILE__,
+   'name' = 'Package Force',
+   'version' = '0.1',
+   'author' = 'Svip',
+   'url' = 'http://www.mediawiki.org/wiki/Extension:PackageForce',
+   'description' = 'Creating a special page to download packages of 
useful templates/etc.',
'descriptionmsg' = 'pf-desc',
-   'version' = '0.1'
 );
 
-$dir = dirname(__FILE__);
+$dir = dirname( __FILE__ );
 $wgExtensionMessagesFiles['PackageForce'] = $dir/PackageForce.i18n.php;
 #$wgExtensionMessagesFiles['PackageForceMagic'] = 
$dir/PackageForce.i18n.magic.php;
 
 $wgExtensionAliasesFiles['PackageForce'] = $dir/PackageForce.alias.php;
-$wgSpecialPages['PackageForce'] = 'PackageForceSpecial

[MediaWiki-CVS] SVN: [64297] trunk/extensions/SocialProfile/UserStats/TopFansRecent.php

2010-03-28 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/64297

Revision: 64297
Author:   ashley
Date: 2010-03-28 17:23:15 + (Sun, 28 Mar 2010)

Log Message:
---
SocialProfile: some E_NOTICE fixes

Modified Paths:
--
trunk/extensions/SocialProfile/UserStats/TopFansRecent.php

Modified: trunk/extensions/SocialProfile/UserStats/TopFansRecent.php
===
--- trunk/extensions/SocialProfile/UserStats/TopFansRecent.php  2010-03-28 
17:00:57 UTC (rev 64296)
+++ trunk/extensions/SocialProfile/UserStats/TopFansRecent.php  2010-03-28 
17:23:15 UTC (rev 64297)
@@ -31,7 +31,7 @@
$period = 'monthly';
}
 
-   if ( !$period ) {
+   if ( !isset( $period ) ) {
$period = 'weekly';
}
 
@@ -79,7 +79,7 @@
$top_title = SpecialPage::getTitleFor( 'TopUsers' );
$recent_title = SpecialPage::getTitleFor( 'TopUsersRecent' );
 
-   $out .= 'div class=top-fan-nav
+   $out = 'div class=top-fan-nav
h1' . wfMsg( 'top-fans-by-points-nav-header' ) . 
'/h1
pa href=' . $top_title-escapeFullURL() . '' . 
wfMsg( 'top-fans-total-points-link' ) . '/a/p';
 



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [64298] trunk/extensions/SocialProfile/UserStats/TopUsers.php

2010-03-28 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/64298

Revision: 64298
Author:   ashley
Date: 2010-03-28 17:33:53 + (Sun, 28 Mar 2010)

Log Message:
---
SocialProfile: fix E_NOTICE in Special:TopUsers

Modified Paths:
--
trunk/extensions/SocialProfile/UserStats/TopUsers.php

Modified: trunk/extensions/SocialProfile/UserStats/TopUsers.php
===
--- trunk/extensions/SocialProfile/UserStats/TopUsers.php   2010-03-28 
17:23:15 UTC (rev 64297)
+++ trunk/extensions/SocialProfile/UserStats/TopUsers.php   2010-03-28 
17:33:53 UTC (rev 64298)
@@ -105,6 +105,7 @@
 
$x = 1;
$out .= 'div class=top-users';
+   $last_level = '';
 
foreach ( $user_list as $user ) {
$user_title = Title::makeTitle( NS_USER, 
$user['user_name'] );



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [64199] trunk/extensions/SocialProfile/UserWelcome/UserWelcome.php

2010-03-25 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/64199

Revision: 64199
Author:   ashley
Date: 2010-03-25 22:41:19 + (Thu, 25 Mar 2010)

Log Message:
---
SocialProfile: cleanup to UserWelcome and a fix for help page link (help pages 
are usually available only in the wiki's content language)

Modified Paths:
--
trunk/extensions/SocialProfile/UserWelcome/UserWelcome.php

Modified: trunk/extensions/SocialProfile/UserWelcome/UserWelcome.php
===
--- trunk/extensions/SocialProfile/UserWelcome/UserWelcome.php  2010-03-25 
22:31:41 UTC (rev 64198)
+++ trunk/extensions/SocialProfile/UserWelcome/UserWelcome.php  2010-03-25 
22:41:19 UTC (rev 64199)
@@ -5,9 +5,9 @@
  *
  * @file
  * @ingroup Extensions
+ * @version 1.3
  * @author David Pean david.p...@gmail.com
  * @author Jack Phoenix j...@countervandalism.net
- * @version 1.2
  * @link http://www.mediawiki.org/wiki/Extension:UserWelcome Documentation
  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
  */
@@ -20,7 +20,7 @@
 $wgExtensionCredits['parserhook'][] = array(
'path' = __FILE__,
'name' = 'UserWelcome',
-   'version' = '1.2',
+   'version' = '1.3',
'author' = array( 'David Pean', 'Jack Phoenix' ),
'descriptionmsg' = 'userwelcome-desc',
'url' = 'http://www.mediawiki.org/wiki/Extension:UserWelcome',
@@ -60,9 +60,8 @@
$user_level = new UserLevel( $stats_data['points'] );
 
// Safe links
-   $level_link = Title::makeTitle( NS_HELP, wfMsgHtml( 
'mp-userlevels-link' ) );
+   $level_link = Title::makeTitle( NS_HELP, wfMsgForContent( 
'mp-userlevels-link' ) );
$avatar_link = SpecialPage::getTitleFor( 'UploadAvatar' );
-   $invite_link = Title::makeTitle( NS_SPECIAL, 'InviteContacts' );
 
// Make an avatar
$avatar = new wAvatar( $wgUser-getID(), 'l' );
@@ -88,10 +87,15 @@
/div
div class=cleared/div
div class=needed-points
-   br /
-   ' . wfMsgExt( 'mp-welcome-needed-points', 
'parsemag', $level_link-escapeFullURL(),
-   $user_level-getNextLevelName(), 
$user_level-getPointsNeededToAdvance() ) . '
-   /div
+   br /'
+   . wfMsgExt(
+   'mp-welcome-needed-points',
+   'parsemag',
+   $level_link-escapeFullURL(),
+   $user_level-getNextLevelName(),
+   $user_level-getPointsNeededToAdvance()
+   ) .
+   '/div
/div';
}
 
@@ -106,7 +110,8 @@
wfLoadExtensionMessages( 'UserWelcome' );
 
// Get requests
-   $requests = getNewMessagesLink() . getRelationshipRequestLink() . 
getNewGiftLink() . getNewSystemGiftLink();
+   $requests = getNewMessagesLink() . getRelationshipRequestLink() .
+   getNewGiftLink() . getNewSystemGiftLink();
 
$output = '';
if ( $requests ) {
@@ -129,7 +134,6 @@
$foe_request_count = UserRelationship::getOpenRequestCount( 
$wgUser-getID(), 2 );
$relationship_request_link = SpecialPage::getTitleFor( 
'ViewRelationshipRequests' );
 
-   $rel_title = SpecialPage::getTitleFor( 'ViewRelationshipRequests' );
$output = '';
 
if ( $friend_request_count ) {
@@ -160,7 +164,9 @@
if ( $gift_count ) {
$output .= 'p
img src=' . $wgScriptPath . 
'/extensions/SocialProfile/images/icon_package_get.gif alt= border=0 /
-   a href=' . $gifts_title-escapeFullURL() . ' 
rel=nofollow' . wfMsgExt( 'mp-request-new-gift', 'parsemag', $gift_count ) . 
'/a
+   a href=' . $gifts_title-escapeFullURL() . ' 
rel=nofollow'
+   . wfMsgExt( 'mp-request-new-gift', 'parsemag', 
$gift_count ) .
+   '/a
/p';
}
return $output;
@@ -176,7 +182,9 @@
if ( $gift_count ) {
$output .= 'p
img src=' . $wgScriptPath . 
'/extensions/SocialProfile/images/awardIcon.png alt= border=0 /
-   a href=' . $gifts_title-escapeFullURL() . ' 
rel=nofollow' . wfMsgExt( 'mp-request-new-award', 'parsemag', $gift_count ) 
. '/a
+   a href=' . $gifts_title-escapeFullURL() . ' 
rel=nofollow'
+   . wfMsgExt( 'mp-request-new-award', 'parsemag', 
$gift_count ) .
+   '/a
/p';
}
 
@@ -191,8 +199,10 @@
if ( $new_messages ) {
$board_link = SpecialPage

[MediaWiki-CVS] SVN: [64077] trunk/phase3/includes/Categoryfinder.php

2010-03-23 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/64077

Revision: 64077
Author:   ashley
Date: 2010-03-23 15:43:57 + (Tue, 23 Mar 2010)

Log Message:
---
coding style tweaks

Modified Paths:
--
trunk/phase3/includes/Categoryfinder.php

Modified: trunk/phase3/includes/Categoryfinder.php
===
--- trunk/phase3/includes/Categoryfinder.php2010-03-23 15:41:18 UTC (rev 
64076)
+++ trunk/phase3/includes/Categoryfinder.php2010-03-23 15:43:57 UTC (rev 
64077)
@@ -10,14 +10,14 @@
  * # Determines whether the article with the page_id 12345 is in both
  * # Category 1 and Category 2 or their subcategories, respectively
  *
- * $cf = new Categoryfinder ;
- * $cf-seed (
- * array ( 12345 ) ,
- * array ( Category 1,Category 2 ) ,
- * AND
- * ) ;
- * $a = $cf-run() ;
- * print implode ( , , $a ) ;
+ * $cf = new Categoryfinder;
+ * $cf-seed(
+ * array( 12345 ),
+ * array( 'Category 1', 'Category 2' ),
+ * 'AND'
+ * );
+ * $a = $cf-run();
+ * print implode( ',' , $a );
  * /code
  *
  */
@@ -43,7 +43,7 @@
 * @param $categories FIXME
 * @param $mode String: FIXME, default 'AND'.
 */
-   function seed( $article_ids, $categories, $mode = AND ) {
+   function seed( $article_ids, $categories, $mode = 'AND' ) {
$this-articles = $article_ids;
$this-next = $article_ids;
$this-mode = $mode;
@@ -64,9 +64,9 @@
 * then checks the articles if they match the conditions
 * @return array of page_ids (those given to seed() that match the 
conditions)
 */
-   function run () {
+   function run() {
$this-dbr = wfGetDB( DB_SLAVE );
-   while ( count ( $this-next )  0 ) {
+   while ( count( $this-next )  0 ) {
$this-scan_next_layer();
}
 
@@ -90,7 +90,7 @@
 * @param $path used to check for recursion loops
 * @return bool Does this match the conditions?
 */
-   function check( $id , $conds, $path = array() ) {
+   function check( $id, $conds, $path = array() ) {
// Check for loops and stop!
if ( in_array( $id, $path ) ) {
return false;
@@ -114,13 +114,13 @@
# Is this a condition?
if ( isset( $conds[$pname] ) ) {
# This key is in the category list!
-   if ( $this-mode == OR ) {
+   if ( $this-mode == 'OR' ) {
# One found, that's enough!
$conds = array();
return true;
} else {
# Assuming AND as default
-   unset( $conds[$pname] ) ;
+   unset( $conds[$pname] );
if ( count( $conds ) == 0 ) {
# All conditions met, done
return true;
@@ -131,7 +131,7 @@
# Not done yet, try sub-parents
if ( !isset( $this-name2id[$pname] ) ) {
# No sub-parent
-   continue ;
+   continue;
}
$done = $this-check( $this-name2id[$pname], $conds, 
$path );
if ( $done || count( $conds ) == 0 ) {
@@ -152,10 +152,10 @@
/* FROM   */ 'categorylinks',
/* SELECT */ '*',
/* WHERE  */ array( 'cl_from' = $this-next ),
-   __METHOD__ . -1
+   __METHOD__ . '-1'
);
while ( $o = $this-dbr-fetchObject( $res ) ) {
-   $k = $o-cl_to ;
+   $k = $o-cl_to;
 
# Update parent tree
if ( !isset( $this-parents[$o-cl_from] ) ) {
@@ -164,9 +164,13 @@
$this-parents[$o-cl_from][$k] = $o;
 
# Ignore those we already have
-   if ( in_array ( $k , $this-deadend ) ) continue;
+   if ( in_array( $k, $this-deadend ) ) {
+   continue;
+   }
 
-   if ( isset ( $this-name2id[$k] ) ) continue;
+   if ( isset( $this-name2id[$k] ) ) {
+   continue;
+   }
 
# Hey, new category!
$layer[$k] = $k

[MediaWiki-CVS] SVN: [64078] trunk/phase3/includes

2010-03-23 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/64078

Revision: 64078
Author:   ashley
Date: 2010-03-23 16:11:37 + (Tue, 23 Mar 2010)

Log Message:
---
move newtalk stuff from SkinTemplate to its own function in Skin

Modified Paths:
--
trunk/phase3/includes/Skin.php
trunk/phase3/includes/SkinTemplate.php

Modified: trunk/phase3/includes/Skin.php
===
--- trunk/phase3/includes/Skin.php  2010-03-23 15:43:57 UTC (rev 64077)
+++ trunk/phase3/includes/Skin.php  2010-03-23 16:11:37 UTC (rev 64078)
@@ -2181,4 +2181,61 @@
public function commonPrintStylesheet() {
return true;
}
+
+   /**
+* Gets new talk page messages for the current user.
+* @return MediaWiki message or if no new talk page messages, nothing
+*/
+   function getNewtalks() {
+   global $wgUser, $wgOut;
+   $newtalks = $wgUser-getNewMessageLinks();
+
+   if( count( $newtalks ) == 1  $newtalks[0]['wiki'] === 
wfWikiID() ) {
+   $userTitle = $this-mUser-getUserPage();
+   $userTalkTitle = $userTitle-getTalkPage();
+
+   if( !$userTalkTitle-equals( $this-mTitle ) ) {
+   $newMessagesLink = $this-link(
+   $userTalkTitle,
+   wfMsgHtml( 'newmessageslink' ),
+   array(),
+   array( 'redirect' = 'no' ),
+   array( 'known', 'noclasses' )
+   );
+
+   $newMessagesDiffLink = $this-link(
+   $userTalkTitle,
+   wfMsgHtml( 'newmessagesdifflink' ),
+   array(),
+   array( 'diff' = 'cur' ),
+   array( 'known', 'noclasses' )
+   );
+
+   $ntl = wfMsg(
+   'youhavenewmessages',
+   $newMessagesLink,
+   $newMessagesDiffLink
+   );
+   # Disable Squid cache
+   $wgOut-setSquidMaxage( 0 );
+   }
+   } elseif( count( $newtalks ) ) {
+   // _  for BC = 1.16
+   $sep = str_replace( '_', ' ', wfMsgHtml( 
'newtalkseparator' ) );
+   $msgs = array();
+   foreach( $newtalks as $newtalk ) {
+   $msgs[] = Xml::element(
+   'a',
+   array( 'href' = $newtalk['link'] ), 
$newtalk['wiki']
+   );
+   }
+   $parts = implode( $sep, $msgs );
+   $ntl = wfMsgHtml( 'youhavenewmessagesmulti', $parts );
+   $wgOut-setSquidMaxage( 0 );
+   } else {
+   $ntl = '';
+   }
+   return $ntl;
+   }
+
 }

Modified: trunk/phase3/includes/SkinTemplate.php
===
--- trunk/phase3/includes/SkinTemplate.php  2010-03-23 15:43:57 UTC (rev 
64077)
+++ trunk/phase3/includes/SkinTemplate.php  2010-03-23 16:11:37 UTC (rev 
64078)
@@ -311,8 +311,8 @@
// Users can have their language set differently than the
// content of the wiki. For these users, tell the web browser
// that interface elements are in a different language.
-   $tpl-set( 'userlangattributes', '');
-   $tpl-set( 'specialpageattributes', '');
+   $tpl-set( 'userlangattributes', '' );
+   $tpl-set( 'specialpageattributes', '' );
 
$lang = $wgLang-getCode();
$dir  = $wgLang-getDir();
@@ -323,60 +323,17 @@
 
// The content of SpecialPages should be presented in 
the
// user's language. Content of regular pages should not 
be touched.
-   if($this-mTitle-isSpecialPage()) {
+   if( $this-mTitle-isSpecialPage() ) {
$tpl-set( 'specialpageattributes', $attrs );
}
}
 
-   $newtalks = $wgUser-getNewMessageLinks();
+   $newtalks = $this-getNewtalks();
 
-   if( count( $newtalks ) == 1  $newtalks[0]['wiki'] === 
wfWikiID() ) {
-   $usertitle = $this-mUser-getUserPage();
-   $usertalktitle = $usertitle

[MediaWiki-CVS] SVN: [64034] trunk/phase3/includes/Message.php

2010-03-22 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/64034

Revision: 64034
Author:   ashley
Date: 2010-03-22 18:39:53 + (Mon, 22 Mar 2010)

Log Message:
---
braces, spacing + comment tweaks

Modified Paths:
--
trunk/phase3/includes/Message.php

Modified: trunk/phase3/includes/Message.php
===
--- trunk/phase3/includes/Message.php   2010-03-22 18:14:25 UTC (rev 64033)
+++ trunk/phase3/includes/Message.php   2010-03-22 18:39:53 UTC (rev 64034)
@@ -23,7 +23,7 @@
  *
  * Shortcut for escaping the message too, similar to wfMsgHTML, but
  * parameters are not replaced after escaping by default.
- * $escaped = Message::key( 'key' )-rawParam( 'apple' ).escaped();
+ * $escaped = Message::key( 'key' )-rawParam( 'apple' )-escaped();
  *
  * TODO:
  * * document everything
@@ -86,7 +86,6 @@
 * @param $value Array: list of parameters, array keys will be ignored.
 * @return Message: reference to the object
 */
-
public function paramList( array $values ) {
$this-parameters += array_values( $values );
return $this;
@@ -166,7 +165,9 @@
 
protected function transformText( $string ) {
global $wgMessageCache;
-   if ( !isset( $wgMessageCache ) ) return $string;
+   if ( !isset( $wgMessageCache ) ) {
+   return $string;
+   }
// FIXME: handle second param correctly
return $wgMessageCache-transform( $string, true, 
$this-getLanguage() );
}



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [64010] trunk/extensions/AjaxLogin/AjaxLogin.css

2010-03-21 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/64010

Revision: 64010
Author:   ashley
Date: 2010-03-21 20:17:01 + (Sun, 21 Mar 2010)

Log Message:
---
AjaxLogin: CSS tweaks

Modified Paths:
--
trunk/extensions/AjaxLogin/AjaxLogin.css

Modified: trunk/extensions/AjaxLogin/AjaxLogin.css
===
--- trunk/extensions/AjaxLogin/AjaxLogin.css2010-03-21 19:48:42 UTC (rev 
64009)
+++ trunk/extensions/AjaxLogin/AjaxLogin.css2010-03-21 20:17:01 UTC (rev 
64010)
@@ -1,6 +1,4 @@
 /* CSS for AjaxLogin extension */
-
-/* styles copied from monaco/css/header.css */
 #userloginRound .r_boxContent {
background-color: #fff;
color: #00;
@@ -10,6 +8,8 @@
 #userloginRound .boxHeader {
padding: 3px 5px;
font-size: 12px;
+   background-color: #36C;
+   color: white;
 }
 
 #userloginRound form {
@@ -17,16 +17,6 @@
font-size: 12px;
 }
 
-/* copied from monaco/css/root.css */
-.color1, .color1 a, .hd {
-   background-color: #36C;
-   color: white;
-}
-
-.color2 {
-   background-color: #F5F5F5;
-}
-
 #userajaxloginform {
margin: 5px;
 }



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [63673] trunk/extensions/SocialProfile/SystemGifts/ SpecialSystemGiftManager.php

2010-03-13 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/63673

Revision: 63673
Author:   ashley
Date: 2010-03-13 13:43:48 + (Sat, 13 Mar 2010)

Log Message:
---
SocialProfile: show 50 gifts on Special:SystemGiftManager instead of 10

Modified Paths:
--
trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManager.php

Modified: 
trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManager.php
===
--- trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManager.php 
2010-03-13 11:42:04 UTC (rev 63672)
+++ trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManager.php 
2010-03-13 13:43:48 UTC (rev 63673)
@@ -80,7 +80,7 @@
global $wgScriptPath;
$output = ''; // Prevent E_NOTICE
$page = 0;
-   $per_page = 10;
+   $per_page = 50;
$gifts = SystemGifts::getGiftList( $per_page, $page );
if ( $gifts ) {
foreach ( $gifts as $gift ) {



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [63403] trunk/extensions/SocialProfile/UserStats/UserStatsClass.php

2010-03-08 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/63403

Revision: 63403
Author:   ashley
Date: 2010-03-08 18:01:28 + (Mon, 08 Mar 2010)

Log Message:
---
SocialProfile: add a comment, since for referencing purposes isn't exactly 
the most helpful comment there is...

Modified Paths:
--
trunk/extensions/SocialProfile/UserStats/UserStatsClass.php

Modified: trunk/extensions/SocialProfile/UserStats/UserStatsClass.php
===
--- trunk/extensions/SocialProfile/UserStats/UserStatsClass.php 2010-03-08 
17:58:22 UTC (rev 63402)
+++ trunk/extensions/SocialProfile/UserStats/UserStatsClass.php 2010-03-08 
18:01:28 UTC (rev 63403)
@@ -37,7 +37,9 @@
 $wgNamespacesForEditPoints = array( 0 );
 
 class UserStatsTrack {
+
// for referencing purposes
+   // key: statistic name in wgUserStatsPointValues - database column name
var $stats_fields = array(
'edit' = 'stats_edit_count',
'vote' = 'stats_vote_count',



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [63359] trunk/phase3/includes/specials/SpecialUpload.php

2010-03-07 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/63359

Revision: 63359
Author:   ashley
Date: 2010-03-07 14:07:14 + (Sun, 07 Mar 2010)

Log Message:
---
cleanup to SpecialUpload.php:
*trimmed trailing spaces
*more braces
*indentation tweaks
*removed unused globals
*removed unused $sk variable from showUploadWarning()
*changed double quotes to single where appropriate

Modified Paths:
--
trunk/phase3/includes/specials/SpecialUpload.php

Modified: trunk/phase3/includes/specials/SpecialUpload.php
===
--- trunk/phase3/includes/specials/SpecialUpload.php2010-03-07 12:32:21 UTC 
(rev 63358)
+++ trunk/phase3/includes/specials/SpecialUpload.php2010-03-07 14:07:14 UTC 
(rev 63359)
@@ -5,7 +5,6 @@
  * @ingroup Upload
  *
  * Form for handling uploads and special page.
- *
  */
 
 class SpecialUpload extends SpecialPage {
@@ -33,7 +32,7 @@
public$mDesiredDestName;// The requested target file name
protected $mComment;
protected $mLicense;
-   
+
/** User input variables from the root section **/
protected $mIgnoreWarning;
protected $mWatchThis;
@@ -46,11 +45,10 @@
protected $mCancelUpload;   // The user clicked Cancel and 
return to upload form button
protected $mTokenOk;
protected $mUploadSuccessful = false;   // Subclasses can use this to 
determine whether a file was uploaded
-   
+
/** Text injection points for hooks not using HTMLForm **/
public $uploadFormTextTop;
public $uploadFormTextAfterSummary;
-   
 
/**
 * Initialize instance variables from request and create an Upload 
handler
@@ -63,14 +61,15 @@
$this-mRequest = $request;
$this-mSourceType= $request-getVal( 'wpSourceType', 
'file' );
$this-mUpload= UploadBase::createFromRequest( 
$request );
-   $this-mUploadClicked = $request-wasPosted() 
-( $request-getCheck( 'wpUpload' ) 
+   $this-mUploadClicked = $request-wasPosted()
+( $request-getCheck( 'wpUpload' )
|| $request-getCheck( 'wpUploadIgnoreWarning' 
) );
 
// Guess the desired name from the filename if not provided
$this-mDesiredDestName   = $request-getText( 'wpDestFile' );
-   if( !$this-mDesiredDestName )
+   if( !$this-mDesiredDestName ) {
$this-mDesiredDestName = $request-getText( 
'wpUploadFile' );
+   }
$this-mComment   = $request-getText( 
'wpUploadDescription' );
$this-mLicense   = $request-getText( 'wpLicense' );
 
@@ -97,7 +96,7 @@
} else {
$this-mTokenOk = $wgUser-matchEditToken( $token );
}
-   
+
$this-uploadFormTextTop = '';
$this-uploadFormTextAfterSummary = '';
}
@@ -156,33 +155,37 @@
 
# Unsave the temporary file in case this was a cancelled upload
if ( $this-mCancelUpload ) {
-   if ( !$this-unsaveUploadedFile() )
+   if ( !$this-unsaveUploadedFile() ) {
# Something went wrong, so unsaveUploadedFile 
showed a warning
return;
+   }
}
 
# Process upload or show a form
-   if ( $this-mTokenOk  !$this-mCancelUpload
-( $this-mUpload  $this-mUploadClicked ) 
) {
+   if (
+   $this-mTokenOk  !$this-mCancelUpload 
+   ( $this-mUpload  $this-mUploadClicked )
+   )
+   {
$this-processUpload();
} else {
# Backwards compatibility hook
-   if( !wfRunHooks( 'UploadForm:initial', array( $this ) 
) )
-   {
+   if( !wfRunHooks( 'UploadForm:initial', array( $this ) 
) ) {
wfDebug( Hook 'UploadForm:initial' broke 
output of the upload form );
return;
}
-   
+
$this-showUploadForm( $this-getUploadForm() );
}
 
# Cleanup
-   if ( $this-mUpload )
+   if ( $this-mUpload ) {
$this-mUpload-cleanupTempFile();
+   }
}
 
/**
-* Show the main upload form 
+* Show the main upload form
 *
 * @param mixed $form An HTMLForm instance or HTML string to show
 */
@@ -191,14 +194,14 @@
if ( !$this-mDesiredDestName

[MediaWiki-CVS] SVN: [63098] trunk/extensions/SocialProfile/SystemGifts

2010-02-28 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/63098

Revision: 63098
Author:   ashley
Date: 2010-02-28 21:22:06 + (Sun, 28 Feb 2010)

Log Message:
---
SocialProfile: rewrote some DB queries, documented some functions and did 
general cleanup to SystemGifts

Modified Paths:
--
trunk/extensions/SocialProfile/SystemGifts/SpecialViewSystemGift.php
trunk/extensions/SocialProfile/SystemGifts/SystemGiftsClass.php

Modified: trunk/extensions/SocialProfile/SystemGifts/SpecialViewSystemGift.php
===
--- trunk/extensions/SocialProfile/SystemGifts/SpecialViewSystemGift.php
2010-02-28 21:16:38 UTC (rev 63097)
+++ trunk/extensions/SocialProfile/SystemGifts/SpecialViewSystemGift.php
2010-02-28 21:22:06 UTC (rev 63098)
@@ -15,10 +15,10 @@
 * @param $par Mixed: parameter passed to the page or null
 */
public function execute( $par ) {
-   global $wgUser, $wgOut, $wgRequest, $wgUploadPath, 
$wgSystemGiftsScripts, $wgDBprefix;
+   global $wgUser, $wgOut, $wgRequest, $wgUploadPath, 
$wgSystemGiftsScripts;
wfLoadExtensionMessages( 'SystemGifts' );
 
-   $wgOut-addStyle( '../..' . $wgSystemGiftsScripts . 
'/SystemGift.css' );
+   $wgOut-addExtensionStyle( $wgSystemGiftsScripts . 
'/SystemGift.css' );
 
$output = ''; // Prevent E_NOTICE
$user_name = ''; // Prevent E_NOTICE
@@ -30,17 +30,15 @@
return false;
}
 
-   if ( !$user_name ) $user_name = $wgUser-getName();
+   if ( !$user_name ) {
+   $user_name = $wgUser-getName();
+   }
$gift = UserSystemGifts::getUserGift( $gift_id );
$id = User::idFromName( $user_name );
 
$user_safe = urlencode( $gift['user_name'] );
 
-   // DB stuff
-   $dbr = wfGetDB( DB_MASTER );
-
if ( $gift ) {
-
if ( $gift['status'] == 1 ) {
if ( $gift['user_name'] == $wgUser-getName() ) 
{
$g = new UserSystemGifts( 
$gift['user_name'] );
@@ -48,45 +46,65 @@
$g-decNewSystemGiftCount( 
$wgUser-getID() );
}
}
-   $sql = SELECT DISTINCT sg_user_name, sg_user_id, 
sg_gift_id, sg_date FROM  . $wgDBprefix . user_system_gift WHERE 
sg_gift_id={$gift[gift_id]} AND sg_user_name' . addslashes( 
$gift['user_name'] ) . ' GROUP BY sg_user_name ORDER BY sg_date DESC LIMIT 
0,6;
-   $res = $dbr-query( $sql );
+   // DB stuff
+   $dbr = wfGetDB( DB_MASTER );
+   $res = $dbr-select(
+   'user_system_gift',
+   array(
+   'DISTINCT sg_user_name', 'sg_user_id', 
'sg_gift_id',
+   'sg_date'
+   ),
+   array(
+   sg_gift_id = {$gift['gift_id']},
+   sg_user_name  ' . $dbr-strencode( 
$gift['user_name'] ) . '
+   ),
+   __METHOD__,
+   array(
+   'GROUP BY' = 'sg_user_name',
+   'ORDER BY' = 'sg_date DESC',
+   'OFFSET' = 0,
+   'LIMIT' = 6
+   )
+   );
 
$output .= $wgOut-setPageTitle( wfMsg( 
'ga-gift-title', $gift['user_name'], $gift['name'] ) );
 
-   $output .= 'div class=back-links
-   ' . wfMsg( 'ga-back-link', Title::makeTitle( 
NS_USER, $gift['user_name'] )-escapeFullURL(), $gift['user_name'] ) . '
-   /div';
+   $output .= 'div class=back-links'
+   . wfMsg( 'ga-back-link', Title::makeTitle( 
NS_USER, $gift['user_name'] )-escapeFullURL(), $gift['user_name'] ) .
+   '/div';
 
$message = $wgOut-parse( trim( $gift['description'] ), 
false );
$output .= 'div class=ga-description-container';
 
-   $gift_image = img 
src=\{$wgUploadPath}/awards/ . SystemGifts::getGiftImage( $gift['gift_id'], 
'l' ) . \ border=\0\ alt=\\/;
+   $gift_image = img src=\{$wgUploadPath}/awards/ . 
SystemGifts::getGiftImage( $gift['gift_id'], 'l' ) . ' border=0 alt=/';
 
-   $output .= div class=\ga-description\
+   $output

[MediaWiki-CVS] SVN: [63099] trunk/extensions/SocialProfile/SystemGifts/ UserSystemGiftsClass.php

2010-02-28 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/63099

Revision: 63099
Author:   ashley
Date: 2010-02-28 21:27:38 + (Sun, 28 Feb 2010)

Log Message:
---
SocialProfile: forgot one SystemGifts file

Modified Paths:
--
trunk/extensions/SocialProfile/SystemGifts/UserSystemGiftsClass.php

Modified: trunk/extensions/SocialProfile/SystemGifts/UserSystemGiftsClass.php
===
--- trunk/extensions/SocialProfile/SystemGifts/UserSystemGiftsClass.php 
2010-02-28 21:22:06 UTC (rev 63098)
+++ trunk/extensions/SocialProfile/SystemGifts/UserSystemGiftsClass.php 
2010-02-28 21:27:38 UTC (rev 63099)
@@ -28,16 +28,19 @@
public function sendSystemGift( $gift_id, $email = true ) {
global $wgMemc;
 
-   if ( $this-doesUserHaveGift( $this-user_id, $gift_id ) ) 
return '';
+   if ( $this-doesUserHaveGift( $this-user_id, $gift_id ) ) {
+   return '';
+   }
 
$dbw = wfGetDB( DB_MASTER );
-   $dbw-insert( 'user_system_gift',
+   $dbw-insert(
+   'user_system_gift',
array(
'sg_gift_id' = $gift_id,
'sg_user_id' = $this-user_id,
'sg_user_name' = $this-user_name,
'sg_status' = 1,
-   'sg_date' = date( Y-m-d H:i:s ),
+   'sg_date' = date( 'Y-m-d H:i:s' ),
),
__METHOD__
);
@@ -47,17 +50,19 @@
// Add to new gift count cache for receiving user
$this-incNewSystemGiftCount( $this-user_id );
 
-   if ( $email  !empty( $sg_gift_id ) ) 
$this-sendGiftNotificationEmail( $this-user_id, $gift_id );
+   if ( $email  !empty( $sg_gift_id ) ) {
+   $this-sendGiftNotificationEmail( $this-user_id, 
$gift_id );
+   }
$wgMemc-delete( wfMemcKey( 'user', 'profile', 'system_gifts', 
$this-user_id ) );
return $sg_gift_id;
}
 
public function sendGiftNotificationEmail( $user_id_to, $gift_id ) {
-   wfLoadExtensionMessages( 'SystemGifts' );
$gift = SystemGifts::getGift( $gift_id );
$user = User::newFromId( $user_id_to );
$user-loadFromDatabase();
if ( $user-isEmailConfirmed()  $user-getIntOption( 
'notifygift', 1 ) ) {
+   wfLoadExtensionMessages( 'SystemGifts' );
$gifts_link = SpecialPage::getTitleFor( 
'ViewSystemGifts' );
$update_profile_link = SpecialPage::getTitleFor( 
'UpdateProfile' );
$subject = wfMsgExt( 'system_gift_received_subject', 
'parsemag',
@@ -77,7 +82,12 @@
 
public function doesUserHaveGift( $user_id, $gift_id ) {
$dbr = wfGetDB( DB_SLAVE );
-   $s = $dbr-selectRow( 'user_system_gift', array( 'sg_status' ), 
array( 'sg_user_id' = $user_id, 'sg_gift_id' = $gift_id ), __METHOD__ );
+   $s = $dbr-selectRow(
+   'user_system_gift',
+   array( 'sg_status' ),
+   array( 'sg_user_id' = $user_id, 'sg_gift_id' = 
$gift_id ),
+   __METHOD__
+   );
if ( $s !== false ) {
return true;
}
@@ -87,11 +97,9 @@
public function clearAllUserSystemGiftStatus() {
$dbw = wfGetDB( DB_MASTER );
$dbw-update( 'user_system_gift',
-   array( /* SET */
-   'sg_status' = 0
-   ), array( /* WHERE */
-   'sg_user_id' = $this-user_id
-   ), __METHOD__
+   /* SET */array( 'sg_status' = 0 ),
+   /* WHERE */array( 'sg_user_id' = $this-user_id ),
+   __METHOD__
);
$this-clearNewSystemGiftCountCache( $this-user_id );
}
@@ -99,17 +107,20 @@
static function clearUserGiftStatus( $id ) {
$dbw = wfGetDB( DB_MASTER );
$dbw-update( 'user_system_gift',
-   array( /* SET */
-   'sg_status' = 0
-   ), array( /* WHERE */
-   'sg_id' = $id
-   ), __METHOD__
+   /* SET */array( 'sg_status' = 0 ),
+   /* WHERE */array( 'sg_id' = $id ),
+   __METHOD__
);
}
 
public function doesUserOwnGift( $user_id, $sg_id ) {
$dbr = wfGetDB( DB_SLAVE );
-   $s = $dbr-selectRow( 'user_system_gift', array( 'sg_user_id' 
), array( 'sg_id' = $sg_id

[MediaWiki-CVS] SVN: [63101] trunk/extensions/SocialProfile/UserGifts

2010-02-28 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/63101

Revision: 63101
Author:   ashley
Date: 2010-02-28 21:40:31 + (Sun, 28 Feb 2010)

Log Message:
---
SocialProfile: rewrote UserGifts' DB queries

Modified Paths:
--
trunk/extensions/SocialProfile/UserGifts/GiftsClass.php
trunk/extensions/SocialProfile/UserGifts/UserGiftsClass.php

Modified: trunk/extensions/SocialProfile/UserGifts/GiftsClass.php
===
--- trunk/extensions/SocialProfile/UserGifts/GiftsClass.php 2010-02-28 
21:28:04 UTC (rev 63100)
+++ trunk/extensions/SocialProfile/UserGifts/GiftsClass.php 2010-02-28 
21:40:31 UTC (rev 63101)
@@ -1,7 +1,8 @@
 ?php
 /**
  * Gifts class
- * Functions for managing individual social gifts (add to/fetch/remove from 
database etc.)
+ * Functions for managing individual social gifts
+ * (add to/fetch/remove from database etc.)
  */
 class Gifts {
 
@@ -35,11 +36,12 @@
 
$dbw = wfGetDB( DB_MASTER );
 
-   $dbw-insert( 'gift',
+   $dbw-insert(
+   'gift',
array(
'gift_name' = $gift_name,
'gift_description' = $gift_description,
-   'gift_createdate' = date( Y-m-d H:i:s ),
+   'gift_createdate' = date( 'Y-m-d H:i:s' ),
'gift_creator_user_id' = $wgUser-getID(),
'gift_creator_user_name' = $wgUser-getName(),
'gift_access' = $gift_access,
@@ -74,15 +76,22 @@
 * @return Gift information, including ID number, name, description, 
creator's user name and ID and gift access
 */
static function getGift( $id ) {
-   if ( !is_numeric( $id ) )
+   if ( !is_numeric( $id ) ) {
return '';
+   }
$dbr = wfGetDB( DB_SLAVE );
-   $sql = SELECT gift_id, gift_name, gift_description,
-   gift_creator_user_id, gift_creator_user_name, 
gift_access
-   FROM {$dbr-tableName( 'gift' )} WHERE gift_id = {$id} 
LIMIT 0,1;
-   $res = $dbr-query( $sql );
+   $res = $dbr-select(
+   'gift',
+   array(
+   'gift_id', 'gift_name', 'gift_description',
+   'gift_creator_user_id', 
'gift_creator_user_name', 'gift_access'
+   ),
+   array( gift_id = {$id} ),
+   __METHOD__,
+   array( 'LIMIT' = 1, 'OFFSET' = 0 )
+   );
$row = $dbr-fetchObject( $res );
-   $gift = '';
+   $gift = array();
if ( $row ) {
$gift['gift_id'] = $row-gift_id;
$gift['gift_name'] = $row-gift_name;
@@ -110,22 +119,31 @@
global $wgUser;
 
$dbr = wfGetDB( DB_SLAVE );
+   $params = array();
 
if ( $limit  0 ) {
$limitvalue = 0;
-   if ( $page ) $limitvalue = $page * $limit - ( $limit );
-   $limit_sql =  LIMIT {$limitvalue},{$limit} ;
+   if ( $page ) {
+   $limitvalue = $page * $limit - ( $limit );
+   }
+   $params['LIMIT'] = $limit;
+   $params['OFFSET'] = $limitvalue;
}
 
-   $sql = SELECT 
gift_id,gift_createdate,gift_name,gift_description,gift_given_count
-   FROM {$dbr-tableName( 'gift' )}
-   WHERE gift_access=0 OR gift_creator_user_id = 
{$wgUser-getID()}
-   ORDER BY {$order}
-   {$limit_sql};
+   $params['ORDER BY'] = $order;
+   $res = $dbr-select(
+   'gift',
+   array(
+   'gift_id', 'gift_createdate', 'gift_name', 
'gift_description',
+   'gift_given_count'
+   ),
+   array( gift_access = 0 OR gift_creator_user_id = 
{$wgUser-getID()} ),
+   __METHOD__,
+   $params
+   );
 
-   $res = $dbr-query( $sql );
$gifts = array();
-   while ( $row = $dbr-fetchObject( $res ) ) {
+   foreach ( $res as $row ) {
$gifts[] = array(
'id' = $row-gift_id,
'timestamp' = ( $row-gift_createdate ),
@@ -143,24 +161,32 @@
 
$where = ''; // Prevent E_NOTICE
$params['ORDER BY'] = 'gift_createdate

[MediaWiki-CVS] SVN: [63102] trunk/extensions/SocialProfile/UserSystemMessages/ UserSystemMessagesClass.php

2010-02-28 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/63102

Revision: 63102
Author:   ashley
Date: 2010-02-28 21:44:54 + (Sun, 28 Feb 2010)

Log Message:
---
SocialProfile: rewrote UserSystemMessage's DB query

Modified Paths:
--

trunk/extensions/SocialProfile/UserSystemMessages/UserSystemMessagesClass.php

Modified: 
trunk/extensions/SocialProfile/UserSystemMessages/UserSystemMessagesClass.php
===
--- 
trunk/extensions/SocialProfile/UserSystemMessages/UserSystemMessagesClass.php   
2010-02-28 21:40:31 UTC (rev 63101)
+++ 
trunk/extensions/SocialProfile/UserSystemMessages/UserSystemMessagesClass.php   
2010-02-28 21:44:54 UTC (rev 63102)
@@ -17,13 +17,14 @@
$user_id = User::idFromName( $user_name );
$dbw = wfGetDB( DB_MASTER );
 
-   $dbw-insert( 'user_system_messages',
+   $dbw-insert(
+   'user_system_messages',
array(
'um_user_id' = $user_id,
'um_user_name' = $user_name,
'um_type' = $type,
'um_message' = $message,
-   'um_date' = date( Y-m-d H:i:s ),
+   'um_date' = date( 'Y-m-d H:i:s' ),
), __METHOD__
);
$dbw-commit();
@@ -50,36 +51,31 @@
public function getMessageList( $type, $limit = 0, $page = 0 ) {
$dbw = wfGetDB( DB_MASTER );
 
-   $limit_sql = '';
if ( $limit  0 ) {
$limitvalue = 0;
-   if ( $page )
+   if ( $page ) {
$limitvalue = $page * $limit - ( $limit );
-   $limit_sql =  LIMIT {$limitvalue},{$limit} ;
-   # $params['LIMIT'] = $limitvalue;
+   }
+   $params['LIMIT'] = $limit;
+   $params['OFFSET'] = $limitvalue;
}
 
-/* $params['ORDER BY'] = 'ug_id DESC';
-   $res = $dbw-select( array( 'user_gift', 'gift' ),
+   $params['ORDER BY'] = 'ug_id DESC';
+   $res = $dbw-select(
+   array( 'user_gift', 'gift' ),
array(
-   'ug_id', 'ug_user_id_from', 
'ug_user_name_from', 'ug_gift_id', 'ug_date', 'ug_status',
-   'gift_name', 'gift_description', 
'gift_given_count'
+   'ug_id', 'ug_user_id_from', 
'ug_user_name_from', 'ug_gift_id',
+   'ug_date', 'ug_status', 'gift_name', 
'gift_description',
+   'gift_given_count'
),
-   array( 'ug_user_id_to' = $this-user_id ),
+   array( ug_user_id_to = {$this-user_id} ),
__METHOD__,
$params,
array( 'gift' = array( 'INNER JOIN', 'ug_gift_id = 
gift_id' ) )
-   );*/
-   $sql = SELECT ug_id, ug_user_id_from, ug_user_name_from, 
ug_gift_id, ug_date, ug_status,
-   gift_name, gift_description, gift_given_count
-   FROM {$dbw-tableName( 'user_gift' )} INNER JOIN 
{$dbw-tableName( 'gift' )} ON ug_gift_id=gift_id
-   WHERE ug_user_id_to = {$this-user_id}
-   ORDER BY ug_id DESC
-   {$limit_sql};
+   );
 
-   $res = $dbw-query( $sql );
$requests = array();
-   while ( $row = $dbw-fetchObject( $res ) ) {
+   foreach ( $res as $row ) {
$requests[] = array(
'id' = $row-ug_id,
'gift_id' = $row-ug_gift_id,



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [63050] trunk/extensions/SocialProfile/UserProfile/SpecialUploadAvatar .php

2010-02-27 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/63050

Revision: 63050
Author:   ashley
Date: 2010-02-27 16:01:44 + (Sat, 27 Feb 2010)

Log Message:
---
SocialProfile: remove debug code, fix page title + random spacing tweaks

Modified Paths:
--
trunk/extensions/SocialProfile/UserProfile/SpecialUploadAvatar.php

Modified: trunk/extensions/SocialProfile/UserProfile/SpecialUploadAvatar.php
===
--- trunk/extensions/SocialProfile/UserProfile/SpecialUploadAvatar.php  
2010-02-27 15:31:36 UTC (rev 63049)
+++ trunk/extensions/SocialProfile/UserProfile/SpecialUploadAvatar.php  
2010-02-27 16:01:44 UTC (rev 63050)
@@ -7,8 +7,6 @@
  *
  * Requirements: Need writable directory $wgUploadPath/avatars
  *
- * TODO: Completely rewrite this garbage page
- *
  * @file
  * @ingroup Extensions
  * @author David Pean david.p...@gmail.com
@@ -24,12 +22,11 @@
 */
public function __construct( $request = null ) {
global $wgRequest;
-   
+
SpecialPage::__construct( 'UploadAvatar', 'upload' );
$this-loadRequest( is_null( $request ) ? $wgRequest : $request 
);
-   
}
-   
+
/**
 * Let the parent handle most of the request, but specify the Upload
 * class ourselves
@@ -49,18 +46,18 @@
public function execute( $params ) {
global $wgRequest, $wgOut, $wgUser, $wgUserProfileScripts;
 
-   $wgOut-setHTMLTitle( wfMsg( 'pagetitle', wfMsg( 
'user-profile-picture-title' ) ) );
$wgOut-addExtensionStyle( $wgUserProfileScripts . 
'/UserProfile.css' );
parent::execute( $params );
-   
+   $wgOut-setPageTitle( wfMsg( 'user-profile-picture-title' ) );
+
if ( $this-mUploadSuccessful ) {
// Cancel redirect
$wgOut-redirect( '' );
-   
+
$this-showSuccess( $this-mUpload-mExtension );
}
}
-   
+
/**
 * Show some text and linkage on successful upload.
 * @access private
@@ -80,8 +77,6 @@
wfMsgForContent( 'user-profile-picture-log-entry' )
);
 
-   $ext = 'jpg';
-
$output = 'h1' . wfMsg( 'user-profile-picture-title' ) . 
'/h1';
$output .= UserProfile::getEditProfileNav( wfMsg( 
'user-profile-section-picture' ) );
$output .= 'div class=profile-info';
@@ -123,7 +118,7 @@
 
$wgOut-addHTML( $output );
}
-   
+
/**
 * Displays the main upload form, optionally with a highlighted
 * error message up at the top.
@@ -165,11 +160,11 @@
 
if ( $wgUseCopyrightUpload ) {
$source = 
-   td align='right' nowrap='nowrap' . wfMsg ( 
'filestatus' ) . :/td
+   td align='right' nowrap='nowrap' . wfMsg( 
'filestatus' ) . :/td
tdinput tabindex='3' type='text' 
name=\wpUploadCopyStatus\ value=\ .
htmlspecialchars( $this-mUploadCopyStatus ) . 
\ size='40' //td
/trtr
-   td align='right' . wfMsg ( 'filesource' ) . 
:/td
+   td align='right' . wfMsg( 'filesource' ) . 
:/td
tdinput tabindex='4' type='text' 
name='wpUploadSource' value=\ .
htmlspecialchars( $this-mUploadSource ) . \ 
style='width:100px' //td
;
@@ -220,7 +215,7 @@
 
return $output;
}
-   
+
function getAvatar( $size ) {
global $wgUser, $wgDBname, $wgUploadDirectory, $wgUploadPath;
$files = glob( $wgUploadDirectory . '/avatars/' . $wgDBname . 
'_' . $wgUser-getID() . '_' . $size . * );
@@ -232,7 +227,7 @@
 
 class UploadAvatar extends UploadFromFile {
public $mExtension;
-   
+
function createThumbnail( $imageSrc, $imageInfo, $imgDest, $thumbWidth 
) {
list( $origWidth, $origHeight, $typeCode ) =  $imageInfo;
 
@@ -263,7 +258,6 @@
 
 $this-avatarUploadDirectory = $wgUploadDirectory . '/avatars';
 
-
$imageInfo = getimagesize( $this-mTempPath );
switch ( $imageInfo[2] ) {
case 1:
@@ -350,27 +344,27 @@
$this-mExtension = $ext;
return Status::newGood();
}
-   
+
/**
-* Don't verify the upload, since it all dangerous stuff is killed by 
+* Don't verify the upload, since it all dangerous stuff is killed by
 * making thumbnails
 */
public function verifyUpload() {
return array( 'status' = self::OK

[MediaWiki-CVS] SVN: [63051] trunk/extensions/SocialProfile/UserProfile/SpecialUploadAvatar .php

2010-02-27 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/63051

Revision: 63051
Author:   ashley
Date: 2010-02-27 16:10:21 + (Sat, 27 Feb 2010)

Log Message:
---
SocialProfile: make Special:UploadAvatar an unlisted special page, like it used 
to be :)

Modified Paths:
--
trunk/extensions/SocialProfile/UserProfile/SpecialUploadAvatar.php

Modified: trunk/extensions/SocialProfile/UserProfile/SpecialUploadAvatar.php
===
--- trunk/extensions/SocialProfile/UserProfile/SpecialUploadAvatar.php  
2010-02-27 16:01:44 UTC (rev 63050)
+++ trunk/extensions/SocialProfile/UserProfile/SpecialUploadAvatar.php  
2010-02-27 16:10:21 UTC (rev 63051)
@@ -23,7 +23,7 @@
public function __construct( $request = null ) {
global $wgRequest;
 
-   SpecialPage::__construct( 'UploadAvatar', 'upload' );
+   SpecialPage::__construct( 'UploadAvatar', 'upload', false/* 
listed? */ );
$this-loadRequest( is_null( $request ) ? $wgRequest : $request 
);
}
 



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [63062] trunk/extensions/SocialProfile/UserGifts

2010-02-27 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/63062

Revision: 63062
Author:   ashley
Date: 2010-02-27 23:09:51 + (Sat, 27 Feb 2010)

Log Message:
---
SocialProfile: cleanup to UserGifts stuff

Modified Paths:
--
trunk/extensions/SocialProfile/UserGifts/SpecialGiveGift.php
trunk/extensions/SocialProfile/UserGifts/SpecialRemoveGift.php
trunk/extensions/SocialProfile/UserGifts/SpecialRemoveMasterGift.php
trunk/extensions/SocialProfile/UserGifts/SpecialViewGift.php
trunk/extensions/SocialProfile/UserGifts/SpecialViewGifts.php

Modified: trunk/extensions/SocialProfile/UserGifts/SpecialGiveGift.php
===
--- trunk/extensions/SocialProfile/UserGifts/SpecialGiveGift.php
2010-02-27 22:56:48 UTC (rev 63061)
+++ trunk/extensions/SocialProfile/UserGifts/SpecialGiveGift.php
2010-02-27 23:09:51 UTC (rev 63062)
@@ -25,7 +25,7 @@
 
$usertitle = Title::newFromDBkey( $wgRequest-getVal( 'user' ) 
);
if ( !$usertitle ) {
-   $wgOut-addHTML( /*$wgOut-addHTML(*/ 
$this-displayFormNoUser() /*)*/ );
+   $wgOut-addHTML( $this-displayFormNoUser() );
return false;
}
 
@@ -38,14 +38,14 @@
$wgOut-setPageTitle( wfMsg( 'g-error-title' ) );
$out .= wfMsg( 'g-error-message-to-yourself' );
$wgOut-addHTML( $out );
-   } else if ( $wgUser-isBlocked() ) {
+   } elseif ( $wgUser-isBlocked() ) {
$wgOut-setPageTitle( wfMsg( 'g-error-title' ) );
$out .= wfMsg( 'g-error-message-blocked' );
$wgOut-addHTML( $out );
-   } else if ( $this-user_id_to == 0 ) {
+   } elseif ( $this-user_id_to == 0 ) {
$wgOut-setPageTitle( wfMsg( 'g-error-title' ) );
$wgOut-addHTML( wfMsg( 'g-error-message-no-user' ) );
-   } else if ( $wgUser-getID() == 0 ) {
+   } elseif ( $wgUser-getID() == 0 ) {
$wgOut-setPageTitle( wfMsg( 'g-error-title' ) );
$out .= wfMsg( 'g-error-message-login' );
$wgOut-addHTML( $out );
@@ -57,7 +57,12 @@
 
$_SESSION['alreadysubmitted'] = true;
 
-   $ug_gift_id = $gift-sendGift( 
$this-user_name_to, $wgRequest-getVal( 'gift_id' ), 0, $wgRequest-getVal( 
'message' ) );
+   $ug_gift_id = $gift-sendGift(
+   $this-user_name_to,
+   $wgRequest-getVal( 'gift_id' ),
+   0,
+   $wgRequest-getVal( 'message' )
+   );
 
// clear the cache for the user profile gifts 
for this user
$wgMemc-delete( wfMemcKey( 'user', 'profile', 
'gifts', $this-user_id_to ) );
@@ -71,7 +76,9 @@
 
if ( is_array( $last_unique_gifts ) ) {
foreach ( $last_unique_gifts as 
$last_unique_gift ) {
-   if ( $wgRequest-getVal( 
'gift_id' ) == $last_unique_gift['gift_id'] ) $found = 0;
+   if ( $wgRequest-getVal( 
'gift_id' ) == $last_unique_gift['gift_id'] ) {
+   $found = 0;
+   }
}
}
 
@@ -83,7 +90,9 @@
);
 
// remove oldest value
-   if ( count( $last_unique_gifts )  4 ) 
array_shift( $last_unique_gifts );
+   if ( count( $last_unique_gifts )  4 ) {
+   array_shift( $last_unique_gifts 
);
+   }
 
// reset the cache
$wgMemc-set( $key, $last_unique_gifts 
);
@@ -97,12 +106,12 @@
$output .= 'div class=back-links
a href=' . 
$user_title-escapeFullURL() . '' . wfMsg( 'g-back-link', $this-user_name_to 
) . '/a
/div
-   div class=g-message
-   ' . wfMsg( 'g-sent-message', 
$this-user_name_to ) . '
-   /div
-   div class=g-container
-   ' . $gift_image . '
-   div class=g-title' . $sent_gift

[MediaWiki-CVS] SVN: [62963] trunk/extensions/SocialProfile/UserStats/UserStatsClass.php

2010-02-25 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62963

Revision: 62963
Author:   ashley
Date: 2010-02-25 16:31:47 + (Thu, 25 Feb 2010)

Log Message:
---
SocialProfile: while - foreach

Modified Paths:
--
trunk/extensions/SocialProfile/UserStats/UserStatsClass.php

Modified: trunk/extensions/SocialProfile/UserStats/UserStatsClass.php
===
--- trunk/extensions/SocialProfile/UserStats/UserStatsClass.php 2010-02-25 
16:08:59 UTC (rev 62962)
+++ trunk/extensions/SocialProfile/UserStats/UserStatsClass.php 2010-02-25 
16:31:47 UTC (rev 62963)
@@ -685,7 +685,7 @@
 
$list = array();
$res = $dbr-query( $sql, __METHOD__ );
-   while ( $row = $dbr-fetchObject( $res ) ) {
+   foreach ( $res as $row ) {
$list[] = array(
'user_id' = $row-stats_user_id,
'user_name' = $row-stats_user_name,
@@ -718,7 +718,7 @@
 
$list = array();
$res = $dbr-query( $sql, __METHOD__ );
-   while ( $row = $dbr-fetchObject( $res ) ) {
+   foreach ( $res as $row ) {
$list[] = array(
'user_id' = $row-up_user_id,
'user_name' = $row-up_user_name,
@@ -755,7 +755,7 @@
 
$list = array();
$res = $dbr-query( $sql, __METHOD__ );
-   while ( $row = $dbr-fetchObject( $res ) ) {
+   foreach ( $res as $row ) {
$list[] = array(
'user_id' = $row-stats_user_id,
'user_name' = $row-stats_user_name,



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [62873] trunk/phase3/includes/api

2010-02-23 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62873

Revision: 62873
Author:   ashley
Date: 2010-02-23 12:30:23 + (Tue, 23 Feb 2010)

Log Message:
---
API: coding style cleanup, fix copyright symbol, more braces

Modified Paths:
--
trunk/phase3/includes/api/ApiFeedWatchlist.php
trunk/phase3/includes/api/ApiFormatBase.php
trunk/phase3/includes/api/ApiFormatDbg.php
trunk/phase3/includes/api/ApiFormatJson.php
trunk/phase3/includes/api/ApiFormatPhp.php
trunk/phase3/includes/api/ApiFormatRaw.php
trunk/phase3/includes/api/ApiFormatTxt.php
trunk/phase3/includes/api/ApiFormatWddx.php

Modified: trunk/phase3/includes/api/ApiFeedWatchlist.php
===
--- trunk/phase3/includes/api/ApiFeedWatchlist.php  2010-02-23 12:24:19 UTC 
(rev 62872)
+++ trunk/phase3/includes/api/ApiFeedWatchlist.php  2010-02-23 12:30:23 UTC 
(rev 62873)
@@ -1,11 +1,11 @@
 ?php
 
-/*
+/**
  * Created on Oct 13, 2006
  *
  * API for MediaWiki 1.8+
  *
- * Copyright (C) 2006 Yuri Astrakhan FirstnameLastname@gmail.com
+ * Copyright © 2006 Yuri Astrakhan FirstnameLastname@gmail.com
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
 
 if ( !defined( 'MEDIAWIKI' ) ) {
// Eclipse helper - will be ignored in production
-   require_once ( ApiBase.php );
+   require_once( ApiBase.php );
 }
 
 /**
@@ -38,7 +38,7 @@
 class ApiFeedWatchlist extends ApiBase {
 
public function __construct( $main, $action ) {
-   parent :: __construct( $main, $action );
+   parent::__construct( $main, $action );
}
 
/**
@@ -53,7 +53,6 @@
 * Wrap the result as an RSS/Atom feed.
 */
public function execute() {
-
global $wgFeedClasses, $wgFeedLimit, $wgSitename, 
$wgContLanguageCode;
 
try {
@@ -64,13 +63,13 @@
 
$dbr = wfGetDB( DB_SLAVE );
// Prepare parameters for nested request
-   $fauxReqArr = array (
+   $fauxReqArr = array(
'action' = 'query',
'meta' = 'siteinfo',
'siprop' = 'general',
'list' = 'watchlist',
'wlprop' = 'title|user|comment|timestamp',
-   'wldir' = 'older', // reverse 
order - from newest to oldest
+   'wldir' = 'older', // reverse order - from 
newest to oldest
'wlend' = $dbr-timestamp( $endTime ), // stop 
at this time
'wllimit' = ( 50  $wgFeedLimit ) ? 
$wgFeedLimit : 50
);
@@ -83,12 +82,12 @@
}
 
// Check for 'allrev' parameter, and if found, show all 
revisions to each page on wl.
-   if ( !is_null ( $params['allrev'] ) ) {
+   if ( !is_null( $params['allrev'] ) ) {
$fauxReqArr['wlallrev'] = '';
}
 
// Create the request
-   $fauxReq = new FauxRequest ( $fauxReqArr );
+   $fauxReq = new FauxRequest( $fauxReqArr );
 
// Execute
$module = new ApiMain( $fauxReq );
@@ -103,11 +102,11 @@
}
 
$feedTitle = $wgSitename . ' - ' . wfMsgForContent( 
'watchlist' ) . ' [' . $wgContLanguageCode . ']';
-   $feedUrl = SpecialPage::getTitleFor( 'Watchlist' 
)-getFullUrl();
+   $feedUrl = SpecialPage::getTitleFor( 'Watchlist' 
)-getFullURL();
 
$feed = new $wgFeedClasses[$params['feedformat']] ( 
$feedTitle, htmlspecialchars( wfMsgForContent( 'watchlist' ) ), $feedUrl );
 
-   ApiFormatFeedWrapper :: setResult( $this-getResult(), 
$feed, $feedItems );
+   ApiFormatFeedWrapper::setResult( $this-getResult(), 
$feed, $feedItems );
 
} catch ( Exception $e ) {
 
@@ -115,7 +114,7 @@
$this-getMain()-setCacheMaxAge( 0 );
 
$feedTitle = $wgSitename . ' - Error - ' . 
wfMsgForContent( 'watchlist' ) . ' [' . $wgContLanguageCode . ']';
-   $feedUrl = SpecialPage::getTitleFor( 'Watchlist' 
)-getFullUrl();
+   $feedUrl = SpecialPage::getTitleFor( 'Watchlist' 
)-getFullURL();
 
$feedFormat = isset( $params['feedformat'] ) ? 
$params['feedformat'] : 'rss';
$feed = new $wgFeedClasses[$feedFormat] ( $feedTitle, 
htmlspecialchars( wfMsgForContent( 'watchlist' ) ), $feedUrl

[MediaWiki-CVS] SVN: [62822] trunk/phase3/includes/api/ApiEditPage.php

2010-02-22 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62822

Revision: 62822
Author:   ashley
Date: 2010-02-22 12:18:42 + (Mon, 22 Feb 2010)

Log Message:
---
ApiEditPage.php: fix copyright symbol, spacing and coding style cleanup, more 
braces

Modified Paths:
--
trunk/phase3/includes/api/ApiEditPage.php

Modified: trunk/phase3/includes/api/ApiEditPage.php
===
--- trunk/phase3/includes/api/ApiEditPage.php   2010-02-22 11:27:52 UTC (rev 
62821)
+++ trunk/phase3/includes/api/ApiEditPage.php   2010-02-22 12:18:42 UTC (rev 
62822)
@@ -1,11 +1,11 @@
 ?php
 
-/*
+/**
  * Created on August 16, 2007
  *
  * API for MediaWiki 1.8+
  *
- * Copyright (C) 2007 Iker Labarga FirstnameLastname@gmail.com
+ * Copyright © 2007 Iker Labarga FirstnameLastname@gmail.com
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -24,8 +24,8 @@
  */
 
 if ( !defined( 'MEDIAWIKI' ) ) {
-// Eclipse helper - will be ignored in production
-require_once ( ApiBase.php );
+   // Eclipse helper - will be ignored in production
+   require_once( ApiBase.php );
 }
 
 /**
@@ -38,40 +38,48 @@
 class ApiEditPage extends ApiBase {
 
public function __construct( $query, $moduleName ) {
-   parent :: __construct( $query, $moduleName );
+   parent::__construct( $query, $moduleName );
}
 
public function execute() {
global $wgUser;
$params = $this-extractRequestParams();
-   
-   if ( is_null( $params['title'] ) )
+
+   if ( is_null( $params['title'] ) ) {
$this-dieUsageMsg( array( 'missingparam', 'title' ) );
+   }
 
if ( is_null( $params['text'] )  is_null( 
$params['appendtext'] ) 
is_null( $params['prependtext'] ) 
$params['undo'] == 0 )
+   {
$this-dieUsageMsg( array( 'missingtext' ) );
+   }
 
$titleObj = Title::newFromText( $params['title'] );
-   if ( !$titleObj || $titleObj-isExternal() )
+   if ( !$titleObj || $titleObj-isExternal() ) {
$this-dieUsageMsg( array( 'invalidtitle', 
$params['title'] ) );
-   
+   }
+
// Some functions depend on $wgTitle == $ep-mTitle
global $wgTitle;
$wgTitle = $titleObj;
 
-   if ( $params['createonly']  $titleObj-exists() )
+   if ( $params['createonly']  $titleObj-exists() ) {
$this-dieUsageMsg( array( 'createonly-exists' ) );
-   if ( $params['nocreate']  !$titleObj-exists() )
+   }
+   if ( $params['nocreate']  !$titleObj-exists() ) {
$this-dieUsageMsg( array( 'nocreate-missing' ) );
+   }
 
// Now let's check whether we're even allowed to do this
$errors = $titleObj-getUserPermissionsErrors( 'edit', $wgUser 
);
-   if ( !$titleObj-exists() )
+   if ( !$titleObj-exists() ) {
$errors = array_merge( $errors, 
$titleObj-getUserPermissionsErrors( 'create', $wgUser ) );
-   if ( count( $errors ) )
+   }
+   if ( count( $errors ) ) {
$this-dieUsageMsg( $errors[0] );
+   }
 
$articleObj = new Article( $titleObj );
$toMD5 = $params['text'];
@@ -81,103 +89,123 @@
// returns an interface message rather than ''
// We do want getContent()'s behavior for non-existent
// MediaWiki: pages, though
-   if ( $articleObj-getID() == 0  
$titleObj-getNamespace() != NS_MEDIAWIKI )
+   if ( $articleObj-getID() == 0  
$titleObj-getNamespace() != NS_MEDIAWIKI ) {
$content = '';
-   else
+   } else {
$content = $articleObj-getContent();
-   
-   if ( !is_null( $params['section'] ) )
-   {
+   }
+
+   if ( !is_null( $params['section'] ) ) {
// Process the content for section edits
global $wgParser;
$section = intval( $params['section'] );
$content = $wgParser-getSection( $content, 
$section, false );
-   if ( $content === false )
+   if ( $content === false ) {
$this-dieUsage

[MediaWiki-CVS] SVN: [62826] trunk/phase3/includes/api/ApiMove.php

2010-02-22 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62826

Revision: 62826
Author:   ashley
Date: 2010-02-22 12:25:53 + (Mon, 22 Feb 2010)

Log Message:
---
ApiMove.php: fix copyright symbol, spacing  coding style tweaks, more braces

Modified Paths:
--
trunk/phase3/includes/api/ApiMove.php

Modified: trunk/phase3/includes/api/ApiMove.php
===
--- trunk/phase3/includes/api/ApiMove.php   2010-02-22 12:25:01 UTC (rev 
62825)
+++ trunk/phase3/includes/api/ApiMove.php   2010-02-22 12:25:53 UTC (rev 
62826)
@@ -1,10 +1,10 @@
 ?php
 
-/*
+/**
  * Created on Oct 31, 2007
  * API for MediaWiki 1.8+
  *
- * Copyright (C) 2007 Roan Kattouw Firstname.Lastname@home.nl
+ * Copyright © 2007 Roan Kattouw Firstname.Lastname@home.nl
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -24,49 +24,51 @@
 
 if ( !defined( 'MEDIAWIKI' ) ) {
// Eclipse helper - will be ignored in production
-   require_once ( ApiBase.php );
+   require_once( ApiBase.php );
 }
 
-
 /**
  * @ingroup API
  */
 class ApiMove extends ApiBase {
 
public function __construct( $main, $action ) {
-   parent :: __construct( $main, $action );
+   parent::__construct( $main, $action );
}
 
public function execute() {
global $wgUser;
$params = $this-extractRequestParams();
-   if ( is_null( $params['reason'] ) )
+   if ( is_null( $params['reason'] ) ) {
$params['reason'] = '';
+   }
 
$this-requireOnlyOneParameter( $params, 'from', 'fromid' );
-   if ( !isset( $params['to'] ) )
+   if ( !isset( $params['to'] ) ) {
$this-dieUsageMsg( array( 'missingparam', 'to' ) );
+   }
 
-   if ( isset( $params['from'] ) )
-   {
+   if ( isset( $params['from'] ) ) {
$fromTitle = Title::newFromText( $params['from'] );
-   if ( !$fromTitle )
+   if ( !$fromTitle ) {
$this-dieUsageMsg( array( 'invalidtitle', 
$params['from'] ) );
-   }
-   else if ( isset( $params['fromid'] ) )
-   {
+   }
+   } elseif ( isset( $params['fromid'] ) ) {
$fromTitle = Title::newFromID( $params['fromid'] );
-   if ( !$fromTitle )
+   if ( !$fromTitle ) {
$this-dieUsageMsg( array( 'nosuchpageid', 
$params['fromid'] ) );
+   }
}
 
-   if ( !$fromTitle-exists() )
+   if ( !$fromTitle-exists() ) {
$this-dieUsageMsg( array( 'notanarticle' ) );
+   }
$fromTalk = $fromTitle-getTalkPage();
 
$toTitle = Title::newFromText( $params['to'] );
-   if ( !$toTitle )
+   if ( !$toTitle ) {
$this-dieUsageMsg( array( 'invalidtitle', 
$params['to'] ) );
+   }
$toTalk = $toTitle-getTalkPage();
 
if ( $toTitle-getNamespace() == NS_FILE
@@ -83,25 +85,25 @@
// Move the page
$hookErr = null;
$retval = $fromTitle-moveTo( $toTitle, true, 
$params['reason'], !$params['noredirect'] );
-   if ( $retval !== true )
+   if ( $retval !== true ) {
$this-dieUsageMsg( reset( $retval ) );
+   }
 
$r = array( 'from' = $fromTitle-getPrefixedText(), 'to' = 
$toTitle-getPrefixedText(), 'reason' = $params['reason'] );
if ( !$params['noredirect'] || !$wgUser-isAllowed( 
'suppressredirect' ) )
+   {
$r['redirectcreated'] = '';
+   }
 
// Move the talk page
if ( $params['movetalk']  $fromTalk-exists()  
!$fromTitle-isTalkPage() )
{
$retval = $fromTalk-moveTo( $toTalk, true, 
$params['reason'], !$params['noredirect'] );
-   if ( $retval === true )
-   {
+   if ( $retval === true ) {
$r['talkfrom'] = $fromTalk-getPrefixedText();
$r['talkto'] = $toTalk-getPrefixedText();
-   }
-   // We're not gonna dieUsage() on failure, since we 
already changed something
-   else
-   {
+   } else {
+   // We're not gonna dieUsage() on failure, since 
we already changed something
$parsed

[MediaWiki-CVS] SVN: [62828] branches/SkinSystemRewrite/includes/Skin.php

2010-02-22 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62828

Revision: 62828
Author:   ashley
Date: 2010-02-22 15:16:36 + (Mon, 22 Feb 2010)

Log Message:
---
Skin system rewrite: only show these in the footer if we actually have 
something to show

Modified Paths:
--
branches/SkinSystemRewrite/includes/Skin.php

Modified: branches/SkinSystemRewrite/includes/Skin.php
===
--- branches/SkinSystemRewrite/includes/Skin.php2010-02-22 13:06:36 UTC 
(rev 62827)
+++ branches/SkinSystemRewrite/includes/Skin.php2010-02-22 15:16:36 UTC 
(rev 62828)
@@ -3057,11 +3057,19 @@
global $wgRequest;
$action = $wgRequest-getVal( 'action', 'view' );
if ( $this-mTitle-getNamespace() != NS_SPECIAL  $action !== 
'edit' ) {
-   $s .= \t\t . 'li id=lastmod' . 
$this-lastModified() . '/li
-   li id=viewcount' . $this-getViewCount() . '/li
-   li id=numberofwatchingusers' . 
$this-getNumberOfWatchingUsers() . '/li
-   li id=credits' . $this-getCredits() . '/li
-   li id=copyrights' . $this-getCopyright() . '/li' 
. \n;
+   $s .= \t\t . 'li id=lastmod' . 
$this-lastModified() . '/li';
+   if ( $this-getViewCount() ) {
+   $s .= \t\t . 'li id=viewcount' . 
$this-getViewCount() . '/li' . \n;
+   }
+   if ( $this-getNumberOfWatchingUsers() ) {
+   $s .= \t\t . 'li 
id=numberofwatchingusers' . $this-getNumberOfWatchingUsers() . '/li' . 
\n;
+   }
+   if ( $this-getCredits() ) {
+   $s .= \t\t . 'li id=credits' . 
$this-getCredits() . '/li' . \n;
+   }
+   if ( $this-getCopyright() ) {
+   $s .= \t\t . 'li id=copyrights' . 
$this-getCopyright() . '/li' . \n;
+   }
}
$s .= \t\t . 'li id=privacy' . $this-privacyLink() . 
'/li
li id=about' . $this-aboutLink() . '/li



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [62838] trunk/phase3/includes/api/ApiExpandTemplates.php

2010-02-22 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62838

Revision: 62838
Author:   ashley
Date: 2010-02-22 20:27:06 + (Mon, 22 Feb 2010)

Log Message:
---
ApiExpandTemplates.php: fix copyright symbol, coding style tweaks, more braces

Modified Paths:
--
trunk/phase3/includes/api/ApiExpandTemplates.php

Modified: trunk/phase3/includes/api/ApiExpandTemplates.php
===
--- trunk/phase3/includes/api/ApiExpandTemplates.php2010-02-22 20:24:42 UTC 
(rev 62837)
+++ trunk/phase3/includes/api/ApiExpandTemplates.php2010-02-22 20:27:06 UTC 
(rev 62838)
@@ -1,11 +1,11 @@
 ?php
 
-/*
+/**
  * Created on Oct 05, 2007
  *
  * API for MediaWiki 1.8+
  *
- * Copyright (C) 2007 Yuri Astrakhan FirstnameLastname@gmail.com
+ * Copyright © 2007 Yuri Astrakhan FirstnameLastname@gmail.com
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
 
 if ( !defined( 'MEDIAWIKI' ) ) {
// Eclipse helper - will be ignored in production
-   require_once ( ApiBase.php );
+   require_once( ApiBase.php );
 }
 
 /**
@@ -38,7 +38,7 @@
 class ApiExpandTemplates extends ApiBase {
 
public function __construct( $main, $action ) {
-   parent :: __construct( $main, $action );
+   parent::__construct( $main, $action );
}
 
public function execute() {
@@ -46,18 +46,18 @@
$params = $this-extractRequestParams();
 
// Create title for parser
-   $title_obj = Title :: newFromText( $params['title'] );
-   if ( !$title_obj )
-   $title_obj = Title :: newFromText( API ); // default
+   $title_obj = Title::newFromText( $params['title'] );
+   if ( !$title_obj ) {
+   $title_obj = Title::newFromText( 'API' ); // default
+   }
 
$result = $this-getResult();
 
// Parse text
global $wgParser;
$options = new ParserOptions();
-   
-   if ( $params['generatexml'] )
-   {
+
+   if ( $params['generatexml'] ) {
$wgParser-startExternalParse( $title_obj, $options, 
OT_PREPROCESS );
$dom = $wgParser-preprocessToDom( $params['text'] );
if ( is_callable( array( $dom, 'saveXML' ) ) ) {
@@ -78,9 +78,9 @@
}
 
public function getAllowedParams() {
-   return array (
+   return array(
'title' = array(
-   ApiBase :: PARAM_DFLT = 'API',
+   ApiBase::PARAM_DFLT = 'API',
),
'text' = null,
'generatexml' = false,
@@ -88,7 +88,7 @@
}
 
public function getParamDescription() {
-   return array (
+   return array(
'text' = 'Wikitext to convert',
'title' = 'Title of page',
'generatexml' = 'Generate XML parse tree',
@@ -100,7 +100,7 @@
}
 
protected function getExamples() {
-   return array (
+   return array(

'api.php?action=expandtemplatestext={{Project:Sandbox}}'
);
}



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [62766] trunk/phase3/includes/api/ApiBlock.php

2010-02-21 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62766

Revision: 62766
Author:   ashley
Date: 2010-02-21 12:32:46 + (Sun, 21 Feb 2010)

Log Message:
---
ApiBlock.php: spacing  coding style tweaks, more braces, fixed copyright symbol

Modified Paths:
--
trunk/phase3/includes/api/ApiBlock.php

Modified: trunk/phase3/includes/api/ApiBlock.php
===
--- trunk/phase3/includes/api/ApiBlock.php  2010-02-21 12:26:44 UTC (rev 
62765)
+++ trunk/phase3/includes/api/ApiBlock.php  2010-02-21 12:32:46 UTC (rev 
62766)
@@ -1,10 +1,10 @@
 ?php
 
-/*
+/**
  * Created on Sep 4, 2007
  * API for MediaWiki 1.8+
  *
- * Copyright (C) 2007 Roan Kattouw Firstname.Lastname@home.nl
+ * Copyright © 2007 Roan Kattouw Firstname.Lastname@home.nl
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -24,7 +24,7 @@
 
 if ( !defined( 'MEDIAWIKI' ) ) {
// Eclipse helper - will be ignored in production
-   require_once ( ApiBase.php );
+   require_once( ApiBase.php );
 }
 
 /**
@@ -39,7 +39,7 @@
 * Std ctor.
 */
public function __construct( $main, $action ) {
-   parent :: __construct( $main, $action );
+   parent::__construct( $main, $action );
}
 
/**
@@ -52,21 +52,24 @@
global $wgUser, $wgBlockAllowsUTEdit;
$params = $this-extractRequestParams();
 
-   if ( $params['gettoken'] )
-   {
+   if ( $params['gettoken'] ) {
$res['blocktoken'] = $wgUser-editToken();
$this-getResult()-addValue( null, 
$this-getModuleName(), $res );
return;
}
 
-   if ( is_null( $params['user'] ) )
+   if ( is_null( $params['user'] ) ) {
$this-dieUsageMsg( array( 'missingparam', 'user' ) );
-   if ( !$wgUser-isAllowed( 'block' ) )
+   }
+   if ( !$wgUser-isAllowed( 'block' ) ) {
$this-dieUsageMsg( array( 'cantblock' ) );
-   if ( $params['hidename']  !$wgUser-isAllowed( 'hideuser' ) )
+   }
+   if ( $params['hidename']  !$wgUser-isAllowed( 'hideuser' ) ) 
{
$this-dieUsageMsg( array( 'canthide' ) );
-   if ( $params['noemail']  !IPBlockForm::canBlockEmail( $wgUser 
) )
+   }
+   if ( $params['noemail']  !IPBlockForm::canBlockEmail( $wgUser 
) ) {
$this-dieUsageMsg( array( 'cantblock-email' ) );
+   }
 
$form = new IPBlockForm( '' );
$form-BlockAddress = $params['user'];
@@ -84,26 +87,33 @@
 
$userID = $expiry = null;
$retval = $form-doBlock( $userID, $expiry );
-   if ( count( $retval ) )
+   if ( count( $retval ) ) {
// We don't care about multiple errors, just report one 
of them
$this-dieUsageMsg( $retval );
+   }
 
$res['user'] = $params['user'];
$res['userID'] = intval( $userID );
$res['expiry'] = ( $expiry == Block::infinity() ? 'infinite' : 
wfTimestamp( TS_ISO_8601, $expiry ) );
$res['reason'] = $params['reason'];
-   if ( $params['anononly'] )
+   if ( $params['anononly'] ) {
$res['anononly'] = '';
-   if ( $params['nocreate'] )
+   }
+   if ( $params['nocreate'] ) {
$res['nocreate'] = '';
-   if ( $params['autoblock'] )
+   }
+   if ( $params['autoblock'] ) {
$res['autoblock'] = '';
-   if ( $params['noemail'] )
+   }
+   if ( $params['noemail'] ) {
$res['noemail'] = '';
-   if ( $params['hidename'] )
+   }
+   if ( $params['hidename'] ) {
$res['hidename'] = '';
-   if ( $params['allowusertalk'] )
+   }
+   if ( $params['allowusertalk'] ) {
$res['allowusertalk'] = '';
+   }
 
$this-getResult()-addValue( null, $this-getModuleName(), 
$res );
}
@@ -117,7 +127,7 @@
}
 
public function getAllowedParams() {
-   return array (
+   return array(
'user' = null,
'token' = null,
'gettoken' = false,
@@ -134,7 +144,7 @@
}
 
public function getParamDescription() {
-   return array (
+   return array(
'user' = 'Username, IP address or IP

[MediaWiki-CVS] SVN: [62772] branches/SkinSystemRewrite/includes/Skin.php

2010-02-21 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62772

Revision: 62772
Author:   ashley
Date: 2010-02-21 15:51:26 + (Sun, 21 Feb 2010)

Log Message:
---
Skin system rewrite: add new 'SkinFooterIcons' hook to allow extensions to add 
new icons to the footer (previously adding a footer icon required 
'SkinTemplateOutputPageBeforeExec' hook and core hacks) + indentation tweaks

Modified Paths:
--
branches/SkinSystemRewrite/includes/Skin.php

Modified: branches/SkinSystemRewrite/includes/Skin.php
===
--- branches/SkinSystemRewrite/includes/Skin.php2010-02-21 14:28:28 UTC 
(rev 62771)
+++ branches/SkinSystemRewrite/includes/Skin.php2010-02-21 15:51:26 UTC 
(rev 62772)
@@ -3037,33 +3037,36 @@
$s = \n . 'div id=footer' . $attribs[0] . '';
 
if( $this-getPoweredBy() ) {
-   $s .= \n . 'div id=f-poweredbyico'
+   $s .= \n\t . 'div id=f-poweredbyico'
. $this-getPoweredBy() .
'/div' . \n;
}
 
if( $this-getCopyrightIcon() ) {
-   $s .= 'div id=f-copyrightico'
+   $s .= \t . 'div id=f-copyrightico'
. $this-getCopyrightIcon() .
'/div' . \n;
}
 
+   // Allow extensions to add more icons
+   wfRunHooks( 'SkinFooterIcons', array( $this, $s ) );
+
// Generate additional footer links
-   $s .= 'ul id=f-list';
+   $s .= \t . 'ul id=f-list' . \n;
// Special pages cannot have authors, watchers etc. so don't 
even try!
global $wgRequest;
$action = $wgRequest-getVal( 'action', 'view' );
if ( $this-mTitle-getNamespace() != NS_SPECIAL  $action !== 
'edit' ) {
-   $s .= 'li id=lastmod' . $this-lastModified() . 
'/li
-   li id=viewcount' . $this-getViewCount() . 
'/li
-   li id=numberofwatchingusers' . 
$this-getNumberOfWatchingUsers() . '/li
-   li id=credits' . $this-getCredits() . 
'/li
-   li id=copyrights' . $this-getCopyright() . 
'/li' . \n;
+   $s .= \t\t . 'li id=lastmod' . 
$this-lastModified() . '/li
+   li id=viewcount' . $this-getViewCount() . '/li
+   li id=numberofwatchingusers' . 
$this-getNumberOfWatchingUsers() . '/li
+   li id=credits' . $this-getCredits() . '/li
+   li id=copyrights' . $this-getCopyright() . '/li' 
. \n;
}
-   $s .= 'li id=privacy' . $this-privacyLink() . '/li
-   li id=about' . $this-aboutLink() . '/li
-   li id=disclaimer' . $this-disclaimerLink() 
. '/li
-   /ul' . \n;
+   $s .= \t\t . 'li id=privacy' . $this-privacyLink() . 
'/li
+   li id=about' . $this-aboutLink() . '/li
+   li id=disclaimer' . $this-disclaimerLink() . '/li
+   /ul' . \n;
$s .= '/div' . \n;
return $s;
}



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [62783] trunk/phase3/includes/api/ApiDisabled.php

2010-02-21 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62783

Revision: 62783
Author:   ashley
Date: 2010-02-21 18:09:00 + (Sun, 21 Feb 2010)

Log Message:
---
ApiDisabled.php: fix copyright symbol, coding style tweaks

Modified Paths:
--
trunk/phase3/includes/api/ApiDisabled.php

Modified: trunk/phase3/includes/api/ApiDisabled.php
===
--- trunk/phase3/includes/api/ApiDisabled.php   2010-02-21 17:28:13 UTC (rev 
62782)
+++ trunk/phase3/includes/api/ApiDisabled.php   2010-02-21 18:09:00 UTC (rev 
62783)
@@ -1,10 +1,10 @@
 ?php
 
-/*
+/**
  * Created on Sep 25, 2008
  * API for MediaWiki 1.8+
  *
- * Copyright (C) 2008 Roan Kattouw Firstname.Lastname@home.nl
+ * Copyright © 2008 Roan Kattouw Firstname.Lastname@home.nl
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -24,7 +24,7 @@
 
 if ( !defined( 'MEDIAWIKI' ) ) {
// Eclipse helper - will be ignored in production
-   require_once ( ApiBase.php );
+   require_once( ApiBase.php );
 }
 
 /**
@@ -40,7 +40,7 @@
 class ApiDisabled extends ApiBase {
 
public function __construct( $main, $action ) {
-   parent :: __construct( $main, $action );
+   parent::__construct( $main, $action );
}
 
public function execute() {
@@ -52,11 +52,11 @@
}
 
public function getAllowedParams() {
-   return array ();
+   return array();
}
 
public function getParamDescription() {
-   return array ();
+   return array();
}
 
public function getDescription() {
@@ -66,7 +66,7 @@
}
 
protected function getExamples() {
-   return array ();
+   return array();
}
 
public function getVersion() {



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [62745] trunk/extensions/SocialProfile

2010-02-20 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62745

Revision: 62745
Author:   ashley
Date: 2010-02-20 18:31:25 + (Sat, 20 Feb 2010)

Log Message:
---
SocialProfile: fix some E_NOTICEs

Modified Paths:
--
trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManager.php
trunk/extensions/SocialProfile/SystemGifts/TopAwards.php
trunk/extensions/SocialProfile/UserGifts/SpecialGiftManager.php

Modified: 
trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManager.php
===
--- trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManager.php 
2010-02-20 18:27:00 UTC (rev 62744)
+++ trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManager.php 
2010-02-20 18:31:25 UTC (rev 62745)
@@ -79,6 +79,7 @@
function displayGiftList() {
global $wgScriptPath;
$output = ''; // Prevent E_NOTICE
+   $page = 0;
$per_page = 10;
$gifts = SystemGifts::getGiftList( $per_page, $page );
if ( $gifts ) {
@@ -104,11 +105,11 @@
table border=0 cellpadding=5 cellspacing=0 width=500
tr
td width=200 class=view-form' . wfMsg( 
'ga-giftname' ) . '/td
-   td width=695input type=text size=45 
class=createbox name=gift_name value=' . $gift['gift_name'] . '//td
+   td width=695input type=text size=45 
class=createbox name=gift_name value=' . ( isset( $gift['gift_name'] ) ? 
$gift['gift_name'] : '' ) . '//td
/tr
tr
td width=200 class=view-form 
valign=top' . wfMsg( 'ga-giftdesc' ) . '/td
-   td width=695textarea class=createbox 
name=gift_description rows=2 cols=30' . $gift['gift_description'] . 
'/textarea/td
+   td width=695textarea class=createbox 
name=gift_description rows=2 cols=30' . ( isset( 
$gift['gift_description'] ) ? $gift['gift_description'] : '' ) . 
'/textarea/td
/tr
tr
td width=200 class=view-form' . wfMsg( 
'ga-gifttype' ) . '/td
@@ -116,30 +117,39 @@
select name=gift_category';
$g = new SystemGifts();
foreach ( $g-categories as $category = $id ) {
-   $form .= 'option' . ( ( $gift['gift_category'] 
== $id ) ? ' selected=selected' : '' ) .  
value=\{$id}\{$category}/option;
+   $sel = '';
+   if ( isset( $gift['gift_category'] )  
$gift['gift_category'] == $id ) {
+   $sel = ' selected=selected';
+   }
+   $form .= 'option' . $sel .  
value=\{$id}\{$category}/option;
}
$form .= '/select
/td
/tr
tr
td width=200 class=view-form' . wfMsg( 
'ga-threshold' ) . '/td
-   td width=695input type=text size=25 
class=createbox name=gift_threshold value=' . $gift['gift_threshold'] . 
'//td
+   td width=695input type=text size=25 
class=createbox name=gift_threshold value=' . ( isset( 
$gift['gift_threshold'] ) ? $gift['gift_threshold'] : '' ) . '//td
/tr';
 
if ( $gift_id ) {
$gift_image = 'img src=' . $wgUploadPath . '/awards/' 
. SystemGifts::getGiftImage( $gift_id, 'l' ) . ' border=0 alt=gift /';
$form .= 'tr
td width=200 class=view-form valign=top' . 
wfMsg( 'ga-giftimage' ) . '/td
-   td width=695' . $gift_image . '
-   a href=' . $wgScriptPath . 
'/index.php?title=Special:SystemGiftManagerLogogift_id=' . $gift_id . '' . 
wfMsg( 'ga-img' ) . '/a
+   td width=695' . $gift_image .
+   'a href=' . $wgScriptPath . 
'/index.php?title=Special:SystemGiftManagerLogogift_id=' . $gift_id . '' . 
wfMsg( 'ga-img' ) . '/a
/td
/tr';
}
 
+   if ( isset( $gift['gift_id'] ) ) {
+   $button = wfMsg( 'edit' );
+   } else {
+   $button = wfMsg( 'ga-create-gift' );
+   }
$form .= 'tr
td colspan=2
-   input type=hidden name=id value=' . 
$gift['gift_id'] . ' /
-   input type=button class=createbox value=' . ( ( 
$gift['gift_id'] ) ? wfMsg( 'edit' ) : wfMsg( 'ga-create-gift' ) ) . ' 
size=20 onclick=document.gift.submit

[MediaWiki-CVS] SVN: [62746] trunk/extensions/SocialProfile/UserRelationship/ UserRelationshipClass.php

2010-02-20 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62746

Revision: 62746
Author:   ashley
Date: 2010-02-20 19:02:16 + (Sat, 20 Feb 2010)

Log Message:
---
SocialProfile: general cleanup to UserRelationshipClass.php + rewrote raw SQL 
queries to use our wrapper class. *not* very extensively tested

Modified Paths:
--
trunk/extensions/SocialProfile/UserRelationship/UserRelationshipClass.php

Modified: 
trunk/extensions/SocialProfile/UserRelationship/UserRelationshipClass.php
===
--- trunk/extensions/SocialProfile/UserRelationship/UserRelationshipClass.php   
2010-02-20 18:31:25 UTC (rev 62745)
+++ trunk/extensions/SocialProfile/UserRelationship/UserRelationshipClass.php   
2010-02-20 19:02:16 UTC (rev 62746)
@@ -3,7 +3,7 @@
  * Functions for managing relationship data
  */
 class UserRelationship {
-/*...@+
+   /*...@+
 * @private
 */
var $user_id;
@@ -24,7 +24,8 @@
$user_id_to = User::idFromName( $user_to );
$dbw = wfGetDB( DB_MASTER );
 
-   $dbw-insert( 'user_relationship_request',
+   $dbw-insert(
+   'user_relationship_request',
array(
'ur_user_id_from' = $this-user_id,
'ur_user_name_from' = $this-user_name,
@@ -32,21 +33,23 @@
'ur_user_name_to' = $user_to,
'ur_type' = $type,
'ur_message' = $message,
-   'ur_date' = date( Y-m-d H:i:s )
+   'ur_date' = date( 'Y-m-d H:i:s' )
), __METHOD__
);
$request_id = $dbw-insertId();
 
$this-incNewRequestCount( $user_id_to, $type );
 
-   if ( $email ) $this-sendRelationshipRequestEmail( $user_id_to, 
$this-user_name, $type );
+   if ( $email ) {
+   $this-sendRelationshipRequestEmail( $user_id_to, 
$this-user_name, $type );
+   }
return $request_id;
}
 
public function sendRelationshipRequestEmail( $user_id_to, $user_from, 
$type ) {
$user = User::newFromId( $user_id_to );
$user-loadFromDatabase();
-   if ( $user-getEmail()  $user-getIntOption( 
'notifyfriendrequest', 1 ) ) { // if($user-isEmailConfirmed()  
$user-getIntOption(notifyfriendrequest,1)){
+   if ( $user-getEmail()  $user-getIntOption( 
'notifyfriendrequest', 1 ) ) {
$request_link = SpecialPage::getTitleFor( 
'ViewRelationshipRequests' );
$update_profile_link = SpecialPage::getTitleFor( 
'UpdateProfile' );
if ( $type == 1 ) {
@@ -77,7 +80,7 @@
public function sendRelationshipAcceptEmail( $user_id_to, $user_from, 
$type ) {
$user = User::newFromId( $user_id_to );
$user-loadFromDatabase();
-   if ( $user-getEmail()  $user-getIntOption( 
'notifyfriendrequest', 1 ) ) { // if($user-isEmailConfirmed()  
$user-getIntOption(notifyfriendrequest,1)){
+   if ( $user-getEmail()  $user-getIntOption( 
'notifyfriendrequest', 1 ) ) {
$user_link = Title::makeTitle( NS_USER, $user_from );
$update_profile_link = SpecialPage::getTitleFor( 
'UpdateProfile' );
if ( $type == 1 ) {
@@ -140,7 +143,8 @@
global $wgMemc;
 
$dbw = wfGetDB( DB_MASTER );
-   $s = $dbw-selectRow( 'user_relationship_request',
+   $s = $dbw-selectRow(
+   'user_relationship_request',
array( 'ur_user_id_from', 'ur_user_name_from', 
'ur_type' ),
array( 'ur_id' = $relationship_request_id ),
__METHOD__
@@ -155,26 +159,30 @@
return '';
}
 
-   $dbw-insert( 'user_relationship',
+   $dbw-insert(
+   'user_relationship',
array(
'r_user_id' = $this-user_id,
'r_user_name' = $this-user_name,
'r_user_id_relation' = 
$ur_user_id_from,
'r_user_name_relation' = 
$ur_user_name_from,
'r_type' = $ur_type,
-   'r_date' = date( Y-m-d H:i:s )
-   ), __METHOD__
+   'r_date' = date( 'Y-m-d H:i:s' )
+   ),
+   __METHOD__

[MediaWiki-CVS] SVN: [62747] trunk/extensions/SocialProfile/SystemGifts/ SpecialPopulateAwards.php

2010-02-20 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62747

Revision: 62747
Author:   ashley
Date: 2010-02-20 19:07:35 + (Sat, 20 Feb 2010)

Log Message:
---
SocialProfile: remove unused global

Modified Paths:
--
trunk/extensions/SocialProfile/SystemGifts/SpecialPopulateAwards.php

Modified: trunk/extensions/SocialProfile/SystemGifts/SpecialPopulateAwards.php
===
--- trunk/extensions/SocialProfile/SystemGifts/SpecialPopulateAwards.php
2010-02-20 19:02:16 UTC (rev 62746)
+++ trunk/extensions/SocialProfile/SystemGifts/SpecialPopulateAwards.php
2010-02-20 19:07:35 UTC (rev 62747)
@@ -15,7 +15,7 @@
 * @param $gift_category Mixed: parameter passed to the page or null
 */
public function execute( $gift_category ) {
-   global $wgUser, $wgOut, $wgMemc;
+   global $wgUser, $wgOut, $wgUserLevels;
 
# If the user doesn't have the required 'awardsmanage' 
permission, display an error
if ( !$wgUser-isAllowed( 'awardsmanage' ) ) {
@@ -35,7 +35,6 @@
return;
}
 
-   global $wgUserLevels;
$wgUserLevels = '';
 
$g = new SystemGifts();



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [62750] trunk/phase3/includes/api/ApiBase.php

2010-02-20 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62750

Revision: 62750
Author:   ashley
Date: 2010-02-20 19:39:51 + (Sat, 20 Feb 2010)

Log Message:
---
ApiBase.php: coding style cleanup, added more braces, trimmed trailing spaces, 
changed copyright symbol to the proper one

Modified Paths:
--
trunk/phase3/includes/api/ApiBase.php

Modified: trunk/phase3/includes/api/ApiBase.php
===
--- trunk/phase3/includes/api/ApiBase.php   2010-02-20 19:37:56 UTC (rev 
62749)
+++ trunk/phase3/includes/api/ApiBase.php   2010-02-20 19:39:51 UTC (rev 
62750)
@@ -1,11 +1,11 @@
 ?php
 
-/*
+/**
  * Created on Sep 5, 2006
  *
  * API for MediaWiki 1.8+
  *
- * Copyright (C) 2006, 2010 Yuri Astrakhan FirstnameLastname@gmail.com
+ * Copyright © 2006, 2010 Yuri Astrakhan FirstnameLastname@gmail.com
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -121,10 +121,11 @@
 * @return string
 */
public function getModuleProfileName( $db = false ) {
-   if ( $db )
+   if ( $db ) {
return 'API:' . $this-mModuleName . '-DB';
-   else
+   } else {
return 'API:' . $this-mModuleName;
+   }
}
 
/**
@@ -151,8 +152,9 @@
public function getResult() {
// Main module has getResult() method overriden
// Safety - avoid infinite loop:
-   if ( $this-isMain() )
-   ApiBase :: dieDebug( __METHOD__, 'base method was 
called on main module. ' );
+   if ( $this-isMain() ) {
+   ApiBase::dieDebug( __METHOD__, 'base method was called 
on main module. ' );
+   }
return $this-getMain()-getResult();
}
 
@@ -173,19 +175,20 @@
 */
public function setWarning( $warning ) {
$data = $this-getResult()-getData();
-   if ( isset( $data['warnings'][$this-getModuleName()] ) )
-   {
+   if ( isset( $data['warnings'][$this-getModuleName()] ) ) {
// Don't add duplicate warnings
$warn_regex = preg_quote( $warning, '/' );
if ( preg_match( /{$warn_regex}(\\n|$)/, 
$data['warnings'][$this-getModuleName()]['*'] ) )
+   {
return;
+   }
$oldwarning = 
$data['warnings'][$this-getModuleName()]['*'];
// If there is a warning already, append it to the 
existing one
$warning = $oldwarning\n$warning;
$this-getResult()-unsetValue( 'warnings', 
$this-getModuleName() );
}
$msg = array();
-   ApiResult :: setContent( $msg, $warning );
+   ApiResult::setContent( $msg, $warning );
$this-getResult()-disableSizeCheck();
$this-getResult()-addValue( 'warnings', 
$this-getModuleName(), $msg );
$this-getResult()-enableSizeCheck();
@@ -206,28 +209,33 @@
 * @return mixed string or false
 */
public function makeHelpMsg() {
-
static $lnPrfx = \n  ;
 
$msg = $this-getDescription();
 
if ( $msg !== false ) {
 
-   if ( !is_array( $msg ) )
-   $msg = array (
+   if ( !is_array( $msg ) ) {
+   $msg = array(
$msg
);
+   }
$msg = $lnPrfx . implode( $lnPrfx, $msg ) . \n;
 
-   if ( $this-isReadMode() )
+   if ( $this-isReadMode() ) {
$msg .= \nThis module requires read rights.;
-   if ( $this-isWriteMode() )
+   }
+   if ( $this-isWriteMode() ) {
$msg .= \nThis module requires write rights.;
-   if ( $this-mustBePosted() )
+   }
+   if ( $this-mustBePosted() ) {
$msg .= \nThis module only accepts POST 
requests.;
+   }
if ( $this-isReadMode() || $this-isWriteMode() ||
$this-mustBePosted() )
+   {
$msg .= \n;
+   }
 
// Parameters
$paramsMsg = $this-makeHelpMsgParameters();
@@ -238,10 +246,11 @@
// Examples
$examples = $this-getExamples

[MediaWiki-CVS] SVN: [62703] trunk/phase3/includes/api/ApiDelete.php

2010-02-19 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62703

Revision: 62703
Author:   ashley
Date: 2010-02-19 12:54:09 + (Fri, 19 Feb 2010)

Log Message:
---
API deletion module: trim trailing spaces, tweak coding style, change copyright 
symbol to a proper one, change else if to elseif

Modified Paths:
--
trunk/phase3/includes/api/ApiDelete.php

Modified: trunk/phase3/includes/api/ApiDelete.php
===
--- trunk/phase3/includes/api/ApiDelete.php 2010-02-19 12:20:43 UTC (rev 
62702)
+++ trunk/phase3/includes/api/ApiDelete.php 2010-02-19 12:54:09 UTC (rev 
62703)
@@ -1,10 +1,10 @@
 ?php
 
-/*
+/**
  * Created on Jun 30, 2007
  * API for MediaWiki 1.8+
  *
- * Copyright (C) 2007 Roan Kattouw Firstname.Lastname@home.nl
+ * Copyright © 2007 Roan Kattouw Firstname.Lastname@home.nl
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -24,7 +24,7 @@
 
 if ( !defined( 'MEDIAWIKI' ) ) {
// Eclipse helper - will be ignored in production
-   require_once ( ApiBase.php );
+   require_once( ApiBase.php );
 }
 
 /**
@@ -36,7 +36,7 @@
 class ApiDelete extends ApiBase {
 
public function __construct( $main, $action ) {
-   parent :: __construct( $main, $action );
+   parent::__construct( $main, $action );
}
 
/**
@@ -47,43 +47,46 @@
 * result object.
 */
public function execute() {
-   global $wgUser;
-   
+   global $wgUser;
+
$params = $this-extractRequestParams();
 
$this-requireOnlyOneParameter( $params, 'title', 'pageid' );
 
-   if ( isset( $params['title'] ) )
-   {
+   if ( isset( $params['title'] ) ) {
$titleObj = Title::newFromText( $params['title'] );
-   if ( !$titleObj )
+   if ( !$titleObj ) {
$this-dieUsageMsg( array( 'invalidtitle', 
$params['title'] ) );
-   }
-   else if ( isset( $params['pageid'] ) )
-   {
+   }
+   } elseif ( isset( $params['pageid'] ) ) {
$titleObj = Title::newFromID( $params['pageid'] );
-   if ( !$titleObj )
+   if ( !$titleObj ) {
$this-dieUsageMsg( array( 'nosuchpageid', 
$params['pageid'] ) );
+   }
}
-   if ( !$titleObj-exists() )
+   if ( !$titleObj-exists() ) {
$this-dieUsageMsg( array( 'notanarticle' ) );
+   }
 
$reason = ( isset( $params['reason'] ) ? $params['reason'] : 
null );
if ( $titleObj-getNamespace() == NS_FILE ) {
$retval = self::deleteFile( $params['token'], 
$titleObj, $params['oldimage'], $reason, false );
-   if ( count( $retval ) )
+   if ( count( $retval ) ) {
$this-dieUsageMsg( reset( $retval ) ); // We 
don't care about multiple errors, just report one of them
+   }
} else {
$articleObj = new Article( $titleObj );
$retval = self::delete( $articleObj, $params['token'], 
$reason );
-   
-   if ( count( $retval ) )
+
+   if ( count( $retval ) ) {
$this-dieUsageMsg( reset( $retval ) ); // We 
don't care about multiple errors, just report one of them
+   }
 
-   if ( $params['watch'] || $wgUser-getOption( 
'watchdeletion' ) )
+   if ( $params['watch'] || $wgUser-getOption( 
'watchdeletion' ) ) {
$articleObj-doWatch();
-   else if ( $params['unwatch'] )
+   } elseif ( $params['unwatch'] ) {
$articleObj-doUnwatch();
+   }
}
 
$r = array( 'title' = $titleObj-getPrefixedText(), 'reason' 
= $reason );
@@ -92,10 +95,12 @@
 
private static function getPermissionsError( $title, $token ) {
global $wgUser;
-   
+
// Check permissions
$errors = $title-getUserPermissionsErrors( 'delete', $wgUser );
-   if ( count( $errors )  0 ) return $errors;
+   if ( count( $errors )  0 ) {
+   return $errors;
+   }
 
return array();
}
@@ -108,8 +113,7 @@
 * @param string $reason - Reason for the deletion. Autogenerated if 
NULL
 * @return Title::getUserPermissionsErrors()-like array

[MediaWiki-CVS] SVN: [62673] trunk/phase3/includes/api/ApiLogin.php

2010-02-18 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62673

Revision: 62673
Author:   ashley
Date: 2010-02-18 14:53:30 + (Thu, 18 Feb 2010)

Log Message:
---
API login module: coding style cleanup, remove stray semicolon, use proper 
copyright symbol

Modified Paths:
--
trunk/phase3/includes/api/ApiLogin.php

Modified: trunk/phase3/includes/api/ApiLogin.php
===
--- trunk/phase3/includes/api/ApiLogin.php  2010-02-18 05:27:48 UTC (rev 
62672)
+++ trunk/phase3/includes/api/ApiLogin.php  2010-02-18 14:53:30 UTC (rev 
62673)
@@ -1,11 +1,11 @@
 ?php
 
-/*
+/**
  * Created on Sep 19, 2006
  *
  * API for MediaWiki 1.8+
  *
- * Copyright (C) 2006-2007 Yuri Astrakhan FirstnameLastname@gmail.com,
+ * Copyright © 2006-2007 Yuri Astrakhan FirstnameLastname@gmail.com,
  * Daniel Cannon (cannon dot danielc at gmail dot com)
  *
  * This program is free software; you can redistribute it and/or modify
@@ -26,7 +26,7 @@
 
 if ( !defined( 'MEDIAWIKI' ) ) {
// Eclipse helper - will be ignored in production
-   require_once ( 'ApiBase.php' );
+   require_once( 'ApiBase.php' );
 }
 
 /**
@@ -37,7 +37,7 @@
 class ApiLogin extends ApiBase {
 
public function __construct( $main, $action ) {
-   parent :: __construct( $main, $action, 'lg' );
+   parent::__construct( $main, $action, 'lg' );
}
 
/**
@@ -48,15 +48,13 @@
 * user, or any other reason, the host is cached with an expiry
 * and no log-in attempts will be accepted until that expiry
 * is reached. The expiry is $this-mLoginThrottle.
-*
-* @access public
 */
public function execute() {
$params = $this-extractRequestParams();
 
-   $result = array ();
+   $result = array();
 
-   $req = new FauxRequest( array (
+   $req = new FauxRequest( array(
'wpName' = $params['name'],
'wpPassword' = $params['password'],
'wpDomain' = $params['domain'],
@@ -70,7 +68,7 @@
 
$loginForm = new LoginForm( $req );
switch ( $authRes = $loginForm-authenticateUserData() ) {
-   case LoginForm :: SUCCESS :
+   case LoginForm::SUCCESS:
global $wgUser, $wgCookiePrefix;
 
$wgUser-setOption( 'rememberpassword', 1 );
@@ -89,48 +87,48 @@
$result['sessionid'] = session_id();
break;
 
-   case LoginForm :: NO_NAME :
+   case LoginForm::NO_NAME:
$result['result'] = 'NoName';
break;
 
-   case LoginForm :: ILLEGAL :
+   case LoginForm::ILLEGAL:
$result['result'] = 'Illegal';
break;
 
-   case LoginForm :: WRONG_PLUGIN_PASS :
+   case LoginForm::WRONG_PLUGIN_PASS:
$result['result'] = 'WrongPluginPass';
break;
 
-   case LoginForm :: NOT_EXISTS :
+   case LoginForm::NOT_EXISTS:
$result['result'] = 'NotExists';
break;
-   
-   case LoginForm :: RESET_PASS : // bug 20223 - Treat a 
temporary password as wrong. Per SpecialUserLogin - The e-mailed temporary 
password should not be used for actual logins;
-   case LoginForm :: WRONG_PASS :
+
+   case LoginForm::RESET_PASS: // bug 20223 - Treat a 
temporary password as wrong. Per SpecialUserLogin - The e-mailed temporary 
password should not be used for actual logins;
+   case LoginForm::WRONG_PASS:
$result['result'] = 'WrongPass';
break;
 
-   case LoginForm :: EMPTY_PASS :
+   case LoginForm::EMPTY_PASS:
$result['result'] = 'EmptyPass';
break;
 
-   case LoginForm :: CREATE_BLOCKED :
+   case LoginForm::CREATE_BLOCKED:
$result['result'] = 'CreateBlocked';
$result['details'] = 'Your IP address is 
blocked from account creation';
break;
 
-   case LoginForm :: THROTTLED :
+   case LoginForm::THROTTLED:
global $wgPasswordAttemptThrottle;
$result['result'] = 'Throttled';
$result['wait'] = intval

[MediaWiki-CVS] SVN: [62598] trunk/phase3/includes/upload/UploadBase.php

2010-02-16 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62598

Revision: 62598
Author:   ashley
Date: 2010-02-16 21:33:55 + (Tue, 16 Feb 2010)

Log Message:
---
more braces, documentation and spacing tweaks

Modified Paths:
--
trunk/phase3/includes/upload/UploadBase.php

Modified: trunk/phase3/includes/upload/UploadBase.php
===
--- trunk/phase3/includes/upload/UploadBase.php 2010-02-16 21:20:41 UTC (rev 
62597)
+++ trunk/phase3/includes/upload/UploadBase.php 2010-02-16 21:33:55 UTC (rev 
62598)
@@ -40,8 +40,9 @@
 */
public static function isEnabled() {
global $wgEnableUploads;
-   if ( !$wgEnableUploads )
+   if ( !$wgEnableUploads ) {
return false;
+   }
 
# Check php's file_uploads setting
if( !wfIniGetBool( 'file_uploads' ) ) {
@@ -56,8 +57,9 @@
 * Can be overriden by subclasses.
 */
public static function isAllowed( $user ) {
-   if( !$user-isAllowed( 'upload' ) )
+   if( !$user-isAllowed( 'upload' ) ) {
return 'upload';
+   }
return true;
}
 
@@ -70,8 +72,9 @@
public static function createFromRequest( $request, $type = null ) {
$type = $type ? $type : $request-getVal( 'wpSourceType', 
'File' );
 
-   if( !$type )
+   if( !$type ) {
return null;
+   }
 
// Get the upload class
$type = ucfirst( $type );
@@ -82,17 +85,20 @@
if ( is_null( $className ) ) {
$className = 'UploadFrom' . $type;
wfDebug( __METHOD__ . : class name: $className\n );
-   if( !in_array( $type, self::$uploadHandlers ) )
+   if( !in_array( $type, self::$uploadHandlers ) ) {
return null;
+   }
}
 
// Check whether this upload class is enabled
-   if( !call_user_func( array( $className, 'isEnabled' ) ) )
+   if( !call_user_func( array( $className, 'isEnabled' ) ) ) {
return null;
+   }
 
// Check whether the request is valid
-   if( !call_user_func( array( $className, 'isValidRequest' ), 
$request ) )
+   if( !call_user_func( array( $className, 'isValidRequest' ), 
$request ) ) {
return null;
+   }
 
$handler = new $className;
 
@@ -139,16 +145,15 @@
/**
 * Return the file size
 */
-   public function isEmptyFile(){
+   public function isEmptyFile() {
return empty( $this-mFileSize );
}
 
/**
- * getRealPath
- * @param string $srcPath the source path
- * @returns the real path if it was a virtual url
- */
-   function getRealPath( $srcPath ){
+* @param string $srcPath the source path
+* @returns the real path if it was a virtual URL
+*/
+   function getRealPath( $srcPath ) {
$repo = RepoGroup::singleton()-getLocalRepo();
if ( $repo-isVirtualUrl( $srcPath ) ) {
return $repo-resolveVirtualUrl( $srcPath );
@@ -164,8 +169,9 @@
/**
 * If there was no filename or a zero size given, give up quick.
 */
-   if( $this-isEmptyFile() )
+   if( $this-isEmptyFile() ) {
return array( 'status' = self::EMPTY_FILE );
+   }
 
/**
 * Look at the contents of the file; if we can recognize the
@@ -174,20 +180,24 @@
 */
$verification = $this-verifyFile();
if( $verification !== true ) {
-   if( !is_array( $verification ) )
+   if( !is_array( $verification ) ) {
$verification = array( $verification );
-   return array( 'status' = self::VERIFICATION_ERROR,
-   'details' = $verification );
-
+   }
+   return array(
+   'status' = self::VERIFICATION_ERROR,
+   'details' = $verification
+   );
}
 
$nt = $this-getTitle();
if( is_null( $nt ) ) {
$result = array( 'status' = $this-mTitleError );
-   if( $this-mTitleError == self::ILLEGAL_FILENAME )
+   if( $this-mTitleError == self::ILLEGAL_FILENAME ) {
$result['filtered'] = $this-mFilteredName

[MediaWiki-CVS] SVN: [62191] trunk/phase3

2010-02-09 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62191

Revision: 62191
Author:   ashley
Date: 2010-02-09 19:51:17 + (Tue, 09 Feb 2010)

Log Message:
---
bug #19334: textarea jumps when editing longer articles in IE8

Modified Paths:
--
trunk/phase3/RELEASE-NOTES
trunk/phase3/includes/EditPage.php

Added Paths:
---
trunk/phase3/skins/common/IE80Fixes.css

Modified: trunk/phase3/RELEASE-NOTES
===
--- trunk/phase3/RELEASE-NOTES  2010-02-09 19:27:27 UTC (rev 62190)
+++ trunk/phase3/RELEASE-NOTES  2010-02-09 19:51:17 UTC (rev 62191)
@@ -747,6 +747,7 @@
   $wgExtensionCredits is no longer sorted with sort() but rather used
   as it appears in extensions as was the case before r30117 where it
   was unintentionally sorted along with other fields.
+* (bug 19334) Textarea no longer jumps when editing longer articles in IE8
 
 == API changes in 1.16 ==
 

Modified: trunk/phase3/includes/EditPage.php
===
--- trunk/phase3/includes/EditPage.php  2010-02-09 19:27:27 UTC (rev 62190)
+++ trunk/phase3/includes/EditPage.php  2010-02-09 19:51:17 UTC (rev 62191)
@@ -397,6 +397,8 @@
$wgOut-includeJQuery();
$wgOut-addScriptFile( 'preview.js' );
}
+   // Bug #19334: textarea jumps when editing articles in IE8
+   $wgOut-addStyle( 'common/IE80Fixes.css', 'screen', 'IE 8' );
 
$permErrors = $this-getEditPermissionErrors();
if ( $permErrors ) {

Added: trunk/phase3/skins/common/IE80Fixes.css
===
--- trunk/phase3/skins/common/IE80Fixes.css (rev 0)
+++ trunk/phase3/skins/common/IE80Fixes.css 2010-02-09 19:51:17 UTC (rev 
62191)
@@ -0,0 +1,9 @@
+/**
+ * Fixes textarea scrolling bug (bug #19334)
+ */
+#wpTextbox1 {
+   height: 390px;
+   width: 500px;
+   min-width: 100%;
+   max-width: 100%;
+}
\ No newline at end of file


Property changes on: trunk/phase3/skins/common/IE80Fixes.css
___
Added: svn:eol-style
   + native



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [62093] trunk/phase3/skins/Skin.sample

2010-02-07 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62093

Revision: 62093
Author:   ashley
Date: 2010-02-07 19:19:32 + (Sun, 07 Feb 2010)

Log Message:
---
delete Skin.sample: old and hardly helpful file; even MediaWiki.org's outdated 
docs on how to write a new skin are better than this

Removed Paths:
-
trunk/phase3/skins/Skin.sample

Deleted: trunk/phase3/skins/Skin.sample
===
--- trunk/phase3/skins/Skin.sample  2010-02-07 18:39:26 UTC (rev 62092)
+++ trunk/phase3/skins/Skin.sample  2010-02-07 19:19:32 UTC (rev 62093)
@@ -1,18 +0,0 @@
-?php
-
-#
-# Do NOT use PHPTal with this sample, if you want PHPTal support have a look at
-# the other sample : SkinPHPTal.sample.
-#
-# The class name MUST begin with 'Skin' and the rest is the name of the file
-# excluding '.php'
-# This file is named Skin.sample (but it should end with php). So the
-# class name will be 'Skin' . 'Skin'
-
-class SkinSkin extends Skin {
-# Override method below
-#
-
-}
-
-}



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [62094] trunk/phase3/skins

2010-02-07 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62094

Revision: 62094
Author:   ashley
Date: 2010-02-07 19:24:43 + (Sun, 07 Feb 2010)

Log Message:
---
cleanup to CologneBlue.php, Nostalgia.php and Standard.php

Modified Paths:
--
trunk/phase3/skins/CologneBlue.php
trunk/phase3/skins/Nostalgia.php
trunk/phase3/skins/Standard.php

Modified: trunk/phase3/skins/CologneBlue.php
===
--- trunk/phase3/skins/CologneBlue.php  2010-02-07 19:19:32 UTC (rev 62093)
+++ trunk/phase3/skins/CologneBlue.php  2010-02-07 19:24:43 UTC (rev 62094)
@@ -7,8 +7,9 @@
  * @ingroup Skins
  */
 
-if( !defined( 'MEDIAWIKI' ) )
+if( !defined( 'MEDIAWIKI' ) ) {
die( -1 );
+}
 
 /**
  * @todo document
@@ -46,7 +47,9 @@
$s .= 'font size=-1span id=langlinks';
$s .= str_replace( 'br /', '', $this-otherLanguages() );
$cat = $this-getCategoryLinks();
-   if( $cat ) $s .= br /$cat\n;
+   if( $cat ) {
+   $s .= br /$cat\n;
+   }
$s .= 'br /' . $this-pageTitleLinks();
$s .= '/span/font';
 
@@ -110,20 +113,20 @@
 
if ( 2 == $qb ) { # Right
$s .= #quickbar { position: absolute; right: 4px; }\n 
.
- #article { margin-left: 4px; margin-right: 148px; 
}\n;
-   } else if ( 1 == $qb ) {
+   #article { margin-left: 4px; margin-right: 
148px; }\n;
+   } elseif ( 1 == $qb ) {
$s .= #quickbar { position: absolute; left: 4px; }\n .
- #article { margin-left: 148px; margin-right: 4px; 
}\n;
-   } else if ( 3 == $qb ) { # Floating left
+   #article { margin-left: 148px; margin-right: 
4px; }\n;
+   } elseif ( 3 == $qb ) { # Floating left
$s .= #quickbar { position:absolute; left:4px } \n .
- #topbar { margin-left: 148px }\n .
- #article { margin-left:148px; margin-right: 4px; } 
\n .
- body#quickbar { position:fixed; left:4px; top:4px; 
overflow:auto ;bottom:4px;} \n; # Hides from IE
-   } else if ( 4 == $qb ) { # Floating right
+   #topbar { margin-left: 148px }\n .
+   #article { margin-left:148px; margin-right: 
4px; } \n .
+   body#quickbar { position:fixed; left:4px; 
top:4px; overflow:auto ;bottom:4px;} \n; # Hides from IE
+   } elseif ( 4 == $qb ) { # Floating right
$s .= #quickbar { position: fixed; right: 4px; } \n .
- #topbar { margin-right: 148px }\n .
- #article { margin-right: 148px; margin-left: 4px; } 
\n .
- body#quickbar { position: fixed; right: 4px; top: 
4px; overflow: auto ;bottom:4px;} \n; # Hides from IE
+   #topbar { margin-right: 148px }\n .
+   #article { margin-right: 148px; margin-left: 
4px; } \n .
+   body#quickbar { position: fixed; right: 4px; 
top: 4px; overflow: auto ;bottom:4px;} \n; # Hides from IE
}
return $s;
}
@@ -242,8 +245,8 @@
 
$s .= $this-menuHead( 'qbpageoptions' );
$s .= $this-talkLink()
- . $sep . $this-commentLink()
- . $sep . $this-printableLink();
+   . $sep . $this-commentLink()
+   . $sep . $this-printableLink();
if ( $wgUser-isLoggedIn() ) {
$s .= $sep . $this-watchThisPage();
}
@@ -251,9 +254,9 @@
$s .= $sep;
 
$s .= $this-menuHead( 'qbpageinfo' )
- . $this-historyLink()
- . $sep . $this-whatLinksHere()
- . $sep . $this-watchPageLinksLink();
+   . $this-historyLink()
+   . $sep . $this-whatLinksHere()
+   . $sep . $this-watchPageLinksLink();
 
if( $tns == NS_USER || $tns == NS_USER_TALK ) {
$id = User::idFromName( 
$this-mTitle-getText() );
@@ -278,35 +281,33 @@
array( 'known', 'noclasses' )
);
if ( $wgUser-getNewtalk() ) {
-   $tl .=  *;
+   $tl .= ' *';
}
 
$s .= $this-link(
-   $wgUser-getUserPage

[MediaWiki-CVS] SVN: [62095] trunk/phase3/includes/filerepo/LocalFile.php

2010-02-07 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62095

Revision: 62095
Author:   ashley
Date: 2010-02-07 19:31:24 + (Sun, 07 Feb 2010)

Log Message:
---
coding style tweaks, marked public functions as such

Modified Paths:
--
trunk/phase3/includes/filerepo/LocalFile.php

Modified: trunk/phase3/includes/filerepo/LocalFile.php
===
--- trunk/phase3/includes/filerepo/LocalFile.php2010-02-07 19:24:43 UTC 
(rev 62094)
+++ trunk/phase3/includes/filerepo/LocalFile.php2010-02-07 19:31:24 UTC 
(rev 62095)
@@ -24,8 +24,7 @@
  *
  * @ingroup FileRepo
  */
-class LocalFile extends File
-{
+class LocalFile extends File {
/*...@+
 * @private
 */
@@ -123,7 +122,7 @@
 */
function __construct( $title, $repo ) {
if( !is_object( $title ) ) {
-   throw new MWException( __CLASS__.' constructor given 
bogus title.' );
+   throw new MWException( __CLASS__ . ' constructor given 
bogus title.' );
}
parent::__construct( $title, $repo );
$this-metadata = '';
@@ -137,7 +136,7 @@
 * there is no access to the shared cache.
 */
function getCacheKey() {
-   $hashedName = md5($this-getName());
+   $hashedName = md5( $this-getName() );
return $this-repo-getSharedCacheKey( 'file', $hashedName );
}
 
@@ -156,7 +155,7 @@
$cachedValues = $wgMemc-get( $key );
 
// Check if the key existed and belongs to this version of 
MediaWiki
-   if ( isset($cachedValues['version'])  ( 
$cachedValues['version'] == MW_FILE_VERSION ) ) {
+   if ( isset( $cachedValues['version'] )  ( 
$cachedValues['version'] == MW_FILE_VERSION ) ) {
wfDebug( Pulling file metadata from cache key $key\n 
);
$this-fileExists = $cachedValues['fileExists'];
if ( $this-fileExists ) {
@@ -253,7 +252,7 @@
$prefixLength = strlen( $prefix );
// Sanity check prefix once
if ( substr( key( $array ), 0, $prefixLength ) !== $prefix ) {
-   throw new MWException( __METHOD__. ': incorrect $prefix 
parameter' );
+   throw new MWException( __METHOD__ .  ': incorrect 
$prefix parameter' );
}
$decoded = array();
foreach ( $array as $name = $value ) {
@@ -261,19 +260,19 @@
}
$decoded['timestamp'] = wfTimestamp( TS_MW, 
$decoded['timestamp'] );
if ( empty( $decoded['major_mime'] ) ) {
-   $decoded['mime'] = unknown/unknown;
+   $decoded['mime'] = 'unknown/unknown';
} else {
-   if (!$decoded['minor_mime']) {
-   $decoded['minor_mime'] = unknown;
+   if ( !$decoded['minor_mime'] ) {
+   $decoded['minor_mime'] = 'unknown';
}
-   $decoded['mime'] = 
$decoded['major_mime'].'/'.$decoded['minor_mime'];
+   $decoded['mime'] = $decoded['major_mime'] . '/' . 
$decoded['minor_mime'];
}
# Trim zero padding from char/binary field
$decoded['sha1'] = rtrim( $decoded['sha1'], \0 );
return $decoded;
}
 
-   /*
+   /**
 * Load file metadata from a DB result row
 */
function loadFromRow( $row, $prefix = 'img_' ) {
@@ -306,7 +305,7 @@
if ( wfReadOnly() ) {
return;
}
-   if ( is_null($this-media_type) ||
+   if ( is_null( $this-media_type ) ||
$this-mime == 'image/svg'
) {
$this-upgradeRow();
@@ -334,7 +333,7 @@
 
# Don't destroy file info of missing files
if ( !$this-fileExists ) {
-   wfDebug( __METHOD__.: file does not exist, aborting\n 
);
+   wfDebug( __METHOD__ . : file does not exist, 
aborting\n );
wfProfileOut( __METHOD__ );
return;
}
@@ -345,7 +344,7 @@
wfProfileOut( __METHOD__ );
return;
}
-   wfDebug(__METHOD__.': upgrading '.$this-getName(). to the 
current schema\n);
+   wfDebug( __METHOD__ . ': upgrading ' . $this-getName() .  to 
the current schema\n );
 
$dbw-update( 'image',
array(
@@ -408,9 +407,8 @@
 * Return the width of the image
 *
 * Returns false on error
-* @public
 */
-   function getWidth( $page = 1

[MediaWiki-CVS] SVN: [61728] trunk/phase3/skins/MonoBook.php

2010-01-30 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/61728

Revision: 61728
Author:   ashley
Date: 2010-01-30 20:26:38 + (Sat, 30 Jan 2010)

Log Message:
---
MonoBook: remove three unused globals which were added in r56770 to support 
loading of IEFixes.js but IEFixes.js was merged into wikibits.js in r60994

Modified Paths:
--
trunk/phase3/skins/MonoBook.php

Modified: trunk/phase3/skins/MonoBook.php
===
--- trunk/phase3/skins/MonoBook.php 2010-01-30 19:20:23 UTC (rev 61727)
+++ trunk/phase3/skins/MonoBook.php 2010-01-30 20:26:38 UTC (rev 61728)
@@ -24,7 +24,7 @@
$template = 'MonoBookTemplate', $useHeadElement = true;
 
function setupSkinUserCss( OutputPage $out ) {
-   global $wgHandheldStyle, $wgStyleVersion, $wgJsMimeType, 
$wgStylePath;
+   global $wgHandheldStyle;
 
parent::setupSkinUserCss( $out );
 



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [61607] trunk/extensions/SocialProfile/UserActivity/UserActivityClass. php

2010-01-27 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/61607

Revision: 61607
Author:   ashley
Date: 2010-01-27 21:31:13 + (Wed, 27 Jan 2010)

Log Message:
---
SocialProfile: while - foreach in UserActivity

Modified Paths:
--
trunk/extensions/SocialProfile/UserActivity/UserActivityClass.php

Modified: trunk/extensions/SocialProfile/UserActivity/UserActivityClass.php
===
--- trunk/extensions/SocialProfile/UserActivity/UserActivityClass.php   
2010-01-27 21:12:22 UTC (rev 61606)
+++ trunk/extensions/SocialProfile/UserActivity/UserActivityClass.php   
2010-01-27 21:31:13 UTC (rev 61607)
@@ -83,7 +83,7 @@
ORDER BY rc_id DESC LIMIT 0, . $this-item_max;
$res = $dbr-query( $sql, __METHOD__ );
 
-   while ( $row = $dbr-fetchObject( $res ) ) {
+   foreach ( $res as $row ) {
// Special pages aren't editable, so ignore them
if ( $row-rc_namespace == NS_SPECIAL ) {
continue;
@@ -145,7 +145,7 @@
{$rel_sql} {$user_sql}
ORDER BY vote_date DESC LIMIT 0, . $this-item_max;
$res = $dbr-query( $sql, __METHOD__ );
-   while ( $row = $dbr-fetchObject( $res ) ) {
+   foreach ( $res as $row ) {
$username = $row-username;
$this-items[] = array(
'id' = 0,
@@ -190,7 +190,7 @@
ORDER BY comment_date DESC LIMIT 0, . $this-item_max;
 
$res = $dbr-query( $sql, __METHOD__ );
-   while ( $row = $dbr-fetchObject( $res ) ) {
+   foreach ( $res as $row ) {
$show_comment = true;
 
global $wgFilterComments;
@@ -255,7 +255,7 @@
{$rel_sql} {$user_sql}
ORDER BY ug_id DESC LIMIT 0,{$this-item_max};
$res = $dbr-query( $sql, __METHOD__ );
-   while ( $row = $dbr-fetchObject( $res ) ) {
+   foreach ( $res as $row ) {
$this-items[] = array(
'id' = $row-ug_id,
'type' = 'gift-sent',
@@ -292,7 +292,7 @@
{$rel_sql} {$user_sql}
ORDER BY ug_id DESC LIMIT 0,{$this-item_max};
$res = $dbr-query( $sql, __METHOD__ );
-   while ( $row = $dbr-fetchObject( $res ) ) {
+   foreach ( $res as $row ) {
global $wgUploadPath;
$user_title = Title::makeTitle( NS_USER, 
$row-ug_user_name_to );
$user_title_from = Title::makeTitle( NS_USER, 
$row-ug_user_name_from );
@@ -352,7 +352,7 @@
{$rel_sql} {$user_sql}
ORDER BY sg_id DESC LIMIT 0,{$this-item_max};
$res = $dbr-query( $sql, __METHOD__ );
-   while ( $row = $dbr-fetchObject( $res ) ) {
+   foreach ( $res as $row ) {
global $wgUploadPath;
$user_title = Title::makeTitle( NS_USER, 
$row-sg_user_name );
$system_gift_image = 'img src=' . $wgUploadPath . 
'/awards/' . SystemGifts::getGiftImage( $row-gift_id, 'm' ) . ' border=0 
alt= /';
@@ -405,7 +405,7 @@
ORDER BY r_id DESC LIMIT 0,{$this-item_max};
$res = $dbr-query( $sql, __METHOD__ );
 
-   while ( $row = $dbr-fetchObject( $res ) ) {
+   foreach ( $res as $row ) {
if ( $row-r_type == 1 ) {
$r_type = 'friend';
} else {
@@ -469,7 +469,7 @@
ORDER BY ub_id DESC LIMIT 0,{$this-item_max};
 
$res = $dbr-query( $sql, __METHOD__ );
-   while ( $row = $dbr-fetchObject( $res ) ) {
+   foreach ( $res as $row ) {
// Ignore nonexistent (for example, renamed) users
$uid = User::idFromName( $row-ub_user_name );
if ( !$uid ) {
@@ -525,7 +525,7 @@
{$rel_sql} {$user_sql}
ORDER BY um_id DESC LIMIT 0,{$this-item_max};
$res = $dbr-query( $sql, __METHOD__ );
-   while ( $row = $dbr-fetchObject( $res ) ) {
+   foreach ( $res as $row ) {
$user_title = Title::makeTitle( NS_USER, 
$row-um_user_name );
$user_name_short = substr( $row-um_user_name, 0, 15 );
if ( $row-um_user_name != $user_name_short ) {



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [61469] trunk/extensions/AjaxLogin

2010-01-24 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/61469

Revision: 61469
Author:   ashley
Date: 2010-01-24 18:20:12 + (Sun, 24 Jan 2010)

Log Message:
---
AjaxLogin:
*don't load any AjaxLogin stuff for Special:UserLogin
*move inline styles to CSS file
*replace deprecated font tag with span + CSS styling
*bump version number

Modified Paths:
--
trunk/extensions/AjaxLogin/AjaxLogin.css
trunk/extensions/AjaxLogin/AjaxLogin.js
trunk/extensions/AjaxLogin/AjaxLogin.php

Modified: trunk/extensions/AjaxLogin/AjaxLogin.css
===
--- trunk/extensions/AjaxLogin/AjaxLogin.css2010-01-24 17:15:21 UTC (rev 
61468)
+++ trunk/extensions/AjaxLogin/AjaxLogin.css2010-01-24 18:20:12 UTC (rev 
61469)
@@ -1,8 +1,6 @@
-/*** AJAX LOGIN ***/
+/* CSS for AjaxLogin extension */
+
 /* styles copied from monaco/css/header.css */
-#userloginRound_c { z-index: 2000 !important; }
-#userloginRound_mask { z-index: 1000 !important; }
-
 #userloginRound .r_boxContent {
background-color: #fff;
color: #00;
@@ -11,13 +9,12 @@
 
 #userloginRound .boxHeader {
padding: 3px 5px;
-   font-size: 12px; /* Jack: added this */
+   font-size: 12px;
 }
 
 #userloginRound form {
padding: 3px;
font-size: 12px;
-/* font-size: 0.9em; original -- doesn't look too good on monobook*/
 }
 
 /* copied from monaco/css/root.css */
@@ -25,10 +22,50 @@
background-color: #36C;
color: white;
 }
+
 .color2 {
background-color: #F5F5F5;
 }
 
+#userajaxloginform {
+   margin: 5px;
+}
+
+#wpClose {
+   float: right;
+   cursor: pointer;
+}
+
+#wpClose span {
+   font-size: 2em;
+   font-weight: bold;
+   color: #FF;
+}
+
+#wpLoginattempt {
+   margin: 0;
+   padding: 0 .25em;
+   width: auto;
+   overflow: visible;
+}
+
+#wpError {
+   width: 250px;
+   line-height: 1.4em;
+}
+
+#ajaxLoginRememberMe {
+   padding-bottom: 3px;
+}
+
+#wpMailmypassword {
+   margin: 3px 0;
+   padding: 0 .25em;
+   width: auto;
+   overflow: visible;
+   font-size: 0.9em;
+}
+
 .jqmWindow {
display: none;
position: fixed;
@@ -40,7 +77,9 @@
border: 1px solid black;
 }
 
-.jqmOverlay { background-color: #000; }
+.jqmOverlay {
+   background-color: #000;
+}
 
 /* Fixed posistioning emulation for IE6
  * Star selector used to hide definition from browsers other than IE6

Modified: trunk/extensions/AjaxLogin/AjaxLogin.js
===
--- trunk/extensions/AjaxLogin/AjaxLogin.js 2010-01-24 17:15:21 UTC (rev 
61468)
+++ trunk/extensions/AjaxLogin/AjaxLogin.js 2010-01-24 18:20:12 UTC (rev 
61469)
@@ -13,27 +13,27 @@
 };
 
 mediawiki.AjaxLogin.prototype.initialize = function() {
-   this._loginPanel = $(#userloginRound);
-   this._loginForm = $(#userajaxloginform);
+   this._loginPanel = $('#userloginRound');
+   this._loginForm = $('#userajaxloginform');
if( this._loginPanel.length  0 ) {
this._loginPanel.jqm({modal : true, toTop : true});
var that = this;
-   $(#pt-anonlogin, #pt-login).click( function( event ) {
+   $('#pt-anonlogin, #pt-login').click( function( event ) {
event.preventDefault();
that.showLoginPanel();
});
-   $(#wpLoginattempt).click(function( event ) {
+   $('#wpLoginattempt').click(function( event ) {
event.preventDefault();
that.postAjax( 'wpLoginattempt' );
});
-   $(#wpMailmypassword).click(function( event ) {
+   $('#wpMailmypassword').click(function( event ) {
event.preventDefault();
that.postAjax( 'wpMailmypassword' );
});
-   $(#wpAjaxRegister).click(function( event ) {
+   $('#wpAjaxRegister').click(function( event ) {
that.doRegister( event );
});
-   $(#wpClose).click(function( event ) {
+   $('#wpClose').click(function( event ) {
that.doClose( event );
});
}
@@ -58,9 +58,9 @@
success : function( data ) {
that.requestSuccess( data );
},
-   error : function( XMLHttpRequest, textStatus, errorThrown ){
-   //TODO : add error handling here
-   if( typeof console != 'undefined' ){
+   error : function( XMLHttpRequest, textStatus, errorThrown ) {
+   // TODO : add error handling here
+   if( typeof console != 'undefined' ) {
console.log( 'Error in AjaxLogin.js

[MediaWiki-CVS] SVN: [61329] trunk/extensions/SocialProfile

2010-01-21 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/61329

Revision: 61329
Author:   ashley
Date: 2010-01-21 12:47:43 + (Thu, 21 Jan 2010)

Log Message:
---
SocialProfile: i18n tweaks

Modified Paths:
--
trunk/extensions/SocialProfile/UserActivity/UserActivity.i18n.php
trunk/extensions/SocialProfile/UserProfile/UserProfile.i18n.php

Modified: trunk/extensions/SocialProfile/UserActivity/UserActivity.i18n.php
===
--- trunk/extensions/SocialProfile/UserActivity/UserActivity.i18n.php   
2010-01-21 09:34:57 UTC (rev 61328)
+++ trunk/extensions/SocialProfile/UserActivity/UserActivity.i18n.php   
2010-01-21 12:47:43 UTC (rev 61329)
@@ -181,8 +181,8 @@
'useractivity-award' = '$1 sai palkinnon',
'useractivity-all' = 'Katso kaikki',
'useractivity-edit' = '$1 {{PLURAL:$2|muokkasi|muokkasivat}} 
{{PLURAL:$4|sivua|seuraavia sivuja:}} $3',
-   'useractivity-foe' = '$1 {{PLURAL:$2|on nyt vihollinen 
käyttäjälle|ovat nyt vihollisia käyttäjille}} $3',
-   'useractivity-friend' = '$1 {{PLURAL:$2|on nyt ystävä käyttäjälle|ovat 
nyt ystäviä käyttäjille}} $3',
+   'useractivity-foe' = '$1 {{PLURAL:$2|on nyt vihollinen|ovat nyt 
vihollisia}} {{PLURAL:$3|käyttäjälle|käyttäjille}} $3',
+   'useractivity-friend' = '$1 {{PLURAL:$2|on nyt ystävä|ovat nyt 
ystäviä}} {{PLURAL:$3|käyttäjälle|käyttäjille}} $3',
'useractivity-gift' = '$1 sai lahjan käyttäjältä $2',
'useractivity-group-edit' = '{{PLURAL:$1|yksi muokkaus|$1 
muokkausta}}',
'useractivity-group-comment' = '{{PLURAL:$1|yksi kommentti|$1 
kommenttia}}',

Modified: trunk/extensions/SocialProfile/UserProfile/UserProfile.i18n.php
===
--- trunk/extensions/SocialProfile/UserProfile/UserProfile.i18n.php 
2010-01-21 09:34:57 UTC (rev 61328)
+++ trunk/extensions/SocialProfile/UserProfile/UserProfile.i18n.php 
2010-01-21 12:47:43 UTC (rev 61329)
@@ -3329,7 +3329,6 @@
 /** Finnish (Suomi)
  * @author Cimon Avaro
  * @author Crt
- * @author Jack Phoenix
  * @author Jack Phoenix j...@countervandalism.net
  * @author Str4nd
  */
@@ -3437,7 +3436,7 @@
'user-profile-personal-websites' = 'Nettisivut',
'user-profile-interests-entertainment' = 'Viihde',
'user-profile-interests-movies' = 'Elokuvat',
-   'user-profile-interests-tv' = 'tv',
+   'user-profile-interests-tv' = 'TV',
'user-profile-interests-music' = 'Musiikki',
'user-profile-interests-books' = 'Kirjat',
'user-profile-interests-magazines' = 'Lehdet',



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [61248] trunk/extensions/SocialProfile/UserStats

2010-01-19 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/61248

Revision: 61248
Author:   ashley
Date: 2010-01-19 14:05:19 + (Tue, 19 Jan 2010)

Log Message:
---
SocialProfile: fixes to UserStats

Modified Paths:
--
trunk/extensions/SocialProfile/UserStats/TopFansByStat.php
trunk/extensions/SocialProfile/UserStats/TopFansRecent.php
trunk/extensions/SocialProfile/UserStats/UserStats.i18n.php

Modified: trunk/extensions/SocialProfile/UserStats/TopFansByStat.php
===
--- trunk/extensions/SocialProfile/UserStats/TopFansByStat.php  2010-01-19 
13:53:34 UTC (rev 61247)
+++ trunk/extensions/SocialProfile/UserStats/TopFansByStat.php  2010-01-19 
14:05:19 UTC (rev 61248)
@@ -24,12 +24,11 @@
// Load CSS
$wgOut-addExtensionStyle( $wgScriptPath . 
'/extensions/SocialProfile/UserStats/TopList.css' );
 
-   $statistic = $wgRequest-getVal( 'stat' );
+   $dbr = wfGetDB( DB_SLAVE );
+
+   $statistic = $dbr-strencode( trim( $wgRequest-getVal( 'stat' 
) ) );
$column = stats_{$statistic};
-   $stat_name_friendly = wfMsg( top-fans-stats-{$statistic} );
 
-   $dbr = wfGetDB( DB_SLAVE );
-
// Error if the querystring value does not match our stat column
if ( !$dbr-fieldExists( 'user_stats', $column ) ) {
$wgOut-setPageTitle( wfMsg( 'top-fans-bad-field-title' 
) );
@@ -37,8 +36,10 @@
return false;
}
 
+   // Fix i18n message key
+   $fixedStatistic = str_replace( '_', '-', $statistic );
// Set page title
-   $wgOut-setPageTitle( wfMsg( 'top-fans-by-category-title', 
$stat_name_friendly ) );
+   $wgOut-setPageTitle( wfMsg( 'top-fans-by-category-title-' . 
$fixedStatistic ) );
 
$count = 50;
 
@@ -58,7 +59,8 @@
$params['LIMIT'] = $count;
 
$dbr = wfGetDB( DB_SLAVE );
-   $res = $dbr-select( 'user_stats',
+   $res = $dbr-select(
+   'user_stats',
array( 'stats_user_id', 'stats_user_name', 
$column ),
array( 'stats_user_id  0', {$column}  0 ),
__METHOD__,
@@ -112,7 +114,11 @@
$out .= 'div class=top-users';
 
foreach ( $user_list as $user ) {
-   $user_name = ( $user['user_name'] == substr( 
$user['user_name'] , 0, 22 ) ) ? $user['user_name'] : ( substr( 
$user['user_name'] , 0, 22 ) . '...' );
+   if ( $user['user_name'] == substr( $user['user_name'], 
0, 22 ) ) {
+   $user_name = $user['user_name'];
+   } else {
+   $user_name = substr( $user['user_name'], 0, 22 
) . wfMsg( 'ellipsis' );
+   }
$user_title = Title::makeTitle( NS_USER, 
$user['user_name'] );
$avatar = new wAvatar( $user['user_id'], 'm' );
$commentIcon = $avatar-getAvatarImage();
@@ -123,8 +129,9 @@
$statistics_row = number_format( 
$row-opinion_average, 2 );
$lowercase_statistics_name = 'percent';
} else {
+   global $wgLang;
$statistics_row = number_format( $user['stat'] 
);
-   $lowercase_statistics_name = strtolower( 
wfMsgExt( top-fans-stats-{$statistic}, 'parsemag', $user['stat'] ) );
+   $lowercase_statistics_name = $wgLang-lc( 
wfMsgExt( top-fans-stats-{$fixedStatistic}, 'parsemag', $user['stat'] ) );
}
 
$out .= 'div class=top-fan-row

Modified: trunk/extensions/SocialProfile/UserStats/TopFansRecent.php
===
--- trunk/extensions/SocialProfile/UserStats/TopFansRecent.php  2010-01-19 
13:53:34 UTC (rev 61247)
+++ trunk/extensions/SocialProfile/UserStats/TopFansRecent.php  2010-01-19 
14:05:19 UTC (rev 61248)
@@ -23,8 +23,14 @@
 
// Load CSS
$wgOut-addExtensionStyle( $wgScriptPath . 
'/extensions/SocialProfile/UserStats/TopList.css' );
-   $period = $wgRequest-getVal( 'period' );
 
+   $periodFromRequest = $wgRequest-getVal( 'period' );
+   if ( $periodFromRequest == 'weekly' ) {
+   $period = 'weekly';
+   } elseif ( $periodFromRequest == 'monthly' ) {
+   $period = 'monthly';
+   }
+
if ( !$period ) {
$period = 'weekly';
}
@@ -52,7 +58,8

[MediaWiki-CVS] SVN: [61250] trunk/extensions/SocialProfile/UserStats/EditCount.php

2010-01-19 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/61250

Revision: 61250
Author:   ashley
Date: 2010-01-19 15:25:59 + (Tue, 19 Jan 2010)

Log Message:
---
SocialProfile: fix fatal in EditCount.php (PHP 5.3/MW trunk); no longer uses 
$wgTitle but rather $article-getTitle()

Modified Paths:
--
trunk/extensions/SocialProfile/UserStats/EditCount.php

Modified: trunk/extensions/SocialProfile/UserStats/EditCount.php
===
--- trunk/extensions/SocialProfile/UserStats/EditCount.php  2010-01-19 
15:23:59 UTC (rev 61249)
+++ trunk/extensions/SocialProfile/UserStats/EditCount.php  2010-01-19 
15:25:59 UTC (rev 61250)
@@ -10,12 +10,12 @@
 $wgHooks['NewRevisionFromEditComplete'][] = 'incEditCount';
 
 function incEditCount( $article, $revision, $baseRevId ) {
-   global $wgUser, $wgTitle, $wgNamespacesForEditPoints;
+   global $wgUser, $wgNamespacesForEditPoints;
 
// only keep tally for allowable namespaces
if (
!is_array( $wgNamespacesForEditPoints ) ||
-   in_array( $wgTitle-getNamespace(), $wgNamespacesForEditPoints )
+   in_array( $article-getTitle()-getNamespace(), 
$wgNamespacesForEditPoints )
) {
$stats = new UserStatsTrack( $wgUser-getID(), 
$wgUser-getName() );
$stats-incStatField( 'edit' );
@@ -27,12 +27,12 @@
 $wgHooks['ArticleDelete'][] = 'removeDeletedEdits';
 
 function removeDeletedEdits( $article, $user, $reason ) {
-   global $wgTitle, $wgNamespacesForEditPoints;
+   global $wgNamespacesForEditPoints;
 
// only keep tally for allowable namespaces
if (
!is_array( $wgNamespacesForEditPoints ) ||
-   in_array( $wgTitle-getNamespace(), $wgNamespacesForEditPoints )
+   in_array( $article-getTitle()-getNamespace(), 
$wgNamespacesForEditPoints )
) {
$dbr = wfGetDB( DB_MASTER );
$res = $dbr-select(



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [61251] trunk/phase3

2010-01-19 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/61251

Revision: 61251
Author:   ashley
Date: 2010-01-19 15:29:26 + (Tue, 19 Jan 2010)

Log Message:
---
cleanup to mwsuggest.js  fix some things suggested by JSLint

Modified Paths:
--
trunk/phase3/includes/DefaultSettings.php
trunk/phase3/skins/common/mwsuggest.js

Modified: trunk/phase3/includes/DefaultSettings.php
===
--- trunk/phase3/includes/DefaultSettings.php   2010-01-19 15:25:59 UTC (rev 
61250)
+++ trunk/phase3/includes/DefaultSettings.php   2010-01-19 15:29:26 UTC (rev 
61251)
@@ -1658,7 +1658,7 @@
  * to ensure that client-side caches do not keep obsolete copies of global
  * styles.
  */
-$wgStyleVersion = '263';
+$wgStyleVersion = '264';
 
 
 # Server-side caching:

Modified: trunk/phase3/skins/common/mwsuggest.js
===
--- trunk/phase3/skins/common/mwsuggest.js  2010-01-19 15:25:59 UTC (rev 
61250)
+++ trunk/phase3/skins/common/mwsuggest.js  2010-01-19 15:29:26 UTC (rev 
61251)
@@ -42,32 +42,34 @@
 var os_animation_timer = null;
 
 /** Timeout timer class that will fetch the results */
-function os_Timer(id,r,query){
+function os_Timer( id, r, query ) {
this.id = id;
this.r = r;
this.query = query;
 }
 
 /** Timer user to animate expansion/contraction of container width */
-function os_AnimationTimer(r, target){
+function os_AnimationTimer( r, target ) {
this.r = r;
var current = document.getElementById(r.container).offsetWidth;
-   this.inc = Math.round((target-current) / os_animation_steps);
-   if(this.inc  os_animation_min_step  this.inc =0)
+   this.inc = Math.round( ( target - current ) / os_animation_steps );
+   if( this.inc  os_animation_min_step  this.inc =0 ) {
this.inc = os_animation_min_step; // minimal animation step
-   if(this.inc  -os_animation_min_step  this.inc 0)
+   }
+   if( this.inc  -os_animation_min_step  this.inc  0 ) {
this.inc = -os_animation_min_step;
+   }
this.target = target;
 }
 
 /** Property class for single search box */
-function os_Results(name, formname){
+function os_Results( name, formname ) {
this.searchform = formname; // id of the searchform
this.searchbox = name; // id of the searchbox
-   this.container = name+Suggest; // div that holds results
-   this.resultTable = name+Result; // id base for the result table (+num 
= table row)
-   this.resultText = name+ResultText; // id base for the spans within 
result tables (+num)
-   this.toggle = name+Toggle; // div that has the toggle 
(enable/disable) link
+   this.container = name + 'Suggest'; // div that holds results
+   this.resultTable = name + 'Result'; // id base for the result table 
(+num = table row)
+   this.resultText = name + 'ResultText'; // id base for the spans within 
result tables (+num)
+   this.toggle = name + 'Toggle'; // div that has the toggle 
(enable/disable) link
this.query = null; // last processed query
this.results = null;  // parsed titles
this.resultCount = 0; // number of results
@@ -81,359 +83,384 @@
 }
 
 /** Hide results div */
-function os_hideResults(r){
-   var c = document.getElementById(r.container);
-   if(c != null)
-   c.style.visibility = hidden;
+function os_hideResults( r ) {
+   var c = document.getElementById( r.container );
+   if( c !== null ) {
+   c.style.visibility = 'hidden';
+   }
r.visible = false;
r.selected = -1;
 }
 
 /** Show results div */
-function os_showResults(r){
-   if(os_is_stopped)
+function os_showResults( r ) {
+   if( os_is_stopped ) {
return;
-   if(r.stayHidden)
-   return
-   os_fitContainer(r);
-   var c = document.getElementById(r.container);
+   }
+   if( r.stayHidden ) {
+   return;
+   }
+   os_fitContainer( r );
+   var c = document.getElementById( r.container );
r.selected = -1;
-   if(c != null){
+   if( c !== null ) {
c.scrollTop = 0;
-   c.style.visibility = visible;
+   c.style.visibility = 'visible';
r.visible = true;
}
 }
 
-function os_operaWidthFix(x){
+function os_operaWidthFix( x ) {
// For browsers that don't understand overflow-x, estimate scrollbar 
width
-   if(typeof document.body.style.overflowX != string){
+   if( typeof document.body.style.overflowX != 'string' ) {
return 30;
}
return 0;
 }
 
-function os_encodeQuery(value){
-  if (encodeURIComponent) {
-return encodeURIComponent(value);
-  }
-  if(escape) {
-return escape(value);
-  }
-  return null;
+function os_encodeQuery( value ) {
+   if ( encodeURIComponent

[MediaWiki-CVS] SVN: [61254] trunk/extensions/DynamicPageList/DPLSetup.php

2010-01-19 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/61254

Revision: 61254
Author:   ashley
Date: 2010-01-19 15:34:05 + (Tue, 19 Jan 2010)

Log Message:
---
DynamicPageList: this too

Modified Paths:
--
trunk/extensions/DynamicPageList/DPLSetup.php

Modified: trunk/extensions/DynamicPageList/DPLSetup.php
===
--- trunk/extensions/DynamicPageList/DPLSetup.php   2010-01-19 15:32:49 UTC 
(rev 61253)
+++ trunk/extensions/DynamicPageList/DPLSetup.php   2010-01-19 15:34:05 UTC 
(rev 61254)
@@ -1207,7 +1207,7 @@
}
 

//-
 ENTRY parser TAG intersection
-   public static function intersectionTag( $input, $params, $parser ) {
+   public static function intersectionTag( $input, $params, $parser ) {
self::behaveLikeIntersection( true );
return self::executeTag( $input, $params, $parser );
}



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [61136] trunk/extensions/SocialProfile

2010-01-16 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/61136

Revision: 61136
Author:   ashley
Date: 2010-01-16 17:40:45 + (Sat, 16 Jan 2010)

Log Message:
---
SocialProfile: JavaScript cleanup

Modified Paths:
--
trunk/extensions/SocialProfile/UserBoard/BoardBlast.js
trunk/extensions/SocialProfile/UserGifts/UserGifts.js
trunk/extensions/SocialProfile/UserProfile/UpdateProfile.js
trunk/extensions/SocialProfile/UserProfile/UserProfilePage.js
trunk/extensions/SocialProfile/UserRelationship/UserRelationship.js

Modified: trunk/extensions/SocialProfile/UserBoard/BoardBlast.js
===
--- trunk/extensions/SocialProfile/UserBoard/BoardBlast.js  2010-01-16 
16:50:25 UTC (rev 61135)
+++ trunk/extensions/SocialProfile/UserBoard/BoardBlast.js  2010-01-16 
17:40:45 UTC (rev 61136)
@@ -1,24 +1,24 @@
-function toggle_user( user_id ){
-   if( YAHOO.util.Dom.hasClass( 'user-' + user_id, 'blast-friend-selected' 
) ){
+function toggle_user( user_id ) {
+   if( YAHOO.util.Dom.hasClass( 'user-' + user_id, 'blast-friend-selected' 
) ) {
YAHOO.util.Dom.replaceClass( 'user-' + user_id, 
'blast-friend-selected', 'blast-friend-unselected' );
-   } else if( YAHOO.util.Dom.hasClass( 'user-' + user_id, 
'blast-friend-unselected' ) ){
+   } else if( YAHOO.util.Dom.hasClass( 'user-' + user_id, 
'blast-friend-unselected' ) ) {
YAHOO.util.Dom.replaceClass( 'user-' + user_id, 
'blast-friend-unselected', 'blast-friend-selected' );
}
 
-   if( YAHOO.util.Dom.hasClass( 'user-' + user_id, 'blast-foe-selected' ) 
){
+   if( YAHOO.util.Dom.hasClass( 'user-' + user_id, 'blast-foe-selected' ) 
) {
YAHOO.util.Dom.replaceClass( 'user-' + user_id, 
'blast-foe-selected', 'blast-foe-unselected' );
-   } else if( YAHOO.util.Dom.hasClass( 'user-' + user_id, 
'blast-foe-unselected' ) ){
+   } else if( YAHOO.util.Dom.hasClass( 'user-' + user_id, 
'blast-foe-unselected' ) ) {
YAHOO.util.Dom.replaceClass( 'user-' + user_id, 
'blast-foe-selected', 'blast-foe-unselected' );
}
 }
 
-function toggle_type( method, on, off ){
+function toggle_type( method, on, off ) {
list = YAHOO.util.Dom.getElementsByClassName( ( ( method == 1 ) ? off : 
on ), 'div', 'blast-friends-list' );
 
-   for( x = 0; x = list.length-1; x++ ){
+   for( x = 0; x = list.length - 1; x++ ) {
el = list[x];
-   if( YAHOO.util.Dom.hasClass( el, on ) || 
YAHOO.util.Dom.hasClass( el, off ) ){
-   if( method == 1 ){
+   if( YAHOO.util.Dom.hasClass( el, on ) || 
YAHOO.util.Dom.hasClass( el, off ) ) {
+   if( method == 1 ) {
YAHOO.util.Dom.replaceClass( el, off, on );
} else {
YAHOO.util.Dom.replaceClass( el, on, off );
@@ -27,34 +27,35 @@
}
 }
 
-function toggle_friends( method ){
+function toggle_friends( method ) {
toggle_type( method, 'blast-friend-selected', 'blast-friend-unselected' 
);
 }
 
-function toggle_foes( method ){
+function toggle_foes( method ) {
toggle_type( method, 'blast-foe-selected', 'blast-foe-unselected' );
 }
 
-function select_all(){
+function select_all() {
toggle_friends( 1 );
toggle_foes( 1 );
 }
-function unselect_all(){
+function unselect_all() {
toggle_friends( 0 );
toggle_foes( 0 );
 }
 
 submitted = 0;
-function send_messages(){
-   if( submitted == 1 )
+function send_messages() {
+   if( submitted == 1 ) {
return 0;
+   }
 
-   submitted = 1
+   submitted = 1;
selected = 0;
user_ids_to = '';
 
list = YAHOO.util.Dom.getElementsByClassName( 'blast-friend-selected', 
'div', 'blast-friends-list' );
-   for( x = 0; x = list.length-1; x++ ){
+   for( x = 0; x = list.length - 1; x++ ) {
el = list[x];
selected++;
user_id = el.id.replace( 'user-', '' );
@@ -62,28 +63,28 @@
}
 
list = YAHOO.util.Dom.getElementsByClassName( 'blast-foe-selected', 
'div', 'blast-friends-list' );
-   for( x = 0; x = list.length-1; x++ ){
+   for( x = 0; x = list.length - 1; x++ ) {
el = list[x];
selected++;
user_id = el.id.replace( 'user-', '' );
user_ids_to += ( ( user_ids_to ) ? ',' : '' ) + user_id;
}
 
-   if( selected == 0 ){
-   alert('Please select at least one person');
+   if( selected === 0 ) {
+   alert( 'Please select at least one person' );
submitted = 0;
return 0;
}
 
-   if( !document.getElementById('message').value ){
-   alert('Please enter a message');
+   if( !document.getElementById('message').value

[MediaWiki-CVS] SVN: [61145] trunk/extensions/SocialProfile

2010-01-16 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/61145

Revision: 61145
Author:   ashley
Date: 2010-01-16 18:19:52 + (Sat, 16 Jan 2010)

Log Message:
---
SocialProfile: general cleanup

Modified Paths:
--
trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManagerLogo.php
trunk/extensions/SocialProfile/SystemGifts/SpecialViewSystemGifts.php
trunk/extensions/SocialProfile/UserRelationship/SpecialAddRelationship.php

trunk/extensions/SocialProfile/UserRelationship/SpecialRemoveRelationship.php
trunk/extensions/SocialProfile/UserRelationship/SpecialViewRelationships.php
trunk/extensions/SocialProfile/UserStats/EditCount.php
trunk/extensions/SocialProfile/UserStats/SpecialUpdateEditCounts.php
trunk/extensions/SocialProfile/UserStats/TopFansByStat.php
trunk/extensions/SocialProfile/UserStats/TopFansRecent.php
trunk/extensions/SocialProfile/UserStats/TopUsers.php
trunk/extensions/SocialProfile/UserStats/UserStats.i18n.php
trunk/extensions/SocialProfile/UserStats/UserStatsClass.php

Modified: 
trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManagerLogo.php
===
--- trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManagerLogo.php 
2010-01-16 18:10:49 UTC (rev 61144)
+++ trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManagerLogo.php 
2010-01-16 18:19:52 UTC (rev 61145)
@@ -204,7 +204,7 @@
if ( ( $this-mUploadSize  102400 ) ) {
# TODO: Format $wgUploadSizeWarning to 
something that looks better than the raw byte
# value, perhaps add GB,MB and KB suffixes?
-   $warning .= 'li' . wfMsg( 'largefile',
102400, $this-mUploadSize ) . '/li';
+   $warning .= 'li' . wfMsg( 'largefile', 
102400, $this-mUploadSize ) . '/li';
}
if ( $this-mUploadSize == 0 ) {
$warning .= 'li' . wfMsg( 'emptyfile' ) . 
'/li';

Modified: trunk/extensions/SocialProfile/SystemGifts/SpecialViewSystemGifts.php
===
--- trunk/extensions/SocialProfile/SystemGifts/SpecialViewSystemGifts.php   
2010-01-16 18:10:49 UTC (rev 61144)
+++ trunk/extensions/SocialProfile/SystemGifts/SpecialViewSystemGifts.php   
2010-01-16 18:19:52 UTC (rev 61145)
@@ -78,13 +78,13 @@
 */
$output .= $wgOut-setPageTitle( wfMsg( 'ga-title', 
$rel-user_name ) );
 
-   $output .= 'div class=back-links
-   ' . wfMsg( 'ga-back-link', 
$wgUser-getUserPage()-escapeFullURL(), $rel-user_name ) . '
-   /div';
+   $output .= 'div class=back-links'
+   . wfMsg( 'ga-back-link', 
$wgUser-getUserPage()-escapeFullURL(), $rel-user_name ) .
+   '/div';
 
-   $output .= 'div class=ga-count
-   ' . wfMsgExt( 'ga-count', 'parsemag', $rel-user_name, 
$total ) . '
-   /div';
+   $output .= 'div class=ga-count'
+   . wfMsgExt( 'ga-count', 'parsemag', $rel-user_name, 
$total ) .
+   '/div';
 
// Safelinks
$view_system_gift_link = SpecialPage::getTitleFor( 
'ViewSystemGift' );

Modified: 
trunk/extensions/SocialProfile/UserRelationship/SpecialAddRelationship.php
===
--- trunk/extensions/SocialProfile/UserRelationship/SpecialAddRelationship.php  
2010-01-16 18:10:49 UTC (rev 61144)
+++ trunk/extensions/SocialProfile/UserRelationship/SpecialAddRelationship.php  
2010-01-16 18:19:52 UTC (rev 61145)
@@ -47,13 +47,15 @@
$this-user_name_to = $usertitle-getText();
$this-user_id_to = User::idFromName( $this-user_name_to );
$this-relationship_type = $wgRequest-getVal( 'rel_type' );
-   if ( !$this-relationship_type || !is_numeric( 
$this-relationship_type ) ) $this-relationship_type = 1;
+   if ( !$this-relationship_type || !is_numeric( 
$this-relationship_type ) ) {
+   $this-relationship_type = 1;
+   }
 
if ( ( $wgUser-getID() == $this-user_id_to )  ( 
$wgUser-getID() != 0 ) ) {
$wgOut-setPageTitle( wfMsg( 'ur-error-title' ) );
-   $out .= 'div class=relationship-error-message
-   ' . wfMsg( 'ur-add-error-message-yourself' ) . '
-   /div
+   $out .= 'div class=relationship-error-message'
+   . wfMsg( 'ur-add-error-message-yourself' ) .
+   '/div
div
input type=button class=site-button 
value=' . wfMsg

[MediaWiki-CVS] SVN: [61088] trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php

2010-01-15 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/61088

Revision: 61088
Author:   ashley
Date: 2010-01-15 17:23:51 + (Fri, 15 Jan 2010)

Log Message:
---
SocialProfile: display city for non-default countries in user profile

Modified Paths:
--
trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php

Modified: trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php
===
--- trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php  
2010-01-15 16:55:00 UTC (rev 61087)
+++ trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php  
2010-01-15 17:23:51 UTC (rev 61088)
@@ -218,10 +218,22 @@
}
$profile_data = $this-profile_data;
 
+   $defaultCountry = wfMsgForContent( 
'user-profile-default-country' );
+
$location = $profile_data['location_city'] . ', ' . 
$profile_data['location_state'];
-   if ( $profile_data['location_country'] != 'United States' ) {
-   $location = '';
-   $location .= $profile_data['location_country'];
+   if ( $profile_data['location_country'] != $defaultCountry ) {
+   if ( $profile_data['location_city']  
$profile_data['location_state'] ) { // city AND state
+   $location = $profile_data['location_city'] . ', 
' .
+   
$profile_data['location_state'] . ', ' .
+   
$profile_data['location_country'];
+   } elseif ( $profile_data['location_city']  
!$profile_data['location_state'] ) { // city, but no state
+   $location = $profile_data['location_city'] . ', 
' . $profile_data['location_country'];
+   } elseif ( $profile_data['location_state']  
!$profile_data['location_city'] ) { // state, but no city
+   $location = $profile_data['location_state'] . 
', ' . $profile_data['location_country'];
+   } else {
+   $location = '';
+   $location .= $profile_data['location_country'];
+   }
}
 
if ( $location == ', ' ) {
@@ -229,10 +241,21 @@
}
 
$hometown = $profile_data['hometown_city'] . ', ' . 
$profile_data['hometown_state'];
-   if ( $profile_data['hometown_country'] != 'United States' ) {
-   $hometown = '';
-   $hometown .= $profile_data['hometown_country'];
+   if ( $profile_data['hometown_country'] != $defaultCountry ) {
+   if ( $profile_data['hometown_city']  
$profile_data['hometown_state'] ) { // city AND state
+   $hometown = $profile_data['hometown_city'] . ', 
' .
+   
$profile_data['hometown_state'] . ', ' .
+   
$profile_data['hometown_country'];
+   } elseif ( $profile_data['hometown_city']  
!$profile_data['hometown_state'] ) { // city, but no state
+   $hometown = $profile_data['hometown_city'] . ', 
' . $profile_data['hometown_country'];
+   } elseif ( $profile_data['hometown_state']  
!$profile_data['hometown_city'] ) { // state, but no city
+   $hometown = $profile_data['hometown_state'] . 
', ' . $profile_data['hometown_country'];
+   } else {
+   $hometown = '';
+   $hometown .= $profile_data['hometown_country'];
+   }
}
+
if ( $hometown == ', ' ) {
$hometown = '';
}



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [60909] trunk/phase3

2010-01-10 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/60909

Revision: 60909
Author:   ashley
Date: 2010-01-10 20:23:48 + (Sun, 10 Jan 2010)

Log Message:
---
cleanup to wikibits.js with the help of JSLint. added missing braces, some 
spacing, changed double quotes to single in some places, added missing 
semicolons and fixed some comparisons

Modified Paths:
--
trunk/phase3/includes/DefaultSettings.php
trunk/phase3/skins/common/wikibits.js

Modified: trunk/phase3/includes/DefaultSettings.php
===
--- trunk/phase3/includes/DefaultSettings.php   2010-01-10 19:13:03 UTC (rev 
60908)
+++ trunk/phase3/includes/DefaultSettings.php   2010-01-10 20:23:48 UTC (rev 
60909)
@@ -1664,7 +1664,7 @@
  * to ensure that client-side caches do not keep obsolete copies of global
  * styles.
  */
-$wgStyleVersion = '259';
+$wgStyleVersion = '260';
 
 
 # Server-side caching:

Modified: trunk/phase3/skins/common/wikibits.js
===
--- trunk/phase3/skins/common/wikibits.js   2010-01-10 19:13:03 UTC (rev 
60908)
+++ trunk/phase3/skins/common/wikibits.js   2010-01-10 20:23:48 UTC (rev 
60909)
@@ -65,8 +65,8 @@
}
loadedScripts[url] = true;
var s = document.createElement('script');
-   s.setAttribute('src',url);
-   s.setAttribute('type','text/javascript');
+   s.setAttribute('src', url);
+   s.setAttribute('type', 'text/javascript');
document.getElementsByTagName('head')[0].appendChild(s);
return s;
 }
@@ -75,12 +75,14 @@
return importStylesheetURI(wgScript + 
'?action=rawctype=text/csstitle=' + encodeURIComponent(page.replace(/ 
/g,'_')));
 }
 
-function importStylesheetURI(url,media) {
+function importStylesheetURI(url, media) {
var l = document.createElement('link');
l.type = 'text/css';
l.rel = 'stylesheet';
l.href = url;
-   if(media) l.media = media
+   if( media ) {
+   l.media = media;
+   }
document.getElementsByTagName('head')[0].appendChild(l);
return l;
 }
@@ -89,8 +91,11 @@
var s = document.createElement('style');
s.type = 'text/css';
s.rel = 'stylesheet';
-   if (s.styleSheet) s.styleSheet.cssText = text //IE
-   else s.appendChild(document.createTextNode(text + '')) //Safari 
sometimes borks on null
+   if ( s.styleSheet ) {
+   s.styleSheet.cssText = text; //IE
+   } else {
+   s.appendChild(document.createTextNode(text + '')); //Safari 
sometimes borks on null
+   }
document.getElementsByTagName('head')[0].appendChild(s);
return s;
 }
@@ -290,58 +295,73 @@
  */
 function addPortletLink(portlet, href, text, id, tooltip, accesskey, nextnode) 
{
var root = document.getElementById(portlet);
-   if ( !root ) return null;
-   var node = root.getElementsByTagName( ul )[0];
-   if ( !node ) return null;
+   if ( !root ) {
+   return null;
+   }
+   var node = root.getElementsByTagName( 'ul' )[0];
+   if ( !node ) {
+   return null;
+   }
 
// unhide portlet if it was hidden before
root.className = root.className.replace( /(^| )emptyPortlet( |$)/, $2 
);
 
-   var span = document.createElement( span );
+   var span = document.createElement( 'span' );
span.appendChild( document.createTextNode( text ) );
 
-   var link = document.createElement( a );
+   var link = document.createElement( 'a' );
link.appendChild( span );
link.href = href;
 
-   var item = document.createElement( li );
+   var item = document.createElement( 'li' );
item.appendChild( link );
-   if ( id ) item.id = id;
+   if ( id ) {
+   item.id = id;
+   }
 
if ( accesskey ) {
-   link.setAttribute( accesskey, accesskey );
-   tooltip +=  [+accesskey+];
+   link.setAttribute( 'accesskey', accesskey );
+   tooltip += ' [' + accesskey + ']';
}
if ( tooltip ) {
-   link.setAttribute( title, tooltip );
+   link.setAttribute( 'title', tooltip );
}
if ( accesskey  tooltip ) {
updateTooltipAccessKeys( new Array( link ) );
}
 
-   if ( nextnode  nextnode.parentNode == node )
+   if ( nextnode  nextnode.parentNode == node ) {
node.insertBefore( item, nextnode );
-   else
+   } else {
node.appendChild( item );  // IE compatibility (?)
+   }
 
return item;
 }
 
 function getInnerText(el) {
-   if (typeof el == string) return el;
-   if (typeof el == undefined) { return el };
-   if (el.textContent) return el.textContent; // not needed but it is 
faster
-   if (el.innerText) return el.innerText; // IE doesn't have

[MediaWiki-CVS] SVN: [60882] trunk/extensions/WikiTextLoggedInOut

2010-01-09 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/60882

Revision: 60882
Author:   ashley
Date: 2010-01-10 01:25:41 + (Sun, 10 Jan 2010)

Log Message:
---
WikiTextLoggedInOut: fixes, fixes

Modified Paths:
--
trunk/extensions/WikiTextLoggedInOut/WikiTextLoggedInOut.i18n.php
trunk/extensions/WikiTextLoggedInOut/WikiTextLoggedInOut.php

Modified: trunk/extensions/WikiTextLoggedInOut/WikiTextLoggedInOut.i18n.php
===
--- trunk/extensions/WikiTextLoggedInOut/WikiTextLoggedInOut.i18n.php   
2010-01-10 00:32:50 UTC (rev 60881)
+++ trunk/extensions/WikiTextLoggedInOut/WikiTextLoggedInOut.i18n.php   
2010-01-10 01:25:41 UTC (rev 60882)
@@ -1,8 +1,14 @@
 ?php
-#Internationalization file fo Wiki Text Logged In Out extenstion
+/**
+ * Internationalization file for WikiTextLoggedInOut extension.
+ *
+ * @file
+ * @ingroup Extensions
+ */
 
 $messages = array();
 
+/** English */
 $messages['en'] = array(
'wikitextloggedinout-desc' = 'Two parser hooks, 
ttlt;loggedingt;/tt and ttlt;loggedoutgt;/tt to show different text 
depending on the users\' login state',
 );

Modified: trunk/extensions/WikiTextLoggedInOut/WikiTextLoggedInOut.php
===
--- trunk/extensions/WikiTextLoggedInOut/WikiTextLoggedInOut.php
2010-01-10 00:32:50 UTC (rev 60881)
+++ trunk/extensions/WikiTextLoggedInOut/WikiTextLoggedInOut.php
2010-01-10 01:25:41 UTC (rev 60882)
@@ -5,38 +5,44 @@
  * that will display different output depending if the user
  * is logged in or not.
  *
- * @author Wikia, Inc.
+ * @file
+ * @ingroup Extensions
+ * @author Aaron Wright
+ * @author David Pean
+ * @author Jack Phoenix j...@countervandalism.net
  * @version 1.0
- * @link http://www.mediawiki.org/wiki/Extension:WikiTextLoggedInOut
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
+ * @link http://www.mediawiki.org/wiki/Extension:WikiTextLoggedInOut 
Documentation
  */
 
-$wgHooks['ParserFirstCallInit'][] = 'wfWikiTextLoggedIn';
-$dir = dirname(__FILE__) . '/';
-$wgExtensionMessagesFiles['WikiTextLoginInOut'] = $dir . 
'WikiTextLoggedInOut.i18n.php';
-
+// Extension credits that will show up on Special:Version
 $wgExtensionCredits['parserhook'][] = array(
'path' = __FILE__,
'name' = 'WikiTextLoggedInOut',
-   'version' = '1.0',
-   'author' = 'Wikia New York Team',
+   'version' = '1.1',
+   'author' = array( 'Aaron Wright', 'David Pean', 'Jack Phoenix' ),
'description' = 'Two parser hooks, ttlt;loggedingt;/tt and 
ttlt;loggedoutgt;/tt to show different text depending on the users\' 
login state',
'url' = 'http://www.mediawiki.org/wiki/Extension:WikiTextLoggedInOut',
'descriptionmsg' = 'wikitextloggedinout-desc'
 );
 
+$dir = dirname( __FILE__ ) . '/';
+$wgExtensionMessagesFiles['WikiTextLoginInOut'] = $dir . 
'WikiTextLoggedInOut.i18n.php';
+
+$wgHooks['ParserFirstCallInit'][] = 'wfWikiTextLoggedIn';
 function wfWikiTextLoggedIn( $parser ) {
$parser-setHook( 'loggedin', 'OutputLoggedInText' );
return true;
 }
 
-function OutputLoggedInText( $input, $args, $parser ) {
-   global $wgUser, $wgOut;
+function OutputLoggedInText( $input, $args, $parser ) {
+   global $wgUser;
 
-   if( $wgUser-isLoggedIn() ){
-   return $parser-recursiveTagParse($input);
+   if( $wgUser-isLoggedIn() ) {
+   return $parser-recursiveTagParse( $input );
}
 
-   return ;
+   return '';
 }
 
 $wgHooks['ParserFirstCallInit'][] = 'wfWikiTextLoggedOut';
@@ -46,12 +52,12 @@
return true;
 }
 
-function OutputLoggedOutText( $input, $args, $parser ) {
-   global $wgUser, $wgOut;
+function OutputLoggedOutText( $input, $args, $parser ) {
+   global $wgUser;
 
-   if( !$wgUser-isLoggedIn() ){
-   return $parser-recursiveTagParse($input);
+   if( !$wgUser-isLoggedIn() ) {
+   return $parser-recursiveTagParse( $input );
}
 
-   return ;
+   return '';
 }



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [60737] trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php

2010-01-06 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/60737

Revision: 60737
Author:   ashley
Date: 2010-01-06 17:04:58 + (Wed, 06 Jan 2010)

Log Message:
---
SocialProfile: some cleanup to UserProfilePage.php

Modified Paths:
--
trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php

Modified: trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php
===
--- trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php  
2010-01-06 16:55:01 UTC (rev 60736)
+++ trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php  
2010-01-06 17:04:58 UTC (rev 60737)
@@ -127,13 +127,17 @@
$stats = new UserStats( $user_id, $user_name );
$stats_data = $stats-getUserStats();
 
-   $total_value = $stats_data['edits'] . $stats_data['votes'] . 
$stats_data['comments'] . $stats_data['recruits'] . $stats_data['poll_votes'] . 
$stats_data['picture_game_votes'] . $stats_data['quiz_points'];
+   $total_value = $stats_data['edits'] . $stats_data['votes'] .
+   $stats_data['comments'] . 
$stats_data['recruits'] .
+   $stats_data['poll_votes'] .
+   
$stats_data['picture_game_votes'] .
+   $stats_data['quiz_points'];
 
if ( $total_value != 0 ) {
$output .= 'div class=user-section-heading
-   div class=user-section-title
-   ' . wfMsg( 'user-stats-title' ) . '
-   /div
+   div class=user-section-title'
+   . wfMsg( 'user-stats-title' ) .
+   '/div
div class=user-section-actions
div class=action-right
/div
@@ -151,8 +155,9 @@
$this-getUserStatsRow( wfMsgExt( 
'user-stats-poll-votes', 'parsemag', $stats_data['poll_votes'] ), 
$stats_data['poll_votes'] ) .
$this-getUserStatsRow( wfMsgExt( 
'user-stats-picture-game-votes', 'parsemag', $stats_data['picture_game_votes'] 
), $stats_data['picture_game_votes'] ) .
$this-getUserStatsRow( wfMsgExt( 
'user-stats-quiz-points', 'parsemag', $stats_data['quiz_points'] ), 
$stats_data['quiz_points'] );
-   if ( $stats_data['currency'] != '10,000' )
+   if ( $stats_data['currency'] != '10,000' ) {
$output .= $this-getUserStatsRow( 
wfMsgExt( 'user-stats-pick-points', 'parsemag', $stats_data['currency'] ), 
$stats_data['currency'] );
+   }
$output .= '/div';
}
 
@@ -219,24 +224,31 @@
$location .= $profile_data['location_country'];
}
 
-   if ( $location == ', ' ) $location = '';
+   if ( $location == ', ' ) {
+   $location = '';
+   }
 
$hometown = $profile_data['hometown_city'] . ', ' . 
$profile_data['hometown_state'];
if ( $profile_data['hometown_country'] != 'United States' ) {
$hometown = '';
$hometown .= $profile_data['hometown_country'];
}
-   if ( $hometown == ', ' ) $hometown = '';
+   if ( $hometown == ', ' ) {
+   $hometown = '';
+   }
 
-   $joined_data = $profile_data['real_name'] . $location . 
$hometown . $profile_data['birthday'] . $profile_data['occupation'] . 
$profile_data['websites'] . $profile_data['places_lived'] . 
$profile_data['schools'] . $profile_data['about'];
+   $joined_data = $profile_data['real_name'] . $location . 
$hometown .
+   $profile_data['birthday'] . 
$profile_data['occupation'] .
+   $profile_data['websites'] . 
$profile_data['places_lived'] .
+   $profile_data['schools'] . 
$profile_data['about'];
$edit_info_link = SpecialPage::getTitleFor( 'UpdateProfile' );
 
$output = '';
if ( $joined_data ) {
$output .= 'div class=user-section-heading
-   div class=user-section-title
-   ' . wfMsg( 'user-personal-info-title' ) 
. '
-   /div
+   div class=user-section-title'
+   . wfMsg( 'user-personal-info-title

[MediaWiki-CVS] SVN: [60638] trunk/extensions/ContactPage

2010-01-04 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/60638

Revision: 60638
Author:   ashley
Date: 2010-01-05 00:43:27 + (Tue, 05 Jan 2010)

Log Message:
---
ContactPage:
*add some comments to ContactPage.php
*added ContactFormBeforeMessage hook to SpecialContact.php so that extensions 
can add new fields to Special:Contact
*else if - elseif
*more braces
*NULL - null
*spacing tweaks
*double quotes - single quotes where appropriate

Modified Paths:
--
trunk/extensions/ContactPage/ContactPage.php
trunk/extensions/ContactPage/SpecialContact.php

Modified: trunk/extensions/ContactPage/ContactPage.php
===
--- trunk/extensions/ContactPage/ContactPage.php2010-01-05 00:39:36 UTC 
(rev 60637)
+++ trunk/extensions/ContactPage/ContactPage.php2010-01-05 00:43:27 UTC 
(rev 60638)
@@ -15,6 +15,7 @@
die( 1 );
 }
 
+// Extension credits that will show up on Special:Version
 $wgExtensionCredits['specialpage'][] = array(
'path' = __FILE__,
'name' = 'ContactPage',
@@ -24,15 +25,25 @@
'descriptionmsg' = 'contactpage-desc',
 );
 
-$dir = dirname(__FILE__) . '/';
+// Set up the new special page
+$dir = dirname( __FILE__ ) . '/';
 $wgExtensionMessagesFiles['ContactPage'] = $dir . 'ContactPage.i18n.php';
 $wgExtensionAliasesFiles['ContactPage'] = $dir . 'ContactPage.alias.php';
 
 $wgAutoloadClasses['SpecialContact'] = $dir . 'SpecialContact.php';
 $wgSpecialPages['Contact'] = 'SpecialContact';
 
-$wgContactUser = NULL;
-$wgContactSender = NULL;
+# Configuration
+// Name of a registered wiki user who will receive the mails
+$wgContactUser = null;
+// E-mail address used as the sender of the contact email, if the visitor does
+// not supply an email address. Defaults to $wgEmergencyContact.
+$wgContactSender = null;
+
+// The name to be used with $wgContactSender.
+// This will be shown in the recipient's e-mail program
 $wgContactSenderName = 'Contact Form on ' . $wgSitename;
 
+// If true, users will be required to supply a name and an e-mail address
+// on Special:Contact.
 $wgContactRequireAll = false;

Modified: trunk/extensions/ContactPage/SpecialContact.php
===
--- trunk/extensions/ContactPage/SpecialContact.php 2010-01-05 00:39:36 UTC 
(rev 60637)
+++ trunk/extensions/ContactPage/SpecialContact.php 2010-01-05 00:43:27 UTC 
(rev 60638)
@@ -57,7 +57,7 @@
if ( 'success' == $action ) {
wfDebug( __METHOD__ . : success.\n );
$f-showSuccess();
-   } else if ( 'submit' == $action  $wgRequest-wasPosted()  
$f-hasAllInfo() ) {
+   } elseif ( 'submit' == $action  $wgRequest-wasPosted()  
$f-hasAllInfo() ) {
$token = $wgRequest-getVal( 'wpEditToken' );
 
if( $wgUser-isAnon() ) {
@@ -69,10 +69,10 @@
}
 
if ( !$tokenOk ) {
-   wfDebug( __METHOD__ . : bad token (.( 
$wgUser-isAnon() ? 'anon' : 'user' ).): $token\n );
+   wfDebug( __METHOD__ . : bad token ( . ( 
$wgUser-isAnon() ? 'anon' : 'user' ) . ): $token\n );
$wgOut-addWikiMsg( 'sessionfailure' );
$f-showForm();
-   } else if ( !$f-passCaptcha() ) {
+   } elseif ( !$f-passCaptcha() ) {
wfDebug( __METHOD__ . : captcha failed );
$wgOut-addWikiMsg( 
'contactpage-captcha-failed' );
$f-showForm();
@@ -113,8 +113,12 @@
$this-fromaddress = $wgRequest-getText( 'wpFromAddress' );
 
if( $wgUser-isLoggedIn() ) {
-   if( !$this-fromname ) $this-fromname = 
$wgUser-getName();
-   if( !$this-fromaddress ) $this-fromaddress = 
$wgUser-getEmail();
+   if( !$this-fromname ) {
+   $this-fromname = $wgUser-getName();
+   }
+   if( !$this-fromaddress ) {
+   $this-fromaddress = $wgUser-getEmail();
+   }
}
 
// prepare captcha if applicable
@@ -128,18 +132,33 @@
function hasAllInfo() {
global $wgContactRequireAll;
 
-   if ( $this-text === NULL ) return false;
-   else $this-text = trim( $this-text );
-   if ( $this-text === '' ) return false;
+   if ( $this-text === null ) {
+   return false;
+   } else {
+   $this-text = trim( $this-text );
+   }
+   if ( $this-text === '' ) {
+   return false

[MediaWiki-CVS] SVN: [60531] trunk/extensions/SocialProfile/UserActivity

2009-12-31 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/60531

Revision: 60531
Author:   ashley
Date: 2009-12-31 22:11:40 + (Thu, 31 Dec 2009)

Log Message:
---
UserActivity:
*remove network-related stuff
*fix SiteActivityHook.php for PHP 5.3+
*fix bug in SiteActivityHook.php: when limit param was specified, the hook 
would return limit-1 results (i.e. limit=5, amount of returned results=4)
*a bunch of i18n fixes
*commented out some unused messages
*special pages cannot be edited, so don't show Foo edited Main Page, 
Special:Log/delete
*add __METHOD__ to SQL queries
*ignore nonexistent users in setMessagesSent()
*more braces
*bump version number from 1.0 to 1.1

Modified Paths:
--
trunk/extensions/SocialProfile/UserActivity/SiteActivityHook.php
trunk/extensions/SocialProfile/UserActivity/UserActivity.body.php
trunk/extensions/SocialProfile/UserActivity/UserActivity.i18n.php
trunk/extensions/SocialProfile/UserActivity/UserActivity.php
trunk/extensions/SocialProfile/UserActivity/UserActivityClass.php

Modified: trunk/extensions/SocialProfile/UserActivity/SiteActivityHook.php
===
--- trunk/extensions/SocialProfile/UserActivity/SiteActivityHook.php
2009-12-31 21:58:46 UTC (rev 60530)
+++ trunk/extensions/SocialProfile/UserActivity/SiteActivityHook.php
2009-12-31 22:11:40 UTC (rev 60531)
@@ -7,30 +7,36 @@
die( Not a valid entry point.\n );
 }
 
-
 $wgHooks['ParserFirstCallInit'][] = 'wfSiteActivity';
+/**
+ * Register siteactivity hook with the Parser
+ * @param $parser Object: instance of Parser
+ * @return true
+ */
 function wfSiteActivity( $parser ) {
$parser-setHook( 'siteactivity', 'getSiteActivity' );
return true;
 }
 
-function getSiteActivity( $input, $args, $parser ) {
+function getSiteActivity( $input, $args, $parser ) {
global $wgMemc, $wgScriptPath;
 
$parser-disableCache();
 
$limit = ( isset( $args['limit'] )  is_numeric( $args['limit'] ) ) ? 
$args['limit'] : 10;
 
+   // so that siteactivity limit=5 / will return 5 items instead of 4...
+   $fixedLimit = $limit + 1;
+
wfLoadExtensionMessages( 'UserActivity' );
 
-   $key = wfMemcKey( 'site_activity', 'all', $limit );
+   $key = wfMemcKey( 'site_activity', 'all', $fixedLimit );
$data = $wgMemc-get( $key );
if ( !$data ) {
wfDebug( Got site activity from DB\n );
-   $rel = new UserActivity( '', 'ALL', $limit );
+   $rel = new UserActivity( '', 'ALL', $fixedLimit );
 
$rel-setActivityToggle( 'show_votes', 0 );
-   $rel-setActivityToggle( 'show_network_updates', 0 );
$activity = $rel-getActivityListGrouped();
$wgMemc-set( $key, $activity, 60 * 2 );
} else {
@@ -40,15 +46,17 @@
 
$output = '';
if ( $activity ) {
+   $output .= 'div class=mp-site-activity
+   h2' . wfMsg( 'useractivity-siteactivity' ) . '/h2';
 
-   $output .= 'div class=mp-site-activityh2' . wfMsg( 
'useractivity-siteactivity' ) . '/h2';
-
$x = 1;
foreach ( $activity as $item ) {
-   if ( $x  $limit ) {
-   $output .= 'div class=mp-activity' . ( ( $x 
== $limit ) ? ' mp-activity-boarder-fix' : '' ) . '
-   img src=' . $wgScriptPath . 
'/extensions/SocialProfile/images/' . UserActivity::getTypeIcon( $item['type'] 
) . ' alt=' . UserActivity::getTypeIcon( $item['type'] ) . ' border=0 /'
-   . $item['data'] . '/div';
+   if ( $x  $fixedLimit ) {
+   $typeIcon = UserActivity::getTypeIcon( 
$item['type'] );
+   $output .= 'div class=mp-activity' . ( ( $x 
== $fixedLimit ) ? ' mp-activity-boarder-fix' : '' ) . '
+   img src=' . $wgScriptPath . 
'/extensions/SocialProfile/images/' . $typeIcon . ' alt=' . $typeIcon . ' 
border=0 /'
+   . $item['data'] .
+   '/div';
$x++;
}
}

Modified: trunk/extensions/SocialProfile/UserActivity/UserActivity.body.php
===
--- trunk/extensions/SocialProfile/UserActivity/UserActivity.body.php   
2009-12-31 21:58:46 UTC (rev 60530)
+++ trunk/extensions/SocialProfile/UserActivity/UserActivity.body.php   
2009-12-31 22:11:40 UTC (rev 60531)
@@ -15,7 +15,7 @@
 * @param $par Mixed: parameter passed to the page or null
 */
public function execute( $par ) {
-   global $wgUser, $wgOut, $wgRequest, $wgSitename, $wgScriptPath;
+   global $wgUser, $wgOut, $wgRequest, $wgScriptPath;
 
wfLoadExtensionMessages

[MediaWiki-CVS] SVN: [60457] trunk/extensions/SocialProfile/UserBoard/SpecialUserBoard.php

2009-12-28 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/60457

Revision: 60457
Author:   ashley
Date: 2009-12-28 23:52:03 + (Mon, 28 Dec 2009)

Log Message:
---
UserBoard: fix for missing argument warning

Modified Paths:
--
trunk/extensions/SocialProfile/UserBoard/SpecialUserBoard.php

Modified: trunk/extensions/SocialProfile/UserBoard/SpecialUserBoard.php
===
--- trunk/extensions/SocialProfile/UserBoard/SpecialUserBoard.php   
2009-12-28 21:51:58 UTC (rev 60456)
+++ trunk/extensions/SocialProfile/UserBoard/SpecialUserBoard.php   
2009-12-28 23:52:03 UTC (rev 60457)
@@ -125,8 +125,9 @@
posted = 1;
encodedName = encodeURIComponent( 
document.getElementById('user_name_to').value );
encodedMsg = encodeURIComponent( 
document.getElementById('message').value );
+   messageType = 
document.getElementById('message_type').value;
sajax_request_type = 'POST';
-   sajax_do_call( 'wfSendBoardMessage', [ 
encodedName, encodedMsg, {$per_page} ], function( originalRequest ) {
+   sajax_do_call( 'wfSendBoardMessage', [ 
encodedName, encodedMsg, messageType, {$per_page} ], function( originalRequest 
) {
posted = 0;
if( 
document.getElementById('user_name_from').value ) { // its a board to board
user_1 = 
document.getElementById('user_name_from').value;



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [60296] trunk/extensions/ApiSVGProxy

2009-12-22 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/60296

Revision: 60296
Author:   ashley
Date: 2009-12-22 22:03:07 + (Tue, 22 Dec 2009)

Log Message:
---
ApiSVGProxy: coding style cleanup

Modified Paths:
--
trunk/extensions/ApiSVGProxy/ApiSVGProxy.body.php
trunk/extensions/ApiSVGProxy/ApiSVGProxy.php

Modified: trunk/extensions/ApiSVGProxy/ApiSVGProxy.body.php
===
--- trunk/extensions/ApiSVGProxy/ApiSVGProxy.body.php   2009-12-22 19:22:11 UTC 
(rev 60295)
+++ trunk/extensions/ApiSVGProxy/ApiSVGProxy.body.php   2009-12-22 22:03:07 UTC 
(rev 60296)
@@ -20,70 +20,68 @@
exit( 1 );
 }
 
-class ApiSVGProxy extends ApiBase
-{
-   public function __construct($main, $action)
-   {
-   parent::__construct($main, $action);
+class ApiSVGProxy extends ApiBase {
+   public function __construct( $main, $action ) {
+   parent::__construct( $main, $action );
}
-   
-   public function execute()
-   {
+
+   public function execute() {
$params = $this-extractRequestParams();
-   $title = Title::newFromText($params['file']);
-   $file = wfFindFile($title);
-   
+   $title = Title::newFromText( $params['file'] );
+   $file = wfFindFile( $title );
+
// Verify that the file exists and is an SVG file
-   if(!$file)
+   if( !$file ) {
$this-dieUsage('The specified file does not exist',
'nosuchfile', 404);
-   if($file-getExtension() != 'svg' || $file-getMimeType() != 
'image/svg+xml')
+   }
+   if( $file-getExtension() != 'svg' || $file-getMimeType() != 
'image/svg+xml' ) {
$this-dieUsage('The specified file is not an SVG file',
'notsvg', 403);
-   
+   }
+
// Grab the file's contents
-   $contents = Http::get($file-getFullUrl());
-   if($contents === false)
+   $contents = Http::get( $file-getFullUrl() );
+   if( $contents === false ) {
$this-dieUsage('The specified file could not be 
fetched',
'fetchfailed', 500);
-   
+   }
+
// Output the file's contents raw
-   $this-getResult()-addValue(null, 'text', $contents);
-   $this-getResult()-addValue(null, 'mime', 'image/svg+xml');
+   $this-getResult()-addValue( null, 'text', $contents );
+   $this-getResult()-addValue( null, 'mime', 'image/svg+xml' );
}
-   
-   public function getCustomPrinter()
-   {
-   return new ApiFormatRaw($this-getMain(),
-   $this-getMain()-createPrinterByName('xml'));
+
+   public function getCustomPrinter() {
+   return new ApiFormatRaw(
+   $this-getMain(),
+   $this-getMain()-createPrinterByName( 'xml' )
+   );
}
-   
-   public function getAllowedParams()
-   {
+
+   public function getAllowedParams() {
return array(
'file' = null,
);
}
-   
-   public function getParamDescription()
-   {
+
+   public function getParamDescription() {
return array(
'file' = 'Name of the file to proxy (including File: 
prefix)',
);
}
-   
-   public function getDescription()
-   {
-   return array('Proxy an SVG file from a (possibly remote) 
repository.',
+
+   public function getDescription() {
+   return array(
+   'Proxy an SVG file from a (possibly remote) 
repository.',
'The file must have the .svg extension and the 
image/svg+xml MIME type.',
'If not, this module will return a 403 response. If the 
file doesn\'t exist,',
'a 404 response will be returned. If fetching the file 
failed, a 500 response',
'will be returned.',
);
}
-   
-   public function getVersion()
-   {
+
+   public function getVersion() {
return __CLASS__ . ': $Id$';
}
 }

Modified: trunk/extensions/ApiSVGProxy/ApiSVGProxy.php
===
--- trunk/extensions/ApiSVGProxy/ApiSVGProxy.php2009-12-22 19:22:11 UTC 
(rev 60295)
+++ trunk/extensions/ApiSVGProxy/ApiSVGProxy.php2009-12-22 22:03:07 UTC 
(rev 60296)
@@ -27,10 +27,10 @@
'author' = 'Roan Kattouw',
'url' = 'http://www.mediawiki.org/wiki/Extension:ApiSVGProxy',
'version' = '1.0

[MediaWiki-CVS] SVN: [60297] trunk/extensions/SocialProfile/UserGifts/ SpecialGiftManagerLogo.php

2009-12-22 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/60297

Revision: 60297
Author:   ashley
Date: 2009-12-22 22:24:35 + (Tue, 22 Dec 2009)

Log Message:
---
UserGifts: replace eregi with preg_match + coding style cleanup

Modified Paths:
--
trunk/extensions/SocialProfile/UserGifts/SpecialGiftManagerLogo.php

Modified: trunk/extensions/SocialProfile/UserGifts/SpecialGiftManagerLogo.php
===
--- trunk/extensions/SocialProfile/UserGifts/SpecialGiftManagerLogo.php 
2009-12-22 22:03:07 UTC (rev 60296)
+++ trunk/extensions/SocialProfile/UserGifts/SpecialGiftManagerLogo.php 
2009-12-22 22:24:35 UTC (rev 60297)
@@ -94,7 +94,9 @@
 */
public function executeLogo() {
global $wgUser, $wgOut, $wgEnableUploads, $wgUploadDirectory;
-   $this-avatarUploadDirectory = $wgUploadDirectory . /awards;
+
+   $this-avatarUploadDirectory = $wgUploadDirectory . '/awards';
+
/** Show an error message if file upload is disabled */
if ( !$wgEnableUploads ) {
$wgOut-addWikiMsg( 'uploaddisabled' );
@@ -120,7 +122,7 @@
if ( $this-mReUpload ) {
$this-unsaveUploadedFile();
$this-mainUploadForm();
-   } else if ( 'submit' == $this-mAction || $this-mUpload ) {
+   } elseif ( 'submit' == $this-mAction || $this-mUpload ) {
$this-processUpload();
} else {
$this-mainUploadForm();
@@ -236,14 +238,24 @@
}
 
function createThumbnail( $imageSrc, $ext, $imgDest, $thumbWidth ) {
-   list( $origWidth, $origHeight, $TypeCode ) = getimagesize( 
$imageSrc );
+   list( $origWidth, $origHeight, $typeCode ) = getimagesize( 
$imageSrc );
 
-   if ( $origWidth  $thumbWidth )$thumbWidth = $origWidth;
+   if ( $origWidth  $thumbWidth ) {
+   $thumbWidth = $origWidth;
+   }
$thumbHeight = ( $thumbWidth * $origHeight / $origWidth );
-   if ( $thumbHeight  $thumbWidth )$border =  -bordercolor white 
-border 0x . ( ( $thumbWidth - $thumbHeight ) / 2 );
-   if ( $TypeCode == 2 )exec( convert -size  . $thumbWidth . x 
. $thumbWidth .  -resize  . $thumbWidth .-quality 100  . 
$border .   . $imageSrc .   . $this-avatarUploadDirectory . / . $imgDest 
. .jpg );
-   if ( $TypeCode == 1 )exec( convert -size  . $thumbWidth . x 
. $thumbWidth .  -resize  . $thumbWidth . . $imageSrc .   . $border . 
  . $this-avatarUploadDirectory . / . $imgDest . .gif );
-   if ( $TypeCode == 3 )exec( convert -size  . $thumbWidth . x 
. $thumbWidth .  -resize  . $thumbWidth .  . $imageSrc .   . 
$this-avatarUploadDirectory . / . $imgDest . .png );
+   if ( $thumbHeight  $thumbWidth ) {
+   $border = ' -bordercolor white -border 0x' . ( ( 
$thumbWidth - $thumbHeight ) / 2 );
+   }
+   if ( $typeCode == 2 ) {
+   exec( 'convert -size ' . $thumbWidth . 'x' . 
$thumbWidth . ' -resize ' . $thumbWidth . '  -quality 100 ' . $border . ' ' . 
$imageSrc . ' ' . $this-avatarUploadDirectory . '/' . $imgDest . '.jpg' );
+   }
+   if ( $typeCode == 1 ) {
+   exec( 'convert -size ' . $thumbWidth . 'x' . 
$thumbWidth . ' -resize ' . $thumbWidth . ' ' . $imageSrc . ' ' . $border . ' ' 
. $this-avatarUploadDirectory . '/' . $imgDest . '.gif' );
+   }
+   if ( $typeCode == 3 ) {
+   exec( 'convert -size ' . $thumbWidth . 'x' . 
$thumbWidth . ' -resize ' . $thumbWidth . ' ' . $imageSrc . ' ' . 
$this-avatarUploadDirectory . '/' . $imgDest . .png );
+   }
}
 
/**
@@ -264,38 +276,62 @@
$dest = $this-avatarUploadDirectory;
 
$this-mSavedFile = {$dest}/{$saveName};
-   $this-createThumbnail( $tempName, $ext, $this-gift_id . _l, 
75 );
-   $this-createThumbnail( $tempName, $ext, $this-gift_id . 
_ml, 50 );
-   $this-createThumbnail( $tempName, $ext, $this-gift_id . _m, 
30 );
-   $this-createThumbnail( $tempName, $ext, $this-gift_id . _s, 
16 );
+   $this-createThumbnail( $tempName, $ext, $this-gift_id . '_l', 
75 );
+   $this-createThumbnail( $tempName, $ext, $this-gift_id . 
'_ml', 50 );
+   $this-createThumbnail( $tempName, $ext, $this-gift_id . '_m', 
30 );
+   $this-createThumbnail( $tempName, $ext, $this-gift_id . '_s', 
16 );
 
-   if ( $ext == JPG  is_file( $this-avatarUploadDirectory . 
/ . $this-gift_id . _l.jpg ) ) {
+   if ( $ext == 'JPG'  is_file( $this-avatarUploadDirectory . 
'/' . $this-gift_id . '_l.jpg

[MediaWiki-CVS] SVN: [60243] trunk/extensions/RandomUsersWithAvatars/RandomUsersWithAvatars .php

2009-12-20 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/60243

Revision: 60243
Author:   ashley
Date: 2009-12-20 17:34:16 + (Sun, 20 Dec 2009)

Log Message:
---
RandomUsersWithAvatars: fix for PHP 5.3 + general cleanup

Modified Paths:
--
trunk/extensions/RandomUsersWithAvatars/RandomUsersWithAvatars.php

Modified: trunk/extensions/RandomUsersWithAvatars/RandomUsersWithAvatars.php
===
--- trunk/extensions/RandomUsersWithAvatars/RandomUsersWithAvatars.php  
2009-12-20 16:16:14 UTC (rev 60242)
+++ trunk/extensions/RandomUsersWithAvatars/RandomUsersWithAvatars.php  
2009-12-20 17:34:16 UTC (rev 60243)
@@ -6,8 +6,9 @@
  *
  * @file
  * @ingroup Extensions
- * @version 1.0
- * @author Wikia New York Team
+ * @version 1.1
+ * @author David Pean david.p...@gmail.com
+ * @author Jack Phoenix j...@countervandalism.net
  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
  * @link http://www.mediawiki.org/wiki/Extension:RandomUsersWithAvatars 
Documentation
  */
@@ -16,32 +17,33 @@
  * Protect against register_globals vulnerabilities.
  * This line must be present before any global variable is referenced.
  */
-if ( !defined( 'MEDIAWIKI' ) )
+if ( !defined( 'MEDIAWIKI' ) ) {
die();
+}
 
-$wgHooks['ParserFirstCallInit'][] = 'wfRandomUsersWithAvatars';
-
 // Extension credits that will show up on Special:Version
 $wgExtensionCredits['parserhook'][] = array(
'path' = __FILE__,
'name' = 'RandomUsersWithAvatars',
-   'version' = '1.0',
-   'author' = 'Wikia New York Team',
+   'version' = '1.1',
+   'author' = array( 'David Pean', 'Jack Phoenix' ),
'description' = 'Adds ttlt;randomuserswithavatarsgt;/tt tag to 
display the avatars of randomly chosen users',
'url' = 
'http://www.mediawiki.org/wiki/Extension:RandomUsersWithAvatars',
'descriptionmsg' = 'random-users-avatars-desc',
 );
 
-$dir = dirname(__FILE__) . '/';
+// Internationalization messages
+$dir = dirname( __FILE__ ) . '/';
 $wgExtensionMessagesFiles['RandomUsersWithAvatars'] = $dir . 
'RandomUsersWithAvatars.i18n.php';
 
+$wgHooks['ParserFirstCallInit'][] = 'wfRandomUsersWithAvatars';
 function wfRandomUsersWithAvatars( $parser ) {
$parser-setHook( 'randomuserswithavatars', 'GetRandomUsersWithAvatars' 
);
return true;
 }
 
-function GetRandomUsersWithAvatars( $input, $args, $parser ){
-   global $wgUser, $wgUploadDirectory, $wgDBname, $wgMemc;
+function GetRandomUsersWithAvatars( $input, $args, $parser ) {
+   global $wgUploadDirectory, $wgDBname, $wgMemc;
wfLoadExtensionMessages( 'RandomUsersWithAvatars' );
 
wfProfileIn( __METHOD__ );
@@ -54,9 +56,9 @@
// Try cache
$key = wfMemcKey( 'users', 'random', 'avatars', $count, $per_row );
$data = $wgMemc-get( $key );
-   if( !$data ){
+   if( !$data ) {
$files = glob( $wgUploadDirectory . 
/avatars/{$wgDBname}_*_ml.* );
-   $wgMemc-set( $key, $files, 60 * 60);
+   $wgMemc-set( $key, $files, 60 * 60 );
} else {
wfDebug( Got random users with avatars from cache\n );
$files = $data;
@@ -70,8 +72,9 @@
 
$x = 1;
 
-   if( count( $files )  $count )
+   if( count( $files )  $count ) {
$count = count( $files );
+   }
if( $count  0 ) {
$random_keys = array_rand( $files, $count );
} else {
@@ -84,7 +87,7 @@
preg_match( /{$wgDBname}_(.*)_/i, $avatar_name, $matches );
$user_id = $matches[1];
 
-   if( $user_id ){
+   if( $user_id ) {
// Load user
$user = User::newFromId( $user_id );
$user-loadFromDatabase();
@@ -95,7 +98,7 @@
 
$output .= 'a href=' . $user_link-escapeFullURL() . 
' rel=nofollow' . $avatar-getAvatarURL() . '/a';
 
-   if( $x == $count || $x != 1  $x%$per_row == 0 ){
+   if( $x == $count || $x != 1  $x%$per_row == 0 ) {
$output .= 'div class=cleared/div';
}
$x++;



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [60230] trunk/extensions/SocialProfile/SystemGifts

2009-12-19 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/60230

Revision: 60230
Author:   ashley
Date: 2009-12-19 19:45:19 + (Sat, 19 Dec 2009)

Log Message:
---
SocialProfile: some cleanup to SystemGifts stuff

Modified Paths:
--
trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManager.php
trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManagerLogo.php
trunk/extensions/SocialProfile/SystemGifts/SpecialViewSystemGifts.php

Modified: 
trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManager.php
===
--- trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManager.php 
2009-12-19 19:34:06 UTC (rev 60229)
+++ trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManager.php 
2009-12-19 19:45:19 UTC (rev 60230)
@@ -39,22 +39,27 @@
}
 
// Add CSS
-   $wgOut-addStyle( $wgSystemGiftsScripts . '/SystemGift.css' );
+   $wgOut-addExtensionStyle( $wgSystemGiftsScripts . 
'/SystemGift.css' );
 
if ( $wgRequest-wasPosted() ) {
$g = new SystemGifts();
 
if ( !( $_POST['id'] ) ) {
$gift_id = $g-addGift(
-   $wgRequest-getVal( 'gift_name' ), 
$wgRequest-getVal( 'gift_description' ),
-   $wgRequest-getVal( 'gift_category' ), 
$wgRequest-getVal( 'gift_threshold' )
+   $wgRequest-getVal( 'gift_name' ),
+   $wgRequest-getVal( 'gift_description' 
),
+   $wgRequest-getVal( 'gift_category' ),
+   $wgRequest-getVal( 'gift_threshold' )
);
$wgOut-addHTML( 'span class=view-status' . 
wfMsg( 'ga-created' ) . '/spanbr /br /' );
} else {
$gift_id = $wgRequest-getVal( 'id' );
-   $g-updateGift( $gift_id,
-   $wgRequest-getVal( 'gift_name' ), 
$wgRequest-getVal( 'gift_description' ),
-   $wgRequest-getVal( 'gift_category' ), 
$wgRequest-getVal( 'gift_threshold' )
+   $g-updateGift(
+   $gift_id,
+   $wgRequest-getVal( 'gift_name' ),
+   $wgRequest-getVal( 'gift_description' 
),
+   $wgRequest-getVal( 'gift_category' ),
+   $wgRequest-getVal( 'gift_threshold' )
);
$wgOut-addHTML( 'span class=view-status' . 
wfMsg( 'ga-saved' ) . '/spanbr /br /' );
}
@@ -79,8 +84,8 @@
if ( $gifts ) {
foreach ( $gifts as $gift ) {
$output .= 'div class=Item
-   a href=' . $wgScriptPath . 
'/index.php?title=Special:SystemGiftManageramp;id=' . $gift['id'] . '' . 
$gift['gift_name'] . '/a
-   /div' . \n;
+   a href=' . $wgScriptPath . 
'/index.php?title=Special:SystemGiftManageramp;id=' . $gift['id'] . '' . 
$gift['gift_name'] . '/a
+   /div' . \n;
}
}
return 'div id=views' . $output . '/div';
@@ -91,7 +96,9 @@
 
$form = 'divba href=' . $wgScriptPath . 
'/index.php?title=Special:SystemGiftManager' . wfMsg( 'ga-viewlist' ) . 
'/a/b/div';
 
-   if ( $gift_id ) $gift = SystemGifts::getGift( $gift_id );
+   if ( $gift_id ) {
+   $gift = SystemGifts::getGift( $gift_id );
+   }
 
$form .= 'form action= method=post 
enctype=multipart/form-data name=gift
table border=0 cellpadding=5 cellspacing=0 width=500

Modified: 
trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManagerLogo.php
===
--- trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManagerLogo.php 
2009-12-19 19:34:06 UTC (rev 60229)
+++ trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManagerLogo.php 
2009-12-19 19:45:19 UTC (rev 60230)
@@ -121,7 +121,7 @@
if ( $this-mReUpload ) {
$this-unsaveUploadedFile();
$this-mainUploadForm();
-   } else if ( 'submit' == $this-mAction || $this-mUpload ) {
+   } elseif ( 'submit' == $this-mAction || $this-mUpload ) {
$this-processUpload();
} else

[MediaWiki-CVS] SVN: [60009] trunk/phase3/includes

2009-12-13 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/60009

Revision: 60009
Author:   ashley
Date: 2009-12-13 17:57:21 + (Sun, 13 Dec 2009)

Log Message:
---
*coding style cleanup
*marked public functions as such in memcached-client.php

Modified Paths:
--
trunk/phase3/includes/JobQueue.php
trunk/phase3/includes/memcached-client.php

Modified: trunk/phase3/includes/JobQueue.php
===
--- trunk/phase3/includes/JobQueue.php  2009-12-12 22:24:33 UTC (rev 60008)
+++ trunk/phase3/includes/JobQueue.php  2009-12-13 17:57:21 UTC (rev 60009)
@@ -46,16 +46,20 @@
 * actually find a job; it may be adversely affected by concurrent job
 * runners.
 */
-   static function pop_type($type) {
+   static function pop_type( $type ) {
wfProfilein( __METHOD__ );
 
$dbw = wfGetDB( DB_MASTER );
 
+   $row = $dbw-selectRow(
+   'job',
+   '*',
+   array( 'job_cmd' = $type ),
+   __METHOD__,
+   array( 'LIMIT' = 1 )
+   );
 
-   $row = $dbw-selectRow( 'job', '*', array( 'job_cmd' = $type 
), __METHOD__,
-   array( 'LIMIT' = 1 ));
-
-   if ($row === false) {
+   if ( $row === false ) {
wfProfileOut( __METHOD__ );
return false;
}
@@ -64,7 +68,7 @@
$dbw-delete( 'job', array( 'job_id' = $row-job_id ), 
__METHOD__ );
$affected = $dbw-affectedRows();
 
-   if ($affected == 0) {
+   if ( $affected == 0 ) {
wfProfileOut( __METHOD__ );
return false;
}
@@ -75,7 +79,7 @@
$job = Job::factory( $row-job_cmd, $title, Job::extractBlob( 
$row-job_params ), $row-job_id );
 
$dbw-delete( 'job', $job-insertFields(), __METHOD__ );
-   $dbw-immediateCommit();
+   $dbw-commit();
 
wfProfileOut( __METHOD__ );
return $job;
@@ -84,10 +88,10 @@
/**
 * Pop a job off the front of the queue
 *
-* @param $offset Number of jobs to skip
+* @param $offset Integer: Number of jobs to skip
 * @return Job or false if there's no jobs
 */
-   static function pop($offset=0) {
+   static function pop( $offset = 0 ) {
wfProfileIn( __METHOD__ );
 
$dbr = wfGetDB( DB_SLAVE );
@@ -100,17 +104,18 @@
*/
 
$row = $dbr-selectRow( 'job', '*', job_id = ${offset}, 
__METHOD__,
-   array( 'ORDER BY' = 'job_id', 'LIMIT' = 1 ));
+   array( 'ORDER BY' = 'job_id', 'LIMIT' = 1 ) );
 
// Refetching without offset is needed as some of job IDs could 
have had delayed commits
// and have lower IDs than jobs already executed, blame 
concurrency :)
//
-   if ( $row === false) {
-   if ($offset!=0)
+   if ( $row === false ) {
+   if ( $offset != 0 ) {
$row = $dbr-selectRow( 'job', '*', '', 
__METHOD__,
-   array( 'ORDER BY' = 'job_id', 'LIMIT' 
= 1 ));
+   array( 'ORDER BY' = 'job_id', 'LIMIT' 
= 1 ) );
+   }
 
-   if ($row === false ) {
+   if ( $row === false ) {
wfProfileOut( __METHOD__ );
return false;
}
@@ -121,7 +126,7 @@
$dbw = wfGetDB( DB_MASTER );
$dbw-delete( 'job', array( 'job_id' = $row-job_id ), 
__METHOD__ );
$affected = $dbw-affectedRows();
-   $dbw-immediateCommit();
+   $dbw-commit();
 
if ( !$affected ) {
// Failed, someone else beat us to it
@@ -135,7 +140,7 @@
}
// Get the random row
$row = $dbw-selectRow( 'job', '*',
-   'job_id = ' . mt_rand( $row-minjob, 
$row-maxjob ),   __METHOD__ );
+   'job_id = ' . mt_rand( $row-minjob, 
$row-maxjob ), __METHOD__ );
if ( $row === false ) {
// Random job gone before we got the chance to 
select it
// Give up
@@ -145,7 +150,7 @@
// Delete the random row
$dbw-delete( 'job', array( 'job_id' = $row-job_id ), 
__METHOD__ );
$affected = $dbw-affectedRows();
-   $dbw-immediateCommit

[MediaWiki-CVS] SVN: [59661] trunk/extensions/SocialProfile/UserStats

2009-12-02 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/59661

Revision: 59661
Author:   ashley
Date: 2009-12-02 14:25:36 + (Wed, 02 Dec 2009)

Log Message:
---
UserStats: take custom namespaces defined in $wgNamespacesForEditPoints into 
account in Special:UpdateEditCounts. also fixed a PHP 5.3 error

Modified Paths:
--
trunk/extensions/SocialProfile/UserStats/EditCount.php
trunk/extensions/SocialProfile/UserStats/SpecialUpdateEditCounts.php

Modified: trunk/extensions/SocialProfile/UserStats/EditCount.php
===
--- trunk/extensions/SocialProfile/UserStats/EditCount.php  2009-12-02 
14:20:33 UTC (rev 59660)
+++ trunk/extensions/SocialProfile/UserStats/EditCount.php  2009-12-02 
14:25:36 UTC (rev 59661)
@@ -9,7 +9,7 @@
 
 $wgHooks['NewRevisionFromEditComplete'][] = 'incEditCount';
 
-function incEditCount( $article, $revision, $baseRevId ) {
+function incEditCount( $article, $revision, $baseRevId ) {
global $wgUser, $wgTitle, $wgNamespacesForEditPoints;
 
// only keep tally for allowable namespaces

Modified: trunk/extensions/SocialProfile/UserStats/SpecialUpdateEditCounts.php
===
--- trunk/extensions/SocialProfile/UserStats/SpecialUpdateEditCounts.php
2009-12-02 14:20:33 UTC (rev 59660)
+++ trunk/extensions/SocialProfile/UserStats/SpecialUpdateEditCounts.php
2009-12-02 14:25:36 UTC (rev 59661)
@@ -10,7 +10,7 @@
}
 
function updateMainEditsCount() {
-   global $wgOut, $wgUser;
+   global $wgOut, $wgUser, $wgNamespacesForEditPoints;
 
$wgOut-setPageTitle( 'Update Edit Counts' );
 
@@ -19,11 +19,24 @@
return false;
}
 
+   $whereConds = array();
+   $whereConds[] = 'rev_user  0';
+   // If points are given out for editing non-main namespaces, 
take that
+   // into account too.
+   if (
+   isset( $wgNamespacesForEditPoints ) 
+   is_array( $wgNamespacesForEditPoints )
+   ) {
+   foreach( $wgNamespacesForEditPoints as $pointNamespace 
) {
+   $whereConds[] = 'page_namespace = ' . (int) 
$pointNamespace;
+   }
+   }
+
$dbw = wfGetDB( DB_MASTER );
$res = $dbw-select(
array( 'revision', 'page' ),
array( 'rev_user_text', 'rev_user', 'COUNT(*) AS 
the_count' ),
-   array( 'page_namespace = 0', 'rev_user  0' ),
+   $whereConds,
__METHOD__,
array( 'GROUP BY' = 'rev_user_text' ),
array( 'page' = array( 'INNER JOIN', 'page_id = 
rev_page' ) )
@@ -39,7 +52,12 @@
$edit_count = 0;
}
 
-   $s = $dbw-selectRow( 'user_stats', array( 
'stats_user_id' ), array( 'stats_user_id' = $row-rev_user ), __METHOD__ );
+   $s = $dbw-selectRow(
+   'user_stats',
+   array( 'stats_user_id' ),
+   array( 'stats_user_id' = $row-rev_user ),
+   __METHOD__
+   );
if ( !$s-stats_user_id ) {
$dbw-insert( 'user_stats',
array(



___
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs


[MediaWiki-CVS] SVN: [59581] trunk/extensions/SocialProfile

2009-11-30 Thread ashley
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/59581

Revision: 59581
Author:   ashley
Date: 2009-11-30 12:39:38 + (Mon, 30 Nov 2009)

Log Message:
---
bug #21684: Remove install.php, use wgExtNewTables

Modified Paths:
--
trunk/extensions/SocialProfile/SocialProfile.php

Removed Paths:
-
trunk/extensions/SocialProfile/install.php

Modified: trunk/extensions/SocialProfile/SocialProfile.php
===
--- trunk/extensions/SocialProfile/SocialProfile.php2009-11-30 12:37:41 UTC 
(rev 59580)
+++ trunk/extensions/SocialProfile/SocialProfile.php2009-11-30 12:39:38 UTC 
(rev 59581)
@@ -195,3 +195,25 @@
 require_once( $IP/extensions/SocialProfile/UserGifts/Gifts.php ); // 
UserGifts (user-to-user gifting functionality) loader file
 require_once( $IP/extensions/SocialProfile/SystemGifts/SystemGifts.php ); // 
SystemGifts (awards functionality) loader file
 require_once( $IP/extensions/SocialProfile/UserActivity/UserActivity.php ); 
// UserActivity - recent social changes
+
+# Schema changes
+$wgHooks['LoadExtensionSchemaUpdates'][] = 'efSocialProfileSchemaUpdates';
+
+function efSocialProfileSchemaUpdates() {
+   global $wgExtNewTables, $wgDBtype;
+   $dir = dirname( __FILE__ );
+   if( $wgDBtype == 'mysql' ) {
+   // Initial install tables
+   $wgExtNewTables[] = array( 'user_board', 
$dir/UserBoard/user_board.sql );
+   $wgExtNewTables[] = array( 'user_profile', 
$dir/UserProfile/user_profile.sql );
+   $wgExtNewTables[] = array( 'user_stats', 
$dir/UserStats/user_stats.sql );
+   $wgExtNewTables[] = array( 'user_relationship', 
$dir/UserRelationship/user_relationship.sql );
+   $wgExtNewTables[] = array( 'user_relationship_request', 
$dir/UserRelationship/user_relationship.sql );
+   $wgExtNewTables[] = array( 'user_system_gift', 
$dir/SystemGifts/systemgifts.sql );
+   $wgExtNewTables[] = array( 'system_gift', 
$dir/SystemGifts/systemgifts.sql );
+   $wgExtNewTables[] = array( 'user_gift', 
$dir/UserGifts/usergifts.sql );
+   $wgExtNewTables[] = array( 'gift', 
$dir/UserGifts/usergifts.sql );
+   $wgExtNewTables[] = array( 'user_system_messages', 
$dir/UserSystemMessages/user_system_messages.sql );
+   }
+   return true;
+}
\ No newline at end of file

Deleted: trunk/extensions/SocialProfile/install.php
===
--- trunk/extensions/SocialProfile/install.php  2009-11-30 12:37:41 UTC (rev 
59580)
+++ trunk/extensions/SocialProfile/install.php  2009-11-30 12:39:38 UTC (rev 
59581)
@@ -1,132 +0,0 @@
-?php
-
-/**
- * Installation script for the extension SocialProfile. MySQL only.
- *
- * @file
- * @ingroup Extensions
- * @author Rob Church robc...@gmail.com
- * @author Siebrand Mazeland
- * @copyright © 2006 Rob Church
- * @copyright © 2008 Siebrand Mazeland
- * @licence Copyright holder allows use of the code for any purpose
- */
-
-# We're going to have to assume we are running from
-# extensions/SocialProfile/install.php (the dir name doesn't even matter)
-
-$maint = getenv( 'MW_INSTALL_PATH' );
-if ( $maint === false )
-   $maint = dirname( dirname( __FILE__ ) ) . '/maintenance';
-else
-   $maint .= '/maintenance';
-
-if ( is_file( $maint . '/commandLine.inc' ) ) {
-   require_once( $maint . '/commandLine.inc' );
-} else {
-   $maint = dirname( dirname( dirname( __FILE__ ) ) ) . '/maintenance';
-   if ( is_file( $maint . '/commandLine.inc' ) ) {
-   require_once( $maint . '/commandLine.inc' );
-   } else {
-   # We can't find it, give up
-   echo( The installation script was unable to find the 
maintenance directories.\n\n );
-   die( 1 );
-   }
-}
-
-# Set up some paths
-$dir = dirname( __FILE__ ) . '/';
-
-# Whine if we don't have appropriate credentials to hand
-if ( !isset( $wgDBadminuser ) || !isset( $wgDBadminpassword ) ) {
-   echo( No superuser credentials could be found. Please provide the 
details\n );
-   echo( of a user with appropriate permissions to update the database. 
See\n );
-   echo( AdminSettings.sample for more details.\n\n );
-   die( 1 );
-}
-
-# Get a connection
-$dbclass = $wgDBtype == 'MySql'
-   ? 'Database'
-   : 'Database' . ucfirst( strtolower( $wgDBtype ) );
-$dba = new $dbclass ( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, 
$wgDBname, 1 );
-
-# Check we're connected
-if ( !$dba-isOpen() ) {
-   echo( A connection to the database could not be established.\n\n );
-   die( 1 );
-}
-
-# Do nothing if the table exists
-if ( $dba-tableExists( 'user_board' ) ) {
-   echo( The table already exists. No action was taken.\n );
-} else {
-   $sql = $dir . '/UserBoard/user_board.sql';
-   if ( $dba-sourceFile

<    1   2   3   4   5   6   >