10 * Smarty {popup} function plugin
14 * Purpose: make text pop up in windows via overlib
15 * @link http://smarty.php.net/manual/en/language.function.popup.php {popup}
16 * (Smarty online manual)
21 function smarty_function_popup($params, &$smarty)
24 foreach ($params as $_key=>$_value) {
30 $
$_key = (string)$_value;
31 if ($_key == 'function' ||
$_key == 'inarray')
32 $append .= ',' . strtoupper($_key) . ",'$_value'";
38 $append .= ',' . strtoupper($_key) . ",'" . str_replace("'","\'",$_value) . "'";
55 $append .= ',' . strtoupper($_key) . ",'$_value'";
74 $append .= ',' . strtoupper($_key) . ",$_value";
91 if ($_value) $append .= ',' . strtoupper($_key);
95 $smarty->trigger_error("[popup] unknown parameter $_key", E_USER_WARNING
);
99 if (empty($text) && !isset($inarray) && empty($function)) {
100 $smarty->trigger_error("overlib: attribute 'text' or 'inarray' or 'function' required");
104 if (empty($trigger)) { $trigger = "onmouseover"; }
106 $retval = $trigger . '="return overlib(\''.preg_replace(array("!'!","![\r\n]!"),array("\'",'\r'),$text).'\'';
107 $retval .= $append . ');"';
108 if ($trigger == 'onmouseover')
109 $retval .= ' onmouseout="nd();"';
115 /* vim: set expandtab: */