Name

run-profile — runs form profile

ATTRIBUTES

Attribute Pos. Req. Default Description
check Yes
cgi Yes
profile Yes
name Yes
no_error
overwrite_error
interpolate     0 interpolate output?
hide     0 Hide the tag return value?

DESCRIPTION

This tags validates form input against a given form profile.

BEHAVIOR

This tag does not appear to be affected by, or affect, the rest of Interchange.

EXAMPLES

No examples are available at this time. We do consider this a problem and will try to supply some.

NOTES

AVAILABILITY

run-profile is available in Interchange versions:

4.6.0-5.9.0 (git-head)

SOURCE

Interchange 5.9.0:

Source: code/UI_Tag/run_profile.coretag
Lines: 60


# Copyright 2002-2009 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: run_profile.coretag,v 1.7 2009-01-26 09:49:11 racke Exp $

UserTag run-profile Order   check cgi profile name
UserTag run-profile addAttr
UserTag run-profile Version $Revision: 1.7 $
UserTag run-profile Routine <<EOR
sub {
my ($check, $cgi, $profile, $name, $opt) = @_;
#::logDebug("call check $check");
my $ref;
my $pname = $name;

if ($opt->{ref}) {
  if (ref($opt->{ref}) eq 'HASH') {
    $ref = $opt->{ref};
  }
  else {
    # error message
    ::logError("Invalid ref parameter provided for profile %s", $pname || $check);
  }
}
elsif ($cgi) {
  $ref = \%CGI::values;
}
else {
  $ref = $::Values;
}

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} unless $name;

return is_yes($opt->{hide}) ? undef : $status;
}
EOR

AUTHORS

Interchange Development Group

SEE ALSO

DocBook! Interchange!