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
27 'scrolling' => 'yes', #scrollbars:
28 # 'auto' (default if omitted), 'yes' or 'no'.
29 'nofalse' => 0, #bool, eliminates "return false;"
39 my( $action, $actionlabel, $frame ) = ( '', '', '' );
40 my( $width, $height ) = ( 540, 336 );
41 my $closetext = emt('Close');
42 my $color = '#333399';
43 my $scrolling = 'auto';
46 if (ref($_[0]) eq 'HASH') {
47 #$params = { %$params, %{ $_[0] } };
50 #$params = { %$params, @_ };
54 $action = q(') . $params->{'action'} . q(');
55 $action = $params->{'js_action'} if exists $params->{'js_action'};
56 $actionlabel = q(') . $params->{'actionlabel'} . q(');
57 $actionlabel = $params->{'js_actionlabel'} if exists $params->{'js_actionlabel'};
58 $width = $params->{'width'} if exists $params->{'width'};
59 $height = $params->{'height'} if exists $params->{'height'};
60 $color = $params->{'color'} if exists $params->{'color'};
61 $closetext = $params->{'closetext'} if exists $params->{'closetext'};
62 $frame = $params->{'frame'} if exists $params->{'frame'};
63 $scrolling = $params->{'scrolling'} if exists $params->{'scrolling'};
65 #stupid safari is caching the "location" of popup iframs, and submitting them
66 #instead of displaying them. this should prevent that.
67 my $popup_name = 'popup-'.random_id();
70 "overlib( OLiframeContent($action, $width, $height, '$popup_name', 0, '$scrolling' ), ".
71 "CAPTION, $actionlabel, STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, ".
72 "DRAGGABLE, CLOSECLICK, ".
73 "BGCOLOR, '$color', CGCOLOR, '$color', CLOSETEXT, '$closetext'".
74 ( $frame ? ", FRAME, $frame" : '' ).
77 $onclick .= " return false;"
78 unless $params->{'nofalse'};