1 # Copyright 2002-2009 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: run_profile.coretag,v 1.7 2009-01-26 09:49:11 racke Exp $
10 UserTag run-profile Order check cgi profile name
11 UserTag run-profile addAttr
12 UserTag run-profile Version $Revision: 1.7 $
13 UserTag run-profile Routine <<EOR
15 my ($check, $cgi, $profile, $name, $opt) = @_;
16 #::logDebug("call check $check");
21 if (ref($opt->{ref}) eq 'HASH') {
26 ::logError("Invalid ref parameter provided for profile %s", $pname || $check);
37 # check scratch for profile if none specified
38 $profile = $Scratch->{"profile_$check"} unless $profile;
40 #::logDebug("PROFILE(" . $Tag->var('MV_PAGE',1) . "):***$profile***");
41 # test passes if no profile exists
42 return 1 if ! $profile;
44 $opt->{no_error} = 1 unless defined $opt->{no_error};
46 $pname = 'tmp_profile.' . $Vend::Session->{id};
47 #Debug("running check $check, pname=$pname profile=$profile");
48 $profile .= "\n&fatal=1\n";
49 $profile = "&noerror=1\n$profile" if $opt->{no_error};
50 $profile = "&overwrite=1\n$profile" if $opt->{overwrite_error};
51 $::Scratch->{$pname} = $profile;
54 my ($status) = ::check_order($pname, $ref);
56 delete $::Scratch->{$pname} unless $name;
58 return is_yes($opt->{hide}) ? undef : $status;