20193873f141d4b6cda1d056f8f6e80dcf4d1ae0
[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
22     #uncommon opt
23     'aname'          => "target", # link NAME= value, useful for #targets
24     'target'         => '_parent',
25   } )
26
27 </%doc>
28 % if ($params->{'action'} && $label) {
29 <A HREF="javascript:void(0);"
30    onClick="<% $onclick %>"
31    <% $params->{'aname'}  ? 'NAME="'.   $params->{'aname'}.  '"' : '' %>
32    <% $params->{'target'} ? 'TARGET="'. $params->{'target'}. '"' : '' %>
33 ><% $label %></A>\
34 % }
35 <%init>
36
37 my $params;
38 if (ref($_[0]) eq 'HASH') {
39   #$params = { %$params, %{ $_[0] } };
40   $params = shift;
41 } else {
42   #$params = { %$params, @_ };
43   $params = { @_ };
44 }
45
46 my $label = $params->{'label'};
47 my $onclick = include('/elements/popup_link_onclick.html', $params);
48
49 </%init>