[Rt-commit] r3039 - in rt/branches/3.4-RELEASE: . html/Search

glasser at bestpractical.com glasser at bestpractical.com
Wed Jun 1 18:32:17 EDT 2005


Author: glasser
Date: Wed Jun  1 18:32:16 2005
New Revision: 3039

Modified:
   rt/branches/3.4-RELEASE/   (props changed)
   rt/branches/3.4-RELEASE/html/Search/Build.html
Log:
 r33100 at tin-foil:  glasser | 2005-05-25 20:21:43 -0400
 Mini refactoring of Tree->SQL/HTML function


Modified: rt/branches/3.4-RELEASE/html/Search/Build.html
==============================================================================
--- rt/branches/3.4-RELEASE/html/Search/Build.html	(original)
+++ rt/branches/3.4-RELEASE/html/Search/Build.html	Wed Jun  1 18:32:16 2005
@@ -472,7 +472,7 @@
     my $tree       = shift;
     my ( $keys, $queues ) = @_;
     my $i = 0;
-    my $optionlist;
+    my @optionlist;
     my $depth = 0;
     my %parens;
 
@@ -506,6 +506,10 @@
             else {
                 $selected = "";
             }
+            
+            # These two variables are for display in the optionlists only.
+            my $before_parens = '';
+            my $after_parens = '';
 
             foreach my $p ( keys %parens ) {
                 if ( $p > $_tree->getDepth ) {
@@ -514,11 +518,6 @@
                 }
             }
 
-            $optionlist .=
-                "<option value=$i $selected>"
-              . ( "&nbsp;" x 5 x ( $_tree->getDepth() - 1 ) )
-              . $m->interp->apply_escapes( $str, 'h' )
-              . "</option>\n";
             my $parent = $_tree->getParent();
             if (   !( $parent->isRoot || $parent->getParent()->isRoot )
                 && !ref( $parent->getNodeValue() ) )
@@ -534,6 +533,13 @@
                 $$Query .= ')';
                 $parens{$depth}--;
             }
+            
+            push @optionlist, {
+                TEXT     => $m->interp->apply_escapes($str, 'h'),
+                INDEX    => $i,
+                SELECTED => $selected,
+                DEPTH    => $_tree->getDepth() - 1,
+            };
 
             $i++;
         }
@@ -543,7 +549,9 @@
         $$Query .= ") " x $parens{$p};
     }
 
-    return $optionlist;
+    return join "\n", map { qq(<option value="$_->{INDEX}" $_->{SELECTED}>) 
+                            . ("&nbsp;" x (5 * $_->{DEPTH}))
+                            . $_->{TEXT} . qq(</option>) } @optionlist;
 
 }
 


More information about the Rt-commit mailing list