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) {
28 $
$_key = (string)$_value;
34 $append .= ',' . strtoupper($_key) . ",'" . str_replace("'","\'",$_value) . "'";
69 $append .= ',' . strtoupper($_key) . ",'$_value'";
84 if ($_value) $append .= ',' . strtoupper($_key);
88 $smarty->trigger_error("[popup] unknown parameter $_key", E_USER_WARNING
);
92 if (empty($text) && !isset($inarray) && empty($function)) {
93 $smarty->trigger_error("overlib: attribute 'text' or 'inarray' or 'function' required");
97 if (empty($trigger)) { $trigger = "onmouseover"; }
99 $retval = $trigger . '="return overlib(\''.preg_replace(array("!'!","![\r\n]!"),array("\'",'\r'),$text).'\'';
100 $retval .= $append . ');" onmouseout="nd();"';
105 /* vim: set expandtab: */