Changeset 7655 for trunk/workflow/inc/smarty
- Timestamp:
- 12/14/12 14:30:35 (11 years ago)
- Location:
- trunk/workflow/inc/smarty
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/workflow/inc/smarty/Config_File.class.php
r795 r7655 282 282 preg_match_all('!^.*\r?\n?!m', $contents, $match); 283 283 $lines = $match[0]; 284 for ($i=0, $count=count($lines); $i<$count; $i++) {284 for ($i=0, $count=count($lines); $i<$count; ++$i) { 285 285 $line = $lines[$i]; 286 286 if (empty($line)) continue; -
trunk/workflow/inc/smarty/Smarty_Compiler.class.php
r795 r7655 277 277 278 278 /* loop through text blocks */ 279 for ($curr_tb = 0, $for_max = count($text_blocks); $curr_tb < $for_max; $curr_tb++) {279 for ($curr_tb = 0, $for_max = count($text_blocks); $curr_tb < $for_max; ++$curr_tb) { 280 280 /* match anything resembling php tags */ 281 281 if (preg_match_all('~(<\?(?:\w+|=)?|\?>|language\s*=\s*[\"\']?\s*php\s*[\"\']?)~is', $text_blocks[$curr_tb], $sp_match)) { … … 283 283 $sp_match[1] = array_unique($sp_match[1]); 284 284 usort($sp_match[1], '_smarty_sort_length'); 285 for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; $curr_sp++) {285 for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; ++$curr_sp) { 286 286 $text_blocks[$curr_tb] = str_replace($sp_match[1][$curr_sp],'%%%SMARTYSP'.$curr_sp.'%%%',$text_blocks[$curr_tb]); 287 287 } 288 288 /* process each one */ 289 for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; $curr_sp++) {289 for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; ++$curr_sp) { 290 290 if ($this->php_handling == SMARTY_PHP_PASSTHRU) { 291 291 /* echo php contents */ … … 308 308 /* Compile the template tags into PHP code. */ 309 309 $compiled_tags = array(); 310 for ($i = 0, $for_max = count($template_tags); $i < $for_max; $i++) {310 for ($i = 0, $for_max = count($template_tags); $i < $for_max; ++$i) { 311 311 $this->_current_line_no += substr_count($text_blocks[$i], "\n"); 312 312 $compiled_tags[] = $this->_compile_tag($template_tags[$i]); … … 331 331 if ($strip) { 332 332 /* strip all $text_blocks before the next '/strip' */ 333 for ($j = $i + 1; $j < $for_max; $j++) {333 for ($j = $i + 1; $j < $for_max; ++$j) { 334 334 /* remove leading and trailing whitespaces of each line */ 335 335 $text_blocks[$j] = preg_replace('![\t ]*[\r\n]+[\t ]*!', '', $text_blocks[$j]); … … 354 354 355 355 /* Interleave the compiled contents and text blocks to get the final result. */ 356 for ($i = 0, $for_max = count($compiled_tags); $i < $for_max; $i++) {356 for ($i = 0, $for_max = count($compiled_tags); $i < $for_max; ++$i) { 357 357 if ($compiled_tags[$i] == '') { 358 358 // tag result empty, remove first newline from following text block … … 1279 1279 1280 1280 $is_arg_stack = array(); 1281 1282 for ($i = 0; $i < count($tokens); $i++) { 1281 $tokens_count = count($tokens); 1282 1283 for ($i = 0; $i < $tokens_count; ++$i) { 1283 1284 1284 1285 $token = &$tokens[$i]; … … 1470 1471 case 'even': 1471 1472 if (isset($tokens[$expr_end]) && $tokens[$expr_end] == 'by') { 1472 $expr_end++;1473 ++$expr_end; 1473 1474 $expr_arg = $tokens[$expr_end++]; 1474 1475 $expr = "!(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))"; … … 1479 1480 case 'odd': 1480 1481 if (isset($tokens[$expr_end]) && $tokens[$expr_end] == 'by') { 1481 $expr_end++;1482 ++$expr_end; 1482 1483 $expr_arg = $tokens[$expr_end++]; 1483 1484 $expr = "(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))"; … … 1488 1489 case 'div': 1489 1490 if (@$tokens[$expr_end] == 'by') { 1490 $expr_end++;1491 ++$expr_end; 1491 1492 $expr_arg = $tokens[$expr_end++]; 1492 1493 $expr = "!($is_arg % " . $this->_parse_var_props($expr_arg) . ")"; … … 1843 1844 $this->_parse_vars_props($match); 1844 1845 $replace = array(); 1845 for ($i = 0, $count = count($match); $i < $count; $i++) {1846 for ($i = 0, $count = count($match); $i < $count; ++$i) { 1846 1847 $replace[$orig_vals[$i]] = $match[$i]; 1847 1848 } … … 1905 1906 list(, $_modifiers, $modifier_arg_strings) = $_match; 1906 1907 1907 for ($_i = 0, $_for_max = count($_modifiers); $_i < $_for_max; $_i++) {1908 for ($_i = 0, $_for_max = count($_modifiers); $_i < $_for_max; ++$_i) { 1908 1909 $_modifier_name = $_modifiers[$_i]; 1909 1910 -
trunk/workflow/inc/smarty/internals/core.process_cached_inserts.php
r795 r7655 18 18 list($cached_inserts, $insert_args) = $match; 19 19 20 for ($i = 0, $for_max = count($cached_inserts); $i < $for_max; $i++) {20 for ($i = 0, $for_max = count($cached_inserts); $i < $for_max; ++$i) { 21 21 if ($smarty->debugging) { 22 22 $_params = array(); -
trunk/workflow/inc/smarty/internals/core.write_cache_file.php
r795 r7655 44 44 $level = 0; 45 45 $j = 0; 46 for ($i=0, $results_count = count($results); $i < $results_count && $j < $match_count; $i++) {46 for ($i=0, $results_count = count($results); $i < $results_count && $j < $match_count; ++$i) { 47 47 if ($results[$i] == $match[0][$j]) { 48 48 // nocache tag … … 53 53 if ($level++ > 0) unset($results[$i]); 54 54 } 55 $j++;55 ++$j; 56 56 } elseif ($level > 0) { 57 57 unset($results[$i]); -
trunk/workflow/inc/smarty/internals/core.write_compiled_include.php
r795 r7655 38 38 39 39 $this_varname = ((double)phpversion() >= 5.0) ? '_smarty' : 'this'; 40 for ($_i = 0, $_for_max = count($_match_source); $_i < $_for_max; $_i++) {40 for ($_i = 0, $_for_max = count($_match_source); $_i < $_for_max; ++$_i) { 41 41 $_match =& $_match_source[$_i]; 42 42 $source = $_match[4]; … … 57 57 } 58 58 59 for ($i=0, $count = count($tokens); $i < $count; $i++) {59 for ($i=0, $count = count($tokens); $i < $count; ++$i) { 60 60 if (is_array($tokens[$i])) { 61 61 if ($tokens[$i][0] == T_VARIABLE && $tokens[$i][1] == '$this') { -
trunk/workflow/inc/smarty/plugins/block.textformat.php
r795 r7655 76 76 $_output = ''; 77 77 78 for($_x = 0, $_y = count($_paragraphs); $_x < $_y; $_x++) {78 for($_x = 0, $_y = count($_paragraphs); $_x < $_y; ++$_x) { 79 79 if ($_paragraphs[$_x] == '') { 80 80 continue; -
trunk/workflow/inc/smarty/plugins/function.config_load.php
r795 r7655 121 121 $smarty->_config[1]['files'][$_file] = true; 122 122 } else if ($_scope == 'global') { 123 for ($i = 1, $for_max = count($smarty->_config); $i < $for_max; $i++) {123 for ($i = 1, $for_max = count($smarty->_config); $i < $for_max; ++$i) { 124 124 $smarty->_config[$i]['vars'] = @array_merge($smarty->_config[$i]['vars'], $_config_vars); 125 125 $smarty->_config[$i]['files'][$_file] = true; -
trunk/workflow/inc/smarty/plugins/function.html_select_date.php
r795 r7655 181 181 $field_separator_count = -1; 182 182 if ($display_months) { 183 $field_separator_count++;183 ++$field_separator_count; 184 184 $month_names = array(); 185 185 $month_values = array(); … … 188 188 $month_values[''] = ''; 189 189 } 190 for ($i = 1; $i <= 12; $i++) {190 for ($i = 1; $i <= 12; ++$i) { 191 191 $month_names[$i] = strftime($month_format, mktime(0, 0, 0, $i, 1, 2000)); 192 192 $month_values[$i] = strftime($month_value_format, mktime(0, 0, 0, $i, 1, 2000)); … … 225 225 $day_values[''] = ''; 226 226 } 227 for ($i = 1; $i <= 31; $i++) {227 for ($i = 1; $i <= 31; ++$i) { 228 228 $days[] = sprintf($day_format, $i); 229 229 $day_values[] = sprintf($day_value_format, $i); … … 255 255 256 256 if ($display_years) { 257 $field_separator_count++;257 ++$field_separator_count; 258 258 if (null !== $field_array){ 259 259 $year_name = $field_array . '[' . $prefix . 'Year]'; … … 303 303 304 304 // Loop thru the field_order field 305 for ($i = 0; $i <= 2; $i++){305 for ($i = 0; $i <= 2; ++$i){ 306 306 $c = substr($field_order, $i, 1); 307 307 switch ($c){ -
trunk/workflow/inc/smarty/plugins/function.html_select_time.php
r795 r7655 85 85 $hours = $use_24_hours ? range(0, 23) : range(1, 12); 86 86 $hour_fmt = $use_24_hours ? '%H' : '%I'; 87 for ($i = 0, $for_max = count($hours); $i < $for_max; $i++)87 for ($i = 0, $for_max = count($hours); $i < $for_max; ++$i) 88 88 $hours[$i] = sprintf('%02d', $hours[$i]); 89 89 $html_result .= '<select name='; -
trunk/workflow/inc/smarty/plugins/function.html_table.php
r795 r7655 128 128 $output .= "<thead><tr>\n"; 129 129 130 for ($r=0; $r<$cols_count; $r++) {130 for ($r=0; $r<$cols_count; ++$r) { 131 131 $output .= '<th' . smarty_function_html_table_cycle('th', $th_attr, $r) . '>'; 132 132 $output .= $cols[$r]; … … 137 137 138 138 $output .= "<tbody>\n"; 139 for ($r=0; $r<$rows; $r++) {139 for ($r=0; $r<$rows; ++$r) { 140 140 $output .= "<tr" . smarty_function_html_table_cycle('tr', $tr_attr, $r) . ">\n"; 141 141 $rx = ($vdir == 'down') ? $r*$cols_count : ($rows-1-$r)*$cols_count; 142 142 143 for ($c=0; $c<$cols_count; $c++) {143 for ($c=0; $c<$cols_count; ++$c) { 144 144 $x = ($hdir == 'right') ? $rx+$c : $rx+$cols_count-1-$c; 145 145 if ($inner!='cols') { -
trunk/workflow/inc/smarty/plugins/function.mailto.php
r795 r7655 89 89 90 90 $mail_parm_vals = ''; 91 for ($i=0; $i<count($mail_parms); $i++) { 91 $mail_parms_count = count($mail_parms); 92 for ($i=0; $i<$mail_parms_count; ++$i) { 92 93 $mail_parm_vals .= (0==$i) ? '?' : '&'; 93 94 $mail_parm_vals .= $mail_parms[$i]; … … 105 106 106 107 $js_encode = ''; 107 for ($x=0; $x < strlen($string); $x++) {108 for ($x=0; $x < strlen($string); ++$x) { 108 109 $js_encode .= '%' . bin2hex($string[$x]); 109 110 } … … 114 115 $string = '<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>'; 115 116 116 for($x = 0, $y = strlen($string); $x < $y; $x++) {117 for($x = 0, $y = strlen($string); $x < $y; ++$x ) { 117 118 $ord[] = ord($string[$x]); 118 119 } … … 138 139 } 139 140 $address_encode = ''; 140 for ($x=0; $x < strlen($address); $x++) {141 for ($x=0; $x < strlen($address); ++$x) { 141 142 if(preg_match('!\w!',$address[$x])) { 142 143 $address_encode .= '%' . bin2hex($address[$x]); … … 146 147 } 147 148 $text_encode = ''; 148 for ($x=0; $x < strlen($text); $x++) {149 for ($x=0; $x < strlen($text); ++$x) { 149 150 $text_encode .= '&#x' . bin2hex($text[$x]).';'; 150 151 } -
trunk/workflow/inc/smarty/plugins/modifier.escape.php
r795 r7655 42 42 // escape every character into hex 43 43 $return = ''; 44 for ($x=0; $x < strlen($string); $x++) {44 for ($x=0; $x < strlen($string); ++$x) { 45 45 $return .= '%' . bin2hex($string[$x]); 46 46 } … … 49 49 case 'hexentity': 50 50 $return = ''; 51 for ($x=0; $x < strlen($string); $x++) {51 for ($x=0; $x < strlen($string); ++$x) { 52 52 $return .= '&#x' . bin2hex($string[$x]) . ';'; 53 53 } … … 56 56 case 'decentity': 57 57 $return = ''; 58 for ($x=0; $x < strlen($string); $x++) {58 for ($x=0; $x < strlen($string); ++$x) { 59 59 $return .= '&#' . ord($string[$x]) . ';'; 60 60 } … … 72 72 // escape non-standard chars, such as ms document quotes 73 73 $_res = ''; 74 for($_i = 0, $_len = strlen($string); $_i < $_len; $_i++) {74 for($_i = 0, $_len = strlen($string); $_i < $_len; ++$_i) { 75 75 $_ord = ord(substr($string, $_i, 1)); 76 76 // non-standard char, escape it -
trunk/workflow/inc/smarty/plugins/outputfilter.trimwhitespace.php
r795 r7655 65 65 $_len = strlen($search_str); 66 66 $_pos = 0; 67 for ($_i=0, $_count=count($replace); $_i<$_count; $_i++)67 for ($_i=0, $_count=count($replace); $_i<$_count; ++$_i) 68 68 if (($_pos=strpos($subject, $search_str, $_pos))!==false) 69 69 $subject = substr_replace($subject, $replace[$_i], $_pos, $_len);
Note: See TracChangeset
for help on using the changeset viewer.