[interchange-cvs] interchange - kwalsh modified code/UI_Tag/run_profile.coretag

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Wed Dec 19 04:45:30 EST 2007


User:      kwalsh
Date:      2007-12-19 09:45:30 GMT
Modified:  code/UI_Tag run_profile.coretag
Log:
    * New "name" parameter for use with pre-defined scratches or
      (more likely) profiles defined in etc/profiles.order.

    * New "hide" parameter to hide the success/failure status.

Revision  Changes    Path
1.5       +23 -20    interchange/code/UI_Tag/run_profile.coretag


rev 1.5, prev_rev 1.4
Index: run_profile.coretag
===================================================================
RCS file: /var/cvs/interchange/code/UI_Tag/run_profile.coretag,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- run_profile.coretag	30 Mar 2007 23:40:54 -0000	1.4
+++ run_profile.coretag	19 Dec 2007 09:45:30 -0000	1.5
@@ -5,37 +5,40 @@
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.  See the LICENSE file for details.
 # 
-# $Id: run_profile.coretag,v 1.4 2007/03/30 23:40:54 pajamian Exp $
+# $Id: run_profile.coretag,v 1.5 2007/12/19 09:45:30 kwalsh Exp $
 
-UserTag run-profile Order   check cgi profile
+UserTag run-profile Order   check cgi profile name
 UserTag run-profile addAttr
-UserTag run-profile Version $Revision: 1.4 $
+UserTag run-profile Version $Revision: 1.5 $
 UserTag run-profile Routine <<EOR
 sub {
-	my ($check, $cgi, $profile, $opt) = @_;
+	my ($check, $cgi, $profile, $name, $opt) = @_;
 #::logDebug("call check $check");
 	my $ref = $cgi ? (\%CGI::values) : $::Values;
+	my $pname = $name;
 
-	# check scratch for profile if none specified
-	$profile = $Scratch->{"profile_$check"} unless $profile;
-
-#::logDebug("PROFILE(" . $Tag->var('MV_PAGE',1) . "):***$profile***");
-	# test passes if no profile exists
-	return 1 if ! $profile;
-
-	$opt->{no_error} = 1 unless defined $opt->{no_error};
-
-	my $pname = 'tmp_profile.' . $Vend::Session->{id};
-#Debug("running check $check, pname=$pname profile=$profile");
-	$profile .= "\n&fatal=1\n";
-	$profile = "&noerror=1\n$profile" if $opt->{no_error};
-	$profile = "&overwrite=1\n$profile" if $opt->{overwrite_error};
-	$::Scratch->{$pname} = $profile;
+	unless ($pname) {
+	    # check scratch for profile if none specified
+	    $profile = $Scratch->{"profile_$check"} unless $profile;
+
+    #::logDebug("PROFILE(" . $Tag->var('MV_PAGE',1) . "):***$profile***");
+	    # test passes if no profile exists
+	    return 1 if ! $profile;
+
+	    $opt->{no_error} = 1 unless defined $opt->{no_error};
+
+	    $pname = 'tmp_profile.' . $Vend::Session->{id};
+    #Debug("running check $check, pname=$pname profile=$profile");
+	    $profile .= "\n&fatal=1\n";
+	    $profile = "&noerror=1\n$profile" if $opt->{no_error};
+	    $profile = "&overwrite=1\n$profile" if $opt->{overwrite_error};
+	    $::Scratch->{$pname} = $profile;
+	}
 
 	my ($status) = ::check_order($pname, $ref);
 
 	delete $::Scratch->{$pname};
 
-	return $status;
+	return is_yes($opt->{hide}) ? undef : $status;
 }
 EOR








More information about the interchange-cvs mailing list