1 # Copyright 2002-2007 Interchange Development Group and others
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version. See the LICENSE file for details.
8 # $Id: include.coretag,v 1.8 2007-03-30 23:40:49 pajamian Exp $
10 UserTag include Order file locale
11 UserTag include PosNumber 2
12 UserTag include Version $Revision: 1.8 $
13 UserTag include Routine <<EOR
15 my ($file, $locale) = @_;
16 $locale = 1 unless defined $locale;
18 $::Instance->{include_depth} ||= 0;
19 my $limit = $Vend::Cfg->{Limit}{include_depth} || 10;
21 if($::Instance->{include_depth}++ >= $limit) {
24 "Depth of include (%s) exceeds limit of %s for file %s.",
25 $::Instance->{include_depth},
32 my $out = Vend::Interpolate::interpolate_html(
33 Vend::Util::readfile($file, undef, $locale)
35 $::Instance->{include_depth}--;