/
include.coretag
36 lines (32 loc) · 1.05 KB
/
include.coretag
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# 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.
UserTag include Order file locale
UserTag include PosNumber 2
UserTag include Version 1.8
UserTag include Routine <<EOR
sub {
my ($file, $locale) = @_;
$locale = 1 unless defined $locale;
$::Instance->{include_depth} ||= 0;
my $limit = $Vend::Cfg->{Limit}{include_depth} || 10;
if($::Instance->{include_depth}++ >= $limit) {
logOnce(
'error',
"Depth of include (%s) exceeds limit of %s for file %s.",
$::Instance->{include_depth},
$limit,
$file,
);
return;
}
my $out = Vend::Interpolate::interpolate_html(
Vend::Util::readfile($file, undef, $locale)
);
$::Instance->{include_depth}--;
return $out;
}
EOR