@@ -582,9 +582,9 @@ discard block |
||
| 582 | 582 | 2 => 0.01, |
| 583 | 583 | ), |
| 584 | 584 | P_MISSION_EXPEDITION_OUTCOME_SECONDARY => [ |
| 585 | - [P_CHANCE => 90, P_MULTIPLIER => 0.01, P_MESSAGE_ID => 2,], |
|
| 586 | - [P_CHANCE => 9, P_MULTIPLIER => 0.02, P_MESSAGE_ID => 1,], |
|
| 587 | - [P_CHANCE => 1, P_MULTIPLIER => 0.10, P_MESSAGE_ID => 0,], |
|
| 585 | + [P_CHANCE => 90, P_MULTIPLIER => 0.01, P_MESSAGE_ID => 2, ], |
|
| 586 | + [P_CHANCE => 9, P_MULTIPLIER => 0.02, P_MESSAGE_ID => 1, ], |
|
| 587 | + [P_CHANCE => 1, P_MULTIPLIER => 0.10, P_MESSAGE_ID => 0, ], |
|
| 588 | 588 | ], |
| 589 | 589 | ), |
| 590 | 590 | FLT_EXPEDITION_OUTCOME_FOUND_RESOURCES => array( |
@@ -596,9 +596,9 @@ discard block |
||
| 596 | 596 | 2 => 0.025, |
| 597 | 597 | ), |
| 598 | 598 | P_MISSION_EXPEDITION_OUTCOME_SECONDARY => [ |
| 599 | - [P_CHANCE => 90, P_MULTIPLIER => 0.025, P_MESSAGE_ID => 2,], |
|
| 600 | - [P_CHANCE => 9, P_MULTIPLIER => 0.050, P_MESSAGE_ID => 1,], |
|
| 601 | - [P_CHANCE => 1, P_MULTIPLIER => 0.100, P_MESSAGE_ID => 0,], |
|
| 599 | + [P_CHANCE => 90, P_MULTIPLIER => 0.025, P_MESSAGE_ID => 2, ], |
|
| 600 | + [P_CHANCE => 9, P_MULTIPLIER => 0.050, P_MESSAGE_ID => 1, ], |
|
| 601 | + [P_CHANCE => 1, P_MULTIPLIER => 0.100, P_MESSAGE_ID => 0, ], |
|
| 602 | 602 | ], |
| 603 | 603 | ), |
| 604 | 604 | FLT_EXPEDITION_OUTCOME_FOUND_DM => array( |
@@ -1265,7 +1265,7 @@ discard block |
||
| 1265 | 1265 | UNIT_PLANS => 'plans', |
| 1266 | 1266 | ], |
| 1267 | 1267 | |
| 1268 | - GROUP_CAPITAL_BUILDING_BONUS_GROUPS => ['structures', 'defense', 'fleet',], |
|
| 1268 | + GROUP_CAPITAL_BUILDING_BONUS_GROUPS => ['structures', 'defense', 'fleet', ], |
|
| 1269 | 1269 | |
| 1270 | 1270 | ), |
| 1271 | 1271 | ); |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | renderFooter(); |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | - $user['authlevel'] >= 3 && $config->debug ? $debug->echo_log() : false;; |
|
| 320 | + $user['authlevel'] >= 3 && $config->debug ? $debug->echo_log() : false; ; |
|
| 321 | 321 | |
| 322 | 322 | sn_db_disconnect(); |
| 323 | 323 | |
@@ -629,7 +629,7 @@ discard block |
||
| 629 | 629 | } |
| 630 | 630 | } |
| 631 | 631 | |
| 632 | -SN::$afterInit[] = function () { |
|
| 632 | +SN::$afterInit[] = function() { |
|
| 633 | 633 | SN::$gc->pimp->add()->tpl_render_topnav($t = 'sn_tpl_render_topnav', [], null); |
| 634 | 634 | }; |
| 635 | 635 | |
@@ -700,7 +700,7 @@ discard block |
||
| 700 | 700 | 'QUE_ID' => QUE_RESEARCH, |
| 701 | 701 | 'QUE_HTML' => 'topnav', |
| 702 | 702 | |
| 703 | - 'RESEARCH_ONGOING' => (boolean)$user['que'], |
|
| 703 | + 'RESEARCH_ONGOING' => (boolean) $user['que'], |
|
| 704 | 704 | |
| 705 | 705 | 'TIME_TEXT' => sprintf($str_date_format, $time_now_parsed['year'], $lang['months'][$time_now_parsed['mon']], $time_now_parsed['mday'], |
| 706 | 706 | $time_now_parsed['hours'], $time_now_parsed['minutes'], $time_now_parsed['seconds'] |
@@ -994,7 +994,7 @@ discard block |
||
| 994 | 994 | 'LANG' => $language ? $language : '', |
| 995 | 995 | 'referral' => $id_ref ? '&id_ref=' . $id_ref : '', |
| 996 | 996 | |
| 997 | - 'REQUEST_PARAMS' => !empty($url_params) ? '?' . implode('&', $url_params) : '',// "?lang={$language}" . ($id_ref ? "&id_ref={$id_ref}" : ''), |
|
| 997 | + 'REQUEST_PARAMS' => !empty($url_params) ? '?' . implode('&', $url_params) : '', // "?lang={$language}" . ($id_ref ? "&id_ref={$id_ref}" : ''), |
|
| 998 | 998 | 'FILENAME' => basename($_SERVER['PHP_SELF']), |
| 999 | 999 | )); |
| 1000 | 1000 | |
@@ -55,9 +55,9 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | - * Load template source from file |
|
| 59 | - * @access private |
|
| 60 | - */ |
|
| 58 | + * Load template source from file |
|
| 59 | + * @access private |
|
| 60 | + */ |
|
| 61 | 61 | function _tpl_load_file($handle, $store_in_db = false) |
| 62 | 62 | { |
| 63 | 63 | // Try and open template for read |
@@ -100,10 +100,10 @@ discard block |
||
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
| 103 | - * Remove any PHP tags that do not belong, these regular expressions are derived from |
|
| 104 | - * the ones that exist in zend_language_scanner.l |
|
| 105 | - * @access private |
|
| 106 | - */ |
|
| 103 | + * Remove any PHP tags that do not belong, these regular expressions are derived from |
|
| 104 | + * the ones that exist in zend_language_scanner.l |
|
| 105 | + * @access private |
|
| 106 | + */ |
|
| 107 | 107 | function remove_php_tags(&$code) |
| 108 | 108 | { |
| 109 | 109 | // This matches the information gathered from the internal PHP lexer |
@@ -117,9 +117,9 @@ discard block |
||
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
| 120 | - * The all seeing all doing compile method. Parts are inspired by or directly from Smarty |
|
| 121 | - * @access private |
|
| 122 | - */ |
|
| 120 | + * The all seeing all doing compile method. Parts are inspired by or directly from Smarty |
|
| 121 | + * @access private |
|
| 122 | + */ |
|
| 123 | 123 | function compile($code, $no_echo = false, $echo_var = '') |
| 124 | 124 | { |
| 125 | 125 | if ($echo_var) |
@@ -288,9 +288,9 @@ discard block |
||
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | /** |
| 291 | - * Compile variables |
|
| 292 | - * @access private |
|
| 293 | - */ |
|
| 291 | + * Compile variables |
|
| 292 | + * @access private |
|
| 293 | + */ |
|
| 294 | 294 | function compile_var_tags(&$text_blocks) |
| 295 | 295 | { |
| 296 | 296 | // including $lang variable |
@@ -363,9 +363,9 @@ discard block |
||
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | /** |
| 366 | - * Compile blocks |
|
| 367 | - * @access private |
|
| 368 | - */ |
|
| 366 | + * Compile blocks |
|
| 367 | + * @access private |
|
| 368 | + */ |
|
| 369 | 369 | function compile_tag_block($tag_args) |
| 370 | 370 | { |
| 371 | 371 | $no_nesting = false; |
@@ -451,14 +451,14 @@ discard block |
||
| 451 | 451 | $tag_template_php .= 'if ($_' . $tag_args . '_count) {'; |
| 452 | 452 | |
| 453 | 453 | /** |
| 454 | - * 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 |
|
| 455 | - * <code> |
|
| 456 | - * if (!$offset) |
|
| 457 | - * { |
|
| 458 | - * $tag_template_php .= 'foreach (' . $varref . ' as $_' . $tag_args . '_i => $_' . $tag_args . '_val){'; |
|
| 459 | - * } |
|
| 460 | - * </code> |
|
| 461 | - */ |
|
| 454 | + * 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 |
|
| 455 | + * <code> |
|
| 456 | + * if (!$offset) |
|
| 457 | + * { |
|
| 458 | + * $tag_template_php .= 'foreach (' . $varref . ' as $_' . $tag_args . '_i => $_' . $tag_args . '_val){'; |
|
| 459 | + * } |
|
| 460 | + * </code> |
|
| 461 | + */ |
|
| 462 | 462 | |
| 463 | 463 | $tag_template_php .= 'for ($_' . $tag_args . '_i = ' . $loop_start . '; $_' . $tag_args . '_i < ' . $loop_end . '; ++$_' . $tag_args . '_i){'; |
| 464 | 464 | // $tag_template_php .= '$this->_block_counter["'. $tag_args . '"] = $_' . $tag_args . '_i;'; |
@@ -469,10 +469,10 @@ discard block |
||
| 469 | 469 | } |
| 470 | 470 | |
| 471 | 471 | /** |
| 472 | - * Compile IF tags - much of this is from Smarty with |
|
| 473 | - * some adaptions for our block level methods |
|
| 474 | - * @access private |
|
| 475 | - */ |
|
| 472 | + * Compile IF tags - much of this is from Smarty with |
|
| 473 | + * some adaptions for our block level methods |
|
| 474 | + * @access private |
|
| 475 | + */ |
|
| 476 | 476 | function compile_tag_if($tag_args, $elseif) |
| 477 | 477 | { |
| 478 | 478 | // Tokenize args for 'if' tag. |
@@ -627,9 +627,9 @@ discard block |
||
| 627 | 627 | } |
| 628 | 628 | |
| 629 | 629 | /** |
| 630 | - * Compile DEFINE tags |
|
| 631 | - * @access private |
|
| 632 | - */ |
|
| 630 | + * Compile DEFINE tags |
|
| 631 | + * @access private |
|
| 632 | + */ |
|
| 633 | 633 | function compile_tag_define($tag_args, $op) |
| 634 | 634 | { |
| 635 | 635 | preg_match('#^((?:[a-z0-9\-_]+\.)+)?\$(?=[A-Z])([A-Z0-9_\-]*)(?: = (\'?)([^\']*)(\'?))?$#', $tag_args, $match); |
@@ -680,9 +680,9 @@ discard block |
||
| 680 | 680 | } |
| 681 | 681 | |
| 682 | 682 | /** |
| 683 | - * Compile INCLUDE tag |
|
| 684 | - * @access private |
|
| 685 | - */ |
|
| 683 | + * Compile INCLUDE tag |
|
| 684 | + * @access private |
|
| 685 | + */ |
|
| 686 | 686 | function compile_tag_include($tag_args) |
| 687 | 687 | { |
| 688 | 688 | // Process dynamic includes |
@@ -695,19 +695,19 @@ discard block |
||
| 695 | 695 | } |
| 696 | 696 | |
| 697 | 697 | /** |
| 698 | - * Compile INCLUDE_PHP tag |
|
| 699 | - * @access private |
|
| 700 | - */ |
|
| 698 | + * Compile INCLUDE_PHP tag |
|
| 699 | + * @access private |
|
| 700 | + */ |
|
| 701 | 701 | function compile_tag_include_php($tag_args) |
| 702 | 702 | { |
| 703 | 703 | return "\$this->_php_include('$tag_args');"; |
| 704 | 704 | } |
| 705 | 705 | |
| 706 | 706 | /** |
| 707 | - * parse expression |
|
| 708 | - * This is from Smarty |
|
| 709 | - * @access private |
|
| 710 | - */ |
|
| 707 | + * parse expression |
|
| 708 | + * This is from Smarty |
|
| 709 | + * @access private |
|
| 710 | + */ |
|
| 711 | 711 | function _parse_is_expr($is_arg, $tokens) |
| 712 | 712 | { |
| 713 | 713 | $expr_end = 0; |
@@ -800,14 +800,14 @@ discard block |
||
| 800 | 800 | } |
| 801 | 801 | |
| 802 | 802 | /** |
| 803 | - * Generates a reference to the array of data values for the given |
|
| 804 | - * (possibly nested) block namespace. This is a string of the form: |
|
| 805 | - * $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN'] |
|
| 806 | - * |
|
| 807 | - * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above. |
|
| 808 | - * NOTE: does not expect a trailing "." on the blockname. |
|
| 809 | - * @access private |
|
| 810 | - */ |
|
| 803 | + * Generates a reference to the array of data values for the given |
|
| 804 | + * (possibly nested) block namespace. This is a string of the form: |
|
| 805 | + * $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN'] |
|
| 806 | + * |
|
| 807 | + * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above. |
|
| 808 | + * NOTE: does not expect a trailing "." on the blockname. |
|
| 809 | + * @access private |
|
| 810 | + */ |
|
| 811 | 811 | function generate_block_data_ref($blockname, $include_last_iterator, $defop = false) |
| 812 | 812 | { |
| 813 | 813 | // Get an array of the blocks involved. |
@@ -843,9 +843,9 @@ discard block |
||
| 843 | 843 | } |
| 844 | 844 | |
| 845 | 845 | /** |
| 846 | - * Write compiled file to cache directory |
|
| 847 | - * @access private |
|
| 848 | - */ |
|
| 846 | + * Write compiled file to cache directory |
|
| 847 | + * @access private |
|
| 848 | + */ |
|
| 849 | 849 | function compile_write($handle, $data) |
| 850 | 850 | { |
| 851 | 851 | $filename = $this->template->cachepath . str_replace('/', '.', $this->template->filename[$handle]) . DOT_PHP_EX; |
@@ -868,9 +868,9 @@ discard block |
||
| 868 | 868 | |
| 869 | 869 | // Gorlum's minifier BOF |
| 870 | 870 | /** |
| 871 | - * Minifies template w/i PHP code by removing extra spaces |
|
| 872 | - * @access private |
|
| 873 | - */ |
|
| 871 | + * Minifies template w/i PHP code by removing extra spaces |
|
| 872 | + * @access private |
|
| 873 | + */ |
|
| 874 | 874 | function minify($html) |
| 875 | 875 | { |
| 876 | 876 | if(!SN::$config->tpl_minifier) |
@@ -141,9 +141,9 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | preg_match_all('#<!-- INCLUDE (\{\$?[A-Z0-9\-_]+\}|[a-zA-Z0-9\_\-\+\./]+) -->#', $code, $matches); |
| 143 | 143 | $include_blocks = $matches[1]; |
| 144 | - if($include_blocks) |
|
| 144 | + if ($include_blocks) |
|
| 145 | 145 | { |
| 146 | - foreach($include_blocks as &$included_file) |
|
| 146 | + foreach ($include_blocks as &$included_file) |
|
| 147 | 147 | { |
| 148 | 148 | $included_file .= '.tpl.html'; |
| 149 | 149 | } |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | $varname = $var_val[3]; |
| 309 | 309 | $new = $this->generate_block_varref($namespace, $varname, $var_val[2]); |
| 310 | 310 | |
| 311 | - if(!empty($var_val[4])) { |
|
| 311 | + if (!empty($var_val[4])) { |
|
| 312 | 312 | $new = \Ptl\PtlVariableDecorator::decorate($var_val[0], $new, $this->template); |
| 313 | 313 | } |
| 314 | 314 | |
@@ -462,8 +462,8 @@ discard block |
||
| 462 | 462 | |
| 463 | 463 | $tag_template_php .= 'for ($_' . $tag_args . '_i = ' . $loop_start . '; $_' . $tag_args . '_i < ' . $loop_end . '; ++$_' . $tag_args . '_i){'; |
| 464 | 464 | // $tag_template_php .= '$this->_block_counter["'. $tag_args . '"] = $_' . $tag_args . '_i;'; |
| 465 | - $tag_template_php .= '$_'. $tag_args . '_val = &' . $varref . '[$_'. $tag_args. '_i];'; |
|
| 466 | - $tag_template_php .= '$this->_block_value["'. $tag_args . '"] = &' . $varref . '[$_'. $tag_args. '_i];'; |
|
| 465 | + $tag_template_php .= '$_' . $tag_args . '_val = &' . $varref . '[$_' . $tag_args . '_i];'; |
|
| 466 | + $tag_template_php .= '$this->_block_value["' . $tag_args . '"] = &' . $varref . '[$_' . $tag_args . '_i];'; |
|
| 467 | 467 | |
| 468 | 468 | return $tag_template_php; |
| 469 | 469 | } |
@@ -567,10 +567,10 @@ discard block |
||
| 567 | 567 | break; |
| 568 | 568 | |
| 569 | 569 | case 'is': |
| 570 | - $is_arg_start = ($tokens[$i-1] == ')') ? array_pop($is_arg_stack) : $i-1; |
|
| 570 | + $is_arg_start = ($tokens[$i - 1] == ')') ? array_pop($is_arg_stack) : $i - 1; |
|
| 571 | 571 | $is_arg = implode(' ', array_slice($tokens, $is_arg_start, $i - $is_arg_start)); |
| 572 | 572 | |
| 573 | - $new_tokens = $this->_parse_is_expr($is_arg, array_slice($tokens, $i+1)); |
|
| 573 | + $new_tokens = $this->_parse_is_expr($is_arg, array_slice($tokens, $i + 1)); |
|
| 574 | 574 | |
| 575 | 575 | array_splice($tokens, $is_arg_start, sizeof($tokens), $new_tokens); |
| 576 | 576 | |
@@ -834,11 +834,11 @@ discard block |
||
| 834 | 834 | } |
| 835 | 835 | else if ($include_last_iterator) |
| 836 | 836 | { |
| 837 | - return '$_'. $blocks[$blockcount] . '_val'; |
|
| 837 | + return '$_' . $blocks[$blockcount] . '_val'; |
|
| 838 | 838 | } |
| 839 | 839 | else |
| 840 | 840 | { |
| 841 | - return '$_'. $blocks[$blockcount - 1] . '_val[\''. $blocks[$blockcount]. '\']'; |
|
| 841 | + return '$_' . $blocks[$blockcount - 1] . '_val[\'' . $blocks[$blockcount] . '\']'; |
|
| 842 | 842 | } |
| 843 | 843 | } |
| 844 | 844 | |
@@ -855,7 +855,7 @@ discard block |
||
| 855 | 855 | if ($fp = @fopen($filename, 'wb')) |
| 856 | 856 | { |
| 857 | 857 | @flock($fp, LOCK_EX); |
| 858 | - @fwrite ($fp, $data); |
|
| 858 | + @fwrite($fp, $data); |
|
| 859 | 859 | @flock($fp, LOCK_UN); |
| 860 | 860 | @fclose($fp); |
| 861 | 861 | |
@@ -873,7 +873,7 @@ discard block |
||
| 873 | 873 | */ |
| 874 | 874 | function minify($html) |
| 875 | 875 | { |
| 876 | - if(!SN::$config->tpl_minifier) |
|
| 876 | + if (!SN::$config->tpl_minifier) |
|
| 877 | 877 | { |
| 878 | 878 | return $html; |
| 879 | 879 | } |
@@ -885,14 +885,14 @@ discard block |
||
| 885 | 885 | //$html = preg_replace('/[\r\n\t]+/', ' ', $html); |
| 886 | 886 | $html = preg_replace('/>[\s]*</', '><', $html); // Strip spacechars between tags |
| 887 | 887 | $html = preg_replace('/[\s]+/', ' ', $html); // Replace several spacechars with one space |
| 888 | - if(!empty($pre[0])) |
|
| 888 | + if (!empty($pre[0])) |
|
| 889 | 889 | { |
| 890 | - foreach($pre[0] as $tag) |
|
| 890 | + foreach ($pre[0] as $tag) |
|
| 891 | 891 | { |
| 892 | 892 | $tag = preg_replace('/^\ *\/\/[^\<]*?$/m', ' ', $tag); // Strips comments - except those that contains HTML comment inside |
| 893 | 893 | $tag = preg_replace('/[\ \t]{2,}/', ' ', $tag); // Replace several spaces by one |
| 894 | 894 | $tag = preg_replace('/\s{2,}/', "\r\n", $tag); // Replace several linefeeds by one |
| 895 | - $html = preg_replace('/#pre#/', $tag, $html,1); |
|
| 895 | + $html = preg_replace('/#pre#/', $tag, $html, 1); |
|
| 896 | 896 | } |
| 897 | 897 | } |
| 898 | 898 | |
@@ -37,8 +37,7 @@ discard block |
||
| 37 | 37 | * |
| 38 | 38 | * @package phpBB3 |
| 39 | 39 | */ |
| 40 | -class template_compile |
|
| 41 | -{ |
|
| 40 | +class template_compile { |
|
| 42 | 41 | var $template; |
| 43 | 42 | |
| 44 | 43 | // Various storage arrays |
@@ -58,8 +57,7 @@ discard block |
||
| 58 | 57 | * Load template source from file |
| 59 | 58 | * @access private |
| 60 | 59 | */ |
| 61 | - function _tpl_load_file($handle, $store_in_db = false) |
|
| 62 | - { |
|
| 60 | + function _tpl_load_file($handle, $store_in_db = false) { |
|
| 63 | 61 | // Try and open template for read |
| 64 | 62 | if (!file_exists($this->template->files[$handle])) |
| 65 | 63 | { |
@@ -67,8 +65,7 @@ discard block |
||
| 67 | 65 | { |
| 68 | 66 | return; |
| 69 | 67 | trigger_error("template->_tpl_load_file(): File {$this->template->files[$handle]} does not exist or is empty", E_USER_ERROR); |
| 70 | - } |
|
| 71 | - else |
|
| 68 | + } else |
|
| 72 | 69 | { |
| 73 | 70 | $this->template->files[$handle] = $this->template->files_inherit[$handle]; |
| 74 | 71 | } |
@@ -104,8 +101,7 @@ discard block |
||
| 104 | 101 | * the ones that exist in zend_language_scanner.l |
| 105 | 102 | * @access private |
| 106 | 103 | */ |
| 107 | - function remove_php_tags(&$code) |
|
| 108 | - { |
|
| 104 | + function remove_php_tags(&$code) { |
|
| 109 | 105 | // This matches the information gathered from the internal PHP lexer |
| 110 | 106 | $match = array( |
| 111 | 107 | '#<([\?%])=?.*?\1>#s', |
@@ -120,8 +116,7 @@ discard block |
||
| 120 | 116 | * The all seeing all doing compile method. Parts are inspired by or directly from Smarty |
| 121 | 117 | * @access private |
| 122 | 118 | */ |
| 123 | - function compile($code, $no_echo = false, $echo_var = '') |
|
| 124 | - { |
|
| 119 | + function compile($code, $no_echo = false, $echo_var = '') { |
|
| 125 | 120 | if ($echo_var) |
| 126 | 121 | { |
| 127 | 122 | global $$echo_var; |
@@ -224,15 +219,13 @@ discard block |
||
| 224 | 219 | $var = substr($temp, 2, -1); |
| 225 | 220 | //$file = $this->template->_tpldata['DEFINE']['.'][$var]; |
| 226 | 221 | $temp = "\$this->_tpldata['DEFINE']['.']['$var']"; |
| 227 | - } |
|
| 228 | - else |
|
| 222 | + } else |
|
| 229 | 223 | { |
| 230 | 224 | $var = substr($temp, 1, -1); |
| 231 | 225 | //$file = $this->template->_rootref[$var]; |
| 232 | 226 | $temp = "\$this->_rootref['$var']"; |
| 233 | 227 | } |
| 234 | - } |
|
| 235 | - else |
|
| 228 | + } else |
|
| 236 | 229 | { |
| 237 | 230 | $file = $temp; |
| 238 | 231 | } |
@@ -291,8 +284,7 @@ discard block |
||
| 291 | 284 | * Compile variables |
| 292 | 285 | * @access private |
| 293 | 286 | */ |
| 294 | - function compile_var_tags(&$text_blocks) |
|
| 295 | - { |
|
| 287 | + function compile_var_tags(&$text_blocks) { |
|
| 296 | 288 | // including $lang variable |
| 297 | 289 | // global $lang, $config; // NOT NEDEED - $lang now is global! |
| 298 | 290 | |
@@ -366,8 +358,7 @@ discard block |
||
| 366 | 358 | * Compile blocks |
| 367 | 359 | * @access private |
| 368 | 360 | */ |
| 369 | - function compile_tag_block($tag_args) |
|
| 370 | - { |
|
| 361 | + function compile_tag_block($tag_args) { |
|
| 371 | 362 | $no_nesting = false; |
| 372 | 363 | |
| 373 | 364 | // Is the designer wanting to call another loop in a loop? |
@@ -390,8 +381,7 @@ discard block |
||
| 390 | 381 | if ($match[2] < 0) |
| 391 | 382 | { |
| 392 | 383 | $loop_start = '($_' . $tag_args . '_count ' . $match[2] . ' < 0 ? 0 : $_' . $tag_args . '_count ' . $match[2] . ')'; |
| 393 | - } |
|
| 394 | - else |
|
| 384 | + } else |
|
| 395 | 385 | { |
| 396 | 386 | $loop_start = '($_' . $tag_args . '_count < ' . $match[2] . ' ? $_' . $tag_args . '_count : ' . $match[2] . ')'; |
| 397 | 387 | } |
@@ -399,17 +389,14 @@ discard block |
||
| 399 | 389 | if (strlen($match[3]) < 1 || $match[3] == -1) |
| 400 | 390 | { |
| 401 | 391 | $loop_end = '$_' . $tag_args . '_count'; |
| 402 | - } |
|
| 403 | - else if ($match[3] >= 0) |
|
| 392 | + } else if ($match[3] >= 0) |
|
| 404 | 393 | { |
| 405 | 394 | $loop_end = '(' . ($match[3] + 1) . ' > $_' . $tag_args . '_count ? $_' . $tag_args . '_count : ' . ($match[3] + 1) . ')'; |
| 406 | - } |
|
| 407 | - else //if ($match[3] < -1) |
|
| 395 | + } else //if ($match[3] < -1) |
|
| 408 | 396 | { |
| 409 | 397 | $loop_end = '$_' . $tag_args . '_count' . ($match[3] + 1); |
| 410 | 398 | } |
| 411 | - } |
|
| 412 | - else |
|
| 399 | + } else |
|
| 413 | 400 | { |
| 414 | 401 | $loop_start = 0; |
| 415 | 402 | $loop_end = '$_' . $tag_args . '_count'; |
@@ -422,8 +409,7 @@ discard block |
||
| 422 | 409 | { |
| 423 | 410 | // We need to implode $no_nesting times from the end... |
| 424 | 411 | $block = array_slice($this->block_names, -$no_nesting); |
| 425 | - } |
|
| 426 | - else |
|
| 412 | + } else |
|
| 427 | 413 | { |
| 428 | 414 | $block = $this->block_names; |
| 429 | 415 | } |
@@ -433,8 +419,7 @@ discard block |
||
| 433 | 419 | // Block is not nested. |
| 434 | 420 | $tag_template_php = '$_' . $tag_args . "_count = (isset(\$this->_tpldata['$tag_args'])) ? sizeof(\$this->_tpldata['$tag_args']) : 0;"; |
| 435 | 421 | $varref = "\$this->_tpldata['$tag_args']"; |
| 436 | - } |
|
| 437 | - else |
|
| 422 | + } else |
|
| 438 | 423 | { |
| 439 | 424 | // This block is nested. |
| 440 | 425 | // Generate a namespace string for this block. |
@@ -473,8 +458,7 @@ discard block |
||
| 473 | 458 | * some adaptions for our block level methods |
| 474 | 459 | * @access private |
| 475 | 460 | */ |
| 476 | - function compile_tag_if($tag_args, $elseif) |
|
| 477 | - { |
|
| 461 | + function compile_tag_if($tag_args, $elseif) { |
|
| 478 | 462 | // Tokenize args for 'if' tag. |
| 479 | 463 | preg_match_all('/(?: |
| 480 | 464 | "[^"\\\\]*(?:\\\\.[^"\\\\]*)*" | |
@@ -582,8 +566,7 @@ discard block |
||
| 582 | 566 | if (preg_match('#^((?:[a-z0-9\-_]+\.)+)?(\$)?(?=[A-Za-z])([A-Za-z0-9\-_]+)#s', $token, $varrefs)) |
| 583 | 567 | { |
| 584 | 568 | $token = (!empty($varrefs[1])) ? $this->generate_block_data_ref(substr($varrefs[1], 0, -1), true, $varrefs[2]) . '[\'' . $varrefs[3] . '\']' : (($varrefs[2]) ? '$this->_tpldata[\'DEFINE\'][\'.\'][\'' . $varrefs[3] . '\']' : '$this->_rootref[\'' . $varrefs[3] . '\']'); |
| 585 | - } |
|
| 586 | - else if (preg_match('#^\.((?:[a-z0-9\-_]+\.?)+)$#s', $token, $varrefs)) |
|
| 569 | + } else if (preg_match('#^\.((?:[a-z0-9\-_]+\.?)+)$#s', $token, $varrefs)) |
|
| 587 | 570 | { |
| 588 | 571 | // Allow checking if loops are set with .loopname |
| 589 | 572 | // It is also possible to check the loop count by doing <!-- IF .loopname > 1 --> for example |
@@ -599,8 +582,7 @@ discard block |
||
| 599 | 582 | |
| 600 | 583 | // Add the block reference for the last child. |
| 601 | 584 | $varref .= "['" . $block . "']"; |
| 602 | - } |
|
| 603 | - else |
|
| 585 | + } else |
|
| 604 | 586 | { |
| 605 | 587 | $varref = '$this->_tpldata'; |
| 606 | 588 | |
@@ -608,8 +590,7 @@ discard block |
||
| 608 | 590 | $varref .= "['" . $blocks[0] . "']"; |
| 609 | 591 | } |
| 610 | 592 | $token = "sizeof($varref)"; |
| 611 | - } |
|
| 612 | - else if (!empty($token)) |
|
| 593 | + } else if (!empty($token)) |
|
| 613 | 594 | { |
| 614 | 595 | $token = '(' . $token . ')'; |
| 615 | 596 | } |
@@ -630,8 +611,7 @@ discard block |
||
| 630 | 611 | * Compile DEFINE tags |
| 631 | 612 | * @access private |
| 632 | 613 | */ |
| 633 | - function compile_tag_define($tag_args, $op) |
|
| 634 | - { |
|
| 614 | + function compile_tag_define($tag_args, $op) { |
|
| 635 | 615 | preg_match('#^((?:[a-z0-9\-_]+\.)+)?\$(?=[A-Z])([A-Z0-9_\-]*)(?: = (\'?)([^\']*)(\'?))?$#', $tag_args, $match); |
| 636 | 616 | |
| 637 | 617 | if (empty($match[2]) || (!isset($match[4]) && $op)) |
@@ -654,8 +634,7 @@ discard block |
||
| 654 | 634 | |
| 655 | 635 | // Now replace the php code |
| 656 | 636 | $match[4] = "'" . str_replace(array('<?php echo ', '; ?>'), array("' . ", " . '"), $match[4]) . "'"; |
| 657 | - } |
|
| 658 | - else |
|
| 637 | + } else |
|
| 659 | 638 | { |
| 660 | 639 | preg_match('#true|false|\.#i', $match[4], $type); |
| 661 | 640 | |
@@ -683,8 +662,7 @@ discard block |
||
| 683 | 662 | * Compile INCLUDE tag |
| 684 | 663 | * @access private |
| 685 | 664 | */ |
| 686 | - function compile_tag_include($tag_args) |
|
| 687 | - { |
|
| 665 | + function compile_tag_include($tag_args) { |
|
| 688 | 666 | // Process dynamic includes |
| 689 | 667 | if ($tag_args[0] == '$') |
| 690 | 668 | { |
@@ -698,8 +676,7 @@ discard block |
||
| 698 | 676 | * Compile INCLUDE_PHP tag |
| 699 | 677 | * @access private |
| 700 | 678 | */ |
| 701 | - function compile_tag_include_php($tag_args) |
|
| 702 | - { |
|
| 679 | + function compile_tag_include_php($tag_args) { |
|
| 703 | 680 | return "\$this->_php_include('$tag_args');"; |
| 704 | 681 | } |
| 705 | 682 | |
@@ -708,8 +685,7 @@ discard block |
||
| 708 | 685 | * This is from Smarty |
| 709 | 686 | * @access private |
| 710 | 687 | */ |
| 711 | - function _parse_is_expr($is_arg, $tokens) |
|
| 712 | - { |
|
| 688 | + function _parse_is_expr($is_arg, $tokens) { |
|
| 713 | 689 | $expr_end = 0; |
| 714 | 690 | $negate_expr = false; |
| 715 | 691 | |
@@ -717,8 +693,7 @@ discard block |
||
| 717 | 693 | { |
| 718 | 694 | $negate_expr = true; |
| 719 | 695 | $expr_type = array_shift($tokens); |
| 720 | - } |
|
| 721 | - else |
|
| 696 | + } else |
|
| 722 | 697 | { |
| 723 | 698 | $expr_type = $first_token; |
| 724 | 699 | } |
@@ -731,8 +706,7 @@ discard block |
||
| 731 | 706 | $expr_end++; |
| 732 | 707 | $expr_arg = $tokens[$expr_end++]; |
| 733 | 708 | $expr = "!(($is_arg / $expr_arg) % $expr_arg)"; |
| 734 | - } |
|
| 735 | - else |
|
| 709 | + } else |
|
| 736 | 710 | { |
| 737 | 711 | $expr = "!($is_arg & 1)"; |
| 738 | 712 | } |
@@ -744,8 +718,7 @@ discard block |
||
| 744 | 718 | $expr_end++; |
| 745 | 719 | $expr_arg = $tokens[$expr_end++]; |
| 746 | 720 | $expr = "(($is_arg / $expr_arg) % $expr_arg)"; |
| 747 | - } |
|
| 748 | - else |
|
| 721 | + } else |
|
| 749 | 722 | { |
| 750 | 723 | $expr = "($is_arg & 1)"; |
| 751 | 724 | } |
@@ -784,8 +757,7 @@ discard block |
||
| 784 | 757 | * |
| 785 | 758 | * @return string |
| 786 | 759 | */ |
| 787 | - private function generate_block_varref($namespace, $varname, $defop = false) |
|
| 788 | - { |
|
| 760 | + private function generate_block_varref($namespace, $varname, $defop = false) { |
|
| 789 | 761 | // Strip the trailing period. |
| 790 | 762 | $namespace = substr($namespace, 0, -1); |
| 791 | 763 | |
@@ -808,8 +780,7 @@ discard block |
||
| 808 | 780 | * NOTE: does not expect a trailing "." on the blockname. |
| 809 | 781 | * @access private |
| 810 | 782 | */ |
| 811 | - function generate_block_data_ref($blockname, $include_last_iterator, $defop = false) |
|
| 812 | - { |
|
| 783 | + function generate_block_data_ref($blockname, $include_last_iterator, $defop = false) { |
|
| 813 | 784 | // Get an array of the blocks involved. |
| 814 | 785 | $blocks = explode('.', $blockname); |
| 815 | 786 | $blockcount = sizeof($blocks) - 1; |
@@ -831,12 +802,10 @@ discard block |
||
| 831 | 802 | $varref .= '[$_' . $blocks[$blockcount] . '_i]'; |
| 832 | 803 | } |
| 833 | 804 | return $varref; |
| 834 | - } |
|
| 835 | - else if ($include_last_iterator) |
|
| 805 | + } else if ($include_last_iterator) |
|
| 836 | 806 | { |
| 837 | 807 | return '$_'. $blocks[$blockcount] . '_val'; |
| 838 | - } |
|
| 839 | - else |
|
| 808 | + } else |
|
| 840 | 809 | { |
| 841 | 810 | return '$_'. $blocks[$blockcount - 1] . '_val[\''. $blocks[$blockcount]. '\']'; |
| 842 | 811 | } |
@@ -846,8 +815,7 @@ discard block |
||
| 846 | 815 | * Write compiled file to cache directory |
| 847 | 816 | * @access private |
| 848 | 817 | */ |
| 849 | - function compile_write($handle, $data) |
|
| 850 | - { |
|
| 818 | + function compile_write($handle, $data) { |
|
| 851 | 819 | $filename = $this->template->cachepath . str_replace('/', '.', $this->template->filename[$handle]) . DOT_PHP_EX; |
| 852 | 820 | |
| 853 | 821 | $data = "<?php if (!defined('INSIDE')) exit;" . ((strpos($data, '<?php') === 0) ? substr($data, 5) : ' ?>' . $data); |
@@ -871,8 +839,7 @@ discard block |
||
| 871 | 839 | * Minifies template w/i PHP code by removing extra spaces |
| 872 | 840 | * @access private |
| 873 | 841 | */ |
| 874 | - function minify($html) |
|
| 875 | - { |
|
| 842 | + function minify($html) { |
|
| 876 | 843 | if(!SN::$config->tpl_minifier) |
| 877 | 844 | { |
| 878 | 845 | return $html; |
@@ -22,8 +22,7 @@ discard block |
||
| 22 | 22 | * Base Template class. |
| 23 | 23 | * @package phpBB3 |
| 24 | 24 | */ |
| 25 | -class template |
|
| 26 | -{ |
|
| 25 | +class template { |
|
| 27 | 26 | /** variable that holds all the data we'll be substituting into |
| 28 | 27 | * the compiled templates. Takes form: |
| 29 | 28 | * --> $this->_tpldata[block][iteration#][child][iteration#][child2][iteration#][variablename] == value |
@@ -82,8 +81,7 @@ discard block |
||
| 82 | 81 | * Set template location |
| 83 | 82 | * @access public |
| 84 | 83 | */ |
| 85 | - function set_template() |
|
| 86 | - { |
|
| 84 | + function set_template() { |
|
| 87 | 85 | global $user; |
| 88 | 86 | |
| 89 | 87 | if (file_exists($this->rootPhysical. 'styles/' . $user->theme['template_path'] . '/template')) |
@@ -108,8 +106,7 @@ discard block |
||
| 108 | 106 | { |
| 109 | 107 | $this->inherit_root = $this->rootPhysical . 'styles/' . $user->theme['template_inherit_path'] . '/template'; |
| 110 | 108 | } |
| 111 | - } |
|
| 112 | - else |
|
| 109 | + } else |
|
| 113 | 110 | { |
| 114 | 111 | trigger_error('Template path could not be found: styles/' . $user->theme['template_path'] . '/template', E_USER_ERROR); |
| 115 | 112 | } |
@@ -123,8 +120,7 @@ discard block |
||
| 123 | 120 | * Set custom template location (able to use directory outside of phpBB) |
| 124 | 121 | * @access public |
| 125 | 122 | */ |
| 126 | - function set_custom_template($template_path, $template_name, $fallback_template_path = false) |
|
| 127 | - { |
|
| 123 | + function set_custom_template($template_path, $template_name, $fallback_template_path = false) { |
|
| 128 | 124 | global $user; |
| 129 | 125 | |
| 130 | 126 | // Make sure $template_path has no ending slash |
@@ -145,8 +141,7 @@ discard block |
||
| 145 | 141 | |
| 146 | 142 | $this->inherit_root = $fallback_template_path; |
| 147 | 143 | $this->orig_tpl_inherits_id = true; |
| 148 | - } |
|
| 149 | - else |
|
| 144 | + } else |
|
| 150 | 145 | { |
| 151 | 146 | $this->orig_tpl_inherits_id = false; |
| 152 | 147 | } |
@@ -165,8 +160,7 @@ discard block |
||
| 165 | 160 | * should be a hash of handle => filename pairs. |
| 166 | 161 | * @access public |
| 167 | 162 | */ |
| 168 | - function set_filenames($filename_array) |
|
| 169 | - { |
|
| 163 | + function set_filenames($filename_array) { |
|
| 170 | 164 | if (!is_array($filename_array)) |
| 171 | 165 | { |
| 172 | 166 | return false; |
@@ -194,8 +188,7 @@ discard block |
||
| 194 | 188 | * Destroy template data set |
| 195 | 189 | * @access public |
| 196 | 190 | */ |
| 197 | - function destroy() |
|
| 198 | - { |
|
| 191 | + function destroy() { |
|
| 199 | 192 | $this->_tpldata = array('.' => array(0 => array())); |
| 200 | 193 | $this->_rootref = &$this->_tpldata['.'][0]; |
| 201 | 194 | } |
@@ -204,8 +197,7 @@ discard block |
||
| 204 | 197 | * Reset/empty complete block |
| 205 | 198 | * @access public |
| 206 | 199 | */ |
| 207 | - function destroy_block_vars($blockname) |
|
| 208 | - { |
|
| 200 | + function destroy_block_vars($blockname) { |
|
| 209 | 201 | if (strpos($blockname, '.') !== false) |
| 210 | 202 | { |
| 211 | 203 | // Nested block. |
@@ -220,8 +212,7 @@ discard block |
||
| 220 | 212 | } |
| 221 | 213 | |
| 222 | 214 | unset($str[$blocks[$blockcount]]); |
| 223 | - } |
|
| 224 | - else |
|
| 215 | + } else |
|
| 225 | 216 | { |
| 226 | 217 | // Top-level block. |
| 227 | 218 | unset($this->_tpldata[$blockname]); |
@@ -234,8 +225,7 @@ discard block |
||
| 234 | 225 | * Display handle |
| 235 | 226 | * @access public |
| 236 | 227 | */ |
| 237 | - function display($handle, $include_once = true) |
|
| 238 | - { |
|
| 228 | + function display($handle, $include_once = true) { |
|
| 239 | 229 | if (defined('IN_ERROR_HANDLER')) |
| 240 | 230 | { |
| 241 | 231 | $is_enotice = error_reporting(); |
@@ -248,8 +238,7 @@ discard block |
||
| 248 | 238 | if ($filename = $this->_tpl_load($handle)) |
| 249 | 239 | { |
| 250 | 240 | ($include_once) ? include_once($filename) : include($filename); |
| 251 | - } |
|
| 252 | - else |
|
| 241 | + } else |
|
| 253 | 242 | { |
| 254 | 243 | $this->evaluate($this->compiled_code[$handle]); |
| 255 | 244 | } |
@@ -261,8 +250,7 @@ discard block |
||
| 261 | 250 | * Display the handle and assign the output to a template variable or return the compiled result. |
| 262 | 251 | * @access public |
| 263 | 252 | */ |
| 264 | - function assign_display($handle, $template_var = '', $return_content = true, $include_once = false) |
|
| 265 | - { |
|
| 253 | + function assign_display($handle, $template_var = '', $return_content = true, $include_once = false) { |
|
| 266 | 254 | ob_start(); |
| 267 | 255 | $this->display($handle, $include_once); |
| 268 | 256 | $contents = ob_get_clean(); |
@@ -281,8 +269,7 @@ discard block |
||
| 281 | 269 | * Load a compiled template if possible, if not, recompile it |
| 282 | 270 | * @access private |
| 283 | 271 | */ |
| 284 | - function _tpl_load(&$handle) |
|
| 285 | - { |
|
| 272 | + function _tpl_load(&$handle) { |
|
| 286 | 273 | global $user, $config; |
| 287 | 274 | |
| 288 | 275 | if (!isset($this->filename[$handle])) |
@@ -303,8 +290,7 @@ discard block |
||
| 303 | 290 | if (!file_exists($filename) || @filesize($filename) === 0) |
| 304 | 291 | { |
| 305 | 292 | $recompile = true; |
| 306 | - } |
|
| 307 | - else if ($config->load_tplcompile) |
|
| 293 | + } else if ($config->load_tplcompile) |
|
| 308 | 294 | { |
| 309 | 295 | // No way around it: we need to check inheritance here |
| 310 | 296 | if ($user->theme['template_inherits_id'] && !file_exists($this->files[$handle])) |
@@ -387,15 +373,13 @@ discard block |
||
| 387 | 373 | $this->files[$row['template_filename']] = $file; |
| 388 | 374 | $this->files_inherit[$row['template_filename']] = $file; |
| 389 | 375 | $this->files_template[$row['template_filename']] = $user->theme['template_inherits_id']; |
| 390 | - } |
|
| 391 | - else if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id']) |
|
| 376 | + } else if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id']) |
|
| 392 | 377 | { |
| 393 | 378 | // Ok, we have a situation. There is a file in the subtemplate, but nothing in the DB. We have to fix that. |
| 394 | 379 | $force_reload = true; |
| 395 | 380 | $this->files_template[$row['template_filename']] = $user->theme['template_inherits_id']; |
| 396 | 381 | } |
| 397 | - } |
|
| 398 | - else |
|
| 382 | + } else |
|
| 399 | 383 | { |
| 400 | 384 | $this->files_template[$row['template_filename']] = $user->theme['template_id']; |
| 401 | 385 | } |
@@ -405,8 +389,7 @@ discard block |
||
| 405 | 389 | if ($row['template_filename'] == $this->filename[$handle]) |
| 406 | 390 | { |
| 407 | 391 | $compile->_tpl_load_file($handle, true); |
| 408 | - } |
|
| 409 | - else |
|
| 392 | + } else |
|
| 410 | 393 | { |
| 411 | 394 | $this->files[$row['template_filename']] = $file; |
| 412 | 395 | $this->filename[$row['template_filename']] = $row['template_filename']; |
@@ -421,8 +404,7 @@ discard block |
||
| 421 | 404 | { |
| 422 | 405 | $this->compiled_code[$handle] = $compile->compile(trim($row['template_data'])); |
| 423 | 406 | $compile->compile_write($handle, $this->compiled_code[$handle]); |
| 424 | - } |
|
| 425 | - else |
|
| 407 | + } else |
|
| 426 | 408 | { |
| 427 | 409 | // Only bother compiling if it doesn't already exist |
| 428 | 410 | if (!file_exists($this->cachepath . str_replace('/', '.', $row['template_filename']) . DOT_PHP_EX)) |
@@ -433,8 +415,7 @@ discard block |
||
| 433 | 415 | } |
| 434 | 416 | } |
| 435 | 417 | } |
| 436 | - } |
|
| 437 | - else |
|
| 418 | + } else |
|
| 438 | 419 | { |
| 439 | 420 | $file = $this->root . '/' . $row['template_filename']; |
| 440 | 421 | |
@@ -461,8 +442,7 @@ discard block |
||
| 461 | 442 | * Assign key variable pairs from an array |
| 462 | 443 | * @access public |
| 463 | 444 | */ |
| 464 | - function assign_vars($vararray) |
|
| 465 | - { |
|
| 445 | + function assign_vars($vararray) { |
|
| 466 | 446 | foreach ($vararray as $key => $val) |
| 467 | 447 | { |
| 468 | 448 | $this->_rootref[$key] = $val; |
@@ -475,8 +455,7 @@ discard block |
||
| 475 | 455 | * Assign a single variable to a single key |
| 476 | 456 | * @access public |
| 477 | 457 | */ |
| 478 | - function assign_var($varname, $varval) |
|
| 479 | - { |
|
| 458 | + function assign_var($varname, $varval) { |
|
| 480 | 459 | $this->_rootref[$varname] = $varval; |
| 481 | 460 | |
| 482 | 461 | return true; |
@@ -486,8 +465,7 @@ discard block |
||
| 486 | 465 | * Assign key variable pairs from an array to a specified block |
| 487 | 466 | * @access public |
| 488 | 467 | */ |
| 489 | - function assign_block_vars($blockname, $vararray) |
|
| 490 | - { |
|
| 468 | + function assign_block_vars($blockname, $vararray) { |
|
| 491 | 469 | if (strpos($blockname, '.') !== false) |
| 492 | 470 | { |
| 493 | 471 | // Nested block. |
@@ -522,8 +500,7 @@ discard block |
||
| 522 | 500 | // We're adding a new iteration to this block with the given |
| 523 | 501 | // variable assignments. |
| 524 | 502 | $str[$blocks[$blockcount]][] = $vararray; |
| 525 | - } |
|
| 526 | - else |
|
| 503 | + } else |
|
| 527 | 504 | { |
| 528 | 505 | // Top-level block. |
| 529 | 506 | $s_row_count = (isset($this->_tpldata[$blockname])) ? sizeof($this->_tpldata[$blockname]) : 0; |
@@ -577,8 +554,7 @@ discard block |
||
| 577 | 554 | * @return bool false on error, true on success |
| 578 | 555 | * @access public |
| 579 | 556 | */ |
| 580 | - function alter_block_array($blockname, $vararray, $key = false, $mode = 'insert') |
|
| 581 | - { |
|
| 557 | + function alter_block_array($blockname, $vararray, $key = false, $mode = 'insert') { |
|
| 582 | 558 | if (strpos($blockname, '.') !== false) |
| 583 | 559 | { |
| 584 | 560 | // Nested blocks are not supported |
@@ -623,8 +599,7 @@ discard block |
||
| 623 | 599 | $key = sizeof($this->_tpldata[$blockname]); |
| 624 | 600 | unset($this->_tpldata[$blockname][($key - 1)]['S_LAST_ROW']); |
| 625 | 601 | $vararray['S_LAST_ROW'] = true; |
| 626 | - } |
|
| 627 | - else if ($key === 0) |
|
| 602 | + } else if ($key === 0) |
|
| 628 | 603 | { |
| 629 | 604 | unset($this->_tpldata[$blockname][0]['S_FIRST_ROW']); |
| 630 | 605 | $vararray['S_FIRST_ROW'] = true; |
@@ -663,8 +638,7 @@ discard block |
||
| 663 | 638 | * Include a separate template |
| 664 | 639 | * @access private |
| 665 | 640 | */ |
| 666 | - function _tpl_include($filename, $include = true) |
|
| 667 | - { |
|
| 641 | + function _tpl_include($filename, $include = true) { |
|
| 668 | 642 | // This is used to access global vars |
| 669 | 643 | // global $lang, $config, $user; // Not needed! |
| 670 | 644 | |
@@ -694,8 +668,7 @@ discard block |
||
| 694 | 668 | * Include a php-file |
| 695 | 669 | * @access private |
| 696 | 670 | */ |
| 697 | - function _php_include($filename) |
|
| 698 | - { |
|
| 671 | + function _php_include($filename) { |
|
| 699 | 672 | $file = $this->rootPhysical . $filename; |
| 700 | 673 | |
| 701 | 674 | if (!file_exists($file)) |
@@ -711,8 +684,7 @@ discard block |
||
| 711 | 684 | * Assign key variable pairs from an array with block support |
| 712 | 685 | * @access public |
| 713 | 686 | */ |
| 714 | - function assign_recursive($values, $name = '') |
|
| 715 | - { |
|
| 687 | + function assign_recursive($values, $name = '') { |
|
| 716 | 688 | if(isset($values['.'])) |
| 717 | 689 | { |
| 718 | 690 | $values_extra = $values['.']; |
@@ -722,8 +694,7 @@ discard block |
||
| 722 | 694 | if(!$name) |
| 723 | 695 | { |
| 724 | 696 | $this->assign_vars($values); |
| 725 | - } |
|
| 726 | - else |
|
| 697 | + } else |
|
| 727 | 698 | { |
| 728 | 699 | $this->assign_block_vars($name, $values); |
| 729 | 700 | } |
@@ -29,19 +29,19 @@ |
||
| 29 | 29 | 'ID' => self::PAGE_SORT_BY_RANK, |
| 30 | 30 | 'HTML_ID' => 'byTotalRank', |
| 31 | 31 | 'HTML_NAME' => '{ byTotalRank }', |
| 32 | - 'SQL_SORT' => ['u.total_rank',], |
|
| 32 | + 'SQL_SORT' => ['u.total_rank', ], |
|
| 33 | 33 | ], |
| 34 | 34 | self::PAGE_SORT_BY_ID => [ |
| 35 | 35 | 'ID' => self::PAGE_SORT_BY_ID, |
| 36 | 36 | 'HTML_ID' => 'byId', |
| 37 | 37 | 'HTML_NAME' => '{ byId }', |
| 38 | - 'SQL_SORT' => ['u.id',], |
|
| 38 | + 'SQL_SORT' => ['u.id', ], |
|
| 39 | 39 | ], |
| 40 | 40 | self::PAGE_SORT_BY_NAME => [ |
| 41 | 41 | 'ID' => self::PAGE_SORT_BY_NAME, |
| 42 | 42 | 'HTML_ID' => 'byName', |
| 43 | 43 | 'HTML_NAME' => '{ byName }', |
| 44 | - 'SQL_SORT' => ['u.username',], |
|
| 44 | + 'SQL_SORT' => ['u.username', ], |
|
| 45 | 45 | ], |
| 46 | 46 | |
| 47 | 47 | self::PAGE_SORT_BY_POINTS => [ |
@@ -13,8 +13,8 @@ |
||
| 13 | 13 | const SORT_BY_ACTIVITY = 1; |
| 14 | 14 | |
| 15 | 15 | private static $sorting = [ |
| 16 | - self::SORT_BY_PACKAGE => ['PACKAGE', 'NAME', '!ACTIVE', '!INSTALLED',], |
|
| 17 | - self::SORT_BY_ACTIVITY => ['!ACTIVE', '!INSTALLED', 'PACKAGE', 'NAME',], |
|
| 16 | + self::SORT_BY_PACKAGE => ['PACKAGE', 'NAME', '!ACTIVE', '!INSTALLED', ], |
|
| 17 | + self::SORT_BY_ACTIVITY => ['!ACTIVE', '!INSTALLED', 'PACKAGE', 'NAME', ], |
|
| 18 | 18 | ]; |
| 19 | 19 | |
| 20 | 20 | private static $sortFields = []; |