X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fautohandler;h=c676d3d2de5be96ef8250c5ce066686cf3f2b8fd;hb=b8d1f6382bd483b4c5718a7930ea2493a1686d50;hp=ae04d423f7edde9b442747cf95358d782bef1c2d;hpb=b5c4237a34aef94976bc343c8d9e138664fc3984;p=freeside.git diff --git a/httemplate/autohandler b/httemplate/autohandler index ae04d423f..c676d3d2d 100644 --- a/httemplate/autohandler +++ b/httemplate/autohandler @@ -1,13 +1,22 @@ % $m->call_next; <%init> + dbh->{'private_profile'} = {} if UNIVERSAL::can(dbh, 'sprintProfile'); + + my $locale = $FS::CurrentUser::CurrentUser->option('locale') + || FS::Conf->new->config('locale') + || 'en_US'; + $locale =~ s/_/-/g; + $lh = FS::L10N->get_handle($locale) || die "Unknown locale $locale"; + <%filter> -my $profile = ''; if ( UNIVERSAL::can(dbh, 'sprintProfile') ) { - if ( lc($r->content_type) eq 'text/html' + my $profile = ''; + + if ( lc($r->content_type) =~ /^text\/html/ && $FS::CurrentUser::CurrentUser->option('show_db_profile') ) { @@ -35,9 +44,10 @@ if ( UNIVERSAL::can(dbh, 'sprintProfile') ) { } dbh->{'private_profile'} = {}; + + s/(<\/BODY>[\s\n]*<\/HTML>[\s\n]*)$/$profile$1/i; } -s/(<\/BODY>[\s\n]*<\/HTML>[\s\n]*)$/$profile$1/i; <%cleanup> dbh->commit();