a444ad1252200c978a004d83d23dc403ad721d0c
[freeside.git] / httemplate / elements / popup_link.html
1 <%doc>
2
3 Example:
4
5   <SCRIPT TYPE="text/javascript" SRC="overlibmws.js"></SCRIPT>
6   <SCRIPT TYPE="text/javascript" SRC="iframecontentmws.js"></SCRIPT>
7
8   include( '/elements/popup_link.html', { #hashref or a list, either way is fine
9
10     #required
11     'action'         => 'content.html', # uri for content of popup
12     'label'          => 'click me',     # text of <A> tag
13    
14     #strongly recommended
15     'actionlabel     => 'You clicked',  # popup title
16    
17     #opt
18     'width'          => '540',
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>