1 # Copyright 2002-2007 Interchange Development Group and others
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version. See the LICENSE file for details.
8 # $Id: return_to.coretag,v 1.4 2007-03-30 23:40:54 pajamian Exp $
10 UserTag return_to Order type table_hack
11 UserTag return_to addAttr
12 UserTag return_to Version $Revision: 1.4 $
13 UserTag return_to Routine <<EOR
16 my ($type, $tablehack, $opt) = @_;
18 $type = 'form' unless $type;
20 my ($page, @args) = split /\0/, $CGI::values{ui_return_to};
21 if($CGI::values{ui_target}) {
22 push @args, "ui_target=$CGI::values{ui_target}";
34 if(s/^mv_data_table=(.*)//) {
35 $extra = "mv_return_table=$1\n";
37 elsif (s/^(ui|mv)_return_table=//) {
38 $found = "mv_return_table=$_\n";
41 $extra = $found if $found;
44 if($type eq 'click') {
45 $out .= qq{mv_nextpage=$page\n} if $page;
47 my ($k, $v) = split /\s*=\s*/, $_, 2;
48 next unless length $k;
49 next if $k =~ /$opt->{exclude}/;
50 $v =~ s/__NULL__/\0/g;
53 if($opt->{stack} or $CGI::values{ui_return_stack}) {
58 $out .= "ui_return_to=\n";
62 if($type eq 'formlink') {
63 $page = $Global::Variable->{MV_PAGE} if ! $page;
64 $out .= qq{ui_return_to=$page\n};
67 $out .= qq{ui_return_to=$_\n}
70 elsif($type eq 'url') {
71 $page = $Global::Variable->{MV_PAGE} if ! $page;
74 form => join("\n", @args),
77 elsif ($type eq 'form') {
78 $page = $Global::Variable->{MV_PAGE} if ! $page;
79 $out .= qq{<INPUT TYPE=hidden NAME=ui_return_to VALUE="$page">\n};
82 $out .= qq{<INPUT TYPE=hidden NAME=ui_return_to VALUE="$_">\n}
85 elsif ($type eq 'regen') {
86 $page = $Global::Variable->{MV_PAGE} if ! $page;
87 $out .= qq{<INPUT TYPE=hidden NAME=ui_return_to VALUE="ui_return_to=$page">\n};
90 $out .= qq{<INPUT TYPE=hidden NAME=ui_return_to VALUE="ui_return_to=$_">\n}
94 $out .= $extra if $extra;
96 $::Scratch->{ui_location} = $Tag->area({
98 form => join "\n", @args,