first part of ACL and re-skinning work and some other small stuff
[freeside.git] / httemplate / autohandler
1 % $m->call_next;
2 <%init>
3   dbh->{'private_profile'} = {} if UNIVERSAL::can(dbh, 'sprintProfile');
4 </%init>
5 <%filter>
6
7 my $profile = '';
8 if ( UNIVERSAL::can(dbh, 'sprintProfile') ) {
9
10   if ( lc($r->content_type) eq 'text/html' ) {
11
12     # barely worth it, just in case someone tries to use profiling on a
13     # non-RT install
14     eval "use Text::Wrapper;";
15     die $@ if $@;
16
17     my $wrapper = new Text::Wrapper( columns => 80 );
18
19     $profile = '<PRE>'.
20                encode_entities( $wrapper->wrap( dbh->sprintProfile() ) ).
21                #"\n\n". &sprintAutoProfile(). '</PRE>';
22                "\n\n".                        '</PRE>';
23   } 
24
25   dbh->{'private_profile'} = {};
26 }
27
28 s/(<\/BODY>[\s\n]*<\/HTML>[\s\n]*)$/$profile$1/i;
29 </%filter>