Index: trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManager.php |
— | — | @@ -22,7 +22,7 @@ |
23 | 23 | * @param $par Mixed: parameter passed to the page or null |
24 | 24 | */ |
25 | 25 | public function execute( $par ) { |
26 | | - global $wgUser, $wgOut, $wgRequest, $wgScriptPath, $wgSystemGiftsScripts; |
| 26 | + global $wgUser, $wgOut, $wgRequest, $wgSystemGiftsScripts; |
27 | 27 | |
28 | 28 | $wgOut->setPageTitle( wfMsg( 'systemgiftmanager' ) ); |
29 | 29 | |
— | — | @@ -56,20 +56,20 @@ |
57 | 57 | $wgRequest->getVal( 'gift_name' ), |
58 | 58 | $wgRequest->getVal( 'gift_description' ), |
59 | 59 | $wgRequest->getVal( 'gift_category' ), |
60 | | - $wgRequest->getVal( 'gift_threshold' ) |
| 60 | + $wgRequest->getInt( 'gift_threshold' ) |
61 | 61 | ); |
62 | 62 | $wgOut->addHTML( |
63 | 63 | '<span class="view-status">' . wfMsg( 'ga-created' ) . |
64 | 64 | '</span><br /><br />' |
65 | 65 | ); |
66 | 66 | } else { |
67 | | - $gift_id = $wgRequest->getVal( 'id' ); |
| 67 | + $gift_id = $wgRequest->getInt( 'id' ); |
68 | 68 | $g->updateGift( |
69 | 69 | $gift_id, |
70 | 70 | $wgRequest->getVal( 'gift_name' ), |
71 | 71 | $wgRequest->getVal( 'gift_description' ), |
72 | 72 | $wgRequest->getVal( 'gift_category' ), |
73 | | - $wgRequest->getVal( 'gift_threshold' ) |
| 73 | + $wgRequest->getInt( 'gift_threshold' ) |
74 | 74 | ); |
75 | 75 | $wgOut->addHTML( |
76 | 76 | '<span class="view-status">' . wfMsg( 'ga-saved' ) . |
— | — | @@ -79,13 +79,13 @@ |
80 | 80 | $g->update_system_gifts(); |
81 | 81 | $wgOut->addHTML( $this->displayForm( $gift_id ) ); |
82 | 82 | } else { |
83 | | - $gift_id = $wgRequest->getVal( 'id' ); |
| 83 | + $gift_id = $wgRequest->getInt( 'id' ); |
84 | 84 | if ( $gift_id || $wgRequest->getVal( 'method' ) == 'edit' ) { |
85 | 85 | $wgOut->addHTML( $this->displayForm( $gift_id ) ); |
86 | 86 | } else { |
87 | 87 | $wgOut->addHTML( |
88 | | - '<div><b><a href="' . $wgScriptPath . |
89 | | - '/index.php?title=Special:SystemGiftManager&method=edit">' . |
| 88 | + '<div><b><a href="' . |
| 89 | + $this->getTitle()->escapeFullURL( 'method=edit' ) . '">' . |
90 | 90 | wfMsg( 'ga-addnew' ) . '</a></b></div>' |
91 | 91 | ); |
92 | 92 | $wgOut->addHTML( $this->displayGiftList() ); |
— | — | @@ -94,7 +94,6 @@ |
95 | 95 | } |
96 | 96 | |
97 | 97 | function displayGiftList() { |
98 | | - global $wgScriptPath; |
99 | 98 | $output = ''; // Prevent E_NOTICE |
100 | 99 | $page = 0; |
101 | 100 | $per_page = 50; |
— | — | @@ -102,7 +101,8 @@ |
103 | 102 | if ( $gifts ) { |
104 | 103 | foreach ( $gifts as $gift ) { |
105 | 104 | $output .= '<div class="Item"> |
106 | | - <a href="' . $wgScriptPath . '/index.php?title=Special:SystemGiftManager&id=' . $gift['id'] . '">' . $gift['gift_name'] . '</a> |
| 105 | + <a href="' . $this->getTitle()->escapeFullURL( 'id=' . $gift['id'] ) . '">' . |
| 106 | + $gift['gift_name'] . '</a> |
107 | 107 | </div>' . "\n"; |
108 | 108 | } |
109 | 109 | } |
— | — | @@ -110,9 +110,10 @@ |
111 | 111 | } |
112 | 112 | |
113 | 113 | function displayForm( $gift_id ) { |
114 | | - global $wgUploadPath, $wgScriptPath; |
| 114 | + global $wgUploadPath; |
115 | 115 | |
116 | | - $form = '<div><b><a href="' . $wgScriptPath . '/index.php?title=Special:SystemGiftManager">' . wfMsg( 'ga-viewlist' ) . '</a></b></div>'; |
| 116 | + $form = '<div><b><a href="' . $this->getTitle()->escapeFullURL() . |
| 117 | + '">' . wfMsg( 'ga-viewlist' ) . '</a></b></div>'; |
117 | 118 | |
118 | 119 | if ( $gift_id ) { |
119 | 120 | $gift = SystemGifts::getGift( $gift_id ); |
— | — | @@ -145,15 +146,20 @@ |
146 | 147 | </tr> |
147 | 148 | <tr> |
148 | 149 | <td width="200" class="view-form">' . wfMsg( 'ga-threshold' ) . '</td> |
149 | | - <td width="695"><input type="text" size="25" class="createbox" name="gift_threshold" value="' . ( isset( $gift['gift_threshold'] ) ? $gift['gift_threshold'] : '' ) . '"/></td> |
| 150 | + <td width="695"><input type="text" size="25" class="createbox" name="gift_threshold" value="' . |
| 151 | + ( isset( $gift['gift_threshold'] ) ? $gift['gift_threshold'] : '' ) . '"/></td> |
150 | 152 | </tr>'; |
151 | 153 | |
152 | 154 | if ( $gift_id ) { |
153 | | - $gift_image = '<img src="' . $wgUploadPath . '/awards/' . SystemGifts::getGiftImage( $gift_id, 'l' ) . '" border="0" alt="gift" />'; |
| 155 | + $sgml = SpecialPage::getTitleFor( 'SystemGiftManagerLogo' ); |
| 156 | + $gift_image = '<img src="' . $wgUploadPath . '/awards/' |
| 157 | + SystemGifts::getGiftImage( $gift_id, 'l' ) . |
| 158 | + '" border="0" alt="gift" />'; |
154 | 159 | $form .= '<tr> |
155 | 160 | <td width="200" class="view-form" valign="top">' . wfMsg( 'ga-giftimage' ) . '</td> |
156 | 161 | <td width="695">' . $gift_image . |
157 | | - '<a href="' . $wgScriptPath . '/index.php?title=Special:SystemGiftManagerLogo&gift_id=' . $gift_id . '">' . wfMsg( 'ga-img' ) . '</a> |
| 162 | + '<a href="' . $sgml->escapeFullURL( 'gift_id=' . $gift_id ) . '">' . |
| 163 | + wfMsg( 'ga-img' ) . '</a> |
158 | 164 | </td> |
159 | 165 | </tr>'; |
160 | 166 | } |
— | — | @@ -163,6 +169,7 @@ |
164 | 170 | } else { |
165 | 171 | $button = wfMsg( 'ga-create-gift' ); |
166 | 172 | } |
| 173 | + |
167 | 174 | $form .= '<tr> |
168 | 175 | <td colspan="2"> |
169 | 176 | <input type="hidden" name="id" value="' . ( isset( $gift['gift_id'] ) ? $gift['gift_id'] : '' ) . '" /> |
Index: trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManagerLogo.php |
— | — | @@ -51,7 +51,7 @@ |
52 | 52 | return; |
53 | 53 | } |
54 | 54 | |
55 | | - $this->gift_id = $wgRequest->getVal( 'gift_id' ); |
| 55 | + $this->gift_id = $wgRequest->getInt( 'gift_id' ); |
56 | 56 | $this->initLogo( $wgRequest ); |
57 | 57 | $this->executeLogo(); |
58 | 58 | } |
— | — | @@ -63,7 +63,7 @@ |
64 | 64 | # GET requests just give the main form; no data except wpDestfile. |
65 | 65 | return; |
66 | 66 | } |
67 | | - $this->gift_id = $request->getVal( 'gift_id' ); |
| 67 | + $this->gift_id = $request->getInt( 'gift_id' ); |
68 | 68 | $this->mIgnoreWarning = $request->getCheck( 'wpIgnoreWarning' ); |
69 | 69 | $this->mReUpload = $request->getCheck( 'wpReUpload' ); |
70 | 70 | $this->mUpload = $request->getCheck( 'wpUpload' ); |
— | — | @@ -426,7 +426,7 @@ |
427 | 427 | * @access private |
428 | 428 | */ |
429 | 429 | function showSuccess( $status ) { |
430 | | - global $wgUser, $wgOut, $wgUploadPath, $wgScriptPath, $wgLang; |
| 430 | + global $wgUser, $wgOut, $wgUploadPath, $wgLang; |
431 | 431 | $ext = 'jpg'; |
432 | 432 | |
433 | 433 | $output = '<h2>' . wfMsg( 'ga-uploadsuccess' ) . '</h2>'; |
— | — | @@ -464,9 +464,12 @@ |
465 | 465 | </td> |
466 | 466 | </tr>'; |
467 | 467 | |
| 468 | + $systemGiftManager = SpecialPage::getTitleFor( 'SystemGiftManager' ); |
468 | 469 | $output .= $wgLang->pipeList( array( |
469 | | - '<tr><td><a href="' . $wgScriptPath . '/index.php?title=Special:SystemGiftManager">' . wfMsg( 'ga-back-gift-list' ) . '</a> ', |
470 | | - ' <a href="' . $wgScriptPath . '/index.php?title=Special:SystemGiftManager&id=' . $this->gift_id . '">' . wfMsg( 'ga-back-edit-gift' ) . '</a></td></tr>' |
| 470 | + '<tr><td><a href="' . $systemGiftManager->escapeFullURL() . '">' . |
| 471 | + wfMsg( 'ga-back-gift-list' ) . '</a> ', |
| 472 | + ' <a href="' . $systemGiftManager->escapeFullURL( 'id=' . $this->gift_id ) . '">' . |
| 473 | + wfMsg( 'ga-back-edit-gift' ) . '</a></td></tr>' |
471 | 474 | ) ); |
472 | 475 | $output .= '</table>'; |
473 | 476 | $wgOut->addHTML( $output ); |
— | — | @@ -563,7 +566,7 @@ |
564 | 567 | $ew = ''; |
565 | 568 | } |
566 | 569 | |
567 | | - if ( '' != $msg ) { |
| 570 | + if ( $msg != '' ) { |
568 | 571 | $sub = wfMsg( 'uploaderror' ); |
569 | 572 | $wgOut->addHTML( "<h2>{$sub}</h2>\n" . |
570 | 573 | "<h4 class='error'>{$msg}</h4>\n" ); |
— | — | @@ -623,7 +626,8 @@ |
624 | 627 | <table border="0"> |
625 | 628 | <tr> |
626 | 629 | |
627 | | - <td style="color:#666666;font-weight:800">' . wfMsg( 'ga-file-instructions' ) . wfMsg( 'ga-choosefile' ) . '<br /> |
| 630 | + <td style="color:#666666;font-weight:800">' . |
| 631 | + wfMsg( 'ga-file-instructions' ) . wfMsg( 'ga-choosefile' ) . '<br /> |
628 | 632 | <input tabindex="1" type="file" name="wpUploadFile" id="wpUploadFile" style="width:100px" /> |
629 | 633 | </td> |
630 | 634 | </tr> |
Index: trunk/extensions/SocialProfile/SystemGifts/SpecialViewSystemGifts.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | |
29 | 29 | $output = ''; |
30 | 30 | $user_name = $wgRequest->getVal( 'user' ); |
31 | | - $page = $wgRequest->getVal( 'page' ); |
| 31 | + $page = $wgRequest->getInt( 'page', 1 ); |
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Redirect Non-logged in users to Login Page |
— | — | @@ -61,9 +61,6 @@ |
62 | 62 | * Config for the page |
63 | 63 | */ |
64 | 64 | $per_page = 10; |
65 | | - if ( !$page || !is_numeric( $page ) ) { |
66 | | - $page = 1; |
67 | | - } |
68 | 65 | $per_row = 2; |
69 | 66 | |
70 | 67 | /** |