5 include('/elements/init_overlib.html')
7 include( '/elements/popup_link_onclick.html', { #hashref or a list, either way
10 'action' => 'content.html', # uri for content of popup
13 'actionlabel => 'You clicked', # popup title
15 #alternately, use instead of action, values will be passed unquoted to overlib
16 'js_action' => 'url', # javascript variable or expression
17 'js_actionlabel' => 'actionlabel', # javascript variable or expression
23 'closetext' => 'Go Away', # the value '' removes the link
24 'nocenter' => 0, #bool, elminates centering the popup
28 'scrolling' => 'yes', #scrollbars:
29 # 'auto' (default if omitted), 'yes' or 'no'.
30 'nofalse' => 0, #bool, eliminates "return false;"
40 my( $action, $actionlabel, $frame ) = ( '', '', '' );
41 my( $width, $height ) = ( 540, 336 );
42 my $closetext = emt('Close');
43 my $color = '#333399';
44 my $scrolling = 'auto';
47 if (ref($_[0]) eq 'HASH') {
48 #$params = { %$params, %{ $_[0] } };
51 #$params = { %$params, @_ };
55 $action = q(') . $params->{'action'} . q(');
56 $action = $params->{'js_action'} if exists $params->{'js_action'};
57 $actionlabel = q(') . $params->{'actionlabel'} . q(');
58 $actionlabel = $params->{'js_actionlabel'} if exists $params->{'js_actionlabel'};
59 $width = $params->{'width'} if exists $params->{'width'};
60 $height = $params->{'height'} if exists $params->{'height'};
61 $color = $params->{'color'} if exists $params->{'color'};
62 $closetext = $params->{'closetext'} if exists $params->{'closetext'};
63 $frame = $params->{'frame'} if exists $params->{'frame'};
64 $scrolling = $params->{'scrolling'} if exists $params->{'scrolling'};
66 #stupid safari is caching the "location" of popup iframs, and submitting them
67 #instead of displaying them. this should prevent that.
68 my $popup_name = 'popup-'.random_id();
71 "overlib( OLiframeContent($action, $width, $height, '$popup_name', 0, '$scrolling' ), ".
72 "CAPTION, $actionlabel, STICKY, AUTOSTATUSCAP, ".
73 ( $params->{'nocenter'} ? "" : "MIDX, 0, MIDY, 0, " ).
74 "DRAGGABLE, CLOSECLICK, TEXTPADDING, 0, BASE, 0, ".
75 "BGCOLOR, '$color', CGCOLOR, '$color', FGCOLOR, '#f8f8f8', ".
76 "CLOSETEXT, '$closetext'".
77 ( $frame ? ", FRAME, $frame" : '' ).
80 $onclick .= " return false;"
81 unless $params->{'nofalse'};