0eb4fcb32a25791116400931aa062b296e7a9eef
[atutor.git] / mods / phpdoc2 / PhpDocumentor / phpDocumentor / Smarty-2.6.0 / libs / plugins / function.popup.php
1 <?php\r
2 /**\r
3  * Smarty plugin\r
4  * @package Smarty\r
5  * @subpackage plugins\r
6  */\r
7 \r
8 \r
9 /**\r
10  * Smarty {popup} function plugin\r
11  *\r
12  * Type:     function<br>\r
13  * Name:     popup<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
17  * @param array\r
18  * @param Smarty\r
19  * @return string\r
20  */\r
21 function smarty_function_popup($params, &$smarty)\r
22 {\r
23     extract($params);\r
24 \r
25     if (empty($text) && !isset($inarray) && empty($function)) {\r
26         $smarty->trigger_error("overlib: attribute 'text' or 'inarray' or 'function' required");\r
27         return false;\r
28     }\r
29 \r
30     if (empty($trigger)) { $trigger = "onmouseover"; }\r
31 \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
81         \r
82         return $retval;\r
83 }\r
84 \r
85 /* vim: set expandtab: */\r
86 \r
87 ?>\r