diff options
| author | ivan <ivan> | 2008-03-31 20:40:57 +0000 |
|---|---|---|
| committer | ivan <ivan> | 2008-03-31 20:40:57 +0000 |
| commit | b7bde670fbe4ccb3e80adc4e701bed87e2ccd9a7 (patch) | |
| tree | d6afe4087bdca533ff2bec013e5a399797e554b9 /httemplate/elements/popup_link-cust_main.html | |
| parent | fe664204a377f190bf653754027cca6a0b93702c (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_main.html')
| -rw-r--r-- | httemplate/elements/popup_link-cust_main.html | 43 |
1 files changed, 15 insertions, 28 deletions
diff --git a/httemplate/elements/popup_link-cust_main.html b/httemplate/elements/popup_link-cust_main.html index 3b1363f49..cbb48c008 100644 --- a/httemplate/elements/popup_link-cust_main.html +++ b/httemplate/elements/popup_link-cust_main.html @@ -5,7 +5,7 @@ Example: <SCRIPT TYPE="text/javascript" SRC="overlibmws.js"></SCRIPT> <SCRIPT TYPE="text/javascript" SRC="iframecontentmws.js"></SCRIPT> - include( '/elements/cust_popup_link.html', { + include( '/elements/cust_popup_link.html', { #hashref or a list, either way #required 'action' => 'content.html', # uri for content of popup which should @@ -23,34 +23,21 @@ Example: ) </%doc> +% if ( $params->{'cust_main'} ) { +<% include('/elements/popup_link.html', $params ) %>\ +% } <%init> -my($params, $action, $label, $actionlabel, $color, $cust_main, $width); -my $closetext = ''; -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_main = $params->{'cust_main'} if exists $params->{'cust_main'}; - } -}else{ # deprecated - ($action, $label, $actionlabel, $color, $cust_main) = @_; -} -$action .= '?'. $cust_main->custnum; +my $params = { 'closetext' => 'Close' }; + +if (ref($_[0]) eq 'HASH') { + $params = { %$params, %{ $_[0] } }; +} else { + $params = { %$params, @_ }; +} + +$params->{'action'} .= + ( $params->{'action'} =~ /\?/ ? ';' : '?' ). + 'custnum='. $params->{'cust_main'}->custnum; </%init> -<% $cust_main - ? include('/elements/popup_link.html', { 'action' => $action, - 'label' => $label, - 'actionlabel' => $actionlabel, - 'color' => $color, - 'closetext' => $closetext, - } - ) - : '' -%> |
