Code

Fixed multi query editor
[gosa.git] / gosa-core / include / class_baseSelector.inc
index 4a41a8dc0db2596efd1a16bf04dd87ed74ae353d..2833ce5e36a00fd6df54c821e55528b139cb9da1 100644 (file)
@@ -185,10 +185,10 @@ class baseSelector {
       }
       $selected= $this->base == $base?" class='treeListSelected'":"";
       $link= "onclick=\"\$('bs_rebase_".$this->pid."').value='".base64_encode($base)."';$('submit_tree_base_".$this->pid."').click();\"";
-      $this->tree.= "<li><a$selected $link>".
-                    "<img src='".$config->department_info[$base]['img']."'>&nbsp;".
-                    str_replace('-', '&#8209;', str_replace(' ', '&nbsp;', $config->department_info[$base]['name'].
-                    ($config->department_info[$base]['description']==''?'':' ['.$config->department_info[$base]['description'].']'))).
+      $this->tree.= "<li>".
+                    image($config->department_info[$base]['img'])."&nbsp;<a$selected $link>".
+                    $this->gennonbreaks($config->department_info[$base]['name']).
+                    ($config->department_info[$base]['description']==''?'':'&nbsp;<span class="informal">['.$this->gennonbreaks($config->department_info[$base]['description']).']</span>').
                     "</a>";
 
       $last_indent= $indent;
@@ -196,14 +196,14 @@ class baseSelector {
     }
 
     // Close tree
-    for ($i= 0; $i<$last_indent; $i++) {
+    for ($i= 1; $i<$last_indent; $i++) {
       $this->tree.= "</li></ul>\n";
     }
     $this->tree.= "</div>\n";
 
     // Draw submitter if required
     if ($this->submitButton) {
-      $this->tree.= "&nbsp;<input class='center' type='image' src='images/lists/submit.png' align='middle' title='"._("Submit")."' name='submit_base_".$this->pid."' id='submit_base_".$this->pid."' alt='"._("Submit")."'>";
+      $this->tree.= image('images/lists/submit.png', "submit_base_".$this->pid, _("Submit"));
     }
     $this->tree.= "<input type='submit' style='display:none' name='submit_tree_base_".$this->pid."' id='submit_tree_base_".$this->pid."'>";
     $this->tree.= "<input type='hidden' name='bs_rebase_".$this->pid."' id='bs_rebase_".$this->pid."'>";
@@ -213,6 +213,13 @@ class baseSelector {
     return true;
   }
 
+
+  function gennonbreaks($string)
+  {
+    return str_replace('-', '&#8209;', str_replace(' ', '&nbsp;', $string));
+  }
+
+
   function render()
   {
     return $this->tree;