[phpMP-CVS] CVS: phpMP/includes/plugins function.counter.php,1.1,1.2 function.cycle.php,1.1,1.2 func
Status: Pre-Alpha
Brought to you by:
heimidal
From: Brian R. <hei...@us...> - 2003-02-06 02:09:58
|
Update of /cvsroot/phpmp/phpMP/includes/plugins In directory sc8-pr-cvs1:/tmp/cvs-serv4088/plugins Modified Files: function.counter.php function.cycle.php function.debug.php function.eval.php function.fetch.php function.html_options.php function.html_select_date.php function.html_select_time.php function.math.php function.popup.php function.popup_init.php modifier.debug_print_var.php modifier.escape.php Log Message: Update to Smarty 2.4.0. Index: function.counter.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/plugins/function.counter.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** function.counter.php 25 Jul 2002 11:06:25 -0000 1.1 --- function.counter.php 6 Feb 2003 02:09:54 -0000 1.2 *************** *** 43,48 **** } ! if ($printval[$name]) ! echo $count[$name]; if (isset($skip)) --- 43,51 ---- } ! if ($printval[$name]) { ! $retval = $count[$name]; ! } else { ! $retval = null; ! } if (isset($skip)) *************** *** 60,63 **** --- 63,69 ---- else $count[$name] += $skipval[$name]; + + return $retval; + } Index: function.cycle.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/plugins/function.cycle.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** function.cycle.php 25 Jul 2002 11:06:25 -0000 1.1 --- function.cycle.php 6 Feb 2003 02:09:55 -0000 1.2 *************** *** 87,91 **** if($print) { ! echo $cycle_array[$cycle_vars[$name]['index']]; } --- 87,93 ---- if($print) { ! $retval = $cycle_array[$cycle_vars[$name]['index']]; ! } else { ! $retval = null; } *************** *** 97,100 **** --- 99,104 ---- } } + + return $retval; } Index: function.debug.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/plugins/function.debug.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** function.debug.php 28 Nov 2002 05:27:53 -0000 1.1 --- function.debug.php 6 Feb 2003 02:09:55 -0000 1.2 *************** *** 17,21 **** $smarty->assign('_smarty_debug_output',$params['output']); } ! echo $smarty->_generate_debug_output(); } --- 17,21 ---- $smarty->assign('_smarty_debug_output',$params['output']); } ! return $smarty->_generate_debug_output(); } Index: function.eval.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/plugins/function.eval.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** function.eval.php 25 Jul 2002 11:06:25 -0000 1.1 --- function.eval.php 6 Feb 2003 02:09:55 -0000 1.2 *************** *** 23,33 **** $this->_compile_template("evaluated template", $var, $source); if (!empty($assign)) { ! ob_start(); ! eval('?>' . $source); ! $this->assign($assign, ob_get_contents()); ! ob_end_clean(); } else { ! eval('?>' . $source); } } --- 23,35 ---- $this->_compile_template("evaluated template", $var, $source); + ob_start(); + eval('?>' . $source); + $contents = ob_get_contents(); + ob_end_clean(); + if (!empty($assign)) { ! $this->assign($assign, $contents); } else { ! return $contents; } } Index: function.fetch.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/plugins/function.fetch.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** function.fetch.php 25 Jul 2002 11:06:25 -0000 1.1 --- function.fetch.php 6 Feb 2003 02:09:55 -0000 1.2 *************** *** 14,18 **** if (empty($file)) { ! $smarty->_trigger_plugin_error("parameter 'file' cannot be empty"); return; } --- 14,18 ---- if (empty($file)) { ! $smarty->_trigger_fatal_error("[plugin] parameter 'file' cannot be empty"); return; } *************** *** 27,31 **** } if (!$resource_is_secure) { ! $smarty->_trigger_plugin_error("(secure mode) fetch '$file' is not allowed"); return; } --- 27,31 ---- } if (!$resource_is_secure) { ! $smarty->_trigger_fatal_error("[plugin] (secure mode) fetch '$file' is not allowed"); return; } *************** *** 37,41 **** fclose($fp); } else { ! $smarty->_trigger_plugin_error("fetch cannot read file '$file'"); return; } --- 37,41 ---- fclose($fp); } else { ! $smarty->_trigger_fatal_error("[plugin] fetch cannot read file '$file'"); return; } *************** *** 51,59 **** $agent = "Smarty Template Engine ".$smarty->_version; $referer = ""; ! if(!empty($uri_parts['path'])) { ! $uri = $uri_parts['path']; ! } else { ! $uri = '/'; ! } $_is_proxy = false; if(empty($uri_parts['port'])) { --- 51,56 ---- $agent = "Smarty Template Engine ".$smarty->_version; $referer = ""; ! $uri = !empty($uri_parts['path']) ? $uri_parts['path'] : '/'; ! $uri .= !empty($uri_parts['query']) ? '?' . $uri_parts['query'] : ''; $_is_proxy = false; if(empty($uri_parts['port'])) { *************** *** 90,94 **** if(!empty($param_value)) { if(!preg_match('![\w\d-]+: .+!',$param_value)) { ! $smarty->_trigger_plugin_error("invalid header format '".$param_value."'"); return; } else { --- 87,91 ---- if(!empty($param_value)) { if(!preg_match('![\w\d-]+: .+!',$param_value)) { ! $smarty->_trigger_fatal_error("[plugin] invalid header format '".$param_value."'"); return; } else { *************** *** 106,110 **** $proxy_port = (int) $param_value; } else { ! $smarty->_trigger_plugin_error("invalid value for attribute '".$param_key."'"); return; } --- 103,107 ---- $proxy_port = (int) $param_value; } else { ! $smarty->_trigger_fatal_error("[plugin] invalid value for attribute '".$param_key."'"); return; } *************** *** 124,133 **** $timeout = (int) $param_value; } else { ! $smarty->_trigger_plugin_error("invalid value for attribute '".$param_key."'"); return; } break; default: ! $smarty->_trigger_plugin_error("unrecognized attribute '".$param_key."'"); return; } --- 121,130 ---- $timeout = (int) $param_value; } else { ! $smarty->_trigger_fatal_error("[plugin] invalid value for attribute '".$param_key."'"); return; } break; default: ! $smarty->_trigger_fatal_error("[plugin] unrecognized attribute '".$param_key."'"); return; } *************** *** 141,145 **** if(!$fp) { ! $smarty->_trigger_plugin_error("unable to fetch: $errstr ($errno)"); return; } else { --- 138,142 ---- if(!$fp) { ! $smarty->_trigger_fatal_error("[plugin] unable to fetch: $errstr ($errno)"); return; } else { *************** *** 184,188 **** } } else { ! $smarty->_trigger_plugin_error("unable to parse URL, check syntax"); return; } --- 181,185 ---- } } else { ! $smarty->_trigger_fatal_error("[plugin] unable to parse URL, check syntax"); return; } *************** *** 195,199 **** fclose($fp); } else { ! $smarty->_trigger_plugin_error("fetch cannot read file '$file'"); return; } --- 192,196 ---- fclose($fp); } else { ! $smarty->_trigger_fatal_error("[plugin] fetch cannot read file '$file'"); return; } *************** *** 206,210 **** $smarty->assign($params['assign'],$content); } else { ! echo $content; } } --- 203,207 ---- $smarty->assign($params['assign'],$content); } else { ! return $content; } } Index: function.html_options.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/plugins/function.html_options.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** function.html_options.php 28 Nov 2002 05:27:53 -0000 1.2 --- function.html_options.php 6 Feb 2003 02:09:55 -0000 1.3 *************** *** 12,17 **** function smarty_function_html_options($params, &$smarty) { - $print_result = true; - extract($params); --- 12,15 ---- *************** *** 36,51 **** } ! if ($print_result) ! print $html_result; ! else ! return $html_result; } function smarty_function_html_options_optoutput($key, $value, $selected) { if(!is_array($value)) { ! $html_result = "<option label=\"$key\" value=\"$key\""; if (in_array($key, $selected)) $html_result .= " selected=\"selected\""; ! $html_result .= ">$value</option>\n"; } else { $html_result = smarty_function_html_options_optgroup($key, $value, $selected); --- 34,47 ---- } ! return $html_result; } function smarty_function_html_options_optoutput($key, $value, $selected) { if(!is_array($value)) { ! $html_result = '<option label="' . htmlspecialchars($value) . '" value="' . ! htmlspecialchars($key) . '"'; if (in_array($key, $selected)) $html_result .= " selected=\"selected\""; ! $html_result .= '>' . htmlspecialchars($value) . '</option>' . "\n"; } else { $html_result = smarty_function_html_options_optgroup($key, $value, $selected); *************** *** 55,59 **** function smarty_function_html_options_optgroup($key, $values, $selected) { ! $optgroup_html = "<optgroup label=\"$key\">\n"; foreach ($values as $key => $value) { $optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected); --- 51,55 ---- function smarty_function_html_options_optgroup($key, $values, $selected) { ! $optgroup_html = '<optgroup label="' . htmlspecialchars($value) . '">' . "\n"; foreach ($values as $key => $value) { $optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected); Index: function.html_select_date.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/plugins/function.html_select_date.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** function.html_select_date.php 25 Jul 2002 11:06:25 -0000 1.1 --- function.html_select_date.php 6 Feb 2003 02:09:55 -0000 1.2 *************** *** 16,19 **** --- 16,21 ---- * 1.3 added support for choosing format for * month values (Gary Loescher) + * 1.3.1 added support for choosing format for + * day values (Marcus Bointon) * ------------------------------------------------------------- */ *************** *** 33,36 **** --- 35,40 ---- $month_value_format = "%m"; $day_format = "%02d"; + /* Write day values using this format MB */ + $day_value_format = "%d"; $year_as_text = false; /* Display years in reverse order? Ie. 2000,1999,.... */ *************** *** 129,134 **** if ($display_days) { $days = array(); ! for ($i = 1; $i <= 31; $i++) $days[] = sprintf($day_format, $i); $day_result .= '<select name='; --- 133,140 ---- if ($display_days) { $days = array(); ! for ($i = 1; $i <= 31; $i++) { $days[] = sprintf($day_format, $i); + $day_values[] = sprintf($day_value_format, $i); + } $day_result .= '<select name='; *************** *** 149,153 **** $day_result .= '>'."\n"; $day_result .= smarty_function_html_options(array('output' => $days, ! 'values' => range(1, 31), 'selected' => $time[2], 'print_result' => false), --- 155,159 ---- $day_result .= '>'."\n"; $day_result .= smarty_function_html_options(array('output' => $days, ! 'values' => $day_values, 'selected' => $time[2], 'print_result' => false), *************** *** 219,223 **** } ! print $html_result; } --- 225,229 ---- } ! return $html_result; } Index: function.html_select_time.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/plugins/function.html_select_time.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** function.html_select_time.php 28 Nov 2002 05:27:53 -0000 1.2 --- function.html_select_time.php 6 Feb 2003 02:09:55 -0000 1.3 *************** *** 145,149 **** } ! print $html_result; } --- 145,149 ---- } ! return $html_result; } Index: function.math.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/plugins/function.math.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** function.math.php 25 Jul 2002 11:06:25 -0000 1.1 --- function.math.php 6 Feb 2003 02:09:55 -0000 1.2 *************** *** 56,60 **** if (empty($params['format'])) { if (empty($params['assign'])) { ! echo $smarty_math_result; } else { $smarty->assign($params['assign'],$smarty_math_result); --- 56,60 ---- if (empty($params['format'])) { if (empty($params['assign'])) { ! return $smarty_math_result; } else { $smarty->assign($params['assign'],$smarty_math_result); Index: function.popup.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/plugins/function.popup.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** function.popup.php 25 Jul 2002 11:06:25 -0000 1.1 --- function.popup.php 6 Feb 2003 02:09:55 -0000 1.2 *************** *** 20,72 **** if (empty($trigger)) { $trigger = "onMouseOver"; } ! echo $trigger.'="return overlib(\''.str_replace("'","\'",$text).'\''; ! if ($sticky) { echo ",STICKY"; } ! if (!empty($caption)) { echo ",CAPTION,'".str_replace("'","\'",$caption)."'"; } ! if (!empty($fgcolor)) { echo ",FGCOLOR,'$fgcolor'"; } ! if (!empty($bgcolor)) { echo ",BGCOLOR,'$bgcolor'"; } ! if (!empty($textcolor)) { echo ",TEXTCOLOR,'$textcolor'"; } ! if (!empty($capcolor)) { echo ",CAPCOLOR,'$capcolor'"; } ! if (!empty($closecolor)) { echo ",CLOSECOLOR,'$closecolor'"; } ! if (!empty($textfont)) { echo ",TEXTFONT,'$textfont'"; } ! if (!empty($captionfont)) { echo ",CAPTIONFONT,'$captionfont'"; } ! if (!empty($closefont)) { echo ",CLOSEFONT,'$closefont'"; } ! if (!empty($textsize)) { echo ",TEXTSIZE,$textsize"; } ! if (!empty($captionsize)) { echo ",CAPTIONSIZE,$captionsize"; } ! if (!empty($closesize)) { echo ",CLOSESIZE,$closesize"; } ! if (!empty($width)) { echo ",WIDTH,$width"; } ! if (!empty($height)) { echo ",HEIGHT,$height"; } ! if (!empty($left)) { echo ",LEFT"; } ! if (!empty($right)) { echo ",RIGHT"; } ! if (!empty($center)) { echo ",CENTER"; } ! if (!empty($above)) { echo ",ABOVE"; } ! if (!empty($below)) { echo ",BELOW"; } ! if (isset($border)) { echo ",BORDER,$border"; } ! if (isset($offsetx)) { echo ",OFFSETX,$offsetx"; } ! if (isset($offsety)) { echo ",OFFSETY,$offsety"; } ! if (!empty($fgbackground)) { echo ",FGBACKGROUND,'$fgbackground'"; } ! if (!empty($bgbackground)) { echo ",BGBACKGROUND,'$bgbackground'"; } ! if (!empty($closetext)) { echo ",CLOSETEXT,'".str_replace("'","\'",$closetext)."'"; } ! if (!empty($noclose)) { echo ",NOCLOSE"; } ! if (!empty($status)) { echo ",STATUS,'".str_replace("'","\'",$status)."'"; } ! if (!empty($autostatus)) { echo ",AUTOSTATUS"; } ! if (!empty($autostatuscap)) { echo ",AUTOSTATUSCAP"; } ! if (isset($inarray)) { echo ",INARRAY,'$inarray'"; } ! if (isset($caparray)) { echo ",CAPARRAY,'$caparray'"; } ! if (!empty($capicon)) { echo ",CAPICON,'$capicon'"; } ! if (!empty($snapx)) { echo ",SNAPX,$snapx"; } ! if (!empty($snapy)) { echo ",SNAPY,$snapy"; } ! if (isset($fixx)) { echo ",FIXX,$fixx"; } ! if (isset($fixy)) { echo ",FIXY,$fixy"; } ! if (!empty($background)) { echo ",BACKGROUND,'$background'"; } ! if (!empty($padx)) { echo ",PADX,$padx"; } ! if (!empty($pady)) { echo ",PADY,$pady"; } ! if (!empty($fullhtml)) { echo ",FULLHTML"; } ! if (!empty($frame)) { echo ",FRAME,'$frame'"; } ! if (isset($timeout)) { echo ",TIMEOUT,$timeout"; } ! if (!empty($function)) { echo ",FUNCTION,'$function'"; } ! if (isset($delay)) { echo ",DELAY,$delay"; } ! if (!empty($hauto)) { echo ",HAUTO"; } ! if (!empty($vauto)) { echo ",VAUTO"; } ! echo ');" onMouseOut="nd();"'; } --- 20,74 ---- if (empty($trigger)) { $trigger = "onMouseOver"; } ! $retval .= $trigger . '="return overlib(\''.preg_replace(array("!'!","![\r\n]!"),array("\'",'\r'),$text).'\''; ! if ($sticky) { $retval .= ",STICKY"; } ! if (!empty($caption)) { $retval .= ",CAPTION,'".str_replace("'","\'",$caption)."'"; } ! if (!empty($fgcolor)) { $retval .= ",FGCOLOR,'$fgcolor'"; } ! if (!empty($bgcolor)) { $retval .= ",BGCOLOR,'$bgcolor'"; } ! if (!empty($textcolor)) { $retval .= ",TEXTCOLOR,'$textcolor'"; } ! if (!empty($capcolor)) { $retval .= ",CAPCOLOR,'$capcolor'"; } ! if (!empty($closecolor)) { $retval .= ",CLOSECOLOR,'$closecolor'"; } ! if (!empty($textfont)) { $retval .= ",TEXTFONT,'$textfont'"; } ! if (!empty($captionfont)) { $retval .= ",CAPTIONFONT,'$captionfont'"; } ! if (!empty($closefont)) { $retval .= ",CLOSEFONT,'$closefont'"; } ! if (!empty($textsize)) { $retval .= ",TEXTSIZE,$textsize"; } ! if (!empty($captionsize)) { $retval .= ",CAPTIONSIZE,$captionsize"; } ! if (!empty($closesize)) { $retval .= ",CLOSESIZE,$closesize"; } ! if (!empty($width)) { $retval .= ",WIDTH,$width"; } ! if (!empty($height)) { $retval .= ",HEIGHT,$height"; } ! if (!empty($left)) { $retval .= ",LEFT"; } ! if (!empty($right)) { $retval .= ",RIGHT"; } ! if (!empty($center)) { $retval .= ",CENTER"; } ! if (!empty($above)) { $retval .= ",ABOVE"; } ! if (!empty($below)) { $retval .= ",BELOW"; } ! if (isset($border)) { $retval .= ",BORDER,$border"; } ! if (isset($offsetx)) { $retval .= ",OFFSETX,$offsetx"; } ! if (isset($offsety)) { $retval .= ",OFFSETY,$offsety"; } ! if (!empty($fgbackground)) { $retval .= ",FGBACKGROUND,'$fgbackground'"; } ! if (!empty($bgbackground)) { $retval .= ",BGBACKGROUND,'$bgbackground'"; } ! if (!empty($closetext)) { $retval .= ",CLOSETEXT,'".str_replace("'","\'",$closetext)."'"; } ! if (!empty($noclose)) { $retval .= ",NOCLOSE"; } ! if (!empty($status)) { $retval .= ",STATUS,'".str_replace("'","\'",$status)."'"; } ! if (!empty($autostatus)) { $retval .= ",AUTOSTATUS"; } ! if (!empty($autostatuscap)) { $retval .= ",AUTOSTATUSCAP"; } ! if (isset($inarray)) { $retval .= ",INARRAY,'$inarray'"; } ! if (isset($caparray)) { $retval .= ",CAPARRAY,'$caparray'"; } ! if (!empty($capicon)) { $retval .= ",CAPICON,'$capicon'"; } ! if (!empty($snapx)) { $retval .= ",SNAPX,$snapx"; } ! if (!empty($snapy)) { $retval .= ",SNAPY,$snapy"; } ! if (isset($fixx)) { $retval .= ",FIXX,$fixx"; } ! if (isset($fixy)) { $retval .= ",FIXY,$fixy"; } ! if (!empty($background)) { $retval .= ",BACKGROUND,'$background'"; } ! if (!empty($padx)) { $retval .= ",PADX,$padx"; } ! if (!empty($pady)) { $retval .= ",PADY,$pady"; } ! if (!empty($fullhtml)) { $retval .= ",FULLHTML"; } ! if (!empty($frame)) { $retval .= ",FRAME,'$frame'"; } ! if (isset($timeout)) { $retval .= ",TIMEOUT,$timeout"; } ! if (!empty($function)) { $retval .= ",FUNCTION,'$function'"; } ! if (isset($delay)) { $retval .= ",DELAY,$delay"; } ! if (!empty($hauto)) { $retval .= ",HAUTO"; } ! if (!empty($vauto)) { $retval .= ",VAUTO"; } ! $retval .= ');" onMouseOut="nd();"'; ! ! return $retval; } Index: function.popup_init.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/plugins/function.popup_init.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** function.popup_init.php 28 Nov 2002 05:27:53 -0000 1.2 --- function.popup_init.php 6 Feb 2003 02:09:55 -0000 1.3 *************** *** 18,23 **** if (!empty($params['src'])) { ! echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:'.$zindex.';"></div>'."\n"; ! echo '<script type="text/javascript" language="JavaScript" src="'.$params['src'].'"></script>'."\n"; } else { $smarty->trigger_error("popup_init: missing src parameter"); --- 18,23 ---- if (!empty($params['src'])) { ! return '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:'.$zindex.';"></div>' . "\n" ! . '<script type="text/javascript" language="JavaScript" src="'.$params['src'].'"></script>' . "\n"; } else { $smarty->trigger_error("popup_init: missing src parameter"); Index: modifier.debug_print_var.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/plugins/modifier.debug_print_var.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** modifier.debug_print_var.php 28 Nov 2002 05:27:53 -0000 1.2 --- modifier.debug_print_var.php 6 Feb 2003 02:09:55 -0000 1.3 *************** *** 36,40 **** } $results = preg_replace("![\r\t\n]!", " ", $results); ! $results = htmlspecialchars(htmlspecialchars($results)); return $results; } --- 36,40 ---- } $results = preg_replace("![\r\t\n]!", " ", $results); ! $results = htmlspecialchars($results); return $results; } Index: modifier.escape.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/plugins/modifier.escape.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** modifier.escape.php 25 Jul 2002 11:06:25 -0000 1.1 --- modifier.escape.php 6 Feb 2003 02:09:55 -0000 1.2 *************** *** 38,41 **** --- 38,45 ---- return $return; + case 'javascript': + // escape quotes and backslashes and newlines + return str_replace(array('\\','\'',"\r","\n"), array("\\\\", "\\'",'\r','\r'), $string); + default: return $string; |