fix examples to use elements/init_overlib.html
[freeside.git] / httemplate / elements / popup_link.html
1 <%doc>
2
3 Example:
4
5   include('/elements/init_overlib.html')
6
7   include( '/elements/popup_link.html', { #hashref or a list, either way is fine
8
9     #required
10     'action'         => 'content.html', # uri for content of popup
11     'label'          => 'click me',     # text of <A> tag
12    
13     #strongly recommended
14     'actionlabel     => 'You clicked',  # popup title
15    
16     #opt
17     'width'          => '540',
18     'color'          => '#ff0000',
19     'closetext'      => 'Go Away',      # the value '' removes the link
20   } )
21
22 </%doc>
23 % if ($params->{'action'} && $label) {
24 <A HREF="javascript:void(0);" onClick="<% $onclick %>"><% $label %></A>\
25 % }
26 <%init>
27
28 my $params;
29 if (ref($_[0]) eq 'HASH') {
30   #$params = { %$params, %{ $_[0] } };
31   $params = shift;
32 } else {
33   #$params = { %$params, @_ };
34   $params = { @_ };
35 }
36
37 my $label = $params->{'label'};
38 my $onclick = include('/elements/popup_link_onclick.html', $params);
39
40 </%init>