import rt 3.6.6
[freeside.git] / rt / html / NoAuth / css / dhandler
1 <%ONCE>
2 my $squisher;
3 </%ONCE>
4 <%INIT>
5 my $arg = $m->dhandler_arg;
6 my $path;
7 if ( $arg =~ m{^(.*)-squished(\.[^\.]+)$} ) {
8     $path = $m->current_comp->dir_path .'/'. $1 . $2;
9 }
10 else {
11     return $m->decline;
12 }
13
14 $squisher = new RT::CSS::Squish unless $squisher;
15 $squisher->{'mason'} = $m;
16
17 $m->out( $squisher->concatenate( $path ) );
18
19 package RT::CSS::Squish;
20 use CSS::Squish '0.06';
21 use base qw(CSS::Squish);
22 sub file_handle {
23     my $self = shift;
24     my $file = shift;
25     my $content = $self->{'mason'}->scomp($file);
26     open my $fh, '<', \$content or die "$!";
27     return $fh;
28 }
29
30 </%INIT>