update plugins to return values instead of echo, fix config file cache

to include global config variables in cache file
This commit is contained in:
mohrt
2003-01-08 17:34:45 +00:00
parent 2cad634805
commit b579c0f51d
26 changed files with 168 additions and 150 deletions

View File

@@ -1260,8 +1260,8 @@ function _generate_debug_output() {
$this->_conf_obj->fix_newlines = $this->config_fix_newlines; $this->_conf_obj->fix_newlines = $this->config_fix_newlines;
$this->_conf_obj->set_path = $_config_dir; $this->_conf_obj->set_path = $_config_dir;
} }
if($_config_vars = $this->_conf_obj->get($file, $section)) { if($_config_vars = @array_merge($this->_conf_obj->get($file),
$this->_conf_obj->get($file, $section))) {
if(function_exists('var_export')) { if(function_exists('var_export')) {
$_compile_data = '<?php $_config_vars = ' . var_export($_config_vars, true) . '; return true; ?>'; $_compile_data = '<?php $_config_vars = ' . var_export($_config_vars, true) . '; return true; ?>';
} else { } else {

View File

@@ -1260,8 +1260,8 @@ function _generate_debug_output() {
$this->_conf_obj->fix_newlines = $this->config_fix_newlines; $this->_conf_obj->fix_newlines = $this->config_fix_newlines;
$this->_conf_obj->set_path = $_config_dir; $this->_conf_obj->set_path = $_config_dir;
} }
if($_config_vars = $this->_conf_obj->get($file, $section)) { if($_config_vars = @array_merge($this->_conf_obj->get($file),
$this->_conf_obj->get($file, $section))) {
if(function_exists('var_export')) { if(function_exists('var_export')) {
$_compile_data = '<?php $_config_vars = ' . var_export($_config_vars, true) . '; return true; ?>'; $_compile_data = '<?php $_config_vars = ' . var_export($_config_vars, true) . '; return true; ?>';
} else { } else {

View File

@@ -42,8 +42,11 @@ function smarty_function_counter($params, &$smarty)
$smarty->assign($assign, $count[$name]); $smarty->assign($assign, $count[$name]);
} }
if ($printval[$name]) if ($printval[$name]) {
echo $count[$name]; $retval = $count[$name];
} else {
$retval = null;
}
if (isset($skip)) if (isset($skip))
$skipval[$name] = $skip; $skipval[$name] = $skip;
@@ -59,6 +62,9 @@ function smarty_function_counter($params, &$smarty)
$count[$name] -= $skipval[$name]; $count[$name] -= $skipval[$name];
else else
$count[$name] += $skipval[$name]; $count[$name] += $skipval[$name];
return $retval;
} }
/* vim: set expandtab: */ /* vim: set expandtab: */

View File

@@ -86,7 +86,9 @@ function smarty_function_cycle($params, &$smarty)
} }
if($print) { if($print) {
echo $cycle_array[$cycle_vars[$name]['index']]; $retval = $cycle_array[$cycle_vars[$name]['index']];
} else {
$retval = null;
} }
if($advance) { if($advance) {
@@ -96,6 +98,8 @@ function smarty_function_cycle($params, &$smarty)
$cycle_vars[$name]['index']++; $cycle_vars[$name]['index']++;
} }
} }
return $retval;
} }
/* vim: set expandtab: */ /* vim: set expandtab: */

View File

@@ -16,7 +16,7 @@ function smarty_function_debug($params, &$smarty)
if($params['output']) { if($params['output']) {
$smarty->assign('_smarty_debug_output',$params['output']); $smarty->assign('_smarty_debug_output',$params['output']);
} }
echo $smarty->_generate_debug_output(); return $smarty->_generate_debug_output();
} }
/* vim: set expandtab: */ /* vim: set expandtab: */

View File

@@ -22,13 +22,15 @@ function smarty_function_eval($params, &$this)
$this->_compile_template("evaluated template", $var, $source); $this->_compile_template("evaluated template", $var, $source);
if (!empty($assign)) {
ob_start(); ob_start();
eval('?>' . $source); eval('?>' . $source);
$this->assign($assign, ob_get_contents()); $contents = ob_get_contents();
ob_end_clean(); ob_end_clean();
if (!empty($assign)) {
$this->assign($assign, $contents);
} else { } else {
eval('?>' . $source); return $contents;
} }
} }

View File

@@ -202,7 +202,7 @@ function smarty_function_fetch($params, &$smarty)
if (!empty($params['assign'])) { if (!empty($params['assign'])) {
$smarty->assign($params['assign'],$content); $smarty->assign($params['assign'],$content);
} else { } else {
echo $content; return $content;
} }
} }

View File

@@ -11,8 +11,6 @@
*/ */
function smarty_function_html_options($params, &$smarty) function smarty_function_html_options($params, &$smarty)
{ {
$print_result = true;
extract($params); extract($params);
$html_result = ''; $html_result = '';
@@ -35,9 +33,6 @@ function smarty_function_html_options($params, &$smarty)
} }
} }
if ($print_result)
print $html_result;
else
return $html_result; return $html_result;
} }

View File

@@ -224,7 +224,7 @@ function smarty_function_html_select_date($params, &$smarty)
} }
} }
print $html_result; return $html_result;
} }
/* vim: set expandtab: */ /* vim: set expandtab: */

View File

@@ -144,7 +144,7 @@ function smarty_function_html_select_time($params, &$smarty)
$html_result .= "</select>\n"; $html_result .= "</select>\n";
} }
print $html_result; return $html_result;
} }
/* vim: set expandtab: */ /* vim: set expandtab: */

View File

@@ -89,7 +89,7 @@ function smarty_function_mailto($params, &$smarty)
$js_encode .= '%' . bin2hex($string[$x]); $js_encode .= '%' . bin2hex($string[$x]);
} }
echo '<SCRIPT language="javascript">eval(unescape(\''.$js_encode.'\'))</SCRIPT>'; return '<SCRIPT language="javascript">eval(unescape(\''.$js_encode.'\'))</SCRIPT>';
} elseif ($encode == 'hex') { } elseif ($encode == 'hex') {
@@ -109,11 +109,11 @@ function smarty_function_mailto($params, &$smarty)
$text_encode .= '&#x' . bin2hex($text[$x]).';'; $text_encode .= '&#x' . bin2hex($text[$x]).';';
} }
echo '<a href="mailto:'.$address_encode.'" '.$extra.'>'.$text_encode.'</a>'; return '<a href="mailto:'.$address_encode.'" '.$extra.'>'.$text_encode.'</a>';
} else { } else {
// no encoding // no encoding
echo '<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>'; return '<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>';
} }

View File

@@ -55,7 +55,7 @@ function smarty_function_math($params, &$smarty)
if (empty($params['format'])) { if (empty($params['format'])) {
if (empty($params['assign'])) { if (empty($params['assign'])) {
echo $smarty_math_result; return $smarty_math_result;
} else { } else {
$smarty->assign($params['assign'],$smarty_math_result); $smarty->assign($params['assign'],$smarty_math_result);
} }

View File

@@ -19,55 +19,57 @@ function smarty_function_popup($params, &$smarty)
if (empty($trigger)) { $trigger = "onMouseOver"; } if (empty($trigger)) { $trigger = "onMouseOver"; }
echo $trigger.'="return overlib(\''.preg_replace(array("!'!","![\r\n]!"),array("\'",'\r'),$text).'\''; $retval .= $trigger . '="return overlib(\''.preg_replace(array("!'!","![\r\n]!"),array("\'",'\r'),$text).'\'';
if ($sticky) { echo ",STICKY"; } if ($sticky) { $retval .= ",STICKY"; }
if (!empty($caption)) { echo ",CAPTION,'".str_replace("'","\'",$caption)."'"; } if (!empty($caption)) { $retval .= ",CAPTION,'".str_replace("'","\'",$caption)."'"; }
if (!empty($fgcolor)) { echo ",FGCOLOR,'$fgcolor'"; } if (!empty($fgcolor)) { $retval .= ",FGCOLOR,'$fgcolor'"; }
if (!empty($bgcolor)) { echo ",BGCOLOR,'$bgcolor'"; } if (!empty($bgcolor)) { $retval .= ",BGCOLOR,'$bgcolor'"; }
if (!empty($textcolor)) { echo ",TEXTCOLOR,'$textcolor'"; } if (!empty($textcolor)) { $retval .= ",TEXTCOLOR,'$textcolor'"; }
if (!empty($capcolor)) { echo ",CAPCOLOR,'$capcolor'"; } if (!empty($capcolor)) { $retval .= ",CAPCOLOR,'$capcolor'"; }
if (!empty($closecolor)) { echo ",CLOSECOLOR,'$closecolor'"; } if (!empty($closecolor)) { $retval .= ",CLOSECOLOR,'$closecolor'"; }
if (!empty($textfont)) { echo ",TEXTFONT,'$textfont'"; } if (!empty($textfont)) { $retval .= ",TEXTFONT,'$textfont'"; }
if (!empty($captionfont)) { echo ",CAPTIONFONT,'$captionfont'"; } if (!empty($captionfont)) { $retval .= ",CAPTIONFONT,'$captionfont'"; }
if (!empty($closefont)) { echo ",CLOSEFONT,'$closefont'"; } if (!empty($closefont)) { $retval .= ",CLOSEFONT,'$closefont'"; }
if (!empty($textsize)) { echo ",TEXTSIZE,$textsize"; } if (!empty($textsize)) { $retval .= ",TEXTSIZE,$textsize"; }
if (!empty($captionsize)) { echo ",CAPTIONSIZE,$captionsize"; } if (!empty($captionsize)) { $retval .= ",CAPTIONSIZE,$captionsize"; }
if (!empty($closesize)) { echo ",CLOSESIZE,$closesize"; } if (!empty($closesize)) { $retval .= ",CLOSESIZE,$closesize"; }
if (!empty($width)) { echo ",WIDTH,$width"; } if (!empty($width)) { $retval .= ",WIDTH,$width"; }
if (!empty($height)) { echo ",HEIGHT,$height"; } if (!empty($height)) { $retval .= ",HEIGHT,$height"; }
if (!empty($left)) { echo ",LEFT"; } if (!empty($left)) { $retval .= ",LEFT"; }
if (!empty($right)) { echo ",RIGHT"; } if (!empty($right)) { $retval .= ",RIGHT"; }
if (!empty($center)) { echo ",CENTER"; } if (!empty($center)) { $retval .= ",CENTER"; }
if (!empty($above)) { echo ",ABOVE"; } if (!empty($above)) { $retval .= ",ABOVE"; }
if (!empty($below)) { echo ",BELOW"; } if (!empty($below)) { $retval .= ",BELOW"; }
if (isset($border)) { echo ",BORDER,$border"; } if (isset($border)) { $retval .= ",BORDER,$border"; }
if (isset($offsetx)) { echo ",OFFSETX,$offsetx"; } if (isset($offsetx)) { $retval .= ",OFFSETX,$offsetx"; }
if (isset($offsety)) { echo ",OFFSETY,$offsety"; } if (isset($offsety)) { $retval .= ",OFFSETY,$offsety"; }
if (!empty($fgbackground)) { echo ",FGBACKGROUND,'$fgbackground'"; } if (!empty($fgbackground)) { $retval .= ",FGBACKGROUND,'$fgbackground'"; }
if (!empty($bgbackground)) { echo ",BGBACKGROUND,'$bgbackground'"; } if (!empty($bgbackground)) { $retval .= ",BGBACKGROUND,'$bgbackground'"; }
if (!empty($closetext)) { echo ",CLOSETEXT,'".str_replace("'","\'",$closetext)."'"; } if (!empty($closetext)) { $retval .= ",CLOSETEXT,'".str_replace("'","\'",$closetext)."'"; }
if (!empty($noclose)) { echo ",NOCLOSE"; } if (!empty($noclose)) { $retval .= ",NOCLOSE"; }
if (!empty($status)) { echo ",STATUS,'".str_replace("'","\'",$status)."'"; } if (!empty($status)) { $retval .= ",STATUS,'".str_replace("'","\'",$status)."'"; }
if (!empty($autostatus)) { echo ",AUTOSTATUS"; } if (!empty($autostatus)) { $retval .= ",AUTOSTATUS"; }
if (!empty($autostatuscap)) { echo ",AUTOSTATUSCAP"; } if (!empty($autostatuscap)) { $retval .= ",AUTOSTATUSCAP"; }
if (isset($inarray)) { echo ",INARRAY,'$inarray'"; } if (isset($inarray)) { $retval .= ",INARRAY,'$inarray'"; }
if (isset($caparray)) { echo ",CAPARRAY,'$caparray'"; } if (isset($caparray)) { $retval .= ",CAPARRAY,'$caparray'"; }
if (!empty($capicon)) { echo ",CAPICON,'$capicon'"; } if (!empty($capicon)) { $retval .= ",CAPICON,'$capicon'"; }
if (!empty($snapx)) { echo ",SNAPX,$snapx"; } if (!empty($snapx)) { $retval .= ",SNAPX,$snapx"; }
if (!empty($snapy)) { echo ",SNAPY,$snapy"; } if (!empty($snapy)) { $retval .= ",SNAPY,$snapy"; }
if (isset($fixx)) { echo ",FIXX,$fixx"; } if (isset($fixx)) { $retval .= ",FIXX,$fixx"; }
if (isset($fixy)) { echo ",FIXY,$fixy"; } if (isset($fixy)) { $retval .= ",FIXY,$fixy"; }
if (!empty($background)) { echo ",BACKGROUND,'$background'"; } if (!empty($background)) { $retval .= ",BACKGROUND,'$background'"; }
if (!empty($padx)) { echo ",PADX,$padx"; } if (!empty($padx)) { $retval .= ",PADX,$padx"; }
if (!empty($pady)) { echo ",PADY,$pady"; } if (!empty($pady)) { $retval .= ",PADY,$pady"; }
if (!empty($fullhtml)) { echo ",FULLHTML"; } if (!empty($fullhtml)) { $retval .= ",FULLHTML"; }
if (!empty($frame)) { echo ",FRAME,'$frame'"; } if (!empty($frame)) { $retval .= ",FRAME,'$frame'"; }
if (isset($timeout)) { echo ",TIMEOUT,$timeout"; } if (isset($timeout)) { $retval .= ",TIMEOUT,$timeout"; }
if (!empty($function)) { echo ",FUNCTION,'$function'"; } if (!empty($function)) { $retval .= ",FUNCTION,'$function'"; }
if (isset($delay)) { echo ",DELAY,$delay"; } if (isset($delay)) { $retval .= ",DELAY,$delay"; }
if (!empty($hauto)) { echo ",HAUTO"; } if (!empty($hauto)) { $retval .= ",HAUTO"; }
if (!empty($vauto)) { echo ",VAUTO"; } if (!empty($vauto)) { $retval .= ",VAUTO"; }
echo ');" onMouseOut="nd();"'; $retval .= ');" onMouseOut="nd();"';
return $retval;
} }
/* vim: set expandtab: */ /* vim: set expandtab: */

View File

@@ -17,8 +17,8 @@ function smarty_function_popup_init($params, &$smarty)
} }
if (!empty($params['src'])) { if (!empty($params['src'])) {
echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:'.$zindex.';"></div>'."\n"; return '<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"; . '<script type="text/javascript" language="JavaScript" src="'.$params['src'].'"></script>' . "\n";
} else { } else {
$smarty->trigger_error("popup_init: missing src parameter"); $smarty->trigger_error("popup_init: missing src parameter");
} }

View File

@@ -42,8 +42,11 @@ function smarty_function_counter($params, &$smarty)
$smarty->assign($assign, $count[$name]); $smarty->assign($assign, $count[$name]);
} }
if ($printval[$name]) if ($printval[$name]) {
echo $count[$name]; $retval = $count[$name];
} else {
$retval = null;
}
if (isset($skip)) if (isset($skip))
$skipval[$name] = $skip; $skipval[$name] = $skip;
@@ -59,6 +62,9 @@ function smarty_function_counter($params, &$smarty)
$count[$name] -= $skipval[$name]; $count[$name] -= $skipval[$name];
else else
$count[$name] += $skipval[$name]; $count[$name] += $skipval[$name];
return $retval;
} }
/* vim: set expandtab: */ /* vim: set expandtab: */

View File

@@ -86,7 +86,9 @@ function smarty_function_cycle($params, &$smarty)
} }
if($print) { if($print) {
echo $cycle_array[$cycle_vars[$name]['index']]; $retval = $cycle_array[$cycle_vars[$name]['index']];
} else {
$retval = null;
} }
if($advance) { if($advance) {
@@ -96,6 +98,8 @@ function smarty_function_cycle($params, &$smarty)
$cycle_vars[$name]['index']++; $cycle_vars[$name]['index']++;
} }
} }
return $retval;
} }
/* vim: set expandtab: */ /* vim: set expandtab: */

View File

@@ -16,7 +16,7 @@ function smarty_function_debug($params, &$smarty)
if($params['output']) { if($params['output']) {
$smarty->assign('_smarty_debug_output',$params['output']); $smarty->assign('_smarty_debug_output',$params['output']);
} }
echo $smarty->_generate_debug_output(); return $smarty->_generate_debug_output();
} }
/* vim: set expandtab: */ /* vim: set expandtab: */

View File

@@ -22,13 +22,15 @@ function smarty_function_eval($params, &$this)
$this->_compile_template("evaluated template", $var, $source); $this->_compile_template("evaluated template", $var, $source);
if (!empty($assign)) {
ob_start(); ob_start();
eval('?>' . $source); eval('?>' . $source);
$this->assign($assign, ob_get_contents()); $contents = ob_get_contents();
ob_end_clean(); ob_end_clean();
if (!empty($assign)) {
$this->assign($assign, $contents);
} else { } else {
eval('?>' . $source); return $contents;
} }
} }

View File

@@ -202,7 +202,7 @@ function smarty_function_fetch($params, &$smarty)
if (!empty($params['assign'])) { if (!empty($params['assign'])) {
$smarty->assign($params['assign'],$content); $smarty->assign($params['assign'],$content);
} else { } else {
echo $content; return $content;
} }
} }

View File

@@ -11,8 +11,6 @@
*/ */
function smarty_function_html_options($params, &$smarty) function smarty_function_html_options($params, &$smarty)
{ {
$print_result = true;
extract($params); extract($params);
$html_result = ''; $html_result = '';
@@ -35,9 +33,6 @@ function smarty_function_html_options($params, &$smarty)
} }
} }
if ($print_result)
print $html_result;
else
return $html_result; return $html_result;
} }

View File

@@ -224,7 +224,7 @@ function smarty_function_html_select_date($params, &$smarty)
} }
} }
print $html_result; return $html_result;
} }
/* vim: set expandtab: */ /* vim: set expandtab: */

View File

@@ -144,7 +144,7 @@ function smarty_function_html_select_time($params, &$smarty)
$html_result .= "</select>\n"; $html_result .= "</select>\n";
} }
print $html_result; return $html_result;
} }
/* vim: set expandtab: */ /* vim: set expandtab: */

View File

@@ -89,7 +89,7 @@ function smarty_function_mailto($params, &$smarty)
$js_encode .= '%' . bin2hex($string[$x]); $js_encode .= '%' . bin2hex($string[$x]);
} }
echo '<SCRIPT language="javascript">eval(unescape(\''.$js_encode.'\'))</SCRIPT>'; return '<SCRIPT language="javascript">eval(unescape(\''.$js_encode.'\'))</SCRIPT>';
} elseif ($encode == 'hex') { } elseif ($encode == 'hex') {
@@ -109,11 +109,11 @@ function smarty_function_mailto($params, &$smarty)
$text_encode .= '&#x' . bin2hex($text[$x]).';'; $text_encode .= '&#x' . bin2hex($text[$x]).';';
} }
echo '<a href="mailto:'.$address_encode.'" '.$extra.'>'.$text_encode.'</a>'; return '<a href="mailto:'.$address_encode.'" '.$extra.'>'.$text_encode.'</a>';
} else { } else {
// no encoding // no encoding
echo '<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>'; return '<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>';
} }

View File

@@ -55,7 +55,7 @@ function smarty_function_math($params, &$smarty)
if (empty($params['format'])) { if (empty($params['format'])) {
if (empty($params['assign'])) { if (empty($params['assign'])) {
echo $smarty_math_result; return $smarty_math_result;
} else { } else {
$smarty->assign($params['assign'],$smarty_math_result); $smarty->assign($params['assign'],$smarty_math_result);
} }

View File

@@ -19,55 +19,57 @@ function smarty_function_popup($params, &$smarty)
if (empty($trigger)) { $trigger = "onMouseOver"; } if (empty($trigger)) { $trigger = "onMouseOver"; }
echo $trigger.'="return overlib(\''.preg_replace(array("!'!","![\r\n]!"),array("\'",'\r'),$text).'\''; $retval .= $trigger . '="return overlib(\''.preg_replace(array("!'!","![\r\n]!"),array("\'",'\r'),$text).'\'';
if ($sticky) { echo ",STICKY"; } if ($sticky) { $retval .= ",STICKY"; }
if (!empty($caption)) { echo ",CAPTION,'".str_replace("'","\'",$caption)."'"; } if (!empty($caption)) { $retval .= ",CAPTION,'".str_replace("'","\'",$caption)."'"; }
if (!empty($fgcolor)) { echo ",FGCOLOR,'$fgcolor'"; } if (!empty($fgcolor)) { $retval .= ",FGCOLOR,'$fgcolor'"; }
if (!empty($bgcolor)) { echo ",BGCOLOR,'$bgcolor'"; } if (!empty($bgcolor)) { $retval .= ",BGCOLOR,'$bgcolor'"; }
if (!empty($textcolor)) { echo ",TEXTCOLOR,'$textcolor'"; } if (!empty($textcolor)) { $retval .= ",TEXTCOLOR,'$textcolor'"; }
if (!empty($capcolor)) { echo ",CAPCOLOR,'$capcolor'"; } if (!empty($capcolor)) { $retval .= ",CAPCOLOR,'$capcolor'"; }
if (!empty($closecolor)) { echo ",CLOSECOLOR,'$closecolor'"; } if (!empty($closecolor)) { $retval .= ",CLOSECOLOR,'$closecolor'"; }
if (!empty($textfont)) { echo ",TEXTFONT,'$textfont'"; } if (!empty($textfont)) { $retval .= ",TEXTFONT,'$textfont'"; }
if (!empty($captionfont)) { echo ",CAPTIONFONT,'$captionfont'"; } if (!empty($captionfont)) { $retval .= ",CAPTIONFONT,'$captionfont'"; }
if (!empty($closefont)) { echo ",CLOSEFONT,'$closefont'"; } if (!empty($closefont)) { $retval .= ",CLOSEFONT,'$closefont'"; }
if (!empty($textsize)) { echo ",TEXTSIZE,$textsize"; } if (!empty($textsize)) { $retval .= ",TEXTSIZE,$textsize"; }
if (!empty($captionsize)) { echo ",CAPTIONSIZE,$captionsize"; } if (!empty($captionsize)) { $retval .= ",CAPTIONSIZE,$captionsize"; }
if (!empty($closesize)) { echo ",CLOSESIZE,$closesize"; } if (!empty($closesize)) { $retval .= ",CLOSESIZE,$closesize"; }
if (!empty($width)) { echo ",WIDTH,$width"; } if (!empty($width)) { $retval .= ",WIDTH,$width"; }
if (!empty($height)) { echo ",HEIGHT,$height"; } if (!empty($height)) { $retval .= ",HEIGHT,$height"; }
if (!empty($left)) { echo ",LEFT"; } if (!empty($left)) { $retval .= ",LEFT"; }
if (!empty($right)) { echo ",RIGHT"; } if (!empty($right)) { $retval .= ",RIGHT"; }
if (!empty($center)) { echo ",CENTER"; } if (!empty($center)) { $retval .= ",CENTER"; }
if (!empty($above)) { echo ",ABOVE"; } if (!empty($above)) { $retval .= ",ABOVE"; }
if (!empty($below)) { echo ",BELOW"; } if (!empty($below)) { $retval .= ",BELOW"; }
if (isset($border)) { echo ",BORDER,$border"; } if (isset($border)) { $retval .= ",BORDER,$border"; }
if (isset($offsetx)) { echo ",OFFSETX,$offsetx"; } if (isset($offsetx)) { $retval .= ",OFFSETX,$offsetx"; }
if (isset($offsety)) { echo ",OFFSETY,$offsety"; } if (isset($offsety)) { $retval .= ",OFFSETY,$offsety"; }
if (!empty($fgbackground)) { echo ",FGBACKGROUND,'$fgbackground'"; } if (!empty($fgbackground)) { $retval .= ",FGBACKGROUND,'$fgbackground'"; }
if (!empty($bgbackground)) { echo ",BGBACKGROUND,'$bgbackground'"; } if (!empty($bgbackground)) { $retval .= ",BGBACKGROUND,'$bgbackground'"; }
if (!empty($closetext)) { echo ",CLOSETEXT,'".str_replace("'","\'",$closetext)."'"; } if (!empty($closetext)) { $retval .= ",CLOSETEXT,'".str_replace("'","\'",$closetext)."'"; }
if (!empty($noclose)) { echo ",NOCLOSE"; } if (!empty($noclose)) { $retval .= ",NOCLOSE"; }
if (!empty($status)) { echo ",STATUS,'".str_replace("'","\'",$status)."'"; } if (!empty($status)) { $retval .= ",STATUS,'".str_replace("'","\'",$status)."'"; }
if (!empty($autostatus)) { echo ",AUTOSTATUS"; } if (!empty($autostatus)) { $retval .= ",AUTOSTATUS"; }
if (!empty($autostatuscap)) { echo ",AUTOSTATUSCAP"; } if (!empty($autostatuscap)) { $retval .= ",AUTOSTATUSCAP"; }
if (isset($inarray)) { echo ",INARRAY,'$inarray'"; } if (isset($inarray)) { $retval .= ",INARRAY,'$inarray'"; }
if (isset($caparray)) { echo ",CAPARRAY,'$caparray'"; } if (isset($caparray)) { $retval .= ",CAPARRAY,'$caparray'"; }
if (!empty($capicon)) { echo ",CAPICON,'$capicon'"; } if (!empty($capicon)) { $retval .= ",CAPICON,'$capicon'"; }
if (!empty($snapx)) { echo ",SNAPX,$snapx"; } if (!empty($snapx)) { $retval .= ",SNAPX,$snapx"; }
if (!empty($snapy)) { echo ",SNAPY,$snapy"; } if (!empty($snapy)) { $retval .= ",SNAPY,$snapy"; }
if (isset($fixx)) { echo ",FIXX,$fixx"; } if (isset($fixx)) { $retval .= ",FIXX,$fixx"; }
if (isset($fixy)) { echo ",FIXY,$fixy"; } if (isset($fixy)) { $retval .= ",FIXY,$fixy"; }
if (!empty($background)) { echo ",BACKGROUND,'$background'"; } if (!empty($background)) { $retval .= ",BACKGROUND,'$background'"; }
if (!empty($padx)) { echo ",PADX,$padx"; } if (!empty($padx)) { $retval .= ",PADX,$padx"; }
if (!empty($pady)) { echo ",PADY,$pady"; } if (!empty($pady)) { $retval .= ",PADY,$pady"; }
if (!empty($fullhtml)) { echo ",FULLHTML"; } if (!empty($fullhtml)) { $retval .= ",FULLHTML"; }
if (!empty($frame)) { echo ",FRAME,'$frame'"; } if (!empty($frame)) { $retval .= ",FRAME,'$frame'"; }
if (isset($timeout)) { echo ",TIMEOUT,$timeout"; } if (isset($timeout)) { $retval .= ",TIMEOUT,$timeout"; }
if (!empty($function)) { echo ",FUNCTION,'$function'"; } if (!empty($function)) { $retval .= ",FUNCTION,'$function'"; }
if (isset($delay)) { echo ",DELAY,$delay"; } if (isset($delay)) { $retval .= ",DELAY,$delay"; }
if (!empty($hauto)) { echo ",HAUTO"; } if (!empty($hauto)) { $retval .= ",HAUTO"; }
if (!empty($vauto)) { echo ",VAUTO"; } if (!empty($vauto)) { $retval .= ",VAUTO"; }
echo ');" onMouseOut="nd();"'; $retval .= ');" onMouseOut="nd();"';
return $retval;
} }
/* vim: set expandtab: */ /* vim: set expandtab: */

View File

@@ -17,8 +17,8 @@ function smarty_function_popup_init($params, &$smarty)
} }
if (!empty($params['src'])) { if (!empty($params['src'])) {
echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:'.$zindex.';"></div>'."\n"; return '<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"; . '<script type="text/javascript" language="JavaScript" src="'.$params['src'].'"></script>' . "\n";
} else { } else {
$smarty->trigger_error("popup_init: missing src parameter"); $smarty->trigger_error("popup_init: missing src parameter");
} }