RT#34960: Quotations [v3 merge]
[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     'title'          => 'Hover Text',
22
23     #uncommon opt
24     'aname'          => "target", # link NAME= value, useful for #targets
25     'target'         => '_parent',
26     'style'          => 'css-attribute:value',
27     'html_label'     => '<IMG SRC="something.png">',  # overrides label
28   } )
29
30 </%doc>
31 % if ($params->{'action'} && $label) {
32 <A HREF="javascript:void(0);"
33    onClick="<% $onclick |n %>"
34    <% $params->{'title'}  ? 'TITLE="' . $params->{'title'}.  '"' : '' |n %>
35    <% $params->{'aname'}  ? 'NAME="'.   $params->{'aname'}.  '"' : '' |n %>
36    <% $params->{'target'} ? 'TARGET="'. $params->{'target'}. '"' : '' |n %>
37    <% $params->{'style'}  ? 'STYLE="'.  $params->{'style'}.  '"' : '' |n %>
38 ><% $label %></A>\
39 % }
40 <%init>
41
42 my $params;
43 if (ref($_[0]) eq 'HASH') {
44   #$params = { %$params, %{ $_[0] } };
45   $params = shift;
46 } else {
47   #$params = { %$params, @_ };
48   $params = { @_ };
49 }
50
51 my $label = $params->{'label'};
52 $label =~ s/ /&nbsp;/g;
53 $label = $params->{'html_label'} || $label;
54 my $onclick = include('/elements/popup_link_onclick.html', $params);
55
56 </%init>