1 |
cvsjoko |
1.1 |
<?php |
2 |
|
|
|
3 |
|
|
/* |
4 |
|
|
* Smarty plugin |
5 |
|
|
* ------------------------------------------------------------- |
6 |
|
|
* Type: function |
7 |
|
|
* Name: popup |
8 |
|
|
* Purpose: make text pop up in windows via overlib |
9 |
|
|
* ------------------------------------------------------------- |
10 |
|
|
*/ |
11 |
|
|
function smarty_function_popup($params, &$smarty) |
12 |
|
|
{ |
13 |
|
|
extract($params); |
14 |
|
|
|
15 |
|
|
if (empty($text) && !isset($inarray) && empty($function)) { |
16 |
|
|
$smarty->trigger_error("overlib: attribute 'text' or 'inarray' or 'function' required"); |
17 |
|
|
return false; |
18 |
|
|
} |
19 |
|
|
|
20 |
|
|
if (empty($trigger)) { $trigger = "onMouseOver"; } |
21 |
|
|
|
22 |
|
|
echo $trigger.'="return overlib(\''.str_replace("'","\'",$text).'\''; |
23 |
|
|
if ($sticky) { echo ",STICKY"; } |
24 |
|
|
if (!empty($caption)) { echo ",CAPTION,'".str_replace("'","\'",$caption)."'"; } |
25 |
|
|
if (!empty($fgcolor)) { echo ",FGCOLOR,'$fgcolor'"; } |
26 |
|
|
if (!empty($bgcolor)) { echo ",BGCOLOR,'$bgcolor'"; } |
27 |
|
|
if (!empty($textcolor)) { echo ",TEXTCOLOR,'$textcolor'"; } |
28 |
|
|
if (!empty($capcolor)) { echo ",CAPCOLOR,'$capcolor'"; } |
29 |
|
|
if (!empty($closecolor)) { echo ",CLOSECOLOR,'$closecolor'"; } |
30 |
|
|
if (!empty($textfont)) { echo ",TEXTFONT,'$textfont'"; } |
31 |
|
|
if (!empty($captionfont)) { echo ",CAPTIONFONT,'$captionfont'"; } |
32 |
|
|
if (!empty($closefont)) { echo ",CLOSEFONT,'$closefont'"; } |
33 |
|
|
if (!empty($textsize)) { echo ",TEXTSIZE,$textsize"; } |
34 |
|
|
if (!empty($captionsize)) { echo ",CAPTIONSIZE,$captionsize"; } |
35 |
|
|
if (!empty($closesize)) { echo ",CLOSESIZE,$closesize"; } |
36 |
|
|
if (!empty($width)) { echo ",WIDTH,$width"; } |
37 |
|
|
if (!empty($height)) { echo ",HEIGHT,$height"; } |
38 |
|
|
if (!empty($left)) { echo ",LEFT"; } |
39 |
|
|
if (!empty($right)) { echo ",RIGHT"; } |
40 |
|
|
if (!empty($center)) { echo ",CENTER"; } |
41 |
|
|
if (!empty($above)) { echo ",ABOVE"; } |
42 |
|
|
if (!empty($below)) { echo ",BELOW"; } |
43 |
|
|
if (isset($border)) { echo ",BORDER,$border"; } |
44 |
|
|
if (isset($offsetx)) { echo ",OFFSETX,$offsetx"; } |
45 |
|
|
if (isset($offsety)) { echo ",OFFSETY,$offsety"; } |
46 |
|
|
if (!empty($fgbackground)) { echo ",FGBACKGROUND,'$fgbackground'"; } |
47 |
|
|
if (!empty($bgbackground)) { echo ",BGBACKGROUND,'$bgbackground'"; } |
48 |
|
|
if (!empty($closetext)) { echo ",CLOSETEXT,'".str_replace("'","\'",$closetext)."'"; } |
49 |
|
|
if (!empty($noclose)) { echo ",NOCLOSE"; } |
50 |
|
|
if (!empty($status)) { echo ",STATUS,'".str_replace("'","\'",$status)."'"; } |
51 |
|
|
if (!empty($autostatus)) { echo ",AUTOSTATUS"; } |
52 |
|
|
if (!empty($autostatuscap)) { echo ",AUTOSTATUSCAP"; } |
53 |
|
|
if (isset($inarray)) { echo ",INARRAY,'$inarray'"; } |
54 |
|
|
if (isset($caparray)) { echo ",CAPARRAY,'$caparray'"; } |
55 |
|
|
if (!empty($capicon)) { echo ",CAPICON,'$capicon'"; } |
56 |
|
|
if (!empty($snapx)) { echo ",SNAPX,$snapx"; } |
57 |
|
|
if (!empty($snapy)) { echo ",SNAPY,$snapy"; } |
58 |
|
|
if (isset($fixx)) { echo ",FIXX,$fixx"; } |
59 |
|
|
if (isset($fixy)) { echo ",FIXY,$fixy"; } |
60 |
|
|
if (!empty($background)) { echo ",BACKGROUND,'$background'"; } |
61 |
|
|
if (!empty($padx)) { echo ",PADX,$padx"; } |
62 |
|
|
if (!empty($pady)) { echo ",PADY,$pady"; } |
63 |
|
|
if (!empty($fullhtml)) { echo ",FULLHTML"; } |
64 |
|
|
if (!empty($frame)) { echo ",FRAME,'$frame'"; } |
65 |
|
|
if (isset($timeout)) { echo ",TIMEOUT,$timeout"; } |
66 |
|
|
if (!empty($function)) { echo ",FUNCTION,'$function'"; } |
67 |
|
|
if (isset($delay)) { echo ",DELAY,$delay"; } |
68 |
|
|
if (!empty($hauto)) { echo ",HAUTO"; } |
69 |
|
|
if (!empty($vauto)) { echo ",VAUTO"; } |
70 |
|
|
echo ');" onMouseOut="nd();"'; |
71 |
|
|
} |
72 |
|
|
|
73 |
|
|
/* vim: set expandtab: */ |
74 |
|
|
|
75 |
|
|
?> |