/
process.coretag
49 lines (46 loc) · 1.54 KB
/
process.coretag
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Copyright 2002-2007 Interchange Development Group and others
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. See the LICENSE file for details.
#
# $Id: process.coretag,v 1.8 2007-03-30 23:40:49 pajamian Exp $
UserTag process Order target secure
UserTag process addAttr
UserTag process Version $Revision: 1.8 $
UserTag process Routine <<EOR
# Returns the href to process the completed order form or do the search.
sub {
my($target,$secure,$opt) = @_;
$secure = defined $secure ? $secure : $CGI::secure;
my $page = $opt->{href} || $Vend::Cfg->{ProcessPage};
if($opt->{download_name}) {
$page .= "/$opt->{download_name}";
}
my $url;
if($secure) {
$url = $Vend::Cfg->{SecurePostURL} || $Vend::Cfg->{SecureURL};
}
else {
$url = $Vend::Cfg->{PostURL} || $Vend::Cfg->{VendURL};
}
$url =~ s,/*$,/,;
$url .= $page;
if($Global::TolerateGet and ! $opt->{no_session}) {
my @args;
push @args, "?$::VN->{mv_session_id}=$Vend::SessionID"
unless $::Scratch->{no_session_id};
push @args, "?$::VN->{mv_pc}=" . ++$Vend::Session->{pageCount}
unless $::Scratch->{no_count};
push @args, "?$::VN->{mv_cat}=" . ++$Vend::Cat
if $Vend::VirtualCat;
if(@args) {
$url .= '?';
$url .= join($Global::UrlJoiner, @args);
}
}
return $url unless $target;
return qq{$url" TARGET="$target};
}
EOR