Index: trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManager.php |
— | — | @@ -15,10 +15,10 @@ |
16 | 16 | * @param $par Mixed: parameter passed to the page or null |
17 | 17 | */ |
18 | 18 | public function execute( $par ){ |
19 | | - global $wgUser, $wgOut, $wgRequest, $wgSiteView, $IP, $wgScriptPath; |
20 | | - wfLoadExtensionMessages('SystemGifts'); |
| 19 | + global $wgUser, $wgOut, $wgRequest, $wgScriptPath; |
| 20 | + wfLoadExtensionMessages( 'SystemGifts' ); |
21 | 21 | |
22 | | - $wgOut->setPageTitle( wfMsg('systemgiftmanager') ); |
| 22 | + $wgOut->setPageTitle( wfMsg( 'systemgiftmanager' ) ); |
23 | 23 | |
24 | 24 | # If the user doesn't have the required 'awardsmanage' permission, display an error |
25 | 25 | if( !$wgUser->isAllowed( 'awardsmanage' ) ) { |
— | — | @@ -42,33 +42,33 @@ |
43 | 43 | .view-form { font-weight:800; font-size:12px; font-color:#666666; } |
44 | 44 | .view-status { font-weight:800; font-size:12px; background-color:#FFFB9B; color:#666666; padding:5px; margin-bottom:5px; } |
45 | 45 | </style>"; |
46 | | - $wgOut->addHTML($css); |
| 46 | + $wgOut->addHTML( $css ); |
47 | 47 | |
48 | 48 | if( $wgRequest->wasPosted() ){ |
49 | 49 | $g = new SystemGifts(); |
50 | 50 | |
51 | 51 | if( !( $_POST['id'] ) ){ |
52 | 52 | $gift_id = $g->addGift( |
53 | | - $wgRequest->getVal('gift_name'), $wgRequest->getVal('gift_description'), |
54 | | - $wgRequest->getVal('gift_category'), $wgRequest->getVal('gift_threshold') |
| 53 | + $wgRequest->getVal( 'gift_name' ), $wgRequest->getVal( 'gift_description' ), |
| 54 | + $wgRequest->getVal( 'gift_category' ), $wgRequest->getVal( 'gift_threshold' ) |
55 | 55 | ); |
56 | | - $wgOut->addHTML('<span class="view-status">'.wfMsg('ga-created').'</span><br /><br />'); |
| 56 | + $wgOut->addHTML( '<span class="view-status">'.wfMsg( 'ga-created' ).'</span><br /><br />' ); |
57 | 57 | } else { |
58 | | - $gift_id = $wgRequest->getVal('id'); |
59 | | - $g->updateGift($gift_id, |
60 | | - $wgRequest->getVal('gift_name'), $wgRequest->getVal('gift_description'), |
61 | | - $wgRequest->getVal('gift_category'), $wgRequest->getVal('gift_threshold') |
| 58 | + $gift_id = $wgRequest->getVal( 'id' ); |
| 59 | + $g->updateGift( $gift_id, |
| 60 | + $wgRequest->getVal( 'gift_name' ), $wgRequest->getVal( 'gift_description' ), |
| 61 | + $wgRequest->getVal( 'gift_category' ), $wgRequest->getVal( 'gift_threshold' ) |
62 | 62 | ); |
63 | | - $wgOut->addHTML('<span class="view-status">'.wfMsg('ga-saved').'</span><br /><br />'); |
| 63 | + $wgOut->addHTML( '<span class="view-status">'.wfMsg( 'ga-saved' ).'</span><br /><br />' ); |
64 | 64 | } |
65 | 65 | $g->update_system_gifts(); |
66 | | - $wgOut->addHTML( $this->displayForm($gift_id) ); |
| 66 | + $wgOut->addHTML( $this->displayForm( $gift_id ) ); |
67 | 67 | } else { |
68 | 68 | $gift_id = $wgRequest->getVal( 'id' ); |
69 | 69 | if( $gift_id || $wgRequest->getVal( 'method' ) == 'edit' ){ |
70 | | - $wgOut->addHTML( $this->displayForm($gift_id) ); |
| 70 | + $wgOut->addHTML( $this->displayForm( $gift_id ) ); |
71 | 71 | } else { |
72 | | - $wgOut->addHTML('<div><b><a href="'.$wgScriptPath.'/index.php?title=Special:SystemGiftManager&method=edit">'.wfMsg('ga-addnew').'</a></b></div><p>'); |
| 72 | + $wgOut->addHTML( '<div><b><a href="'.$wgScriptPath.'/index.php?title=Special:SystemGiftManager&method=edit">'.wfMsg( 'ga-addnew' ).'</a></b></div><p>' ); |
73 | 73 | $wgOut->addHTML( $this->displayGiftList() ); |
74 | 74 | } |
75 | 75 | } |
— | — | @@ -78,7 +78,7 @@ |
79 | 79 | global $wgScriptPath; |
80 | 80 | $output = ''; // Prevent E_NOTICE |
81 | 81 | $per_page = 10; |
82 | | - $gifts = SystemGifts::getGiftList($per_page, $page); |
| 82 | + $gifts = SystemGifts::getGiftList( $per_page, $page ); |
83 | 83 | if( $gifts ){ |
84 | 84 | foreach( $gifts as $gift ) { |
85 | 85 | $output .= '<div class="Item"> |
— | — | @@ -92,42 +92,42 @@ |
93 | 93 | function displayForm( $gift_id ){ |
94 | 94 | global $wgUploadPath, $wgScriptPath; |
95 | 95 | |
96 | | - $form = '<div><b><a href="'.$wgScriptPath.'/index.php?title=Special:SystemGiftManager">'.wfMsg('ga-viewlist').'</a></b></div><p>'; |
| 96 | + $form = '<div><b><a href="'.$wgScriptPath.'/index.php?title=Special:SystemGiftManager">'.wfMsg( 'ga-viewlist' ).'</a></b></div><p>'; |
97 | 97 | |
98 | | - if( $gift_id ) $gift = SystemGifts::getGift($gift_id); |
| 98 | + if( $gift_id ) $gift = SystemGifts::getGift( $gift_id ); |
99 | 99 | |
100 | | - $form .= '<form action="" method="POST" enctype="multipart/form-data" name="gift">'; |
| 100 | + $form .= '<form action="" method="post" enctype="multipart/form-data" name="gift">'; |
101 | 101 | $form .= '<table border="0" cellpadding="5" cellspacing="0" width="500">'; |
102 | 102 | $form .= '<tr> |
103 | | - <td width="200" class="view-form">'.wfMsg('ga-giftname').'</td> |
| 103 | + <td width="200" class="view-form">'.wfMsg( 'ga-giftname' ).'</td> |
104 | 104 | <td width="695"><input type="text" size="45" class="createbox" name="gift_name" value="'. $gift['gift_name'] . '"/></td> |
105 | 105 | </tr> |
106 | 106 | <tr> |
107 | | - <td width="200" class="view-form" valign="top">'.wfMsg('ga-giftdesc').'</td> |
| 107 | + <td width="200" class="view-form" valign="top">'.wfMsg( 'ga-giftdesc' ).'</td> |
108 | 108 | <td width="695"><textarea class="createbox" name="gift_description" rows="2" cols="30">'. $gift['gift_description'] . '</textarea></td> |
109 | 109 | </tr> |
110 | 110 | <tr> |
111 | | - <td width="200" class="view-form">'.wfMsg('ga-gifttype').'</td> |
| 111 | + <td width="200" class="view-form">'.wfMsg( 'ga-gifttype' ).'</td> |
112 | 112 | <td width="695"> |
113 | 113 | <select name="gift_category">'; |
114 | 114 | $g = new SystemGifts(); |
115 | 115 | foreach( $g->categories as $category => $id ){ |
116 | | - $form .= '<option ' . ( ( $gift['gift_category'] == $id ) ? 'selected' : '' ) . " value=\"{$id}\">{$category}</option>"; |
| 116 | + $form .= '<option' . ( ( $gift['gift_category'] == $id ) ? ' selected="selected"' : '' ) . " value=\"{$id}\">{$category}</option>"; |
117 | 117 | } |
118 | 118 | $form .= '</select> |
119 | 119 | <tr> |
120 | | - <td width="200" class="view-form">'.wfMsg('ga-threshold').'</td> |
| 120 | + <td width="200" class="view-form">'.wfMsg( 'ga-threshold' ).'</td> |
121 | 121 | <td width="695"><input type="text" size="25" class="createbox" name="gift_threshold" value="'. $gift['gift_threshold'] . '"/></td> |
122 | 122 | </tr> |
123 | 123 | <tr>'; |
124 | 124 | |
125 | 125 | if( $gift_id ){ |
126 | | - $gift_image = "<img src=\"{$wgUploadPath}/awards/" . SystemGifts::getGiftImage( $gift_id, 'l' ) . "\" border=\"0\" alt=\"gift\" />"; |
| 126 | + $gift_image = '<img src="'. $wgUploadPath .'/awards/' . SystemGifts::getGiftImage( $gift_id, 'l' ) . '" border="0" alt="gift" />'; |
127 | 127 | $form .= '<tr> |
128 | 128 | <td width="200" class="view-form" valign="top">'.wfMsg('ga-giftimage').'</td> |
129 | 129 | <td width="695">' . $gift_image . ' |
130 | 130 | <p> |
131 | | - <a href="'.$wgScriptPath.'/index.php?title=Special:SystemGiftManagerLogo&gift_id=' . $gift_id . '">'.wfMsg('ga-img').'</a> |
| 131 | + <a href="'.$wgScriptPath.'/index.php?title=Special:SystemGiftManagerLogo&gift_id=' . $gift_id . '">'.wfMsg( 'ga-img' ).'</a> |
132 | 132 | </td> |
133 | 133 | </tr>'; |
134 | 134 | } |
— | — | @@ -135,8 +135,8 @@ |
136 | 136 | $form .= '<tr> |
137 | 137 | <td colspan="2"> |
138 | 138 | <input type="hidden" name="id" value="' . $gift['gift_id'] . '"> |
139 | | - <input type="button" class="createbox" value="' . ( ( $gift['gift_id'] ) ? wfMsg('edit') : wfMsg('ga-create-gift') ) . '" size="20" onclick="document.gift.submit()" /> |
140 | | - <input type="button" class="createbox" value="'.wfMsg('cancel').'" size="20" onclick="history.go(-1)" /> |
| 139 | + <input type="button" class="createbox" value="' . ( ( $gift['gift_id'] ) ? wfMsg( 'edit' ) : wfMsg( 'ga-create-gift' ) ) . '" size="20" onclick="document.gift.submit()" /> |
| 140 | + <input type="button" class="createbox" value="'.wfMsg( 'cancel' ).'" size="20" onclick="history.go(-1)" /> |
141 | 141 | </td> |
142 | 142 | </tr> |
143 | 143 | </table> |