Up to [Local Repository] / interchange / code / SystemTag
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
Allow default error labels to be set in the Locale.
The previous behavior was to use the variable name when no label was given. This change causes it to first check for a default label in the form of an error_label_${variable name} entry in the Locale configuration before falling back on just the variable name. As such, it is fully backwards compatible.
This is useful if you use Locale to override the error messages in core modules and also want to override the display of the label without setting up or modifying the profile everywhere the error may be displayed (with labels) on the site. For example:
Locale en_US <<EOF
{
# Override an error in Order.pm with one specific to this catalog.
"'%s' for item %s is not numeric/integer",
"We do not offer fractions of a product; however, the product is designed so that you may cut it to the exact dimensions needed. (The quantity you entered was '%s'.)",
# Also override the error label.
"error_label_mv_order_quantity",
"Quantity",
}
EOF
* Corrected some stupidity in my last commits:
-- Created a new CSS_CONTRAST Variable, which we'll use instead of
the CONTRAST variable to select the CSS class name.
-- The CSS class now defaults to mv_contrast instead of just
"contrast", as "contrast" is more likely to conflict with
existing CSS classes.
* Closing bug #83 (Fallback value for std_label uses deprecated
HTML font tag).
-- Added a ".contrast" class to the THEME_CSS file.
-- Modified the [error] tag to use <span class="contrast"> instead
of <FONT COLOR=RED>.
Fix incorrect license in headers GPL v2 -> GPL v2 "or later". Update copyrights.
Fix incorrect license in headers GPL v2 -> GPL v2 "or later". Update copyrights.
Fix [error] tag so it does not attempt to replace format codes other than %s in
the text or std_label attributes. The following test code demonstrates the
problem:
[error name=test set="This is a test error"]
[error name=test std_label=|
<a href="[area href=formhelp form='
field=mytable::test
returnto=this/page
']">mylabel</a>
| show_error=1]
In the above test the [area] tag translates this/page in the form attribute to
this%2fpage. The error tag then sees the %2f as a float specifier and
translates it to this0.000000page, also since the error text itself is gobbled
up the error itself does not display since there is nothing for the later %s
code to match against. This patch corrects that problem by using a regexp to
substitute the error text instead of an sprintf, and so only the first instance
of %s will be substituted.
Big copyright and version number update to prepare for 5.3.2 release.
Header/license fix or Version update+minor formatting fix, or both
Add "filter" option to error tag. Especially useful is the "entities" filter when outputting admin errors.
* Add [error auto=1] similar to [warnings auto=1].
updated LINUXIA branch to 4.9 sources in order to use it as testbed again
* The great tag breakout!
* Almost all tags are now UserTag definitions. The only exceptions
are:
and bounce goto if label or unless
* New TagDir directive (default is VENDROOT/code) sets the
directory (or directories) which are searched for code definitions
set by UserTag and CodeDef.
* New TagGroup directive establishes groups of ITL tags which can
be included.
TagGroup :crufty "banner default ecml html_table onfly sql"
The default groups include :core, which contains all of the
ITL tags defined in 4.8/early 4.9. The groups are defined
in $Vend::Cfg::StdTags and can be undefined if desired
with "TagGroup :group".
* New TagInclude directive allows inclusion of tags (or groups
of tags). If a tag is defined as a core tag (with a .coretag
or .tag or .ct extension) and is not included, it will not
be compiled and placed in the tag map. This is for all catalogs,
so if *any* catalog uses a tag it must be included.
Examples:
# Include the base tags
TagInclude :core
# Not the commerce tags
TagInclude !:commerce
# But make sure item-list is included even though
# it is in :commerce
TagInclude item-list
## Double negatives are honored
TagGroup :foo "bar !baz buz"
## With the group above, the below is equivalent
## to TagInclude !bar baz !buz
TagInclude !:foo
* New CodeDef directive allows the setting of filters,
order checks, FormAction, ActionMap, ItemAction,
and LocaleChange.
## filters
CodeDef mixedcase Filter
CodeDef mixedcase Routine <<EOR
sub {
my $val = shift;
## [filter mixedcase]mixed case[/filter]
## outputs "MiXeD CaSe"
$val =~ s/(.)(.)/\u$1\l$2/g;
return $val;
}
EOR
## order checks
CodeDef mixedcase OrderCheck
CodeDef foo Routine <<EOR
sub {
my ($ref, $var, $val) = @_;
return (1,$var) if $val eq 'bar';
return (0,$var, "foo must be bar");
}
EOR
All work in catalog.cfg; LocaleChange and ItemAction are not
global. FormAction, ActionMap, and ItemAction directives
are equivalent to their CodeDef equivalents.