@@ -29,14 +29,14 @@ discard block |
||
| 29 | 29 | 'planet' => $target_planet = sys_get_param_int('planet'), |
| 30 | 30 | ); |
| 31 | 31 | |
| 32 | -if(!uni_coordinates_valid($target_coord)) |
|
| 32 | +if (!uni_coordinates_valid($target_coord)) |
|
| 33 | 33 | { |
| 34 | 34 | die($lang['gs_c02']); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | $target_mission = sys_get_param_int('mission'); |
| 38 | 38 | $sn_group_missions = sn_get_groups('missions'); |
| 39 | -if(!isset($sn_group_missions[$target_mission]['AJAX']) || !$sn_group_missions[$target_mission]['AJAX']) |
|
| 39 | +if (!isset($sn_group_missions[$target_mission]['AJAX']) || !$sn_group_missions[$target_mission]['AJAX']) |
|
| 40 | 40 | { |
| 41 | 41 | die($lang['gs_c00']); |
| 42 | 42 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $target_coord['planet_type'] = $target_planet_check; |
| 53 | 53 | $target_row = DBStaticPlanet::db_planet_by_vector($target_coord); |
| 54 | 54 | |
| 55 | -if(empty($target_row)) |
|
| 55 | +if (empty($target_row)) |
|
| 56 | 56 | { |
| 57 | 57 | $target_row = array( |
| 58 | 58 | 'galaxy' => $target_coord['galaxy'], |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | $fleet_array = array(); |
| 67 | -switch($target_mission) |
|
| 67 | +switch ($target_mission) |
|
| 68 | 68 | { |
| 69 | 69 | case MT_SPY: |
| 70 | 70 | // $fleet_array[SHIP_SPY] = min(mrc_get_level($user, $planetrow, SHIP_SPY), abs($user['spio_anz'])); |
@@ -73,9 +73,9 @@ discard block |
||
| 73 | 73 | break; |
| 74 | 74 | |
| 75 | 75 | case MT_RECYCLE: |
| 76 | - foreach(sn_get_groups('flt_recyclers') as $unit_id) |
|
| 76 | + foreach (sn_get_groups('flt_recyclers') as $unit_id) |
|
| 77 | 77 | { |
| 78 | - if($unit_count = mrc_get_level($user, $planetrow, $unit_id)) |
|
| 78 | + if ($unit_count = mrc_get_level($user, $planetrow, $unit_id)) |
|
| 79 | 79 | { |
| 80 | 80 | $fleet_array[$unit_id] = $unit_count; |
| 81 | 81 | } |
@@ -96,14 +96,14 @@ discard block |
||
| 96 | 96 | $cant_attack = flt_can_attack($planetrow, $target_row, $fleet_array, $target_mission, $options); |
| 97 | 97 | |
| 98 | 98 | |
| 99 | -if($cant_attack != ATTACK_ALLOWED) |
|
| 99 | +if ($cant_attack != ATTACK_ALLOWED) |
|
| 100 | 100 | { |
| 101 | 101 | die($lang['fl_attack_error'][$cant_attack]); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | -$FleetDBArray = array(); |
|
| 104 | +$FleetDBArray = array(); |
|
| 105 | 105 | $db_changeset = array(); |
| 106 | -foreach($fleet_array as $unit_id => $unit_count) |
|
| 106 | +foreach ($fleet_array as $unit_id => $unit_count) |
|
| 107 | 107 | { |
| 108 | 108 | $FleetDBArray[] = "{$unit_id},{$unit_count}"; |
| 109 | 109 | $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($unit_id, -$unit_count, $user, $planetrow); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | $fleet_ship_count = array_sum($fleet_array); |
| 114 | 114 | |
| 115 | -if($target_mission == MT_MISSILE) |
|
| 115 | +if ($target_mission == MT_MISSILE) |
|
| 116 | 116 | { |
| 117 | 117 | $distance = abs($target_coord['system'] - $planetrow['system']); |
| 118 | 118 | $duration = round((30 + (60 * $distance)) / flt_server_flight_speed_multiplier()); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | { |
| 131 | 131 | $travel_data = flt_travel_data($user, $planetrow, $target_coord, $fleet_array, 10); |
| 132 | 132 | |
| 133 | - if($planetrow['deuterium'] < $travel_data['consumption']) |
|
| 133 | + if ($planetrow['deuterium'] < $travel_data['consumption']) |
|
| 134 | 134 | { |
| 135 | 135 | die($lang['gs_c13']); |
| 136 | 136 | } |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | $ships_sent = array(); |
| 190 | 190 | //$ships_sent_js = array(); |
| 191 | 191 | $ships_sent_js = 0; |
| 192 | -foreach($fleet_array as $unit_id => $unit_count) |
|
| 192 | +foreach ($fleet_array as $unit_id => $unit_count) |
|
| 193 | 193 | { |
| 194 | 194 | $ships_sent[] = "{$unit_count} {$lang['tech'][$unit_id]}"; |
| 195 | 195 | $ships_sent_js += mrc_get_level($user, $planetrow, $unit_id, false, true); |
@@ -198,6 +198,6 @@ discard block |
||
| 198 | 198 | //$ships_sent_js = implode(',', $ships_sent_js); |
| 199 | 199 | $ships_sent_js = "{$unit_group}={$ships_sent_js}"; |
| 200 | 200 | |
| 201 | -$ResultMessage = "{$lang['gs_sending']} {$ships_sent} {$lang['gs_to']} {$target_coord['galaxy']}:{$target_coord['system']}:{$target_coord['planet']}|{$ships_sent_js}"; |
|
| 201 | +$ResultMessage = "{$lang['gs_sending']} {$ships_sent} {$lang['gs_to']} {$target_coord['galaxy']}:{$target_coord['system']}:{$target_coord['planet']}|{$ships_sent_js}"; |
|
| 202 | 202 | |
| 203 | 203 | die($ResultMessage); |
@@ -5,14 +5,14 @@ |
||
| 5 | 5 | */ |
| 6 | 6 | global $template; |
| 7 | 7 | |
| 8 | -if(isset($sn_page_name) || ($sn_page_name = isset($_GET['page']) ? trim(strip_tags($_GET['page'])) : '')) { |
|
| 8 | +if (isset($sn_page_name) || ($sn_page_name = isset($_GET['page']) ? trim(strip_tags($_GET['page'])) : '')) { |
|
| 9 | 9 | require_once('common.' . substr(strrchr(__FILE__, '.'), 1)); |
| 10 | - if($sn_page_name) { |
|
| 10 | + if ($sn_page_name) { |
|
| 11 | 11 | // Loading page-specific language files |
| 12 | 12 | |
| 13 | 13 | !empty($sn_mvc['model'][$sn_page_name]) and execute_hooks($sn_mvc['model'][$sn_page_name], $template, 'model', $sn_page_name); |
| 14 | 14 | !empty($sn_mvc['view'][$sn_page_name]) and execute_hooks($sn_mvc['view'][$sn_page_name], $template, 'view', $sn_page_name); |
| 15 | - if(!empty($template_result) && is_object($template)) { |
|
| 15 | + if (!empty($template_result) && is_object($template)) { |
|
| 16 | 16 | $template->assign_recursive($template_result); |
| 17 | 17 | } |
| 18 | 18 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | define('IN_AJAX', true); |
| 23 | 23 | |
| 24 | - if(!is_object($template)) { |
|
| 24 | + if (!is_object($template)) { |
|
| 25 | 25 | $template = gettemplate('_ajax', true); |
| 26 | 26 | } |
| 27 | 27 | |
@@ -37,16 +37,16 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | $mode = sys_get_param_str('mode'); |
| 39 | 39 | |
| 40 | - if(class_exists($className = 'Pages\\Page' . ucfirst($mode))) { |
|
| 40 | + if (class_exists($className = 'Pages\\Page' . ucfirst($mode))) { |
|
| 41 | 41 | /** |
| 42 | 42 | * @var \Pages\IPage $page |
| 43 | 43 | */ |
| 44 | 44 | $page = new $className(); |
| 45 | - if(method_exists($page, 'loadParams')) { |
|
| 45 | + if (method_exists($page, 'loadParams')) { |
|
| 46 | 46 | $page->loadParams(); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - if(method_exists($page, $action = sys_get_param('action')) && $page->checkAction($action)) { |
|
| 49 | + if (method_exists($page, $action = sys_get_param('action')) && $page->checkAction($action)) { |
|
| 50 | 50 | $result = $page->$action(); |
| 51 | 51 | is_array($result) ? HelperArray::merge($template_result['AJAX'], $result) : false; |
| 52 | 52 | } |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | QUEST_STATUS_COMPLETE => '', |
| 32 | 32 | ); |
| 33 | 33 | |
| 34 | - if(!isset($statuses[$this->filterQuestStatus])) { |
|
| 34 | + if (!isset($statuses[$this->filterQuestStatus])) { |
|
| 35 | 35 | $this->filterQuestStatus = QUEST_STATUS_ALL; |
| 36 | 36 | } |
| 37 | 37 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - if(!isset($next)) { |
|
| 104 | + if (!isset($next)) { |
|
| 105 | 105 | $next = new TextEntity(); |
| 106 | 106 | } |
| 107 | 107 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $prev = $this->getById($currentText->prev); |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - if(!isset($prev)) { |
|
| 122 | + if (!isset($prev)) { |
|
| 123 | 123 | $prev = new TextEntity(); |
| 124 | 124 | } |
| 125 | 125 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | { |
| 87 | 87 | global $user; |
| 88 | 88 | |
| 89 | - if (file_exists($this->rootPhysical. 'styles/' . $user->theme['template_path'] . '/template')) |
|
| 89 | + if (file_exists($this->rootPhysical . 'styles/' . $user->theme['template_path'] . '/template')) |
|
| 90 | 90 | { |
| 91 | 91 | $this->root = $this->rootPhysical . 'styles/' . $user->theme['template_path'] . '/template'; |
| 92 | 92 | $this->cachepath = $this->rootPhysical . 'cache/tpl_' . str_replace('_', '-', $user->theme['template_path']) . '_'; |
@@ -645,7 +645,7 @@ discard block |
||
| 645 | 645 | // Re-position template blocks |
| 646 | 646 | for ($i = sizeof($this->_tpldata[$blockname]); $i > $key; $i--) |
| 647 | 647 | { |
| 648 | - $this->_tpldata[$blockname][$i] = $this->_tpldata[$blockname][$i-1]; |
|
| 648 | + $this->_tpldata[$blockname][$i] = $this->_tpldata[$blockname][$i - 1]; |
|
| 649 | 649 | $this->_tpldata[$blockname][$i]['S_ROW_COUNT'] = $i; |
| 650 | 650 | } |
| 651 | 651 | |
@@ -725,13 +725,13 @@ discard block |
||
| 725 | 725 | */ |
| 726 | 726 | function assign_recursive($values, $name = '') |
| 727 | 727 | { |
| 728 | - if(isset($values['.'])) |
|
| 728 | + if (isset($values['.'])) |
|
| 729 | 729 | { |
| 730 | 730 | $values_extra = $values['.']; |
| 731 | 731 | unset($values['.']); |
| 732 | 732 | } |
| 733 | 733 | |
| 734 | - if(!$name) |
|
| 734 | + if (!$name) |
|
| 735 | 735 | { |
| 736 | 736 | $this->assign_vars($values); |
| 737 | 737 | } |
@@ -740,12 +740,12 @@ discard block |
||
| 740 | 740 | $this->assign_block_vars($name, $values); |
| 741 | 741 | } |
| 742 | 742 | |
| 743 | - if(isset($values_extra)) |
|
| 743 | + if (isset($values_extra)) |
|
| 744 | 744 | { |
| 745 | - foreach($values_extra as $sub_array_name => $sub_array) |
|
| 745 | + foreach ($values_extra as $sub_array_name => $sub_array) |
|
| 746 | 746 | { |
| 747 | 747 | $new_name = $name . ($name ? '.' : '') . $sub_array_name; |
| 748 | - foreach($sub_array as $sub_element) |
|
| 748 | + foreach ($sub_array as $sub_element) |
|
| 749 | 749 | { |
| 750 | 750 | $this->assign_recursive($sub_element, $new_name); |
| 751 | 751 | } |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | * @return string |
| 339 | 339 | */ |
| 340 | 340 | protected function stringValue($value) { |
| 341 | - return "'" . $this->escape((string)$value) . "'"; |
|
| 341 | + return "'" . $this->escape((string) $value) . "'"; |
|
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | /** |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | * @return string |
| 350 | 350 | */ |
| 351 | 351 | public function quote($fieldName) { |
| 352 | - return "`" . $this->escape((string)$fieldName) . "`"; |
|
| 352 | + return "`" . $this->escape((string) $fieldName) . "`"; |
|
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | /** |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | * @return string |
| 397 | 397 | */ |
| 398 | 398 | protected function quoteTable($tableName) { |
| 399 | - return "`{{" . $this->escape((string)$tableName) . "}}`"; |
|
| 399 | + return "`{{" . $this->escape((string) $tableName) . "}}`"; |
|
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | /** |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | */ |
| 44 | 44 | public function toArray() { |
| 45 | 45 | $tutorial = array(); |
| 46 | - foreach($this->keys() as $key) { |
|
| 46 | + foreach ($this->keys() as $key) { |
|
| 47 | 47 | $tutorial[$key] = $this->$key; |
| 48 | 48 | } |
| 49 | 49 | |
@@ -7,9 +7,9 @@ |
||
| 7 | 7 | * |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -define('INSIDE' , true); |
|
| 11 | -define('INSTALL' , false); |
|
| 12 | -define('IN_ADMIN' , true); |
|
| 10 | +define('INSIDE', true); |
|
| 11 | +define('INSTALL', false); |
|
| 12 | +define('IN_ADMIN', true); |
|
| 13 | 13 | |
| 14 | 14 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
| 15 | 15 | |