Completed
Push — work-fleets ( a1656f...ab0e6c )
by SuperNova.WS
09:07 queued 03:10
created
stat.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -50,52 +50,52 @@
 block discarded – undo
50 50
 stat_tpl_assign($template, $who, 'subject', $subject_list, $sn_group_stat_common);
51 51
 
52 52
 $stat_types = array(
53
-   STAT_TOTAL => array(
54
-     'type' => 'total',
55
-   ),
53
+    STAT_TOTAL => array(
54
+      'type' => 'total',
55
+    ),
56 56
 
57
-   STAT_FLEET => array(
58
-     'type' => 'fleet',
59
-   ),
57
+    STAT_FLEET => array(
58
+      'type' => 'fleet',
59
+    ),
60 60
 
61
-   STAT_TECH => array(
62
-     'type' => 'tech',
63
-   ),
61
+    STAT_TECH => array(
62
+      'type' => 'tech',
63
+    ),
64 64
 
65
-   STAT_BUILDING => array(
66
-     'type' => 'build',
67
-   ),
65
+    STAT_BUILDING => array(
66
+      'type' => 'build',
67
+    ),
68 68
 
69
-   STAT_DEFENSE => array(
70
-     'type' => 'defs',
71
-   ),
69
+    STAT_DEFENSE => array(
70
+      'type' => 'defs',
71
+    ),
72 72
 
73
-   STAT_RESOURCE => array(
74
-     'type' => 'res',
75
-   ),
73
+    STAT_RESOURCE => array(
74
+      'type' => 'res',
75
+    ),
76 76
 
77
-   STAT_RAID_TOTAL => array(
78
-     'type' => 'raids',
79
-   ),
77
+    STAT_RAID_TOTAL => array(
78
+      'type' => 'raids',
79
+    ),
80 80
 
81
-   STAT_RAID_WON => array(
82
-     'type' => 'raidswin',
83
-   ),
81
+    STAT_RAID_WON => array(
82
+      'type' => 'raidswin',
83
+    ),
84 84
 
85
-   STAT_RAID_LOST => array(
86
-     'type' => 'raidsloose',
87
-   ),
85
+    STAT_RAID_LOST => array(
86
+      'type' => 'raidsloose',
87
+    ),
88 88
 
89 89
   STAT_LVL_BUILDING => array(
90
-     'type' => 'lvl_minier',
90
+      'type' => 'lvl_minier',
91 91
   ),
92 92
 
93 93
   STAT_LVL_TECH => array(
94
-     'type' => 'player_rpg_tech_level',
94
+      'type' => 'player_rpg_tech_level',
95 95
   ),
96 96
 
97 97
   STAT_LVL_RAID => array(
98
-     'type' => 'lvl_raid',
98
+      'type' => 'lvl_raid',
99 99
   ),
100 100
 );
101 101
 stat_tpl_assign($template, $type, 'type', $stat_types, $sn_group_stat_common);
Please login to merge, or discard this patch.
classes/template_compile.php 1 patch
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -44,17 +44,17 @@  discard block
 block discarded – undo
44 44
   var $block_else_level = array();
45 45
 
46 46
   /**
47
-  * constuctor
48
-  */
47
+   * constuctor
48
+   */
49 49
   function template_compile(&$template)
50 50
   {
51 51
     $this->template = &$template;
52 52
   }
53 53
 
54 54
   /**
55
-  * Load template source from file
56
-  * @access private
57
-  */
55
+   * Load template source from file
56
+   * @access private
57
+   */
58 58
   function _tpl_load_file($handle, $store_in_db = false)
59 59
   {
60 60
     // Try and open template for read
@@ -97,10 +97,10 @@  discard block
 block discarded – undo
97 97
   }
98 98
 
99 99
   /**
100
-  * Remove any PHP tags that do not belong, these regular expressions are derived from
101
-  * the ones that exist in zend_language_scanner.l
102
-  * @access private
103
-  */
100
+   * Remove any PHP tags that do not belong, these regular expressions are derived from
101
+   * the ones that exist in zend_language_scanner.l
102
+   * @access private
103
+   */
104 104
   function remove_php_tags(&$code)
105 105
   {
106 106
     // This matches the information gathered from the internal PHP lexer
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
   }
115 115
 
116 116
   /**
117
-  * The all seeing all doing compile method. Parts are inspired by or directly from Smarty
118
-  * @access private
119
-  */
117
+   * The all seeing all doing compile method. Parts are inspired by or directly from Smarty
118
+   * @access private
119
+   */
120 120
   function compile($code, $no_echo = false, $echo_var = '')
121 121
   {
122 122
     if ($echo_var)
@@ -285,9 +285,9 @@  discard block
 block discarded – undo
285 285
   }
286 286
 
287 287
   /**
288
-  * Compile variables
289
-  * @access private
290
-  */
288
+   * Compile variables
289
+   * @access private
290
+   */
291 291
   function compile_var_tags(&$text_blocks)
292 292
   {
293 293
     // change template varrefs into PHP varrefs
@@ -347,9 +347,9 @@  discard block
 block discarded – undo
347 347
   }
348 348
 
349 349
   /**
350
-  * Compile blocks
351
-  * @access private
352
-  */
350
+   * Compile blocks
351
+   * @access private
352
+   */
353 353
   function compile_tag_block($tag_args)
354 354
   {
355 355
     $no_nesting = false;
@@ -435,14 +435,14 @@  discard block
 block discarded – undo
435 435
     $tag_template_php .= 'if ($_' . $tag_args . '_count) {';
436 436
 
437 437
     /**
438
-    * The following uses foreach for iteration instead of a for loop, foreach is faster but requires PHP to make a copy of the contents of the array which uses more memory
439
-    * <code>
440
-    * if (!$offset)
441
-    * {
442
-    *   $tag_template_php .= 'foreach (' . $varref . ' as $_' . $tag_args . '_i => $_' . $tag_args . '_val){';
443
-    * }
444
-    * </code>
445
-    */
438
+     * The following uses foreach for iteration instead of a for loop, foreach is faster but requires PHP to make a copy of the contents of the array which uses more memory
439
+     * <code>
440
+     * if (!$offset)
441
+     * {
442
+     *   $tag_template_php .= 'foreach (' . $varref . ' as $_' . $tag_args . '_i => $_' . $tag_args . '_val){';
443
+     * }
444
+     * </code>
445
+     */
446 446
 
447 447
     $tag_template_php .= 'for ($_' . $tag_args . '_i = ' . $loop_start . '; $_' . $tag_args . '_i < ' . $loop_end . '; ++$_' . $tag_args . '_i){';
448 448
 //    $tag_template_php .= '$this->_block_counter["'. $tag_args . '"] = $_' . $tag_args . '_i;';
@@ -453,10 +453,10 @@  discard block
 block discarded – undo
453 453
   }
454 454
 
455 455
   /**
456
-  * Compile IF tags - much of this is from Smarty with
457
-  * some adaptions for our block level methods
458
-  * @access private
459
-  */
456
+   * Compile IF tags - much of this is from Smarty with
457
+   * some adaptions for our block level methods
458
+   * @access private
459
+   */
460 460
   function compile_tag_if($tag_args, $elseif)
461 461
   {
462 462
     // Tokenize args for 'if' tag.
@@ -611,9 +611,9 @@  discard block
 block discarded – undo
611 611
   }
612 612
 
613 613
   /**
614
-  * Compile DEFINE tags
615
-  * @access private
616
-  */
614
+   * Compile DEFINE tags
615
+   * @access private
616
+   */
617 617
   function compile_tag_define($tag_args, $op)
618 618
   {
619 619
     preg_match('#^((?:[a-z0-9\-_]+\.)+)?\$(?=[A-Z])([A-Z0-9_\-]*)(?: = (\'?)([^\']*)(\'?))?$#', $tag_args, $match);
@@ -664,9 +664,9 @@  discard block
 block discarded – undo
664 664
   }
665 665
 
666 666
   /**
667
-  * Compile INCLUDE tag
668
-  * @access private
669
-  */
667
+   * Compile INCLUDE tag
668
+   * @access private
669
+   */
670 670
   function compile_tag_include($tag_args)
671 671
   {
672 672
     // Process dynamic includes
@@ -679,19 +679,19 @@  discard block
 block discarded – undo
679 679
   }
680 680
 
681 681
   /**
682
-  * Compile INCLUDE_PHP tag
683
-  * @access private
684
-  */
682
+   * Compile INCLUDE_PHP tag
683
+   * @access private
684
+   */
685 685
   function compile_tag_include_php($tag_args)
686 686
   {
687 687
     return "\$this->_php_include('$tag_args');";
688 688
   }
689 689
 
690 690
   /**
691
-  * parse expression
692
-  * This is from Smarty
693
-  * @access private
694
-  */
691
+   * parse expression
692
+   * This is from Smarty
693
+   * @access private
694
+   */
695 695
   function _parse_is_expr($is_arg, $tokens)
696 696
   {
697 697
     $expr_end = 0;
@@ -756,13 +756,13 @@  discard block
 block discarded – undo
756 756
   }
757 757
 
758 758
   /**
759
-  * Generates a reference to the given variable inside the given (possibly nested)
760
-  * block namespace. This is a string of the form:
761
-  * ' . $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['varname'] . '
762
-  * It's ready to be inserted into an "echo" line in one of the templates.
763
-  * NOTE: expects a trailing "." on the namespace.
764
-  * @access private
765
-  */
759
+   * Generates a reference to the given variable inside the given (possibly nested)
760
+   * block namespace. This is a string of the form:
761
+   * ' . $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['varname'] . '
762
+   * It's ready to be inserted into an "echo" line in one of the templates.
763
+   * NOTE: expects a trailing "." on the namespace.
764
+   * @access private
765
+   */
766 766
   function generate_block_varref($namespace, $varname, $echo = true, $defop = false)
767 767
   {
768 768
     // Strip the trailing period.
@@ -780,14 +780,14 @@  discard block
 block discarded – undo
780 780
   }
781 781
 
782 782
   /**
783
-  * Generates a reference to the array of data values for the given
784
-  * (possibly nested) block namespace. This is a string of the form:
785
-  * $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN']
786
-  *
787
-  * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above.
788
-  * NOTE: does not expect a trailing "." on the blockname.
789
-  * @access private
790
-  */
783
+   * Generates a reference to the array of data values for the given
784
+   * (possibly nested) block namespace. This is a string of the form:
785
+   * $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN']
786
+   *
787
+   * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above.
788
+   * NOTE: does not expect a trailing "." on the blockname.
789
+   * @access private
790
+   */
791 791
   function generate_block_data_ref($blockname, $include_last_iterator, $defop = false)
792 792
   {
793 793
     // Get an array of the blocks involved.
@@ -823,9 +823,9 @@  discard block
 block discarded – undo
823 823
   }
824 824
 
825 825
   /**
826
-  * Write compiled file to cache directory
827
-  * @access private
828
-  */
826
+   * Write compiled file to cache directory
827
+   * @access private
828
+   */
829 829
   function compile_write($handle, $data)
830 830
   {
831 831
     $filename = $this->template->cachepath . str_replace('/', '.', $this->template->filename[$handle]) . DOT_PHP_EX;
@@ -848,8 +848,8 @@  discard block
 block discarded – undo
848 848
 
849 849
   // Gorlum's minifier BOF
850 850
   /**
851
-  * Minifies template w/i PHP code by removing extra spaces
852
-  */
851
+   * Minifies template w/i PHP code by removing extra spaces
852
+   */
853 853
   private function minify($html)
854 854
   {
855 855
     if(!classSupernova::$config->tpl_minifier)
Please login to merge, or discard this patch.
classes/template.php 1 patch
Indentation   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -25,11 +25,11 @@  discard block
 block discarded – undo
25 25
 class template
26 26
 {
27 27
   /** variable that holds all the data we'll be substituting into
28
-  * the compiled templates. Takes form:
29
-  * --> $this->_tpldata[block][iteration#][child][iteration#][child2][iteration#][variablename] == value
30
-  * if it's a root-level variable, it'll be like this:
31
-  * --> $this->_tpldata[.][0][varname] == value
32
-  */
28
+   * the compiled templates. Takes form:
29
+   * --> $this->_tpldata[block][iteration#][child][iteration#][child2][iteration#][variablename] == value
30
+   * if it's a root-level variable, it'll be like this:
31
+   * --> $this->_tpldata[.][0][varname] == value
32
+   */
33 33
   var $_tpldata = array('.' => array(0 => array()));
34 34
   var $_rootref;
35 35
 //  var $_block_counter = array();
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
   var $parsed = false;
61 61
 
62 62
   /**
63
-  * Set template location
64
-  * @access public
65
-  */
63
+   * Set template location
64
+   * @access public
65
+   */
66 66
   function set_template()
67 67
   {
68 68
     global $phpbb_root_path, $user;
@@ -101,9 +101,9 @@  discard block
 block discarded – undo
101 101
   }
102 102
 
103 103
   /**
104
-  * Set custom template location (able to use directory outside of phpBB)
105
-  * @access public
106
-  */
104
+   * Set custom template location (able to use directory outside of phpBB)
105
+   * @access public
106
+   */
107 107
   function set_custom_template($template_path, $template_name, $fallback_template_path = false)
108 108
   {
109 109
     global $phpbb_root_path, $user;
@@ -142,10 +142,10 @@  discard block
 block discarded – undo
142 142
   }
143 143
 
144 144
   /**
145
-  * Sets the template filenames for handles. $filename_array
146
-  * should be a hash of handle => filename pairs.
147
-  * @access public
148
-  */
145
+   * Sets the template filenames for handles. $filename_array
146
+   * should be a hash of handle => filename pairs.
147
+   * @access public
148
+   */
149 149
   function set_filenames($filename_array)
150 150
   {
151 151
     if (!is_array($filename_array))
@@ -172,9 +172,9 @@  discard block
 block discarded – undo
172 172
   }
173 173
 
174 174
   /**
175
-  * Destroy template data set
176
-  * @access public
177
-  */
175
+   * Destroy template data set
176
+   * @access public
177
+   */
178 178
   function destroy()
179 179
   {
180 180
     $this->_tpldata = array('.' => array(0 => array()));
@@ -182,9 +182,9 @@  discard block
 block discarded – undo
182 182
   }
183 183
 
184 184
   /**
185
-  * Reset/empty complete block
186
-  * @access public
187
-  */
185
+   * Reset/empty complete block
186
+   * @access public
187
+   */
188 188
   function destroy_block_vars($blockname)
189 189
   {
190 190
     if (strpos($blockname, '.') !== false)
@@ -212,9 +212,9 @@  discard block
 block discarded – undo
212 212
   }
213 213
 
214 214
   /**
215
-  * Display handle
216
-  * @access public
217
-  */
215
+   * Display handle
216
+   * @access public
217
+   */
218 218
   function display($handle, $include_once = true)
219 219
   {
220 220
     global $user, $phpbb_hook, $lang, $config;
@@ -248,9 +248,9 @@  discard block
 block discarded – undo
248 248
   }
249 249
 
250 250
   /**
251
-  * Display the handle and assign the output to a template variable or return the compiled result.
252
-  * @access public
253
-  */
251
+   * Display the handle and assign the output to a template variable or return the compiled result.
252
+   * @access public
253
+   */
254 254
   function assign_display($handle, $template_var = '', $return_content = true, $include_once = false)
255 255
   {
256 256
     ob_start();
@@ -268,9 +268,9 @@  discard block
 block discarded – undo
268 268
   }
269 269
 
270 270
   /**
271
-  * Load a compiled template if possible, if not, recompile it
272
-  * @access private
273
-  */
271
+   * Load a compiled template if possible, if not, recompile it
272
+   * @access private
273
+   */
274 274
   function _tpl_load(&$handle)
275 275
   {
276 276
     global $user, $config;
@@ -453,9 +453,9 @@  discard block
 block discarded – undo
453 453
   }
454 454
 
455 455
   /**
456
-  * Assign key variable pairs from an array
457
-  * @access public
458
-  */
456
+   * Assign key variable pairs from an array
457
+   * @access public
458
+   */
459 459
   function assign_vars($vararray)
460 460
   {
461 461
     foreach ($vararray as $key => $val)
@@ -467,9 +467,9 @@  discard block
 block discarded – undo
467 467
   }
468 468
 
469 469
   /**
470
-  * Assign a single variable to a single key
471
-  * @access public
472
-  */
470
+   * Assign a single variable to a single key
471
+   * @access public
472
+   */
473 473
   function assign_var($varname, $varval)
474 474
   {
475 475
     $this->_rootref[$varname] = $varval;
@@ -478,9 +478,9 @@  discard block
 block discarded – undo
478 478
   }
479 479
 
480 480
   /**
481
-  * Assign key variable pairs from an array to a specified block
482
-  * @access public
483
-  */
481
+   * Assign key variable pairs from an array to a specified block
482
+   * @access public
483
+   */
484 484
   function assign_block_vars($blockname, $vararray)
485 485
   {
486 486
     if (strpos($blockname, '.') !== false)
@@ -545,33 +545,33 @@  discard block
 block discarded – undo
545 545
   }
546 546
 
547 547
   /**
548
-  * Change already assigned key variable pair (one-dimensional - single loop entry)
549
-  *
550
-  * An example of how to use this function:
551
-  * {@example alter_block_array.php}
552
-  *
553
-  * @param  string  $blockname  the blockname, for example 'loop'
554
-  * @param  array $vararray the var array to insert/add or merge
555
-  * @param  mixed $key    Key to search for
556
-  *
557
-  * array: KEY => VALUE [the key/value pair to search for within the loop to determine the correct position]
558
-  *
559
-  * int: Position [the position to change or insert at directly given]
560
-  *
561
-  * If key is false the position is set to 0
562
-  * If key is true the position is set to the last entry
563
-  *
564
-  * @param  string  $mode   Mode to execute (valid modes are 'insert' and 'change')
565
-  *
566
-  * If insert, the vararray is inserted at the given position (position counting from zero).
567
-  * If change, the current block gets merged with the vararray (resulting in new key/value pairs be added and existing keys be replaced by the new value).
568
-  *
569
-  * Since counting begins by zero, inserting at the last position will result in this array: array(vararray, last positioned array)
570
-  * and inserting at position 1 will result in this array: array(first positioned array, vararray, following vars)
571
-  *
572
-  * @return bool false on error, true on success
573
-  * @access public
574
-  */
548
+   * Change already assigned key variable pair (one-dimensional - single loop entry)
549
+   *
550
+   * An example of how to use this function:
551
+   * {@example alter_block_array.php}
552
+   *
553
+   * @param  string  $blockname  the blockname, for example 'loop'
554
+   * @param  array $vararray the var array to insert/add or merge
555
+   * @param  mixed $key    Key to search for
556
+   *
557
+   * array: KEY => VALUE [the key/value pair to search for within the loop to determine the correct position]
558
+   *
559
+   * int: Position [the position to change or insert at directly given]
560
+   *
561
+   * If key is false the position is set to 0
562
+   * If key is true the position is set to the last entry
563
+   *
564
+   * @param  string  $mode   Mode to execute (valid modes are 'insert' and 'change')
565
+   *
566
+   * If insert, the vararray is inserted at the given position (position counting from zero).
567
+   * If change, the current block gets merged with the vararray (resulting in new key/value pairs be added and existing keys be replaced by the new value).
568
+   *
569
+   * Since counting begins by zero, inserting at the last position will result in this array: array(vararray, last positioned array)
570
+   * and inserting at position 1 will result in this array: array(first positioned array, vararray, following vars)
571
+   *
572
+   * @return bool false on error, true on success
573
+   * @access public
574
+   */
575 575
   function alter_block_array($blockname, $vararray, $key = false, $mode = 'insert')
576 576
   {
577 577
     if (strpos($blockname, '.') !== false)
@@ -655,9 +655,9 @@  discard block
 block discarded – undo
655 655
   }
656 656
 
657 657
   /**
658
-  * Include a separate template
659
-  * @access private
660
-  */
658
+   * Include a separate template
659
+   * @access private
660
+   */
661 661
   function _tpl_include($filename, $include = true)
662 662
   {
663 663
     global $lang, $config;
@@ -686,9 +686,9 @@  discard block
 block discarded – undo
686 686
   }
687 687
 
688 688
   /**
689
-  * Include a php-file
690
-  * @access private
691
-  */
689
+   * Include a php-file
690
+   * @access private
691
+   */
692 692
   function _php_include($filename)
693 693
   {
694 694
     global $phpbb_root_path;
@@ -705,9 +705,9 @@  discard block
 block discarded – undo
705 705
   }
706 706
 
707 707
   /**
708
-  * Assign key variable pairs from an array with block support
709
-  * @access public
710
-  */
708
+   * Assign key variable pairs from an array with block support
709
+   * @access public
710
+   */
711 711
   function assign_recursive($values, $name = '')
712 712
   {
713 713
     if(isset($values['.']))
Please login to merge, or discard this patch.