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)
17 * @author Monte Ohrt <monte at ohrt dot com>
22 function smarty_function_popup($params, &$smarty)
25 foreach ($params as $_key=>$_value) {
31 $
$_key = (string)$_value;
32 if ($_key == 'function' ||
$_key == 'inarray')
33 $append .= ',' . strtoupper($_key) . ",'$_value'";
39 $append .= ',' . strtoupper($_key) . ",'" . str_replace("'","\'",$_value) . "'";
56 $append .= ',' . strtoupper($_key) . ",'$_value'";
75 $append .= ',' . strtoupper($_key) . ",$_value";
93 if ($_value) $append .= ',' . strtoupper($_key);
97 $smarty->trigger_error("[popup] unknown parameter $_key", E_USER_WARNING
);
101 if (empty($text) && !isset($inarray) && empty($function)) {
102 $smarty->trigger_error("overlib: attribute 'text' or 'inarray' or 'function' required");
106 if (empty($trigger)) { $trigger = "onmouseover"; }
108 $retval = $trigger . '="return overlib(\''.preg_replace(array("!'!","![\r\n]!"),array("\'",'\r'),$text).'\'';
109 $retval .= $append . ');"';
110 if ($trigger == 'onmouseover')
111 $retval .= ' onmouseout="nd();"';
117 /* vim: set expandtab: */
This page took 0.37601 seconds and 4 git commands to generate.