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->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')) {
$_compile_data = '<?php $_config_vars = ' . var_export($_config_vars, true) . '; return true; ?>';
} else {

View File

@@ -1260,8 +1260,8 @@ function _generate_debug_output() {
$this->_conf_obj->fix_newlines = $this->config_fix_newlines;
$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')) {
$_compile_data = '<?php $_config_vars = ' . var_export($_config_vars, true) . '; return true; ?>';
} else {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -89,7 +89,7 @@ function smarty_function_mailto($params, &$smarty)
$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') {
@@ -109,11 +109,11 @@ function smarty_function_mailto($params, &$smarty)
$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 {
// 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['assign'])) {
echo $smarty_math_result;
return $smarty_math_result;
} else {
$smarty->assign($params['assign'],$smarty_math_result);
}

View File

@@ -19,55 +19,57 @@ function smarty_function_popup($params, &$smarty)
if (empty($trigger)) { $trigger = "onMouseOver"; }
echo $trigger.'="return overlib(\''.preg_replace(array("!'!","![\r\n]!"),array("\'",'\r'),$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();"';
$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;
}
/* vim: set expandtab: */

View File

@@ -17,8 +17,8 @@ function smarty_function_popup_init($params, &$smarty)
}
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";
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");
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -89,7 +89,7 @@ function smarty_function_mailto($params, &$smarty)
$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') {
@@ -109,11 +109,11 @@ function smarty_function_mailto($params, &$smarty)
$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 {
// 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['assign'])) {
echo $smarty_math_result;
return $smarty_math_result;
} else {
$smarty->assign($params['assign'],$smarty_math_result);
}

View File

@@ -19,55 +19,57 @@ function smarty_function_popup($params, &$smarty)
if (empty($trigger)) { $trigger = "onMouseOver"; }
echo $trigger.'="return overlib(\''.preg_replace(array("!'!","![\r\n]!"),array("\'",'\r'),$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();"';
$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;
}
/* vim: set expandtab: */

View File

@@ -17,8 +17,8 @@ function smarty_function_popup_init($params, &$smarty)
}
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";
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");
}