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
19 'closetext' => 'Go Away', # the value '' removes the link
23 'scrolling' => 'yes', #scrollbars:
24 # 'auto' (default if omitted), 'yes' or 'no'.
25 'nofalse' => 0, #bool, eliminates "return false;"
35 my( $action, $actionlabel, $frame ) = ( '', '', '' );
36 my( $width, $height ) = ( 540, 336 );
37 my $closetext = emt('Close');
38 my $color = '#333399';
39 my $scrolling = 'auto';
42 if (ref($_[0]) eq 'HASH') {
43 #$params = { %$params, %{ $_[0] } };
46 #$params = { %$params, @_ };
50 $action = $params->{'action'} if exists $params->{'action'};
51 $actionlabel = $params->{'actionlabel'} if exists $params->{'actionlabel'};
52 $width = $params->{'width'} if exists $params->{'width'};
53 $height = $params->{'height'} if exists $params->{'height'};
54 $color = $params->{'color'} if exists $params->{'color'};
55 $closetext = $params->{'closetext'} if exists $params->{'closetext'};
56 $frame = $params->{'frame'} if exists $params->{'frame'};
57 $scrolling = $params->{'scrolling'} if exists $params->{'scrolling'};
59 #stupid safari is caching the "location" of popup iframs, and submitting them
60 #instead of displaying them. this should prevent that.
61 my $popup_name = 'popup-'.time. "-$$-". rand() * 2**32;
64 "overlib( OLiframeContent('$action', $width, $height, '$popup_name', 0, '$scrolling' ), ".
65 "CAPTION, '$actionlabel', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, ".
66 "DRAGGABLE, CLOSECLICK, ".
67 "BGCOLOR, '$color', CGCOLOR, '$color', CLOSETEXT, '$closetext'".
68 ( $frame ? ", FRAME, $frame" : '' ).
71 $onclick .= " return false;"
72 unless $params->{'nofalse'};