Index: trunk/extensions/SocialProfile/UserGifts/UserGiftsClass.php |
— | — | @@ -5,22 +5,13 @@ |
6 | 6 | */ |
7 | 7 | class UserGifts { |
8 | 8 | |
9 | | - /** |
10 | | - * All member variables should be considered private |
11 | | - * Please use the accessor functions |
12 | | - */ |
| 9 | + private $user_id; # Text form (spaces not underscores) of the main part |
| 10 | + private $user_name; # Text form (spaces not underscores) of the main part |
13 | 11 | |
14 | | - /**#@+ |
15 | | - * @private |
16 | | - */ |
17 | | - var $user_id; # Text form (spaces not underscores) of the main part |
18 | | - var $user_name; # Text form (spaces not underscores) of the main part |
19 | | - |
20 | 12 | /** |
21 | 13 | * Constructor |
22 | | - * @private |
23 | 14 | */ |
24 | | - /* private */ function __construct( $username ) { |
| 15 | + public function __construct( $username ) { |
25 | 16 | $title1 = Title::newFromDBkey( $username ); |
26 | 17 | $this->user_name = $title1->getText(); |
27 | 18 | $this->user_id = User::idFromName( $this->user_name ); |
Index: trunk/extensions/SocialProfile/UserGifts/GiftsClass.php |
— | — | @@ -7,24 +7,10 @@ |
8 | 8 | class Gifts { |
9 | 9 | |
10 | 10 | /** |
11 | | - * All member variables should be considered private |
12 | | - * Please use the accessor functions |
13 | | - */ |
14 | | - |
15 | | - /**#@+ |
16 | | - * @private |
17 | | - */ |
18 | | - var $user_id; # Text form (spaces not underscores) of the main part |
19 | | - var $user_name; # Text form (spaces not underscores) of the main part |
20 | | - |
21 | | - /** |
22 | 11 | * Constructor |
23 | | - * @private |
24 | 12 | */ |
25 | | - /* private */ function __construct() { |
| 13 | + public function __construct() {} |
26 | 14 | |
27 | | - } |
28 | | - |
29 | 15 | /** |
30 | 16 | * Adds a gift to the database |
31 | 17 | * @param $gift_name Mixed: name of the gift, as supplied by the user |
— | — | @@ -203,7 +189,7 @@ |
204 | 190 | $gift_count = 0; |
205 | 191 | $s = $dbr->selectRow( |
206 | 192 | 'gift', |
207 | | - array( 'COUNT(*) AS count' ), |
| 193 | + array( 'COUNT(gift_id) AS count' ), |
208 | 194 | array( 'gift_creator_user_id' => $user_id ), |
209 | 195 | __METHOD__ |
210 | 196 | ); |
— | — | @@ -218,7 +204,7 @@ |
219 | 205 | $gift_count = 0; |
220 | 206 | $s = $dbr->selectRow( |
221 | 207 | 'gift', |
222 | | - array( 'COUNT(*) AS count' ), |
| 208 | + array( 'COUNT(gift_id) AS count' ), |
223 | 209 | array( 'gift_given_count' => $gift_count ), |
224 | 210 | __METHOD__ |
225 | 211 | ); |
Index: trunk/extensions/SocialProfile/UserGifts/SpecialGiftManager.php |
— | — | @@ -34,12 +34,12 @@ |
35 | 35 | // Add CSS |
36 | 36 | $wgOut->addExtensionStyle( $wgUserGiftsScripts . '/UserGifts.css' ); |
37 | 37 | |
38 | | - if ( count( $_POST ) ) { |
39 | | - if ( !( $_POST['id'] ) ) { |
| 38 | + if ( $wgRequest->wasPosted() ) { |
| 39 | + if ( !$wgRequest->getInt( 'id' ) ) { |
40 | 40 | $giftId = Gifts::addGift( |
41 | | - $_POST['gift_name'], |
42 | | - $_POST['gift_description'], |
43 | | - intval( $_POST['access'] ) |
| 41 | + $wgRequest->getVal( 'gift_name' ), |
| 42 | + $wgRequest->getVal( 'gift_description' ), |
| 43 | + $wgRequest->getInt( 'access' ) |
44 | 44 | ); |
45 | 45 | $wgOut->addHTML( |
46 | 46 | '<span class="view-status">' . |
— | — | @@ -47,12 +47,12 @@ |
48 | 48 | '</span><br /><br />' |
49 | 49 | ); |
50 | 50 | } else { |
51 | | - $giftId = intval( $_POST['id'] ); |
| 51 | + $giftId = $wgRequest->getInt( 'id' ); |
52 | 52 | Gifts::updateGift( |
53 | 53 | $giftId, |
54 | | - $_POST['gift_name'], |
55 | | - $_POST['gift_description'], |
56 | | - intval( $_POST['access'] ) |
| 54 | + $wgRequest->getVal( 'gift_name' ), |
| 55 | + $wgRequest->getVal( 'gift_description' ), |
| 56 | + $wgRequest->getInt( 'access' ) |
57 | 57 | ); |
58 | 58 | $wgOut->addHTML( |
59 | 59 | '<span class="view-status">' . |
Index: trunk/extensions/SocialProfile/UserGifts/SpecialGiftManagerLogo.php |
— | — | @@ -9,13 +9,13 @@ |
10 | 10 | */ |
11 | 11 | class GiftManagerLogo extends UnlistedSpecialPage { |
12 | 12 | |
13 | | - var $mUploadFile, $mUploadDescription, $mIgnoreWarning; |
14 | | - var $mUploadSaveName, $mUploadTempName, $mUploadSize, $mUploadOldVersion; |
15 | | - var $mUploadCopyStatus, $mUploadSource, $mReUpload, $mAction, $mUpload; |
16 | | - var $mOname, $mSessionKey, $mStashed, $mDestFile; |
17 | | - var $avatarUploadDirectory; |
18 | | - var $fileExtensions; |
19 | | - var $gift_id; |
| 13 | + public $mUploadFile, $mUploadDescription, $mIgnoreWarning; |
| 14 | + public $mUploadSaveName, $mUploadTempName, $mUploadSize, $mUploadOldVersion; |
| 15 | + public $mUploadCopyStatus, $mUploadSource, $mReUpload, $mAction, $mUpload; |
| 16 | + public $mOname, $mSessionKey, $mStashed, $mDestFile; |
| 17 | + public $avatarUploadDirectory; |
| 18 | + public $fileExtensions; |
| 19 | + public $gift_id; |
20 | 20 | |
21 | 21 | /** |
22 | 22 | * Constructor |