View | Details | Raw Unified | Return to bug 18036
Collapse All | Expand All

(-)a/C4/Templates.pm (-1 / +4 lines)
Lines 256-274 sub themelanguage { Link Here
256
    my $where = $tmpl =~ /xsl$/ ? 'xslt' : 'modules';
256
    my $where = $tmpl =~ /xsl$/ ? 'xslt' : 'modules';
257
    for my $theme (@themes) {
257
    for my $theme (@themes) {
258
        if ( -e "$htdocs/$theme/$lang/$where/$tmpl" ) {
258
        if ( -e "$htdocs/$theme/$lang/$where/$tmpl" ) {
259
print STDERR "CASE 1";
259
            return ( $theme, $lang, [ uniq(@themes) ] );
260
            return ( $theme, $lang, [ uniq(@themes) ] );
260
        }
261
        }
261
    }
262
    }
262
    # Otherwise return theme/'en', last resort fallback/'en'
263
    # Otherwise return theme/'en', last resort fallback/'en'
263
    for my $theme (@themes) {
264
    for my $theme (@themes) {
264
        if ( -e "$htdocs/$theme/en/$where/$tmpl" ) {
265
        if ( -e "$htdocs/$theme/en/$where/$tmpl" ) {
266
print STDERR "CASE 2";
265
            return ( $theme, 'en', [ uniq(@themes) ] );
267
            return ( $theme, 'en', [ uniq(@themes) ] );
266
        }
268
        }
267
    }
269
    }
268
    # tmpl is a full path, so this is a template for a plugin
270
    # tmpl is a full path, so this is a template for a plugin
269
    if ( $tmpl =~ /^\// && -e $tmpl ) {
271
    if ( $tmpl =~ /^\// && -e $tmpl ) {
272
print STDERR "CASE 3";
270
        return ( $themes[0], $lang, [ uniq(@themes) ] );
273
        return ( $themes[0], $lang, [ uniq(@themes) ] );
271
    }
274
    }
275
print STDERR "CASE 4";
272
}
276
}
273
277
274
278
275
- 

Return to bug 18036