Allow cache subversion for css files as well as js files.

This commit is contained in:
Chris 2015-01-21 14:56:56 +00:00
parent ca7973e384
commit 56b48d5e33

View File

@ -357,12 +357,15 @@ sub set_template_dir {
$self -> {"templatepath"} = path_join($self -> {"scriptpath"}, $self -> {"basedir"}, $self -> {"theme"}); $self -> {"templatepath"} = path_join($self -> {"scriptpath"}, $self -> {"basedir"}, $self -> {"theme"});
$self -> {"templatepath"} .= "/" unless($self -> {"templatepath"} =~ m|/$|); # templatepath must have trailing slash $self -> {"templatepath"} .= "/" unless($self -> {"templatepath"} =~ m|/$|); # templatepath must have trailing slash
# work out the javascript path # work out the javascript and css paths
my $jsdir = "js"; my $dirid = $self -> {"settings"} -> {"config"} -> {"jsdirid"} ? "_".$self -> {"settings"} -> {"config"} -> {"jsdirid"} : "";
$jsdir .= "_".$self -> {"settings"} -> {"config"} -> {"jsdirid"} if($self -> {"settings"} -> {"config"} -> {"jsdirid"});
$self -> {"jspath"} = path_join($self -> {"templatepath"}, $jsdir); $self -> {"jspath"} = path_join($self -> {"templatepath"}, "js".$dirid);
$self -> {"jspath"} .= "/" unless($self -> {"jspath"} =~ m|/$|); # jspath must have trailing slash $self -> {"jspath"} .= "/" unless($self -> {"jspath"} =~ m|/$|); # jspath must have trailing slash
$self -> {"csspath"} = path_join($self -> {"templatepath"}, "css".$dirid);
$self -> {"csspath"} .= "/" unless($self -> {"csspath"} =~ m|/$|); # csspath must have trailing slash
# The URL... # The URL...
$self -> {"templateurl"} = path_join($self -> {"cgi"} -> url(-base => 1), $self -> {"templatepath"})."/" $self -> {"templateurl"} = path_join($self -> {"cgi"} -> url(-base => 1), $self -> {"templatepath"})."/"
if($self -> {"cgi"}); if($self -> {"cgi"});
@ -560,6 +563,7 @@ sub fix_variables {
$$textref =~ s/{V_\[templatepath\]}/$self->{templatepath}/g; $$textref =~ s/{V_\[templatepath\]}/$self->{templatepath}/g;
$$textref =~ s/{V_\[templateurl\]}/$self->{templateurl}/g; $$textref =~ s/{V_\[templateurl\]}/$self->{templateurl}/g;
$$textref =~ s/{V_\[jspath\]}/$self->{jspath}/g; $$textref =~ s/{V_\[jspath\]}/$self->{jspath}/g;
$$textref =~ s/{V_\[csspath\]}/$self->{csspath}/g;
$$textref =~ s/{V_\[commonpath\]}/$self->{commonpath}/g; $$textref =~ s/{V_\[commonpath\]}/$self->{commonpath}/g;
$$textref =~ s/{V_\[sitename\]}/$self->{settings}->{config}->{site_name}/g; $$textref =~ s/{V_\[sitename\]}/$self->{settings}->{config}->{site_name}/g;
$$textref =~ s/{V_\[admin_email\]}/$email/g; $$textref =~ s/{V_\[admin_email\]}/$email/g;