diff options
author | ivan <ivan> | 2008-03-31 20:40:33 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-03-31 20:40:33 +0000 |
commit | a2649b652a3db877b105b4bea5b34727dbcb914f (patch) | |
tree | 535157e59a08899407fadf892405b0abd7afd57b /httemplate/elements/popup_link-cust_svc.html | |
parent | f9b6a37aaee52d875ea9393cda79d46f8916e593 (diff) |
clean up popup link elements a bit, have the iframe name autogenerate to work around safari fuckery
Diffstat (limited to 'httemplate/elements/popup_link-cust_svc.html')
-rw-r--r-- | httemplate/elements/popup_link-cust_svc.html | 49 |
1 files changed, 19 insertions, 30 deletions
diff --git a/httemplate/elements/popup_link-cust_svc.html b/httemplate/elements/popup_link-cust_svc.html index decb82d97..8a11fd780 100644 --- a/httemplate/elements/popup_link-cust_svc.html +++ b/httemplate/elements/popup_link-cust_svc.html @@ -5,7 +5,7 @@ Example: <SCRIPT TYPE="text/javascript" SRC="overlibmws.js"></SCRIPT> <SCRIPT TYPE="text/javascript" SRC="iframecontentmws.js"></SCRIPT> - include( '/elements/svc_popup_link.html', { + include( '/elements/svc_popup_link.html', { #hashref or a list, either way #required 'action' => 'content.html', # uri for content of popup which should @@ -23,37 +23,26 @@ Example: ) </%doc> +% if ( $params->{'cust_svc'} ) { +<% include( '/elements/popup_link.html', $params ) %>\ +% } <%init> -my($params, $action, $label, $actionlabel, $cust_svc, $color, $width); -my $closetext = 'Close'; -if (ref(@_[0]) eq 'HASH') { - $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'}; - $cust_svc = $params->{'cust_svc'} if exists $params->{'cust_svc'}; - } -}else{ # deprecated - ($action, $label, $actionlabel, $cust_svc) = @_; + +my $params = { 'closetext' => 'Close', + 'width' => 392, + }; + +if (ref($_[0]) eq 'HASH') { + $params = { %$params, %{ $_[0] } }; +} else { + $params = { %$params, @_ }; } -$action .= '?svcnum='. $cust_svc->svcnum; -$actionlabel .= ' service '. $cust_svc->svcnum; -$width ||= 392; +$params->{'action'} .= + ( $params->{'action'} =~ /\?/ ? ';' : '?' ). + 'svcnum='. $params->{'cust_svc'}->svcnum; + +$params->{'actionlabel'} .= + ' service '. $params->{'cust_svc'}->svcnum; #XXX svcnum? really? </%init> -<% $cust_svc - ? include('/elements/popup_link.html', { 'action' => $action, - 'label' => $label, - 'actionlabel' => $actionlabel, - 'color' => $color, - 'width' => $width, - 'closetext' => $closetext, - } - ) - : '' -%> |