Also look in the next-highest directory when detecting VCS; add SVN
[interchange.git] / code / SystemTag / include.coretag
1 # Copyright 2002-2007 Interchange Development Group and others
2
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.
7
8 UserTag include             Order        file locale
9 UserTag include             PosNumber    2
10 UserTag include             Version      1.8
11 UserTag include             Routine      <<EOR
12 sub {
13         my ($file, $locale) = @_;
14         $locale = 1 unless defined $locale;
15
16         $::Instance->{include_depth} ||= 0;
17         my $limit = $Vend::Cfg->{Limit}{include_depth} || 10;
18
19         if($::Instance->{include_depth}++ >= $limit) {
20                 logOnce(
21                                 'error',
22                                 "Depth of include (%s) exceeds limit of %s for file %s.", 
23                                 $::Instance->{include_depth},
24                                 $limit,
25                                 $file,
26                         );
27                 return;
28         }
29
30         my $out = Vend::Interpolate::interpolate_html(
31                                         Vend::Util::readfile($file, undef, $locale)
32                                 );
33         $::Instance->{include_depth}--;
34         return $out;
35 }
36 EOR