[Rt-commit] r16976 - rt/3.8/trunk/share/html/Ticket/Elements

ruz at bestpractical.com ruz at bestpractical.com
Fri Nov 21 20:44:36 EST 2008


Author: ruz
Date: Fri Nov 21 20:44:36 2008
New Revision: 16976

Modified:
   rt/3.8/trunk/share/html/Ticket/Elements/ShowMessageStanza

Log:
* call config with current user only once and don't do
  it in function that can be called many times during request

Modified: rt/3.8/trunk/share/html/Ticket/Elements/ShowMessageStanza
==============================================================================
--- rt/3.8/trunk/share/html/Ticket/Elements/ShowMessageStanza	(original)
+++ rt/3.8/trunk/share/html/Ticket/Elements/ShowMessageStanza	Fri Nov 21 20:44:36 2008
@@ -46,7 +46,7 @@
 %# 
 %# END BPS TAGGED BLOCK }}}
 % if ( ref $Message ) {
-%    $m->out($pon);
+%    $m->out('<pre>') if $plain_text_pre && !$Depth;
 <div class="message-stanza-depth-<% $Depth %>">
 <%perl>
 my $para = '';
@@ -65,14 +65,12 @@
 $print_content->( \$para ) if length $para;
 </%perl>
 </div>
-%$m->out($poff);
+% $m->out('</pre>') if $plain_text_pre && !$Depth;
 % } else {
 %       $print_content->( \$Message );
 % }
 <%INIT>
-my ($pon, $poff) = (RT->Config->Get('PlainTextPre', $session{'CurrentUser'}) && $Depth == 0)
-                            ? ('<pre>', '</pre>')
-                            : ('', '');
+my $plain_text_pre = RT->Config->Get('PlainTextPre', $session{'CurrentUser'});
 
 my $ticket = $Transaction ? $Transaction->TicketObj : undef;
 
@@ -82,7 +80,7 @@
 
     $m->callback( content => $ref, %ARGS );
     $m->comp('/Elements/MakeClicky', content => $ref, ticket => $ticket, %ARGS);
-    unless ( RT->Config->Get('PlainTextPre', $session{'CurrentUser'}) ) {
+    unless ( $plain_text_pre ) {
         $$ref =~ s{$}{<br />}mg if defined $$ref;
     }
     $m->out( $$ref );


More information about the Rt-commit mailing list