diff options
Diffstat (limited to 'rt/html/NoAuth/css/dhandler')
-rw-r--r-- | rt/html/NoAuth/css/dhandler | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/rt/html/NoAuth/css/dhandler b/rt/html/NoAuth/css/dhandler new file mode 100644 index 000000000..4c8ba3405 --- /dev/null +++ b/rt/html/NoAuth/css/dhandler @@ -0,0 +1,30 @@ +<%ONCE> +my $squisher; +</%ONCE> +<%INIT> +my $arg = $m->dhandler_arg; +my $path; +if ( $arg =~ m{^(.*)-squished(\.[^\.]+)$} ) { + $path = $m->current_comp->dir_path .'/'. $1 . $2; +} +else { + return $m->decline; +} + +$squisher = new RT::CSS::Squish unless $squisher; +$squisher->{'mason'} = $m; + +$m->out( $squisher->concatenate( $path ) ); + +package RT::CSS::Squish; +use CSS::Squish '0.06'; +use base qw(CSS::Squish); +sub file_handle { + my $self = shift; + my $file = shift; + my $content = $self->{'mason'}->scomp($file); + open my $fh, '<', \$content or die "$!"; + return $fh; +} + +</%INIT> |