@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | function smarty_function_html_checkboxes($params, &$smarty) |
42 | 42 | { |
43 | - require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); |
|
43 | + require_once $smarty->_get_plugin_filepath('shared', 'escape_special_chars'); |
|
44 | 44 | |
45 | 45 | $name = 'checkbox'; |
46 | 46 | $values = null; |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | |
53 | 53 | $extra = ''; |
54 | 54 | |
55 | - foreach($params as $_key => $_val) { |
|
56 | - switch($_key) { |
|
55 | + foreach ($params as $_key => $_val) { |
|
56 | + switch ($_key) { |
|
57 | 57 | case 'name': |
58 | 58 | case 'separator': |
59 | 59 | $$_key = $_val; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | break; |
87 | 87 | |
88 | 88 | default: |
89 | - if(!is_array($_val)) { |
|
89 | + if (!is_array($_val)) { |
|
90 | 90 | $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"'; |
91 | 91 | } else { |
92 | 92 | $smarty->trigger_error("html_checkboxes: extra attribute '$_key' cannot be an array", E_USER_NOTICE); |
@@ -115,10 +115,10 @@ discard block |
||
115 | 115 | |
116 | 116 | } |
117 | 117 | |
118 | - if(!empty($params['assign'])) { |
|
118 | + if (!empty($params['assign'])) { |
|
119 | 119 | $smarty->assign($params['assign'], $_html_result); |
120 | 120 | } else { |
121 | - return implode("\n",$_html_result); |
|
121 | + return implode("\n", $_html_result); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | } |
@@ -127,15 +127,15 @@ discard block |
||
127 | 127 | $_output = ''; |
128 | 128 | if ($labels) $_output .= '<label>'; |
129 | 129 | $_output .= '<input type="checkbox" name="' |
130 | - . smarty_function_escape_special_chars($name) . '[]" value="' |
|
131 | - . smarty_function_escape_special_chars($value) . '"'; |
|
130 | + . smarty_function_escape_special_chars($name).'[]" value="' |
|
131 | + . smarty_function_escape_special_chars($value).'"'; |
|
132 | 132 | |
133 | 133 | if (in_array((string)$value, $selected)) { |
134 | 134 | $_output .= ' checked="checked"'; |
135 | 135 | } |
136 | - $_output .= $extra . ' />' . $output; |
|
136 | + $_output .= $extra.' />'.$output; |
|
137 | 137 | if ($labels) $_output .= '</label>'; |
138 | - $_output .= $separator; |
|
138 | + $_output .= $separator; |
|
139 | 139 | |
140 | 140 | return $_output; |
141 | 141 | } |
@@ -95,16 +95,19 @@ discard block |
||
95 | 95 | } |
96 | 96 | } |
97 | 97 | |
98 | - if (!isset($options) && !isset($values)) |
|
99 | - return ''; /* raise error here? */ |
|
98 | + if (!isset($options) && !isset($values)) { |
|
99 | + return ''; |
|
100 | + } |
|
101 | + /* raise error here? */ |
|
100 | 102 | |
101 | 103 | settype($selected, 'array'); |
102 | 104 | $_html_result = array(); |
103 | 105 | |
104 | 106 | if (isset($options)) { |
105 | 107 | |
106 | - foreach ($options as $_key=>$_val) |
|
107 | - $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels); |
|
108 | + foreach ($options as $_key=>$_val) { |
|
109 | + $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels); |
|
110 | + } |
|
108 | 111 | |
109 | 112 | |
110 | 113 | } else { |
@@ -125,7 +128,9 @@ discard block |
||
125 | 128 | |
126 | 129 | function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels) { |
127 | 130 | $_output = ''; |
128 | - if ($labels) $_output .= '<label>'; |
|
131 | + if ($labels) { |
|
132 | + $_output .= '<label>'; |
|
133 | + } |
|
129 | 134 | $_output .= '<input type="checkbox" name="' |
130 | 135 | . smarty_function_escape_special_chars($name) . '[]" value="' |
131 | 136 | . smarty_function_escape_special_chars($value) . '"'; |
@@ -134,7 +139,9 @@ discard block |
||
134 | 139 | $_output .= ' checked="checked"'; |
135 | 140 | } |
136 | 141 | $_output .= $extra . ' />' . $output; |
137 | - if ($labels) $_output .= '</label>'; |
|
142 | + if ($labels) { |
|
143 | + $_output .= '</label>'; |
|
144 | + } |
|
138 | 145 | $_output .= $separator; |
139 | 146 | |
140 | 147 | return $_output; |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | function smarty_function_html_options($params, &$smarty) |
31 | 31 | { |
32 | - require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); |
|
32 | + require_once $smarty->_get_plugin_filepath('shared', 'escape_special_chars'); |
|
33 | 33 | |
34 | 34 | $name = null; |
35 | 35 | $values = null; |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | |
40 | 40 | $extra = ''; |
41 | 41 | |
42 | - foreach($params as $_key => $_val) { |
|
43 | - switch($_key) { |
|
42 | + foreach ($params as $_key => $_val) { |
|
43 | + switch ($_key) { |
|
44 | 44 | case 'name': |
45 | 45 | $$_key = (string)$_val; |
46 | 46 | break; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | break; |
60 | 60 | |
61 | 61 | default: |
62 | - if(!is_array($_val)) { |
|
62 | + if (!is_array($_val)) { |
|
63 | 63 | $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"'; |
64 | 64 | } else { |
65 | 65 | $smarty->trigger_error("html_options: extra attribute '$_key' cannot be an array", E_USER_NOTICE); |
@@ -87,8 +87,8 @@ discard block |
||
87 | 87 | |
88 | 88 | } |
89 | 89 | |
90 | - if(!empty($name)) { |
|
91 | - $_html_result = '<select name="' . $name . '"' . $extra . '>' . "\n" . $_html_result . '</select>' . "\n"; |
|
90 | + if (!empty($name)) { |
|
91 | + $_html_result = '<select name="'.$name.'"'.$extra.'>'."\n".$_html_result.'</select>'."\n"; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | return $_html_result; |
@@ -96,12 +96,12 @@ discard block |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | function smarty_function_html_options_optoutput($key, $value, $selected) { |
99 | - if(!is_array($value)) { |
|
100 | - $_html_result = '<option label="' . smarty_function_escape_special_chars($value) . '" value="' . |
|
101 | - smarty_function_escape_special_chars($key) . '"'; |
|
99 | + if (!is_array($value)) { |
|
100 | + $_html_result = '<option label="'.smarty_function_escape_special_chars($value).'" value="'. |
|
101 | + smarty_function_escape_special_chars($key).'"'; |
|
102 | 102 | if (in_array((string)$key, $selected)) |
103 | 103 | $_html_result .= ' selected="selected"'; |
104 | - $_html_result .= '>' . smarty_function_escape_special_chars($value) . '</option>' . "\n"; |
|
104 | + $_html_result .= '>'.smarty_function_escape_special_chars($value).'</option>'."\n"; |
|
105 | 105 | } else { |
106 | 106 | $_html_result = smarty_function_html_options_optgroup($key, $value, $selected); |
107 | 107 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | } |
110 | 110 | |
111 | 111 | function smarty_function_html_options_optgroup($key, $values, $selected) { |
112 | - $optgroup_html = '<optgroup label="' . smarty_function_escape_special_chars($key) . '">' . "\n"; |
|
112 | + $optgroup_html = '<optgroup label="'.smarty_function_escape_special_chars($key).'">'."\n"; |
|
113 | 113 | foreach ($values as $key => $value) { |
114 | 114 | $optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected); |
115 | 115 | } |
@@ -68,15 +68,18 @@ discard block |
||
68 | 68 | } |
69 | 69 | } |
70 | 70 | |
71 | - if (!isset($options) && !isset($values)) |
|
72 | - return ''; /* raise error here? */ |
|
71 | + if (!isset($options) && !isset($values)) { |
|
72 | + return ''; |
|
73 | + } |
|
74 | + /* raise error here? */ |
|
73 | 75 | |
74 | 76 | $_html_result = ''; |
75 | 77 | |
76 | 78 | if (isset($options)) { |
77 | 79 | |
78 | - foreach ($options as $_key=>$_val) |
|
79 | - $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected); |
|
80 | + foreach ($options as $_key=>$_val) { |
|
81 | + $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected); |
|
82 | + } |
|
80 | 83 | |
81 | 84 | } else { |
82 | 85 | |
@@ -99,8 +102,9 @@ discard block |
||
99 | 102 | if(!is_array($value)) { |
100 | 103 | $_html_result = '<option label="' . smarty_function_escape_special_chars($value) . '" value="' . |
101 | 104 | smarty_function_escape_special_chars($key) . '"'; |
102 | - if (in_array((string)$key, $selected)) |
|
103 | - $_html_result .= ' selected="selected"'; |
|
105 | + if (in_array((string)$key, $selected)) { |
|
106 | + $_html_result .= ' selected="selected"'; |
|
107 | + } |
|
104 | 108 | $_html_result .= '>' . smarty_function_escape_special_chars($value) . '</option>' . "\n"; |
105 | 109 | } else { |
106 | 110 | $_html_result = smarty_function_html_options_optgroup($key, $value, $selected); |
@@ -26,7 +26,7 @@ |
||
26 | 26 | if (isset($params['output'])) { |
27 | 27 | $smarty->assign('_smarty_debug_output', $params['output']); |
28 | 28 | } |
29 | - require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php'); |
|
29 | + require_once(SMARTY_CORE_DIR.'core.display_debug_console.php'); |
|
30 | 30 | return smarty_core_display_debug_console(null, $smarty); |
31 | 31 | } |
32 | 32 |
@@ -38,7 +38,7 @@ |
||
38 | 38 | return; |
39 | 39 | } |
40 | 40 | if (DIRECTORY_SEPARATOR == '\\') { |
41 | - $_win_from = array('%D', '%h', '%n', '%r', '%R', '%t', '%T'); |
|
41 | + $_win_from = array('%D', '%h', '%n', '%r', '%R', '%t', '%T'); |
|
42 | 42 | $_win_to = array('%m/%d/%y', '%b', "\n", '%I:%M:%S %p', '%H:%M', "\t", '%H:%M:%S'); |
43 | 43 | if (strpos($format, '%e') !== false) { |
44 | 44 | $_win_from[] = '%e'; |
@@ -108,7 +108,7 @@ |
||
108 | 108 | $retval = $trigger . '="return overlib(\''.preg_replace(array("!'!","![\r\n]!"),array("\'",'\r'),$text).'\''; |
109 | 109 | $retval .= $append . ');"'; |
110 | 110 | if ($trigger == 'onmouseover') |
111 | - $retval .= ' onmouseout="nd();"'; |
|
111 | + $retval .= ' onmouseout="nd();"'; |
|
112 | 112 | |
113 | 113 | |
114 | 114 | return $retval; |
@@ -30,13 +30,13 @@ discard block |
||
30 | 30 | case 'inarray': |
31 | 31 | $$_key = (string)$_value; |
32 | 32 | if ($_key == 'function' || $_key == 'inarray') |
33 | - $append .= ',' . strtoupper($_key) . ",'$_value'"; |
|
33 | + $append .= ','.strtoupper($_key).",'$_value'"; |
|
34 | 34 | break; |
35 | 35 | |
36 | 36 | case 'caption': |
37 | 37 | case 'closetext': |
38 | 38 | case 'status': |
39 | - $append .= ',' . strtoupper($_key) . ",'" . str_replace("'","\'",$_value) . "'"; |
|
39 | + $append .= ','.strtoupper($_key).",'".str_replace("'", "\'", $_value)."'"; |
|
40 | 40 | break; |
41 | 41 | |
42 | 42 | case 'fgcolor': |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | case 'capicon': |
54 | 54 | case 'background': |
55 | 55 | case 'frame': |
56 | - $append .= ',' . strtoupper($_key) . ",'$_value'"; |
|
56 | + $append .= ','.strtoupper($_key).",'$_value'"; |
|
57 | 57 | break; |
58 | 58 | |
59 | 59 | case 'textsize': |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | case 'pady': |
73 | 73 | case 'timeout': |
74 | 74 | case 'delay': |
75 | - $append .= ',' . strtoupper($_key) . ",$_value"; |
|
75 | + $append .= ','.strtoupper($_key).",$_value"; |
|
76 | 76 | break; |
77 | 77 | |
78 | 78 | case 'sticky': |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | case 'mouseoff': |
91 | 91 | case 'followmouse': |
92 | 92 | case 'closeclick': |
93 | - if ($_value) $append .= ',' . strtoupper($_key); |
|
93 | + if ($_value) $append .= ','.strtoupper($_key); |
|
94 | 94 | break; |
95 | 95 | |
96 | 96 | default: |
@@ -105,8 +105,8 @@ discard block |
||
105 | 105 | |
106 | 106 | if (empty($trigger)) { $trigger = "onmouseover"; } |
107 | 107 | |
108 | - $retval = $trigger . '="return overlib(\''.preg_replace(array("!'!","![\r\n]!"),array("\'",'\r'),$text).'\''; |
|
109 | - $retval .= $append . ');"'; |
|
108 | + $retval = $trigger.'="return overlib(\''.preg_replace(array("!'!", "![\r\n]!"), array("\'", '\r'), $text).'\''; |
|
109 | + $retval .= $append.');"'; |
|
110 | 110 | if ($trigger == 'onmouseover') |
111 | 111 | $retval .= ' onmouseout="nd();"'; |
112 | 112 |
@@ -29,8 +29,9 @@ discard block |
||
29 | 29 | case 'function': |
30 | 30 | case 'inarray': |
31 | 31 | $$_key = (string)$_value; |
32 | - if ($_key == 'function' || $_key == 'inarray') |
|
33 | - $append .= ',' . strtoupper($_key) . ",'$_value'"; |
|
32 | + if ($_key == 'function' || $_key == 'inarray') { |
|
33 | + $append .= ',' . strtoupper($_key) . ",'$_value'"; |
|
34 | + } |
|
34 | 35 | break; |
35 | 36 | |
36 | 37 | case 'caption': |
@@ -90,7 +91,9 @@ discard block |
||
90 | 91 | case 'mouseoff': |
91 | 92 | case 'followmouse': |
92 | 93 | case 'closeclick': |
93 | - if ($_value) $append .= ',' . strtoupper($_key); |
|
94 | + if ($_value) { |
|
95 | + $append .= ',' . strtoupper($_key); |
|
96 | + } |
|
94 | 97 | break; |
95 | 98 | |
96 | 99 | default: |
@@ -107,8 +110,9 @@ discard block |
||
107 | 110 | |
108 | 111 | $retval = $trigger . '="return overlib(\''.preg_replace(array("!'!","![\r\n]!"),array("\'",'\r'),$text).'\''; |
109 | 112 | $retval .= $append . ');"'; |
110 | - if ($trigger == 'onmouseover') |
|
111 | - $retval .= ' onmouseout="nd();"'; |
|
113 | + if ($trigger == 'onmouseover') { |
|
114 | + $retval .= ' onmouseout="nd();"'; |
|
115 | + } |
|
112 | 116 | |
113 | 117 | |
114 | 118 | return $retval; |
@@ -109,26 +109,26 @@ discard block |
||
109 | 109 | $loop_count = count($loop); |
110 | 110 | if (empty($params['rows'])) { |
111 | 111 | /* no rows specified */ |
112 | - $rows = ceil($loop_count/$cols_count); |
|
112 | + $rows = ceil($loop_count / $cols_count); |
|
113 | 113 | } elseif (empty($params['cols'])) { |
114 | 114 | if (!empty($params['rows'])) { |
115 | 115 | /* no cols specified, but rows */ |
116 | - $cols_count = ceil($loop_count/$rows); |
|
116 | + $cols_count = ceil($loop_count / $rows); |
|
117 | 117 | } |
118 | 118 | } |
119 | 119 | |
120 | 120 | $output = "<table $table_attr>\n"; |
121 | 121 | |
122 | 122 | if (!empty($caption)) { |
123 | - $output .= '<caption>' . $caption . "</caption>\n"; |
|
123 | + $output .= '<caption>'.$caption."</caption>\n"; |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | if (is_array($cols)) { |
127 | 127 | $cols = ($hdir == 'right') ? $cols : array_reverse($cols); |
128 | 128 | $output .= "<thead><tr>\n"; |
129 | 129 | |
130 | - for ($r=0; $r<$cols_count; $r++) { |
|
131 | - $output .= '<th' . smarty_function_html_table_cycle('th', $th_attr, $r) . '>'; |
|
130 | + for ($r = 0; $r < $cols_count; $r++) { |
|
131 | + $output .= '<th'.smarty_function_html_table_cycle('th', $th_attr, $r).'>'; |
|
132 | 132 | $output .= $cols[$r]; |
133 | 133 | $output .= "</th>\n"; |
134 | 134 | } |
@@ -136,21 +136,21 @@ discard block |
||
136 | 136 | } |
137 | 137 | |
138 | 138 | $output .= "<tbody>\n"; |
139 | - for ($r=0; $r<$rows; $r++) { |
|
140 | - $output .= "<tr" . smarty_function_html_table_cycle('tr', $tr_attr, $r) . ">\n"; |
|
141 | - $rx = ($vdir == 'down') ? $r*$cols_count : ($rows-1-$r)*$cols_count; |
|
139 | + for ($r = 0; $r < $rows; $r++) { |
|
140 | + $output .= "<tr".smarty_function_html_table_cycle('tr', $tr_attr, $r).">\n"; |
|
141 | + $rx = ($vdir == 'down') ? $r * $cols_count : ($rows - 1 - $r) * $cols_count; |
|
142 | 142 | |
143 | - for ($c=0; $c<$cols_count; $c++) { |
|
144 | - $x = ($hdir == 'right') ? $rx+$c : $rx+$cols_count-1-$c; |
|
145 | - if ($inner!='cols') { |
|
143 | + for ($c = 0; $c < $cols_count; $c++) { |
|
144 | + $x = ($hdir == 'right') ? $rx + $c : $rx + $cols_count - 1 - $c; |
|
145 | + if ($inner != 'cols') { |
|
146 | 146 | /* shuffle x to loop over rows*/ |
147 | - $x = floor($x/$cols_count) + ($x%$cols_count)*$rows; |
|
147 | + $x = floor($x / $cols_count) + ($x % $cols_count) * $rows; |
|
148 | 148 | } |
149 | 149 | |
150 | - if ($x<$loop_count) { |
|
151 | - $output .= "<td" . smarty_function_html_table_cycle('td', $td_attr, $c) . ">" . $loop[$x] . "</td>\n"; |
|
150 | + if ($x < $loop_count) { |
|
151 | + $output .= "<td".smarty_function_html_table_cycle('td', $td_attr, $c).">".$loop[$x]."</td>\n"; |
|
152 | 152 | } else { |
153 | - $output .= "<td" . smarty_function_html_table_cycle('td', $td_attr, $c) . ">$trailpad</td>\n"; |
|
153 | + $output .= "<td".smarty_function_html_table_cycle('td', $td_attr, $c).">$trailpad</td>\n"; |
|
154 | 154 | } |
155 | 155 | } |
156 | 156 | $output .= "</tr>\n"; |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | } |
163 | 163 | |
164 | 164 | function smarty_function_html_table_cycle($name, $var, $no) { |
165 | - if(!is_array($var)) { |
|
165 | + if (!is_array($var)) { |
|
166 | 166 | $ret = $var; |
167 | 167 | } else { |
168 | 168 | $ret = $var[$no % count($var)]; |
@@ -25,7 +25,7 @@ |
||
25 | 25 | * @return string |
26 | 26 | */ |
27 | 27 | function smarty_modifier_truncate($string, $length = 80, $etc = '...', |
28 | - $break_words = false, $middle = false) |
|
28 | + $break_words = false, $middle = false) |
|
29 | 29 | { |
30 | 30 | if ($length == 0) |
31 | 31 | return ''; |
@@ -33,12 +33,12 @@ |
||
33 | 33 | if (strlen($string) > $length) { |
34 | 34 | $length -= min($length, strlen($etc)); |
35 | 35 | if (!$break_words && !$middle) { |
36 | - $string = preg_replace('/\s+?(\S+)?$/', '', substr($string, 0, $length+1)); |
|
36 | + $string = preg_replace('/\s+?(\S+)?$/', '', substr($string, 0, $length + 1)); |
|
37 | 37 | } |
38 | - if(!$middle) { |
|
39 | - return substr($string, 0, $length) . $etc; |
|
38 | + if (!$middle) { |
|
39 | + return substr($string, 0, $length).$etc; |
|
40 | 40 | } else { |
41 | - return substr($string, 0, $length/2) . $etc . substr($string, -$length/2); |
|
41 | + return substr($string, 0, $length / 2).$etc.substr($string, -$length / 2); |
|
42 | 42 | } |
43 | 43 | } else { |
44 | 44 | return $string; |
@@ -27,8 +27,9 @@ |
||
27 | 27 | function smarty_modifier_truncate($string, $length = 80, $etc = '...', |
28 | 28 | $break_words = false, $middle = false) |
29 | 29 | { |
30 | - if ($length == 0) |
|
31 | - return ''; |
|
30 | + if ($length == 0) { |
|
31 | + return ''; |
|
32 | + } |
|
32 | 33 | |
33 | 34 | if (strlen($string) > $length) { |
34 | 35 | $length -= min($length, strlen($etc)); |
@@ -23,7 +23,7 @@ |
||
23 | 23 | } elseif (preg_match('/^\d{14}$/', $string)) { |
24 | 24 | // it is mysql timestamp format of YYYYMMDDHHMMSS? |
25 | 25 | $time = mktime(substr($string, 8, 2),substr($string, 10, 2),substr($string, 12, 2), |
26 | - substr($string, 4, 2),substr($string, 6, 2),substr($string, 0, 4)); |
|
26 | + substr($string, 4, 2),substr($string, 6, 2),substr($string, 0, 4)); |
|
27 | 27 | |
28 | 28 | } elseif (is_numeric($string)) { |
29 | 29 | // it is a numeric string, we handle it as timestamp |
@@ -16,14 +16,14 @@ |
||
16 | 16 | */ |
17 | 17 | function smarty_make_timestamp($string) |
18 | 18 | { |
19 | - if(empty($string)) { |
|
19 | + if (empty($string)) { |
|
20 | 20 | // use "now": |
21 | 21 | $time = time(); |
22 | 22 | |
23 | 23 | } elseif (preg_match('/^\d{14}$/', $string)) { |
24 | 24 | // it is mysql timestamp format of YYYYMMDDHHMMSS? |
25 | - $time = mktime(substr($string, 8, 2),substr($string, 10, 2),substr($string, 12, 2), |
|
26 | - substr($string, 4, 2),substr($string, 6, 2),substr($string, 0, 4)); |
|
25 | + $time = mktime(substr($string, 8, 2), substr($string, 10, 2), substr($string, 12, 2), |
|
26 | + substr($string, 4, 2), substr($string, 6, 2), substr($string, 0, 4)); |
|
27 | 27 | |
28 | 28 | } elseif (is_numeric($string)) { |
29 | 29 | // it is a numeric string, we handle it as timestamp |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * For backwards compatibility, we check for insert functions in |
48 | 48 | * the symbol table before trying to load them as a plugin. |
49 | 49 | */ |
50 | - $_plugin_func = 'insert_' . $_name; |
|
50 | + $_plugin_func = 'insert_'.$_name; |
|
51 | 51 | if (function_exists($_plugin_func)) { |
52 | 52 | $_plugin = array($_plugin_func, $_tpl_file, $_tpl_line, true, false); |
53 | 53 | continue; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | $_plugin_file = $smarty->_get_plugin_filepath($_type, $_name); |
58 | 58 | |
59 | - if (! $_found = ($_plugin_file != false)) { |
|
59 | + if (!$_found = ($_plugin_file != false)) { |
|
60 | 60 | $_message = "could not load plugin file '$_type.$_name.php'\n"; |
61 | 61 | } |
62 | 62 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | if ($_found) { |
69 | 69 | include_once $_plugin_file; |
70 | 70 | |
71 | - $_plugin_func = 'smarty_' . $_type . '_' . $_name; |
|
71 | + $_plugin_func = 'smarty_'.$_type.'_'.$_name; |
|
72 | 72 | if (!function_exists($_plugin_func)) { |
73 | 73 | $smarty->_trigger_fatal_error("[plugin] function $_plugin_func() not found in $_plugin_file", $_tpl_file, $_tpl_line, __FILE__, __LINE__); |
74 | 74 | continue; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * 'script' attribute. |
80 | 80 | */ |
81 | 81 | else if ($_type == 'insert' && $_delayed_loading) { |
82 | - $_plugin_func = 'smarty_' . $_type . '_' . $_name; |
|
82 | + $_plugin_func = 'smarty_'.$_type.'_'.$_name; |
|
83 | 83 | $_found = true; |
84 | 84 | } |
85 | 85 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $smarty->_plugins[$_type][$_name] = array($_plugin_func, $_tpl_file, $_tpl_line, true, true); |
116 | 116 | } else { |
117 | 117 | // output error |
118 | - $smarty->_trigger_fatal_error('[plugin] ' . $_message, $_tpl_file, $_tpl_line, __FILE__, __LINE__); |
|
118 | + $smarty->_trigger_fatal_error('[plugin] '.$_message, $_tpl_file, $_tpl_line, __FILE__, __LINE__); |
|
119 | 119 | } |
120 | 120 | } |
121 | 121 | } |
@@ -38,7 +38,10 @@ |
||
38 | 38 | $_plugin[1] = $_tpl_file; |
39 | 39 | $_plugin[2] = $_tpl_line; |
40 | 40 | $_plugin[3] = true; |
41 | - if (!isset($_plugin[4])) $_plugin[4] = true; /* cacheable */ |
|
41 | + if (!isset($_plugin[4])) { |
|
42 | + $_plugin[4] = true; |
|
43 | + } |
|
44 | + /* cacheable */ |
|
42 | 45 | } |
43 | 46 | } |
44 | 47 | continue; |