@@ -37,12 +37,12 @@ |
||
37 | 37 | protected $user; |
38 | 38 | |
39 | 39 | /** |
40 | - * Constructor |
|
41 | - * |
|
42 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
43 | - * @param \phpbb\template $template Template object |
|
44 | - * @param \phpbb\user $user User object |
|
45 | - */ |
|
40 | + * Constructor |
|
41 | + * |
|
42 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
43 | + * @param \phpbb\template $template Template object |
|
44 | + * @param \phpbb\user $user User object |
|
45 | + */ |
|
46 | 46 | public function __construct(\phpbb\controller\helper $helper, \phpbb\template\template $template, \phpbb\user $user) |
47 | 47 | { |
48 | 48 | $this->helper = $helper; |
@@ -27,13 +27,13 @@ discard block |
||
27 | 27 | /* @var \phpbb\user */ |
28 | 28 | protected $user; |
29 | 29 | /** |
30 | - * Constructor |
|
31 | - * |
|
32 | - * @param \phpbb\config\config $config |
|
33 | - * @param \phpbb\controller\helper $helper |
|
34 | - * @param \phpbb\template\template $template |
|
35 | - * @param \phpbb\user $user |
|
36 | - */ |
|
30 | + * Constructor |
|
31 | + * |
|
32 | + * @param \phpbb\config\config $config |
|
33 | + * @param \phpbb\controller\helper $helper |
|
34 | + * @param \phpbb\template\template $template |
|
35 | + * @param \phpbb\user $user |
|
36 | + */ |
|
37 | 37 | public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, $table_amount, $table_config, $table_donations, $table_items) |
38 | 38 | { |
39 | 39 | $this->config = $config; |
@@ -48,10 +48,10 @@ discard block |
||
48 | 48 | $this->table_items = $table_items; |
49 | 49 | } |
50 | 50 | /** |
51 | - * Controller for route /paypal |
|
52 | - * |
|
53 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
54 | - */ |
|
51 | + * Controller for route /paypal |
|
52 | + * |
|
53 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
54 | + */ |
|
55 | 55 | public function page() |
56 | 56 | { |
57 | 57 | $this->user->add_lang_ext('tas2580/paypal', 'common'); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $myPost = array(); |
118 | 118 | foreach ($raw_post_array as $keyval) |
119 | 119 | { |
120 | - $keyval = explode ('=', $keyval); |
|
120 | + $keyval = explode('=', $keyval); |
|
121 | 121 | if (count($keyval) == 2) |
122 | 122 | { |
123 | 123 | $myPost[$keyval[0]] = urldecode($keyval[1]); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | } |
126 | 126 | // read the post from PayPal system and add 'cmd' |
127 | 127 | $req = 'cmd=_notify-validate'; |
128 | - if(function_exists('get_magic_quotes_gpc')) |
|
128 | + if (function_exists('get_magic_quotes_gpc')) |
|
129 | 129 | { |
130 | 130 | $get_magic_quotes_exists = true; |
131 | 131 | } |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | } |
158 | 158 | curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); |
159 | 159 | curl_setopt($ch, CURLOPT_POST, 1); |
160 | - curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); |
|
160 | + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
161 | 161 | curl_setopt($ch, CURLOPT_POSTFIELDS, $req); |
162 | 162 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); |
163 | 163 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); |
@@ -134,8 +134,7 @@ |
||
134 | 134 | if ($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) |
135 | 135 | { |
136 | 136 | $value = urlencode(stripslashes($value)); |
137 | - } |
|
138 | - else |
|
137 | + } else |
|
139 | 138 | { |
140 | 139 | $value = urlencode($value); |
141 | 140 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | |
168 | 168 | $item_id = $request->variable('item_id', 0); |
169 | 169 | |
170 | - $action = $request->variable('action', ''); |
|
170 | + $action = $request->variable('action', ''); |
|
171 | 171 | switch ($action) |
172 | 172 | { |
173 | 173 | case 'add': |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | else if ($action == 'edit') |
266 | 266 | { |
267 | 267 | $sql = 'UPDATE ' . $table_prefix . 'paypal_items SET |
268 | - ' . $db->sql_build_array('UPDATE', $sql_data) .' |
|
268 | + ' . $db->sql_build_array('UPDATE', $sql_data) . ' |
|
269 | 269 | WHERE item_id = ' . (int) $item_id; |
270 | 270 | $db->sql_query($sql); |
271 | 271 | trigger_error($user->lang('ACP_ITEM_EDIT_SUCCESS') . adm_back_link($this->u_action)); |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | $this->page_title = $user->lang('ACP_PAYPAL_DONATIONS'); |
330 | 330 | |
331 | 331 | |
332 | - $action = $request->variable('action', ''); |
|
332 | + $action = $request->variable('action', ''); |
|
333 | 333 | if ($action == 'delete') |
334 | 334 | { |
335 | 335 | $donation_id = $request->variable('donation_id', 0); |
@@ -47,8 +47,7 @@ discard block |
||
47 | 47 | $sql = 'DELETE FROM ' . $table_prefix . 'paypal_amount WHERE amount_id = ' . (int) $id; |
48 | 48 | $result = $db->sql_query($sql); |
49 | 49 | trigger_error($user->lang['AMOUNT_DELETED'] . adm_back_link($this->u_action)); |
50 | - } |
|
51 | - else |
|
50 | + } else |
|
52 | 51 | { |
53 | 52 | confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( |
54 | 53 | 'action' => 'delete', |
@@ -105,8 +104,7 @@ discard block |
||
105 | 104 | |
106 | 105 | $db->sql_query($sql); |
107 | 106 | trigger_error($user->lang('ACP_SAVED') . adm_back_link($this->u_action)); |
108 | - } |
|
109 | - else |
|
107 | + } else |
|
110 | 108 | { |
111 | 109 | $template->assign_vars(array( |
112 | 110 | 'ERROR' => implode('<br />', $error), |
@@ -206,8 +204,7 @@ discard block |
||
206 | 204 | $sql = 'DELETE FROM ' . $table_prefix . 'paypal_items WHERE item_id = ' . (int) $item_id; |
207 | 205 | $result = $db->sql_query($sql); |
208 | 206 | trigger_error($user->lang['ITEM_DELETED'] . adm_back_link($this->u_action)); |
209 | - } |
|
210 | - else |
|
207 | + } else |
|
211 | 208 | { |
212 | 209 | confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( |
213 | 210 | 'action' => 'delete', |
@@ -261,8 +258,7 @@ discard block |
||
261 | 258 | ' . $db->sql_build_array('INSERT', $sql_data); |
262 | 259 | $db->sql_query($sql); |
263 | 260 | trigger_error($user->lang('ACP_ITEM_ADD_SUCCESS') . adm_back_link($this->u_action)); |
264 | - } |
|
265 | - else if ($action == 'edit') |
|
261 | + } else if ($action == 'edit') |
|
266 | 262 | { |
267 | 263 | $sql = 'UPDATE ' . $table_prefix . 'paypal_items SET |
268 | 264 | ' . $db->sql_build_array('UPDATE', $sql_data) .' |
@@ -270,8 +266,7 @@ discard block |
||
270 | 266 | $db->sql_query($sql); |
271 | 267 | trigger_error($user->lang('ACP_ITEM_EDIT_SUCCESS') . adm_back_link($this->u_action)); |
272 | 268 | } |
273 | - } |
|
274 | - else |
|
269 | + } else |
|
275 | 270 | { |
276 | 271 | $template->assign_vars(array( |
277 | 272 | 'ERROR' => implode('<br />', $error), |
@@ -295,8 +290,7 @@ discard block |
||
295 | 290 | if (isset($ammount[$row['item_id']])) |
296 | 291 | { |
297 | 292 | $ammount[$row['item_id']] += $row['donation_amount']; |
298 | - } |
|
299 | - else |
|
293 | + } else |
|
300 | 294 | { |
301 | 295 | $ammount[$row['item_id']] = $row['donation_amount']; |
302 | 296 | } |
@@ -338,8 +332,7 @@ discard block |
||
338 | 332 | $sql = 'DELETE FROM ' . $table_prefix . 'paypal_donations WHERE donation_id = ' . (int) $donation_id; |
339 | 333 | $result = $db->sql_query($sql); |
340 | 334 | trigger_error($user->lang['DONATION_DELETED'] . adm_back_link($this->u_action)); |
341 | - } |
|
342 | - else |
|
335 | + } else |
|
343 | 336 | { |
344 | 337 | confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( |
345 | 338 | 'action' => 'delete', |