cgi — expand to value of the CGI variable specified in body
The filter expands to the value of a CGI variable. Name of the variable is specified in filter body.
Example: Filter example
[cgi name=online_cgi_test set="TEST VALUE" hide=1] My test value is [filter cgi]online_cgi_test[/filter]Example in action:
My test value is TEST VALUE
cgi is available in Interchange versions:
4.6.0, 4.6.0, 4.8.0, 5.0.0, 5.2.0, 5.4.0, 5.6.0, 5.8.0, 5.9.0 (git-head)
Interchange 5.9.0:
Source: code/SystemTag/cgi.coretag
Lines: 37
# 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: cgi.coretag,v 1.6 2007-03-30 23:40:49 pajamian Exp $
UserTag cgi Order name
UserTag cgi addAttr
UserTag cgi PosNumber 1
UserTag cgi Version $Revision: 1.6 $
UserTag cgi Routine <<EOR
sub {
my($var, $opt) = @_;
my($value);
local($^W) = 0;
$CGI::values{$var} = $opt->{set} if defined $opt->{set};
$value = defined $CGI::values{$var} ? ($CGI::values{$var}) : '';
if ($value) {
# Eliminate any Interchange tags
$value =~ s~<([A-Za-z]*[^>]*\s+[Mm][Vv]\s*=\s*)~<$1~g;
$value =~ s/\[/[/g;
}
if($opt->{filter}) {
$value = filter_value($opt->{filter}, $value, $var);
$CGI::values{$var} = $value unless $opt->{keep};
}
return '' if $opt->{hide};
$value =~ s/</</g unless $opt->{enable_html};
return $value;
}
EOR