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
12 #alternately, use instead of action
13 'js_action' => 'url', # javascript variable or expression
16 'actionlabel => 'You clicked', # popup title
22 'closetext' => 'Go Away', # the value '' removes the link
26 'scrolling' => 'yes', #scrollbars:
27 # 'auto' (default if omitted), 'yes' or 'no'.
28 'nofalse' => 0, #bool, eliminates "return false;"
38 my( $action, $actionlabel, $frame ) = ( '', '', '' );
39 my( $width, $height ) = ( 540, 336 );
40 my $closetext = emt('Close');
41 my $color = '#333399';
42 my $scrolling = 'auto';
45 if (ref($_[0]) eq 'HASH') {
46 #$params = { %$params, %{ $_[0] } };
49 #$params = { %$params, @_ };
53 $action = q(') . $params->{'action'} . q(') if exists $params->{'action'};
54 $action = $params->{'js_action'} if exists $params->{'js_action'};
55 $actionlabel = $params->{'actionlabel'} if exists $params->{'actionlabel'};
56 $width = $params->{'width'} if exists $params->{'width'};
57 $height = $params->{'height'} if exists $params->{'height'};
58 $color = $params->{'color'} if exists $params->{'color'};
59 $closetext = $params->{'closetext'} if exists $params->{'closetext'};
60 $frame = $params->{'frame'} if exists $params->{'frame'};
61 $scrolling = $params->{'scrolling'} if exists $params->{'scrolling'};
63 #stupid safari is caching the "location" of popup iframs, and submitting them
64 #instead of displaying them. this should prevent that.
65 my $popup_name = 'popup-'.time. "-$$-". rand() * 2**32;
68 "overlib( OLiframeContent($action, $width, $height, '$popup_name', 0, '$scrolling' ), ".
69 "CAPTION, '$actionlabel', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, ".
70 "DRAGGABLE, CLOSECLICK, ".
71 "BGCOLOR, '$color', CGCOLOR, '$color', CLOSETEXT, '$closetext'".
72 ( $frame ? ", FRAME, $frame" : '' ).
75 $onclick .= " return false;"
76 unless $params->{'nofalse'};