Completed
Push — work-fleets ( 0fb536...3e8bfe )
by SuperNova.WS
06:08
created
includes/template.php 2 patches
Doc Comments   +7 added lines, -8 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
  * @param string    $title
37 37
  * @param string    $dest
38 38
  * @param int       $time
39
- * @param bool|true $show_header
39
+ * @param boolean $show_header
40 40
  */
41 41
 function message($mes, $title = 'Error', $dest = '', $time = 5, $show_header = true) {
42 42
   $template = gettemplate('message_body', true);
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
  * @param bool|true       $isDisplayTopNav
196 196
  * @param string          $metatags
197 197
  * @param bool|false      $AdminPage
198
- * @param bool|true       $isDisplayMenu
198
+ * @param boolean       $isDisplayMenu
199 199
  *
200 200
  * @return mixed
201 201
  */
@@ -208,7 +208,6 @@  discard block
 block discarded – undo
208 208
  * @param string          $title
209 209
  * @param bool|true       $isDisplayTopNav
210 210
  * @param string          $metatags
211
- * @param bool|false      $AdminPage
212 211
  * @param bool|true       $isDisplayMenu
213 212
  * @param bool|int|string $exitStatus - Код или сообщение выхода
214 213
  */
@@ -359,7 +358,7 @@  discard block
 block discarded – undo
359 358
 
360 359
 /**
361 360
  * @param $fileList
362
- * @param $extension
361
+ * @param string $extension
363 362
  * @param $sn_page_name
364 363
  * @param $template_result
365 364
  *
@@ -387,7 +386,7 @@  discard block
 block discarded – undo
387 386
 }
388 387
 
389 388
 /**
390
- * @return mixed|string
389
+ * @return string
391 390
  */
392 391
 function calculateFontSize() {
393 392
   $font_size = !empty($_COOKIE[SN_COOKIE_F]) ? $_COOKIE[SN_COOKIE_F] : classSupernova::$user_options[PLAYER_OPTION_BASE_FONT_SIZE];
@@ -406,10 +405,10 @@  discard block
 block discarded – undo
406 405
 
407 406
 /**
408 407
  * @param       $time
409
- * @param       $event
408
+ * @param       integer $event
410 409
  * @param       $msg
411 410
  * @param       $coordinates
412
- * @param       $is_decrease
411
+ * @param       boolean $is_decrease
413 412
  * @param Fleet $objFleet
414 413
  * @param       $fleet_flying_sorter
415 414
  * @param       $fleet_flying_events
@@ -733,7 +732,7 @@  discard block
 block discarded – undo
733 732
 }
734 733
 
735 734
 /**
736
- * @param array|string  $files
735
+ * @param string  $files
737 736
  * @param template|bool $template
738 737
  * @param string|bool   $template_path
739 738
  *
Please login to merge, or discard this patch.
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 function gettemplatename($u_dpath) {
13 13
   static $template_names = array();
14 14
 
15
-  if(!isset($template_names[$u_dpath])) {
15
+  if (!isset($template_names[$u_dpath])) {
16 16
     $template_names[$u_dpath] = file_exists(SN_ROOT_PHYSICAL . $u_dpath . 'tmpl.ini') ? sys_file_read(SN_ROOT_PHYSICAL . $u_dpath . 'tmpl.ini') : TEMPLATE_NAME;
17 17
   }
18 18
 
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
  * @param $sn_menu_extra
55 55
  */
56 56
 function tpl_menu_merge_extra(&$sn_menu, &$sn_menu_extra) {
57
-  if(empty($sn_menu) || empty($sn_menu_extra)) {
57
+  if (empty($sn_menu) || empty($sn_menu_extra)) {
58 58
     return;
59 59
   }
60 60
 
61
-  foreach($sn_menu_extra as $menu_item_id => $menu_item) {
62
-    if(empty($menu_item['LOCATION'])) {
61
+  foreach ($sn_menu_extra as $menu_item_id => $menu_item) {
62
+    if (empty($menu_item['LOCATION'])) {
63 63
       $sn_menu[$menu_item_id] = $menu_item;
64 64
       continue;
65 65
     }
@@ -68,16 +68,16 @@  discard block
 block discarded – undo
68 68
     unset($menu_item['LOCATION']);
69 69
 
70 70
     $is_positioned = $item_location[0];
71
-    if($is_positioned == '+' || $is_positioned == '-') {
71
+    if ($is_positioned == '+' || $is_positioned == '-') {
72 72
       $item_location = substr($item_location, 1);
73 73
     } else {
74 74
       $is_positioned = '';
75 75
     }
76 76
 
77
-    if($item_location) {
77
+    if ($item_location) {
78 78
       $menu_keys = array_keys($sn_menu);
79 79
       $insert_position = array_search($item_location, $menu_keys);
80
-      if($insert_position === false) {
80
+      if ($insert_position === false) {
81 81
         $insert_position = count($sn_menu) - 1;
82 82
         $is_positioned = '+';
83 83
         $item_location = '';
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     $spliced = array_splice($sn_menu, $insert_position, count($sn_menu) - $insert_position);
91 91
     $sn_menu[$menu_item_id] = $menu_item;
92 92
 
93
-    if(!$is_positioned && $item_location) {
93
+    if (!$is_positioned && $item_location) {
94 94
       unset($spliced[$item_location]);
95 95
     }
96 96
     $sn_menu = array_merge($sn_menu, $spliced);
@@ -104,24 +104,24 @@  discard block
 block discarded – undo
104 104
  * @param template $template
105 105
  */
106 106
 function tpl_menu_assign_to_template(&$sn_menu, &$template) {
107
-  if(empty($sn_menu) || !is_array($sn_menu)) {
107
+  if (empty($sn_menu) || !is_array($sn_menu)) {
108 108
     return;
109 109
   }
110 110
 
111
-  foreach($sn_menu as $menu_item_id => $menu_item) {
112
-    if(!$menu_item) {
111
+  foreach ($sn_menu as $menu_item_id => $menu_item) {
112
+    if (!$menu_item) {
113 113
       continue;
114 114
     }
115 115
 
116
-    if(is_string($menu_item_id)) {
116
+    if (is_string($menu_item_id)) {
117 117
       $menu_item['ID'] = $menu_item_id;
118 118
     }
119 119
 
120
-    if($menu_item['TYPE'] == 'lang') {
120
+    if ($menu_item['TYPE'] == 'lang') {
121 121
       $lang_string = &classLocale::$lang;
122
-      if(preg_match('#(\w+)(?:\[(\w+)\])?(?:\[(\w+)\])?(?:\[(\w+)\])?(?:\[(\w+)\])?#', $menu_item['ITEM'], $matches) && count($matches) > 1) {
123
-        for($i = 1; $i < count($matches); $i++) {
124
-          if(defined($matches[$i])) {
122
+      if (preg_match('#(\w+)(?:\[(\w+)\])?(?:\[(\w+)\])?(?:\[(\w+)\])?(?:\[(\w+)\])?#', $menu_item['ITEM'], $matches) && count($matches) > 1) {
123
+        for ($i = 1; $i < count($matches); $i++) {
124
+          if (defined($matches[$i])) {
125 125
             $matches[$i] = constant($matches[$i]);
126 126
           }
127 127
           $lang_string = &$lang_string[$matches[$i]];
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
     $menu_item['ALT'] = htmlentities($menu_item['ALT']);
134 134
     $menu_item['TITLE'] = htmlentities($menu_item['TITLE']);
135 135
 
136
-    if(!empty($menu_item['ICON'])) {
137
-      if(is_string($menu_item['ICON'])) {
136
+    if (!empty($menu_item['ICON'])) {
137
+      if (is_string($menu_item['ICON'])) {
138 138
         $menu_item['ICON_PATH'] = $menu_item['ICON'];
139 139
       } else {
140 140
         $menu_item['ICON'] = $menu_item_id;
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
     'MENU_START_HIDE'     => !empty($_COOKIE[SN_COOKIE . '_menu_hidden']) || defined('SN_GOOGLE'),
165 165
   ));
166 166
 
167
-  if(isset($template_result['MENU_CUSTOMIZE'])) {
167
+  if (isset($template_result['MENU_CUSTOMIZE'])) {
168 168
     $template->assign_vars(array(
169 169
       'PLAYER_OPTION_MENU_SHOW_ON_BUTTON'   => classSupernova::$user_options[PLAYER_OPTION_MENU_SHOW_ON_BUTTON],
170 170
       'PLAYER_OPTION_MENU_HIDE_ON_BUTTON'   => classSupernova::$user_options[PLAYER_OPTION_MENU_HIDE_ON_BUTTON],
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
     ));
179 179
   }
180 180
 
181
-  if(defined('IN_ADMIN') && IN_ADMIN === true && !empty($user['authlevel']) && $user['authlevel'] > 0) {
181
+  if (defined('IN_ADMIN') && IN_ADMIN === true && !empty($user['authlevel']) && $user['authlevel'] > 0) {
182 182
     tpl_menu_merge_extra($sn_menu_admin, $sn_menu_admin_extra);
183 183
     tpl_menu_assign_to_template($sn_menu_admin, $template);
184 184
   } else {
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
   $in_admin = defined('IN_ADMIN') && IN_ADMIN === true;
219 219
   $is_login = defined('LOGIN_LOGOUT') && LOGIN_LOGOUT === true;
220 220
 
221
-  if(is_object($page)) {
221
+  if (is_object($page)) {
222 222
     isset($page->_rootref['MENU']) ? $isDisplayMenu = $page->_rootref['MENU'] : false;
223 223
     isset($page->_rootref['NAVBAR']) ? $isDisplayTopNav = $page->_rootref['NAVBAR'] : false;
224 224
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
     !isset($page->_rootref['PAGE_HEADER']) && $title ? $page->assign_var('PAGE_HEADER', $title) : false;
227 227
   }
228 228
 
229
-  if(empty($user['id']) || !is_numeric($user['id'])) {
229
+  if (empty($user['id']) || !is_numeric($user['id'])) {
230 230
     $isDisplayMenu = false;
231 231
     $isDisplayTopNav = false;
232 232
   }
@@ -313,12 +313,12 @@  discard block
 block discarded – undo
313 313
   $template->assign_recursive($template_result);
314 314
   displayP(parsetemplate($template));
315 315
 
316
-  if(($isDisplayMenu || $in_admin) && !isset($_COOKIE['menu_disable'])) {
316
+  if (($isDisplayMenu || $in_admin) && !isset($_COOKIE['menu_disable'])) {
317 317
     // $AdminPage = $AdminPage ? $user['authlevel'] : 0;
318 318
     displayP(parsetemplate(tpl_render_menu()));
319 319
   }
320 320
 
321
-  if($isDisplayTopNav && !$in_admin) {
321
+  if ($isDisplayTopNav && !$in_admin) {
322 322
     displayP(parsetemplate(tpl_render_topnav($user, $planetrow)));
323 323
   }
324 324
 
@@ -326,8 +326,8 @@  discard block
 block discarded – undo
326 326
 
327 327
   !is_array($page) ? $page = array($page) : false;
328 328
   $result_added = false;
329
-  foreach($page as $page_item) {
330
-    if(!$result_added && is_object($page_item) && isset($page_item->_tpldata['result'])) {
329
+  foreach ($page as $page_item) {
330
+    if (!$result_added && is_object($page_item) && isset($page_item->_tpldata['result'])) {
331 331
       $page_item = gettemplate('_result_message', $page_item);
332 332
       $temp = $page_item->files['_result_message'];
333 333
       unset($page_item->files['_result_message']);
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
   ));
351 351
   displayP(parsetemplate($template));
352 352
 
353
-  $user['authlevel'] >= 3 && classSupernova::$config->debug ? classSupernova::$debug->echo_log() : false;;
353
+  $user['authlevel'] >= 3 && classSupernova::$config->debug ? classSupernova::$debug->echo_log() : false; ;
354 354
 
355 355
   classSupernova::$db->db_disconnect();
356 356
 
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
  * @param string         $type
436 436
  */
437 437
 function tpl_topnav_event_build(&$template, $FleetList, $type = 'fleet') {
438
-  if(empty($FleetList)) {
438
+  if (empty($FleetList)) {
439 439
     return;
440 440
   }
441 441
 
@@ -444,19 +444,19 @@  discard block
 block discarded – undo
444 444
   $fleet_event_count = 0;
445 445
   $fleet_flying_sorter = array();
446 446
   $fleet_flying_events = array();
447
-  foreach($FleetList->_container as $objFleet) {
447
+  foreach ($FleetList->_container as $objFleet) {
448 448
     $will_return = true;
449
-    if(!$objFleet->isReturning()) {
449
+    if (!$objFleet->isReturning()) {
450 450
       // cut fleets on Hold and Expedition
451
-      if($objFleet->time_arrive_to_target >= SN_TIME_NOW) {
451
+      if ($objFleet->time_arrive_to_target >= SN_TIME_NOW) {
452 452
         $objFleet->mission_type == MT_RELOCATE ? $will_return = false : false;
453 453
         tpl_topnav_event_build_helper($objFleet->time_arrive_to_target, EVENT_FLEET_ARRIVE, classLocale::$lang['sys_event_arrive'], $objFleet->target_coordinates_typed(), !$will_return, $objFleet, $fleet_flying_sorter, $fleet_flying_events, $fleet_event_count);
454 454
       }
455
-      if($objFleet->time_mission_job_complete) {
455
+      if ($objFleet->time_mission_job_complete) {
456 456
         tpl_topnav_event_build_helper($objFleet->time_mission_job_complete, EVENT_FLEET_STAY, classLocale::$lang['sys_event_stay'], $objFleet->target_coordinates_typed(), false, $objFleet, $fleet_flying_sorter, $fleet_flying_events, $fleet_event_count);
457 457
       }
458 458
     }
459
-    if($will_return) {
459
+    if ($will_return) {
460 460
       tpl_topnav_event_build_helper($objFleet->time_return_to_source, EVENT_FLEET_RETURN, classLocale::$lang['sys_event_return'], $objFleet->launch_coordinates_typed(), true, $objFleet, $fleet_flying_sorter, $fleet_flying_events, $fleet_event_count);
461 461
     }
462 462
   }
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
   asort($fleet_flying_sorter);
465 465
 
466 466
   $fleet_flying_count = $FleetList->count();
467
-  foreach($fleet_flying_sorter as $fleet_event_id => $fleet_time) {
467
+  foreach ($fleet_flying_sorter as $fleet_event_id => $fleet_time) {
468 468
     $fleet_event = &$fleet_flying_events[$fleet_event_id];
469 469
     $template->assign_block_vars("flying_{$type}s", array(
470 470
       'TIME' => max(0, $fleet_time - SN_TIME_NOW),
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
   global $template_result;
494 494
   $classLocale = classLocale::$lang;
495 495
 
496
-  if(!is_array($user)) {
496
+  if (!is_array($user)) {
497 497
     return '';
498 498
   }
499 499
 
@@ -514,8 +514,8 @@  discard block
 block discarded – undo
514 514
 
515 515
   $ThisUsersPlanets = DBStaticPlanet::db_planet_list_sorted($user);
516 516
   // while ($CurPlanet = db_fetch($ThisUsersPlanets))
517
-  foreach($ThisUsersPlanets as $CurPlanet) {
518
-    if($CurPlanet['destruyed']) {
517
+  foreach ($ThisUsersPlanets as $CurPlanet) {
518
+    if ($CurPlanet['destruyed']) {
519 519
       continue;
520 520
     }
521 521
 
@@ -539,8 +539,8 @@  discard block
 block discarded – undo
539 539
    */
540 540
   $fleet_flying_list = array();
541 541
   $fleet_flying_list[0] = FleetList::dbGetFleetListByOwnerId($user['id']);
542
-  foreach($fleet_flying_list[0]->_container as $fleet_id => $objFleet) {
543
-    if(empty($fleet_flying_list[$objFleet->mission_type])) {
542
+  foreach ($fleet_flying_list[0]->_container as $fleet_id => $objFleet) {
543
+    if (empty($fleet_flying_list[$objFleet->mission_type])) {
544 544
       $fleet_flying_list[$objFleet->mission_type] = new FleetList();
545 545
     }
546 546
     $fleet_flying_list[$objFleet->mission_type][$fleet_id] = $objFleet;
@@ -552,8 +552,8 @@  discard block
 block discarded – undo
552 552
   que_tpl_parse($template, QUE_RESEARCH, $user, array(), null, !classSupernova::$user_options[PLAYER_OPTION_NAVBAR_RESEARCH_WIDE]);
553 553
   que_tpl_parse($template, SUBQUE_FLEET, $user, $planetrow, null, true);
554 554
 
555
-  if(!empty(classSupernova::$sn_mvc['navbar_prefix_button']) && is_array(classSupernova::$sn_mvc['navbar_prefix_button'])) {
556
-    foreach(classSupernova::$sn_mvc['navbar_prefix_button'] as $navbar_button_image => $navbar_button_url) {
555
+  if (!empty(classSupernova::$sn_mvc['navbar_prefix_button']) && is_array(classSupernova::$sn_mvc['navbar_prefix_button'])) {
556
+    foreach (classSupernova::$sn_mvc['navbar_prefix_button'] as $navbar_button_image => $navbar_button_url) {
557 557
       $template->assign_block_vars('navbar_prefix_button', array(
558 558
         'IMAGE'        => $navbar_button_image,
559 559
         'URL_RELATIVE' => $navbar_button_url,
@@ -567,13 +567,13 @@  discard block
 block discarded – undo
567 567
   $time_now_parsed = getdate(SN_TIME_NOW);
568 568
   $time_local_parsed = getdate(defined('SN_CLIENT_TIME_LOCAL') ? SN_CLIENT_TIME_LOCAL : SN_TIME_NOW);
569 569
 
570
-  if(classSupernova::$config->game_news_overview) {
570
+  if (classSupernova::$config->game_news_overview) {
571 571
     $user_last_read_safe = intval($user['news_lastread']);
572 572
     nws_render($template, "WHERE UNIX_TIMESTAMP(`tsTimeStamp`) >= {$user_last_read_safe}", classSupernova::$config->game_news_overview);
573 573
   }
574 574
 
575 575
   $notes_query = DBStaticNote::db_note_list_by_owner($user['id'], true);
576
-  while($note_row = db_fetch($notes_query)) {
576
+  while ($note_row = db_fetch($notes_query)) {
577 577
     note_assign($template, $note_row);
578 578
   }
579 579
 
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
     'QUE_ID'   => QUE_RESEARCH,
588 588
     'QUE_HTML' => 'topnav',
589 589
 
590
-    'RESEARCH_ONGOING' => (boolean)$user['que'],
590
+    'RESEARCH_ONGOING' => (boolean) $user['que'],
591 591
 
592 592
     'TIME_TEXT'       => sprintf($str_date_format, $time_now_parsed['year'], classLocale::$lang['months'][$time_now_parsed['mon']], $time_now_parsed['mday'],
593 593
       $time_now_parsed['hours'], $time_now_parsed['minutes'], $time_now_parsed['seconds']
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
     'QUE_STRUCTURES' => QUE_STRUCTURES,
665 665
   ));
666 666
 
667
-  if((defined('SN_RENDER_NAVBAR_PLANET') && SN_RENDER_NAVBAR_PLANET === true) || ($user['option_list'][OPT_INTERFACE]['opt_int_navbar_resource_force'] && SN_RENDER_NAVBAR_PLANET !== false)) {
667
+  if ((defined('SN_RENDER_NAVBAR_PLANET') && SN_RENDER_NAVBAR_PLANET === true) || ($user['option_list'][OPT_INTERFACE]['opt_int_navbar_resource_force'] && SN_RENDER_NAVBAR_PLANET !== false)) {
668 668
     tpl_set_resource_info($template, $planetrow);
669 669
     $template->assign_vars(array(
670 670
       'SN_RENDER_NAVBAR_PLANET' => true,
@@ -679,12 +679,12 @@  discard block
 block discarded – undo
679 679
  * @param template|string $template
680 680
  */
681 681
 function displayP($template) {
682
-  if(is_object($template)) {
683
-    if(empty($template->parsed)) {
682
+  if (is_object($template)) {
683
+    if (empty($template->parsed)) {
684 684
       parsetemplate($template);
685 685
     }
686 686
 
687
-    foreach($template->files as $section => $filename) {
687
+    foreach ($template->files as $section => $filename) {
688 688
       $template->display($section);
689 689
     }
690 690
   } else {
@@ -699,11 +699,11 @@  discard block
 block discarded – undo
699 699
  * @return mixed
700 700
  */
701 701
 function parsetemplate($template, $array = false) {
702
-  if(is_object($template)) {
702
+  if (is_object($template)) {
703 703
     global $user;
704 704
 
705
-    if(!empty($array) && is_array($array)) {
706
-      foreach($array as $key => $data) {
705
+    if (!empty($array) && is_array($array)) {
706
+      foreach ($array as $key => $data) {
707 707
         $template->assign_var($key, $data);
708 708
       }
709 709
     }
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
 
745 745
   $template_ex = '.tpl.html';
746 746
 
747
-  if($template === false) {
747
+  if ($template === false) {
748 748
     return sys_file_read(TEMPLATE_DIR . '/' . $files . $template_ex);
749 749
   }
750 750
 
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
   !empty(classSupernova::$sn_mvc['i18n']['']) ? lng_load_i18n(classSupernova::$sn_mvc['i18n']['']) : false;
765 765
   $sn_page_name ? lng_load_i18n(classSupernova::$sn_mvc['i18n'][$sn_page_name]) : false;
766 766
 
767
-  foreach($files as &$filename) {
767
+  foreach ($files as &$filename) {
768 768
     $filename = $filename . $template_ex;
769 769
   }
770 770
 
@@ -789,13 +789,13 @@  discard block
 block discarded – undo
789 789
     'LANG'     => $language ? $language : '',
790 790
     'referral' => $id_ref ? '&id_ref=' . $id_ref : '',
791 791
 
792
-    'REQUEST_PARAMS' => !empty($url_params) ? '?' . implode('&', $url_params) : '',// "?lang={$language}" . ($id_ref ? "&id_ref={$id_ref}" : ''),
792
+    'REQUEST_PARAMS' => !empty($url_params) ? '?' . implode('&', $url_params) : '', // "?lang={$language}" . ($id_ref ? "&id_ref={$id_ref}" : ''),
793 793
     'FILENAME'       => basename($_SERVER['PHP_SELF']),
794 794
   ));
795 795
 
796
-  foreach(lng_get_list() as $lng_id => $lng_data) {
797
-    if(isset($lng_data['LANG_VARIANTS']) && is_array($lng_data['LANG_VARIANTS'])) {
798
-      foreach($lng_data['LANG_VARIANTS'] as $lang_variant) {
796
+  foreach (lng_get_list() as $lng_id => $lng_data) {
797
+    if (isset($lng_data['LANG_VARIANTS']) && is_array($lng_data['LANG_VARIANTS'])) {
798
+      foreach ($lng_data['LANG_VARIANTS'] as $lang_variant) {
799 799
         $lng_data1 = $lng_data;
800 800
         $lng_data1 = array_merge($lng_data1, $lang_variant);
801 801
         $template->assign_block_vars('language', $lng_data1);
@@ -818,8 +818,8 @@  discard block
 block discarded – undo
818 818
   $que = $que['ques'][$que_type][$planet['id_owner']][$planet['id']];
819 819
 
820 820
   $que_length = 0;
821
-  if(!empty($que)) {
822
-    foreach($que as $que_item) {
821
+  if (!empty($que)) {
822
+    foreach ($que as $que_item) {
823 823
       $template->assign_block_vars('que', que_tpl_parse_element($que_item));
824 824
     }
825 825
     $que_length = count($que);
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
  * @param int      $user_dark_matter
835 835
  */
836 836
 function tpl_planet_density_info(&$template, &$density_price_chart, $user_dark_matter) {
837
-  foreach($density_price_chart as $density_price_index => &$density_price_data) {
837
+  foreach ($density_price_chart as $density_price_index => &$density_price_data) {
838 838
     $density_cost = $density_price_data;
839 839
     $density_number_style = pretty_number($density_cost, true, $user_dark_matter, false, false);
840 840
 
@@ -858,7 +858,7 @@  discard block
 block discarded – undo
858 858
 function tpl_assign_select(&$template, $name, $values) {
859 859
   !is_array($values) ? $values = array($values => $values) : false;
860 860
 
861
-  foreach($values as $key => $value) {
861
+  foreach ($values as $key => $value) {
862 862
     $template->assign_block_vars($name, array(
863 863
       'KEY'   => htmlentities($key, ENT_COMPAT, 'UTF-8'),
864 864
       'VALUE' => htmlentities($value, ENT_COMPAT, 'UTF-8'),
Please login to merge, or discard this patch.