72073e34873eed60f40c041ad925da898b62fdb8
[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     'height'         => 336,
19     'color'          => '#ff0000',
20     'closetext'      => 'Go Away',      # the value '' removes the link
21     'aname'          => "target", # link NAME= value, useful for #targets
22   } )
23
24 </%doc>
25 % if ($params->{'action'} && $label) {
26 <A HREF="javascript:void(0);"
27    onClick="<% $onclick %>"
28    <% $params->{'aname'} ? 'NAME="'. $params->{'aname'}. '"' : '' %>
29 ><% $label %></A>\
30 % }
31 <%init>
32
33 my $params;
34 if (ref($_[0]) eq 'HASH') {
35   #$params = { %$params, %{ $_[0] } };
36   $params = shift;
37 } else {
38   #$params = { %$params, @_ };
39   $params = { @_ };
40 }
41
42 my $label = $params->{'label'};
43 my $onclick = include('/elements/popup_link_onclick.html', $params);
44
45 </%init>