@@ -46,8 +46,7 @@ |
||
46 | 46 | sn_db_transaction_commit(); |
47 | 47 | sys_redirect("galaxy.php?mode=name&galaxy={$uni_galaxy}&system={$uni_system}"); |
48 | 48 | } |
49 | - } |
|
50 | - catch (exception $e) |
|
49 | + } catch (exception $e) |
|
51 | 50 | { |
52 | 51 | sn_db_transaction_rollback(); |
53 | 52 | $template->assign_block_vars('result', array( |
@@ -79,8 +79,7 @@ |
||
79 | 79 | |
80 | 80 | sn_db_transaction_commit(); |
81 | 81 | throw new Exception($info_action, ERR_NONE); |
82 | - } |
|
83 | - catch (Exception $e) |
|
82 | + } catch (Exception $e) |
|
84 | 83 | { |
85 | 84 | sn_db_transaction_rollback(); |
86 | 85 |
@@ -1,8 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -function dump($value,$varname = "",$level=0,$dumper = "") |
|
4 | -{ |
|
5 | - if ($varname) $varname .= " = "; |
|
3 | +function dump($value,$varname = "",$level=0,$dumper = "") { |
|
4 | + if ($varname) { |
|
5 | + $varname .= " = "; |
|
6 | + } |
|
6 | 7 | |
7 | 8 | if ($level==-1) |
8 | 9 | { |
@@ -13,7 +14,9 @@ discard block |
||
13 | 14 | $trans["\0"]='⊕'; |
14 | 15 | return strtr(htmlspecialchars($value),$trans); |
15 | 16 | } |
16 | - if ($level==0) $dumper = '<pre>' . $varname; |
|
17 | + if ($level==0) { |
|
18 | + $dumper = '<pre>' . $varname; |
|
19 | + } |
|
17 | 20 | |
18 | 21 | $type = gettype($value); |
19 | 22 | $dumper .= $type; |
@@ -22,9 +25,9 @@ discard block |
||
22 | 25 | { |
23 | 26 | $dumper .= '('.strlen($value).')'; |
24 | 27 | $value = dump($value,"",-1); |
25 | - } |
|
26 | - elseif ($type=='boolean') $value= ($value?'true':'false'); |
|
27 | - elseif ($type=='object') |
|
28 | + } elseif ($type=='boolean') { |
|
29 | + $value= ($value?'true':'false'); |
|
30 | + } elseif ($type=='object') |
|
28 | 31 | { |
29 | 32 | $props= get_class_vars(get_class($value)); |
30 | 33 | $dumper .= '('.count($props).') <u>'.get_class($value).'</u>'; |
@@ -34,8 +37,7 @@ discard block |
||
34 | 37 | $dumper .= dump($value->$key,"",$level+1); |
35 | 38 | } |
36 | 39 | $value= ''; |
37 | - } |
|
38 | - elseif ($type=='array') |
|
40 | + } elseif ($type=='array') |
|
39 | 41 | { |
40 | 42 | $dumper .= '('.count($value).')'; |
41 | 43 | foreach($value as $key=>$val) |
@@ -46,22 +48,21 @@ discard block |
||
46 | 48 | $value= ''; |
47 | 49 | } |
48 | 50 | $dumper .= " <b>$value</b>"; |
49 | - if ($level==0) $dumper .= '</pre>'; |
|
51 | + if ($level==0) { |
|
52 | + $dumper .= '</pre>'; |
|
53 | + } |
|
50 | 54 | return $dumper; |
51 | 55 | } |
52 | 56 | |
53 | -function pdump($value, $varname = '') |
|
54 | -{ |
|
57 | +function pdump($value, $varname = '') { |
|
55 | 58 | print('<span style="text-align: left">' . dump($value, $varname) . '</span>'); |
56 | 59 | } |
57 | 60 | |
58 | -function debug($value, $varname = '') |
|
59 | -{ |
|
61 | +function debug($value, $varname = '') { |
|
60 | 62 | return pdump($value, $varname); |
61 | 63 | } |
62 | 64 | |
63 | -function buf_print($string) |
|
64 | -{ |
|
65 | +function buf_print($string) { |
|
65 | 66 | global $output_buffer; |
66 | 67 | |
67 | 68 | $output_buffer .= $string; |
@@ -70,8 +71,7 @@ discard block |
||
70 | 71 | if(substr(getcwd(), -4) != 'docs') |
71 | 72 | { |
72 | 73 | $path_prefix = 'docs/'; |
73 | -} |
|
74 | -else |
|
74 | +} else |
|
75 | 75 | { |
76 | 76 | $path_prefix = ''; |
77 | 77 | } |
@@ -119,8 +119,7 @@ discard block |
||
119 | 119 | $buffer['name'] = $chapter[0]; |
120 | 120 | } |
121 | 121 | $prev_chapter_is_header = true; |
122 | - } |
|
123 | - else |
|
122 | + } else |
|
124 | 123 | { |
125 | 124 | $prev_chapter_is_header = false; |
126 | 125 | foreach($chapter as &$note) |
@@ -150,8 +149,7 @@ discard block |
||
150 | 149 | if(!isset($note_out['name'])) |
151 | 150 | { |
152 | 151 | $note_out['name'] = $buf_str; |
153 | - } |
|
154 | - else |
|
152 | + } else |
|
155 | 153 | { |
156 | 154 | $note_out['lines'][] = $buf_str; |
157 | 155 | } |
@@ -228,36 +226,31 @@ discard block |
||
228 | 226 | if($matches[2]) |
229 | 227 | { |
230 | 228 | buf_print("<ol>\r\n"); |
231 | - } |
|
232 | - else |
|
229 | + } else |
|
233 | 230 | { |
234 | 231 | buf_print("<ul>\r\n"); |
235 | 232 | } |
236 | 233 | buf_print('<li>'); |
237 | 234 | $last_spaces = $matches[1]; |
238 | 235 | $depth[] = $matches[2]; |
239 | - } |
|
240 | - elseif(strlen($matches[1]) < strlen($last_spaces) && count($depth)) |
|
236 | + } elseif(strlen($matches[1]) < strlen($last_spaces) && count($depth)) |
|
241 | 237 | { |
242 | 238 | if(array_pop($depth)) |
243 | 239 | { |
244 | 240 | buf_print("</ol>\r\n"); |
245 | - } |
|
246 | - else |
|
241 | + } else |
|
247 | 242 | { |
248 | 243 | buf_print("</ul>\r\n"); |
249 | 244 | } |
250 | 245 | $last_spaces = $matches[1]; |
251 | 246 | buf_print('<li>'); |
252 | - } |
|
253 | - elseif(strlen($last_spaces) == strlen($matches[1])) |
|
247 | + } elseif(strlen($last_spaces) == strlen($matches[1])) |
|
254 | 248 | { |
255 | 249 | if($matches[2] == '' && $depth[count($depth) - 1] != '') |
256 | 250 | { |
257 | 251 | buf_print("</ol>\r\n"); |
258 | 252 | buf_print("<ul>\r\n"); |
259 | - } |
|
260 | - elseif($matches[2] != '' && $depth[count($depth) - 1] == '') |
|
253 | + } elseif($matches[2] != '' && $depth[count($depth) - 1] == '') |
|
261 | 254 | { |
262 | 255 | buf_print("</ul>\r\n"); |
263 | 256 | buf_print("<ol>\r\n"); |
@@ -274,8 +267,7 @@ discard block |
||
274 | 267 | if(array_pop($depth)) |
275 | 268 | { |
276 | 269 | buf_print("</ol>\r\n"); |
277 | - } |
|
278 | - else |
|
270 | + } else |
|
279 | 271 | { |
280 | 272 | buf_print("</ul>\r\n"); |
281 | 273 | } |
@@ -8,8 +8,7 @@ |
||
8 | 8 | |
9 | 9 | classSupernova::$sn_mvc['view']['techtree'][] = 'sn_techtree_view'; |
10 | 10 | |
11 | -function sn_techtree_view($template = null) |
|
12 | -{ |
|
11 | +function sn_techtree_view($template = null) { |
|
13 | 12 | global $user, $planetrow; |
14 | 13 | |
15 | 14 | $tech_tree = array(); |
@@ -2,8 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | // Эти функции будут переписаны по добавлению инфы в БД |
4 | 4 | |
5 | -function pname_factory_production_field_name($factory_unit_id) |
|
6 | -{ |
|
5 | +function pname_factory_production_field_name($factory_unit_id) { |
|
7 | 6 | return get_unit_param($factory_unit_id, P_NAME) . '_porcent'; |
8 | 7 | } |
9 | 8 | |
@@ -14,7 +13,6 @@ discard block |
||
14 | 13 | * |
15 | 14 | * @return mixed |
16 | 15 | */ |
17 | -function pname_resource_name($resource_id) |
|
18 | -{ |
|
16 | +function pname_resource_name($resource_id) { |
|
19 | 17 | return get_unit_param($resource_id, P_NAME); |
20 | 18 | } |
21 | 19 | \ No newline at end of file |
@@ -1,7 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -function sn_ube_combat_helper_round_header($round) |
|
4 | -{ |
|
3 | +function sn_ube_combat_helper_round_header($round) { |
|
5 | 4 | $header = array( |
6 | 5 | 'ИД1', |
7 | 6 | 'ИД2', |
@@ -40,13 +39,11 @@ discard block |
||
40 | 39 | print('</tr>'); |
41 | 40 | } |
42 | 41 | |
43 | -function sn_ube_combat_helper_round_footer($round = 0) |
|
44 | -{ |
|
42 | +function sn_ube_combat_helper_round_footer($round = 0) { |
|
45 | 43 | print('</table>'); |
46 | 44 | } |
47 | 45 | |
48 | -function sn_ube_combat_helper_round_row(&$unit_crossfire_result) |
|
49 | -{ |
|
46 | +function sn_ube_combat_helper_round_row(&$unit_crossfire_result) { |
|
50 | 47 | $SN = array( |
51 | 48 | SHIP_CARGO_SMALL => 'МаТр', SHIP_CARGO_BIG => 'БоТр', SHIP_CARGO_SUPER => 'СуТр', SHIP_CARGO_HYPER => 'ГпТр', |
52 | 49 | SHIP_SATTELITE_SOLAR => 'СоСп', |
@@ -1,7 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -function sn_ube_simulator_encode_replay($combat, $type) |
|
4 | -{ |
|
3 | +function sn_ube_simulator_encode_replay($combat, $type) { |
|
5 | 4 | $strPacked = "{$type}!"; |
6 | 5 | |
7 | 6 | foreach($combat as $fleetID => $fleetCompress) |
@@ -17,8 +16,7 @@ discard block |
||
17 | 16 | return $strPacked; |
18 | 17 | } |
19 | 18 | |
20 | -function sn_ube_simulator_decode_replay($str_data) |
|
21 | -{ |
|
19 | +function sn_ube_simulator_decode_replay($str_data) { |
|
22 | 20 | $fleet_id = 0; |
23 | 21 | |
24 | 22 | $arr_data_unpacked = explode('!', $str_data); |
@@ -125,8 +125,7 @@ |
||
125 | 125 | return tplParseFleetObject($objFleet, ++$fleet_number, $user_data); |
126 | 126 | } |
127 | 127 | |
128 | -function int_planet_pretemplate($planetrow, &$template) |
|
129 | -{ |
|
128 | +function int_planet_pretemplate($planetrow, &$template) { |
|
130 | 129 | global $user; |
131 | 130 | |
132 | 131 | $governor_id = $planetrow['PLANET_GOVERNOR_ID']; |
@@ -131,7 +131,6 @@ |
||
131 | 131 | // return cht_message_parse($text, $escaped, $author_auth); |
132 | 132 | } |
133 | 133 | |
134 | -function sys_bbcodeUnParse($text, $escaped = false, $author_auth = 0) |
|
135 | -{ |
|
134 | +function sys_bbcodeUnParse($text, $escaped = false, $author_auth = 0) { |
|
136 | 135 | return str_replace('<br />', $escaped ? '\r\n' : "\r\n", $text); |
137 | 136 | } |