</IfModule>
</Location>
+<LocationMatch /eg/staff/>
+ Options -MultiViews
+ PerlSetVar OILSWebStopAtIndex "true"
+
+ # sample staff-specific translation files
+ #PerlAddVar OILSWebLocale "en_ca"
+ #PerlAddVar OILSWebLocale "/openils/var/data/locale/staff/en-CA.po"
+ #PerlAddVar OILSWebLocale "fr_ca"
+ #PerlAddVar OILSWebLocale "/openils/var/data/locale/staff/fr-CA.po"
+</LocationMatch>
+
+<Location /js/>
+ <IfModule mod_headers.c>
+ Header append Cache-Control "public"
+ </IFModule>
+ <IfModule mod_deflate.c>
+ SetOutputFilter DEFLATE
+ BrowserMatch ^Mozilla/4 gzip-only-text/html
+ BrowserMatch ^Mozilla/4\.0[678] no-gzip
+ BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
+ SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
+ <IfModule mod_headers.c>
+ Header append Vary User-Agent env=!dont-vary
+ </IfModule>
+ </IfModule>
+</Location>
+
# Uncomment the following to force SSL for everything. Note that this defeats caching
# and you will suffer a performance hit.
#RewriteCond %{HTTPS} off
</IfModule>
</Location>
+<LocationMatch /eg/staff/>
+ Options -MultiViews
+ PerlSetVar OILSWebStopAtIndex "true"
+
+ # sample staff-specific translation files
+ #PerlAddVar OILSWebLocale "en_ca"
+ #PerlAddVar OILSWebLocale "/openils/var/data/locale/staff/en-CA.po"
+ #PerlAddVar OILSWebLocale "fr_ca"
+ #PerlAddVar OILSWebLocale "/openils/var/data/locale/staff/fr-CA.po"
+</LocationMatch>
+
+<Location /js/>
+ <IfModule mod_headers.c>
+ Header append Cache-Control "public"
+ </IFModule>
+ <IfModule mod_deflate.c>
+ SetOutputFilter DEFLATE
+ BrowserMatch ^Mozilla/4 gzip-only-text/html
+ BrowserMatch ^Mozilla/4\.0[678] no-gzip
+ BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
+ SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
+ <IfModule mod_headers.c>
+ Header append Vary User-Agent env=!dont-vary
+ </IfModule>
+ </IfModule>
+</Location>
+
+
# Uncomment the following to force SSL for everything. Note that this defeats caching
# and you will suffer a performance hit.
#RewriteCond %{HTTPS} off
my $page_args = [];
my $as_xml = $r->dir_config('OILSWebForceValidXML');
my $ext = $r->dir_config('OILSWebDefaultTemplateExtension');
+ my $at_index = $r->dir_config('OILSWebStopAtIndex');
my @parts = split('/', $path);
my $localpath = $path;
- if ($localpath =~ m|opac/css|) {
+ if ($localpath =~ m|/css/|) {
$r->content_type('text/css; encoding=utf8');
} else {
$r->content_type('text/html; encoding=utf8');
if(-r $fpath) {
$template = "$localpath.$ext";
last;
+ }
+ }
+ last if $template;
+
+ if ($at_index) {
+ # no matching template was found in the current directory.
+ # stop-at-index requested; see if there is an index.ext
+ # file in the same directory instead.
+ for my $tpath (@{$ctx->{template_paths}}) {
+ # replace the final path component with 'index'
+ if ($localpath =~ m|/$|) {
+ $localpath .= 'index';
+ } else {
+ $localpath =~ s|/[^/]+$|/index|;
+ }
+ my $fpath = "$tpath/$localpath.$ext";
+ $r->log->debug("egweb: looking at possible template $fpath");
+ if (-r $fpath) {
+ $template = "$localpath.$ext";
+ last;
+ }
}
}
last if $template;
+
push(@args, pop @parts);
$localpath = join('/', @parts);
}