5 * @subpackage plugins
\r
10 * Smarty {popup} function plugin
\r
12 * Type: function<br>
\r
14 * Purpose: make text pop up in windows via overlib
\r
15 * @link http://smarty.php.net/manual/en/language.function.popup.php {popup}
\r
16 * (Smarty online manual)
\r
21 function smarty_function_popup($params, &$smarty)
\r
25 if (empty($text) && !isset($inarray) && empty($function)) {
\r
26 $smarty->trigger_error("overlib: attribute 'text' or 'inarray' or 'function' required");
\r
30 if (empty($trigger)) { $trigger = "onmouseover"; }
\r
32 $retval = $trigger . '="return overlib(\''.preg_replace(array("!'!","![\r\n]!"),array("\'",'\r'),$text).'\'';
\r
33 if ($sticky) { $retval .= ",STICKY"; }
\r
34 if (!empty($caption)) { $retval .= ",CAPTION,'".str_replace("'","\'",$caption)."'"; }
\r
35 if (!empty($fgcolor)) { $retval .= ",FGCOLOR,'$fgcolor'"; }
\r
36 if (!empty($bgcolor)) { $retval .= ",BGCOLOR,'$bgcolor'"; }
\r
37 if (!empty($textcolor)) { $retval .= ",TEXTCOLOR,'$textcolor'"; }
\r
38 if (!empty($capcolor)) { $retval .= ",CAPCOLOR,'$capcolor'"; }
\r
39 if (!empty($closecolor)) { $retval .= ",CLOSECOLOR,'$closecolor'"; }
\r
40 if (!empty($textfont)) { $retval .= ",TEXTFONT,'$textfont'"; }
\r
41 if (!empty($captionfont)) { $retval .= ",CAPTIONFONT,'$captionfont'"; }
\r
42 if (!empty($closefont)) { $retval .= ",CLOSEFONT,'$closefont'"; }
\r
43 if (!empty($textsize)) { $retval .= ",TEXTSIZE,$textsize"; }
\r
44 if (!empty($captionsize)) { $retval .= ",CAPTIONSIZE,$captionsize"; }
\r
45 if (!empty($closesize)) { $retval .= ",CLOSESIZE,$closesize"; }
\r
46 if (!empty($width)) { $retval .= ",WIDTH,$width"; }
\r
47 if (!empty($height)) { $retval .= ",HEIGHT,$height"; }
\r
48 if (!empty($left)) { $retval .= ",LEFT"; }
\r
49 if (!empty($right)) { $retval .= ",RIGHT"; }
\r
50 if (!empty($center)) { $retval .= ",CENTER"; }
\r
51 if (!empty($above)) { $retval .= ",ABOVE"; }
\r
52 if (!empty($below)) { $retval .= ",BELOW"; }
\r
53 if (isset($border)) { $retval .= ",BORDER,$border"; }
\r
54 if (isset($offsetx)) { $retval .= ",OFFSETX,$offsetx"; }
\r
55 if (isset($offsety)) { $retval .= ",OFFSETY,$offsety"; }
\r
56 if (!empty($fgbackground)) { $retval .= ",FGBACKGROUND,'$fgbackground'"; }
\r
57 if (!empty($bgbackground)) { $retval .= ",BGBACKGROUND,'$bgbackground'"; }
\r
58 if (!empty($closetext)) { $retval .= ",CLOSETEXT,'".str_replace("'","\'",$closetext)."'"; }
\r
59 if (!empty($noclose)) { $retval .= ",NOCLOSE"; }
\r
60 if (!empty($status)) { $retval .= ",STATUS,'".str_replace("'","\'",$status)."'"; }
\r
61 if (!empty($autostatus)) { $retval .= ",AUTOSTATUS"; }
\r
62 if (!empty($autostatuscap)) { $retval .= ",AUTOSTATUSCAP"; }
\r
63 if (isset($inarray)) { $retval .= ",INARRAY,'$inarray'"; }
\r
64 if (isset($caparray)) { $retval .= ",CAPARRAY,'$caparray'"; }
\r
65 if (!empty($capicon)) { $retval .= ",CAPICON,'$capicon'"; }
\r
66 if (!empty($snapx)) { $retval .= ",SNAPX,$snapx"; }
\r
67 if (!empty($snapy)) { $retval .= ",SNAPY,$snapy"; }
\r
68 if (isset($fixx)) { $retval .= ",FIXX,$fixx"; }
\r
69 if (isset($fixy)) { $retval .= ",FIXY,$fixy"; }
\r
70 if (!empty($background)) { $retval .= ",BACKGROUND,'$background'"; }
\r
71 if (!empty($padx)) { $retval .= ",PADX,$padx"; }
\r
72 if (!empty($pady)) { $retval .= ",PADY,$pady"; }
\r
73 if (!empty($fullhtml)) { $retval .= ",FULLHTML"; }
\r
74 if (!empty($frame)) { $retval .= ",FRAME,'$frame'"; }
\r
75 if (isset($timeout)) { $retval .= ",TIMEOUT,$timeout"; }
\r
76 if (!empty($function)) { $retval .= ",FUNCTION,'$function'"; }
\r
77 if (isset($delay)) { $retval .= ",DELAY,$delay"; }
\r
78 if (!empty($hauto)) { $retval .= ",HAUTO"; }
\r
79 if (!empty($vauto)) { $retval .= ",VAUTO"; }
\r
80 $retval .= ');" onmouseout="nd();"';
\r
85 /* vim: set expandtab: */
\r