@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | function ali_rank_list_save($ranks) { |
4 | 4 | global $user; |
5 | 5 | |
6 | - if(!empty($ranks)) { |
|
7 | - foreach($ranks as $rank => $rights) { |
|
6 | + if (!empty($ranks)) { |
|
7 | + foreach ($ranks as $rank => $rights) { |
|
8 | 8 | $rights = implode(',', $rights); |
9 | 9 | $ranklist .= $rights . ';'; |
10 | 10 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $temp_array = array(); |
23 | 23 | $query = db_ally_diplomacy_get_relations($ally_from, $ally_to); |
24 | 24 | |
25 | - while($record = db_fetch($query)) { |
|
25 | + while ($record = db_fetch($query)) { |
|
26 | 26 | $temp_array[$record['alliance_diplomacy_contr_ally_id']] = $record; |
27 | 27 | } |
28 | 28 |
@@ -27,19 +27,19 @@ |
||
27 | 27 | */ |
28 | 28 | function db_set_make_safe_string($set, $delta = false) { |
29 | 29 | $set_safe = array(); |
30 | - foreach($set as $field => $value) { |
|
31 | - if(empty($field)) { |
|
30 | + foreach ($set as $field => $value) { |
|
31 | + if (empty($field)) { |
|
32 | 32 | continue; |
33 | 33 | } |
34 | 34 | |
35 | 35 | $field = '`' . db_escape($field) . '`'; |
36 | 36 | $new_value = $value; |
37 | - if($value === null) { |
|
37 | + if ($value === null) { |
|
38 | 38 | $new_value = 'NULL'; |
39 | - } elseif(is_string($value) && (string)($new_value = floatval($value)) != (string)$value) { |
|
39 | + } elseif (is_string($value) && (string) ($new_value = floatval($value)) != (string) $value) { |
|
40 | 40 | // non-float |
41 | 41 | $new_value = '"' . db_escape($value) . '"'; |
42 | - } elseif($delta) { |
|
42 | + } elseif ($delta) { |
|
43 | 43 | // float and DELTA-set |
44 | 44 | $new_value = "{$field} + ({$new_value})"; |
45 | 45 | } |
@@ -10,7 +10,7 @@ |
||
10 | 10 | * @copyright 2008 by Gorlum for Project "SuperNova.WS" |
11 | 11 | */ |
12 | 12 | function flt_mission_hold($mission_data) { |
13 | - if($mission_data->fleet->time_mission_job_complete < SN_TIME_NOW) { |
|
13 | + if ($mission_data->fleet->time_mission_job_complete < SN_TIME_NOW) { |
|
14 | 14 | $mission_data->fleet->mark_fleet_as_returned_and_save(); |
15 | 15 | |
16 | 16 | return CACHE_FLEET; |
@@ -20,14 +20,14 @@ discard block |
||
20 | 20 | $TargetAddress = sprintf($lang['sys_adress_planet'], $fleet_end_coordinates['galaxy'], $fleet_end_coordinates['system'], $fleet_end_coordinates['planet']); |
21 | 21 | |
22 | 22 | $TheMessage = $lang['sys_colo_no_colonizer']; |
23 | - if($objFleet->shipsGetTotalById(SHIP_COLONIZER) >= 1) { |
|
23 | + if ($objFleet->shipsGetTotalById(SHIP_COLONIZER) >= 1) { |
|
24 | 24 | $TheMessage = $lang['sys_colo_notfree']; |
25 | - if(empty($mission_data->dst_planet)) { |
|
25 | + if (empty($mission_data->dst_planet)) { |
|
26 | 26 | $iPlanetCount = get_player_current_colonies($src_user_row); |
27 | 27 | |
28 | 28 | // Can we colonize more planets? |
29 | 29 | $TheMessage = $lang['sys_colo_maxcolo']; |
30 | - if($iPlanetCount < get_player_max_colonies($src_user_row)) { |
|
30 | + if ($iPlanetCount < get_player_max_colonies($src_user_row)) { |
|
31 | 31 | // Yes, we can colonize |
32 | 32 | $TheMessage = $lang['sys_colo_badpos']; |
33 | 33 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $fleet_end_coordinates['galaxy'], $fleet_end_coordinates['system'], $fleet_end_coordinates['planet'], |
36 | 36 | $objFleet->playerOwnerId, "{$lang['sys_colo_defaultname']} {$iPlanetCount}", false, |
37 | 37 | array('user_row' => $src_user_row)); |
38 | - if($NewOwnerPlanet) { |
|
38 | + if ($NewOwnerPlanet) { |
|
39 | 39 | $TheMessage = $lang['sys_colo_arrival'] . $TargetAddress . $lang['sys_colo_allisok']; |
40 | 40 | msg_send_simple_message($objFleet->playerOwnerId, '', $objFleet->time_arrive_to_target, MSG_TYPE_SPY, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage); |
41 | 41 |
@@ -17,14 +17,14 @@ |
||
17 | 17 | function flt_mission_attack($objMission) { |
18 | 18 | $objFleet = $objMission->fleet; |
19 | 19 | |
20 | - if($objFleet->shipsGetTotal() <= 0) { |
|
20 | + if ($objFleet->shipsGetTotal() <= 0) { |
|
21 | 21 | return null; |
22 | 22 | } |
23 | 23 | |
24 | 24 | $destination_user = $objMission->dst_user; |
25 | 25 | $destination_planet = $objMission->dst_planet; |
26 | 26 | |
27 | - if( |
|
27 | + if ( |
|
28 | 28 | // Нет данных о планете назначения или её владельце |
29 | 29 | empty($destination_user) || empty($destination_planet) || !is_array($destination_user) || !is_array($destination_planet) |
30 | 30 | || |
@@ -9,7 +9,6 @@ |
||
9 | 9 | |
10 | 10 | /** |
11 | 11 | * @param Mission $objMission |
12 | - * @param array $mission_data |
|
13 | 12 | */ |
14 | 13 | function flt_mission_attack($objMission) { |
15 | 14 | $objFleet = $objMission->fleet; |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -define('INSIDE' , true); |
|
4 | -define('INSTALL' , false); |
|
3 | +define('INSIDE', true); |
|
4 | +define('INSTALL', false); |
|
5 | 5 | define('IN_ADMIN', true); |
6 | 6 | |
7 | 7 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
@@ -9,12 +9,12 @@ discard block |
||
9 | 9 | global $config, $lang, $user; |
10 | 10 | |
11 | 11 | // if($user['authlevel'] < 1) |
12 | -if($user['authlevel'] < 3) { |
|
12 | +if ($user['authlevel'] < 3) { |
|
13 | 13 | AdminMessage(classLocale::$lang['adm_err_denied']); |
14 | 14 | } |
15 | 15 | |
16 | 16 | $planet_active = sys_get_param_int('planet_active'); |
17 | -if(!$planet_active) { |
|
17 | +if (!$planet_active) { |
|
18 | 18 | $planet_type = sys_get_param_int('planet_type', 1); |
19 | 19 | $planet_type = $planet_type == 3 ? 3 : 1; |
20 | 20 | } else { |
@@ -43,8 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | $page_title = |
45 | 45 | classLocale::$lang['adm_planet_list_title'] . ': ' . |
46 | - ($planet_active ? classLocale::$lang['adm_planet_active'] : |
|
47 | - ($planet_type ? ($planet_type == 3 ? classLocale::$lang['sys_moons'] : classLocale::$lang['sys_planets']) : '') |
|
46 | + ($planet_active ? classLocale::$lang['adm_planet_active'] : ($planet_type ? ($planet_type == 3 ? classLocale::$lang['sys_moons'] : classLocale::$lang['sys_planets']) : '') |
|
48 | 47 | ); |
49 | 48 | $template->assign_vars(array( |
50 | 49 | 'PAGE_TITLE' => $page_title, |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | include_once('common.' . substr(strrchr(__FILE__, '.'), 1)); |
10 | 10 | |
11 | -if(!sn_module_get_active_count('payment')) { |
|
11 | +if (!sn_module_get_active_count('payment')) { |
|
12 | 12 | sys_redirect('dark_matter.php'); |
13 | 13 | die(); |
14 | 14 | } |
@@ -65,9 +65,9 @@ discard block |
||
65 | 65 | |
66 | 66 | // Таблица скидок |
67 | 67 | $prev_discount = 0; |
68 | -if(isset(sn_module_payment::$bonus_table) && is_array(sn_module_payment::$bonus_table)) { |
|
69 | - foreach(sn_module_payment::$bonus_table as $sum => $discount) { |
|
70 | - if($discount && $discount != $prev_discount) { |
|
68 | +if (isset(sn_module_payment::$bonus_table) && is_array(sn_module_payment::$bonus_table)) { |
|
69 | + foreach (sn_module_payment::$bonus_table as $sum => $discount) { |
|
70 | + if ($discount && $discount != $prev_discount) { |
|
71 | 71 | $template->assign_block_vars('discount', array( |
72 | 72 | 'SUM' => $sum, |
73 | 73 | 'DISCOUNT' => $discount * 100, |
@@ -80,19 +80,19 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | // Результат платежа |
83 | -if($payment_id = sys_get_param_id('payment_id')) { |
|
83 | +if ($payment_id = sys_get_param_id('payment_id')) { |
|
84 | 84 | $payment = db_payment_get($payment_id); |
85 | - if($payment && $payment['payment_user_id'] == $user['id']) { |
|
86 | - if($payment['payment_status'] == PAYMENT_STATUS_COMPLETE) { |
|
85 | + if ($payment && $payment['payment_user_id'] == $user['id']) { |
|
86 | + if ($payment['payment_status'] == PAYMENT_STATUS_COMPLETE) { |
|
87 | 87 | $template->assign_block_vars('result', array('MESSAGE' => sprintf(classLocale::$lang['pay_msg_mm_purchase_complete'], $payment['payment_dark_matter_paid'], $payment['payment_module_name'], $payment['payment_dark_matter_gained']))); |
88 | 88 | } |
89 | - if($payment['payment_status'] == PAYMENT_STATUS_NONE) { |
|
89 | + if ($payment['payment_status'] == PAYMENT_STATUS_NONE) { |
|
90 | 90 | $template->assign_block_vars('result', array( |
91 | 91 | 'MESSAGE' => sprintf(classLocale::$lang['pay_msg_mm_purchase_incomplete'], $payment['payment_dark_matter_paid'], $payment['payment_module_name']), |
92 | 92 | 'STATUS' => 1, |
93 | 93 | )); |
94 | 94 | } |
95 | - if($payment['payment_test']) { |
|
95 | + if ($payment['payment_test']) { |
|
96 | 96 | $template->assign_block_vars('result', array( |
97 | 97 | 'MESSAGE' => sprintf(classLocale::$lang['pay_msg_mm_purchase_test']), |
98 | 98 | 'STATUS' => -1, |
@@ -107,28 +107,28 @@ discard block |
||
107 | 107 | 'metamatter' => sys_get_param_float('metamatter'), |
108 | 108 | ); |
109 | 109 | |
110 | -if(!$request['metamatter']) { |
|
110 | +if (!$request['metamatter']) { |
|
111 | 111 | unset($_POST); |
112 | 112 | } |
113 | 113 | |
114 | 114 | $payment_methods_available = array_combine(array_keys(sn_module_payment::$payment_methods), array_fill(0, count(sn_module_payment::$payment_methods), null)); |
115 | -array_walk($payment_methods_available, function (&$value, $index) { |
|
115 | +array_walk($payment_methods_available, function(&$value, $index) { |
|
116 | 116 | $value = !empty(sn_module_payment::$payment_methods[$index]) ? array_combine(array_keys(sn_module_payment::$payment_methods[$index]), array_fill(0, count(sn_module_payment::$payment_methods[$index]), null)) : $value; |
117 | 117 | }); |
118 | 118 | |
119 | 119 | // pdump($payment_methods_available); |
120 | 120 | $payment_module_valid = false; |
121 | 121 | $payment_module = sys_get_param_str('payment_module'); |
122 | -foreach(sn_module::$sn_module_list['payment'] as $module_name => $module) { |
|
123 | - if(!is_object($module) || !$module->manifest['active']) { |
|
122 | +foreach (sn_module::$sn_module_list['payment'] as $module_name => $module) { |
|
123 | + if (!is_object($module) || !$module->manifest['active']) { |
|
124 | 124 | continue; |
125 | 125 | } |
126 | 126 | |
127 | 127 | lng_include($module_name, $module->manifest['root_relative']); |
128 | 128 | |
129 | - foreach(sn_module_payment::$payment_methods as $payment_type_id => $available_methods) { |
|
130 | - foreach($available_methods as $payment_method => $payment_currency) { |
|
131 | - if(isset($module->manifest['payment_method'][$payment_method])) { |
|
129 | + foreach (sn_module_payment::$payment_methods as $payment_type_id => $available_methods) { |
|
130 | + foreach ($available_methods as $payment_method => $payment_currency) { |
|
131 | + if (isset($module->manifest['payment_method'][$payment_method])) { |
|
132 | 132 | $payment_methods_available[$payment_type_id][$payment_method][$module_name] = $module->manifest['payment_method'][$payment_method]; |
133 | 133 | } |
134 | 134 | } |
@@ -139,8 +139,8 @@ discard block |
||
139 | 139 | |
140 | 140 | global $template_result; |
141 | 141 | // Доступные платежные методы |
142 | -foreach($payment_methods_available as $payment_type_id => $payment_methods) { |
|
143 | - if(empty($payment_methods)) { |
|
142 | +foreach ($payment_methods_available as $payment_type_id => $payment_methods) { |
|
143 | + if (empty($payment_methods)) { |
|
144 | 144 | continue; |
145 | 145 | } |
146 | 146 | |
@@ -148,8 +148,8 @@ discard block |
||
148 | 148 | 'ID' => $payment_type_id, |
149 | 149 | 'NAME' => classLocale::$lang['pay_methods'][$payment_type_id], |
150 | 150 | ); |
151 | - foreach($payment_methods as $payment_method_id => $module_list) { |
|
152 | - if(empty($module_list)) { |
|
151 | + foreach ($payment_methods as $payment_method_id => $module_list) { |
|
152 | + if (empty($module_list)) { |
|
153 | 153 | continue; |
154 | 154 | } |
155 | 155 | $template_result['.']['payment'][$payment_type_id]['.']['method'][$payment_method_id] = array( |
@@ -160,14 +160,14 @@ discard block |
||
160 | 160 | 'NAME_FORCE' => isset(sn_module_payment::$payment_methods[$payment_type_id][$payment_method_id]['name']), |
161 | 161 | 'BUTTON' => isset(sn_module_payment::$payment_methods[$payment_type_id][$payment_method_id]['button']), |
162 | 162 | ); |
163 | - foreach($module_list as $payment_module_name => $payment_module_method_details) { |
|
163 | + foreach ($module_list as $payment_module_name => $payment_module_method_details) { |
|
164 | 164 | $template_result['.']['payment'][$payment_type_id]['.']['method'][$payment_method_id]['.']['module'][] = array( |
165 | 165 | 'MODULE' => $payment_module_name, |
166 | 166 | ); |
167 | 167 | } |
168 | 168 | } |
169 | 169 | |
170 | - if(empty($template_result['.']['payment'][$payment_type_id]['.'])) { |
|
170 | + if (empty($template_result['.']['payment'][$payment_type_id]['.'])) { |
|
171 | 171 | unset($template_result['.']['payment'][$payment_type_id]); |
172 | 172 | } |
173 | 173 | } |
@@ -180,19 +180,19 @@ discard block |
||
180 | 180 | $payment_module_valid = $payment_module_valid && (!$payment_method_selected || isset($payment_methods_available[$payment_type_selected][$payment_method_selected][$module_name])); |
181 | 181 | |
182 | 182 | // If payment_module invalid - making it empty OR if there is only one payment_module - selecting it |
183 | -if($payment_module_valid) { |
|
183 | +if ($payment_module_valid) { |
|
184 | 184 | // $payment_module = $payment_module; // Really - do nothing |
185 | -} elseif($payment_type_selected && count($payment_methods_available[$payment_type_selected][$payment_method_selected]) == 1) { |
|
185 | +} elseif ($payment_type_selected && count($payment_methods_available[$payment_type_selected][$payment_method_selected]) == 1) { |
|
186 | 186 | reset($payment_methods_available[$payment_type_selected][$payment_method_selected]); |
187 | 187 | $payment_module = key($payment_methods_available[$payment_type_selected][$payment_method_selected]); |
188 | -} elseif(count(sn_module::$sn_module_list['payment']) == 1) { |
|
188 | +} elseif (count(sn_module::$sn_module_list['payment']) == 1) { |
|
189 | 189 | $payment_module = $module_name; |
190 | 190 | } else { |
191 | 191 | $payment_module = ''; |
192 | 192 | } |
193 | 193 | |
194 | -if($payment_type_selected && $payment_method_selected) { |
|
195 | - foreach($payment_methods_available[$payment_type_selected][$payment_method_selected] as $module_name => $temp) { |
|
194 | +if ($payment_type_selected && $payment_method_selected) { |
|
195 | + foreach ($payment_methods_available[$payment_type_selected][$payment_method_selected] as $module_name => $temp) { |
|
196 | 196 | $template->assign_block_vars('payment_module', array( |
197 | 197 | 'ID' => $module_name, |
198 | 198 | 'NAME' => classLocale::$lang["module_{$module_name}_name"], |
@@ -201,10 +201,10 @@ discard block |
||
201 | 201 | } |
202 | 202 | } |
203 | 203 | |
204 | -foreach(classLocale::$lang['pay_currency_list'] as $key => $value) { |
|
204 | +foreach (classLocale::$lang['pay_currency_list'] as $key => $value) { |
|
205 | 205 | $course = get_exchange_rate($key); |
206 | 206 | // if(!$course || $key == $config->payment_currency_default) { |
207 | - if(!$course) { |
|
207 | + if (!$course) { |
|
208 | 208 | continue; |
209 | 209 | } |
210 | 210 | $template->assign_block_vars('exchange', array( |
@@ -219,17 +219,17 @@ discard block |
||
219 | 219 | )); |
220 | 220 | } |
221 | 221 | |
222 | -if($request['metamatter'] && $payment_module) { |
|
222 | +if ($request['metamatter'] && $payment_module) { |
|
223 | 223 | try { |
224 | 224 | // Any possible errors about generating paylink should be raised in module! |
225 | 225 | $pay_link = sn_module::$sn_module[$payment_module]->compile_request($request); |
226 | 226 | |
227 | 227 | // Поддержка дополнительной информации |
228 | - if(is_array($pay_link['RENDER'])) { |
|
229 | - foreach($pay_link['RENDER'] as $html_data) { |
|
228 | + if (is_array($pay_link['RENDER'])) { |
|
229 | + foreach ($pay_link['RENDER'] as $html_data) { |
|
230 | 230 | $template->assign_block_vars('render', $html_data); |
231 | - if(isset($html_data['VALUE']) && is_array($html_data['VALUE'])) { |
|
232 | - foreach($html_data['VALUE'] as $value_id => $value_value) { |
|
231 | + if (isset($html_data['VALUE']) && is_array($html_data['VALUE'])) { |
|
232 | + foreach ($html_data['VALUE'] as $value_id => $value_value) { |
|
233 | 233 | $template->assign_block_vars('render.value', array( |
234 | 234 | 'FIELD' => $value_id, |
235 | 235 | 'VALUE' => $value_value, |
@@ -240,8 +240,8 @@ discard block |
||
240 | 240 | } |
241 | 241 | |
242 | 242 | // Поддержка передачи данных для многошаговых платежных систем |
243 | - if(is_array($pay_link['DATA'])) { |
|
244 | - foreach($pay_link['DATA'] as $key => $value) { |
|
243 | + if (is_array($pay_link['DATA'])) { |
|
244 | + foreach ($pay_link['DATA'] as $key => $value) { |
|
245 | 245 | $template->assign_block_vars('pay_link_data', array( |
246 | 246 | 'FIELD' => $key, |
247 | 247 | 'VALUE' => $value, |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | } |
250 | 250 | } |
251 | 251 | |
252 | - if(is_array($pay_link) && in_array($pay_link['PAY_LINK_METHOD'], array('POST', 'GET', 'LINK', 'STEP'))) { |
|
252 | + if (is_array($pay_link) && in_array($pay_link['PAY_LINK_METHOD'], array('POST', 'GET', 'LINK', 'STEP'))) { |
|
253 | 253 | // TODO Переделать это под assign_vars_recursive и возвращать пустые строки если нет платежного метода - для унификации формы в темплейте |
254 | 254 | $template->assign_vars(array( |
255 | 255 | 'PAY_LINK_METHOD' => $pay_link['PAY_LINK_METHOD'], |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | } else { |
259 | 259 | throw new exception(classLocale::$lang['pay_msg_request_paylink_unsupported'], ERR_ERROR); |
260 | 260 | } |
261 | - } catch(exception $e) { |
|
261 | + } catch (exception $e) { |
|
262 | 262 | $template->assign_block_vars('result', $response = array( |
263 | 263 | 'STATUS' => $e->getCode(), |
264 | 264 | 'MESSAGE' => $e->getMessage(), |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | } |
269 | 269 | |
270 | 270 | // Прегенерированные пакеты |
271 | -foreach($unit_available_amount_list as $unit_amount => $discount) { |
|
271 | +foreach ($unit_available_amount_list as $unit_amount => $discount) { |
|
272 | 272 | $temp = sn_module_payment::currency_convert($unit_amount, 'MM_', $player_currency); |
273 | 273 | $template->assign_block_vars('mm_amount', array( |
274 | 274 | 'VALUE' => $unit_amount, |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | 'PLAYER_CURRENCY' => $player_currency, |
304 | 304 | 'PLAYER_CURRENCY_PRICE_PER_MM' => sn_module_payment::currency_convert(1, $player_currency, 'MM_', 10), |
305 | 305 | |
306 | - 'UNIT_AMOUNT' => (float)$request['metamatter'], |
|
306 | + 'UNIT_AMOUNT' => (float) $request['metamatter'], |
|
307 | 307 | 'UNIT_AMOUNT_TEXT' => pretty_number($request['metamatter']), |
308 | 308 | 'UNIT_AMOUNT_BONUS_PERCENT' => $bonus_percent, |
309 | 309 | 'UNIT_AMOUNT_TEXT_DISCOUNTED' => $income_metamatter_text, |
@@ -21,8 +21,8 @@ |
||
21 | 21 | $mode = sys_get_param_escaped('mode'); |
22 | 22 | $mode = (!$mode || $mode == 'buildings') ? QUE_STRUCTURES : ($mode == 'fleet' ? SUBQUE_FLEET : ($mode == 'defense' ? SUBQUE_DEFENSE : ($mode == 'research' ? QUE_RESEARCH : $mode))); |
23 | 23 | |
24 | -if($building_sort = sys_get_param_id('sort_elements')) { |
|
25 | - if(!empty(classLocale::$lang['player_option_building_sort'][$building_sort])) { |
|
24 | +if ($building_sort = sys_get_param_id('sort_elements')) { |
|
25 | + if (!empty(classLocale::$lang['player_option_building_sort'][$building_sort])) { |
|
26 | 26 | classSupernova::$user_options[array(PLAYER_OPTION_BUILDING_SORT, $mode)] = $building_sort; |
27 | 27 | classSupernova::$user_options[array(PLAYER_OPTION_BUILDING_SORT_INVERSE, $mode)] = sys_get_param_id('sort_elements_inverse', 0); |
28 | 28 | } |
@@ -21,12 +21,12 @@ discard block |
||
21 | 21 | |
22 | 22 | function sn_admin_planet_edit_template(&$template, $edit_planet_row, $mode) { |
23 | 23 | $unit_list = sn_get_groups($mode); |
24 | - if(empty($unit_list)) { |
|
24 | + if (empty($unit_list)) { |
|
25 | 25 | return; |
26 | 26 | } |
27 | 27 | $name_list = classLocale::$lang['tech']; |
28 | 28 | |
29 | - foreach($unit_list as $unit_id) { |
|
29 | + foreach ($unit_list as $unit_id) { |
|
30 | 30 | $template->assign_block_vars('unit', array( |
31 | 31 | 'ID' => $unit_id, |
32 | 32 | 'NAME' => $name_list[$unit_id], |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | function admin_planet_edit_query_string($unit_id, $unit_amount, $mode) { return sn_function_call(__FUNCTION__, array($unit_id, $unit_amount, $mode)); } |
40 | 40 | |
41 | 41 | function sn_admin_planet_edit_query_string($unit_id, $unit_amount, $mode) { |
42 | - if($unit_amount && in_array($unit_id, sn_get_groups($mode))) { |
|
42 | + if ($unit_amount && in_array($unit_id, sn_get_groups($mode))) { |
|
43 | 43 | $unit_amount = round($unit_amount); |
44 | 44 | $unit_name = get_unit_param($unit_id, P_NAME); |
45 | 45 | $result = "{$unit_name} = GREATEST(0, {$unit_name} + ({$unit_amount}))"; |