-#
-my $parser = new HTML::Mason::Parser;
-my $interp = new HTML::Mason::Interp (parser=>$parser,
- comp_root=>'/var/www/masondocs',
- data_dir=>'/home/ivan/freeside_current/masondata',
- out_mode=>'stream',
- );
-my $ah = new HTML::Mason::ApacheHandler ( interp => $interp,
- #auto_send_headers => 0,
- );
+
+my %interp = (
+ request_class => 'HTML::Mason::Request::ApacheHandler',
+ data_dir => '%%%MASONDATA%%%',
+ error_mode => 'output',
+ error_format => 'html',
+ ignore_warnings_expr => '.',
+ comp_root => [
+ [ 'freeside' => '%%%FREESIDE_DOCUMENT_ROOT%%%' ],
+ [ 'rt' => '%%%FREESIDE_DOCUMENT_ROOT%%%/rt' ],
+ ],
+);
+
+my $fs_interp = new HTML::Mason::Interp (
+ %interp,
+ escape_flags => { 'js_string' => sub {
+ #${$_[0]} =~ s/(['\\\n])/'\\'.($1 eq "\n" ? 'n' : $1)/ge;
+ ${$_[0]} =~ s/(['\\])/\\$1/g;
+ ${$_[0]} =~ s/\n/\\n/g;
+ ${$_[0]} = "'". ${$_[0]}. "'";
+ }
+ },
+);
+
+my $rt_interp = new HTML::Mason::Interp (
+ %interp,
+ escape_flags => { 'h' => \&RT::Interface::Web::EscapeUTF8 },
+ compiler => HTML::Mason::Compiler::ToObject->new(
+ default_escape_flags => 'h',
+ allow_globals => [qw(%session)],
+ ),
+);
+
+my $ah = new HTML::Mason::ApacheHandler (
+ interp => $fs_interp,
+ args_method => 'CGI', #(and FS too)
+);