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