X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fpopup_link.html;h=fbb6ce3b8ad3d6e6dbf0d94a1be2a762292ba275;hp=816856bba38a57202afc292d33e3adf0ae58b2db;hb=f3b1e139720b2262516ee3690b1d4b2b9941b500;hpb=5ea49c83c4a5b71a1e7baf2b6a75fe50816fdce5 diff --git a/httemplate/elements/popup_link.html b/httemplate/elements/popup_link.html index 816856bba..fbb6ce3b8 100644 --- a/httemplate/elements/popup_link.html +++ b/httemplate/elements/popup_link.html @@ -2,46 +2,50 @@ Example: - - + include('/elements/init_overlib.html') - include( '/elements/popup_link.html', { + include( '/elements/popup_link.html', { #hashref or a list, either way is fine #required 'action' => 'content.html', # uri for content of popup 'label' => 'click me', # text of tag #strongly recommended - 'actionlabel => 'You clicked', # popup title + 'actionlabel' => 'You clicked', # popup title #opt - 'width' => '540', + 'width' => 540, + 'height' => 336, 'color' => '#ff0000', 'closetext' => 'Go Away', # the value '' removes the link - ) + + #uncommon opt + 'aname' => "target", # link NAME= value, useful for #targets + 'target' => '_parent', + 'style' => 'css-attribute:value', + } ) +% if ($params->{'action'} && $label) { +{'aname'} ? 'NAME="'. $params->{'aname'}. '"' : '' |n %> + <% $params->{'target'} ? 'TARGET="'. $params->{'target'}. '"' : '' |n %> + <% $params->{'style'} ? 'STYLE="'. $params->{'style'}. '"' : '' |n %> +><% $label %>\ +% } <%init> -my($params, $action, $label, $actionlabel, $width, $color); -my $closetext = 'Close'; -if (ref(@_[0]) eq 'HASH') { + +my $params; +if (ref($_[0]) eq 'HASH') { + #$params = { %$params, %{ $_[0] } }; $params = shift; - foreach (qw(action label actionlabel width color)) { - $action = $params->{'action'} if exists $params->{'action'}; - $label = $params->{'label'} if exists $params->{'label'}; - $actionlabel = $params->{'actionlabel'} if exists $params->{'actionlabel'}; - $width = $params->{'width'} if exists $params->{'width'}; - $color = $params->{'color'} if exists $params->{'color'}; - $closetext = $params->{'closetext'} if exists $params->{'closetext'}; - } -}else{ # deprecated - ($action, $label, $actionlabel, $width) = @_; +} else { + #$params = { %$params, @_ }; + $params = { @_ }; } -$width ||= 540; -$color ||= '#333399'; +my $label = $params->{'label'}; +my $onclick = include('/elements/popup_link_onclick.html', $params); -%if ($action && $label) { -', <% $width %>, 336, 'pkg_or_svc_action_popup' ), CAPTION, '<% $actionlabel %>', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK, BGCOLOR, '<% $color %>', CGCOLOR, '<% $color %>', CLOSETEXT, '<% $closetext %>' ); return false;"><% $label %> -%}