Code

Updated base selector
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 28 Jan 2010 10:12:39 +0000 (10:12 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 28 Jan 2010 10:12:39 +0000 (10:12 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15400 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/html/themes/default/style.css
gosa-core/include/class_baseSelector.inc
gosa-core/include/class_config.inc

index 944d5c2233d4501547954df2871fe54bb34317b3..7ed48fd59c9c0dbe8453c86c7f94d94158862ed0 100644 (file)
@@ -2028,7 +2028,6 @@ ul.treeList a:hover {
 }
 
 a.treeList {
-    font-weight: bold;
     padding: 2px;
 }
 
@@ -2052,7 +2051,6 @@ ul.treeList li {
     padding: 0 12px;
     line-height: 20px;
     background: url(../../images/lists/node.png) no-repeat;
-    font-weight: bold;
 }
 
 li.treeListSelected a {
@@ -2074,6 +2072,8 @@ div.treeList {
     padding: 5px;
     height: 500px;
     display: inline-block;
+    position: absolute;
+    z-index: 500;
     overflow-y: auto;
 }
 
index 9ca0a429542758b63d761508c383eb411812e8f0..28d0025c24aed26dae580ac3c6337d68506a6c36 100644 (file)
@@ -23,6 +23,7 @@
 class baseSelector {
 
   private $base;
+  private $pid;
   protected $tree;
   protected $pathMapping;
 
@@ -37,6 +38,10 @@ class baseSelector {
 
   function __construct($bases, $base= "")
   {
+    // Initialize pid
+    $this->pid= preg_replace("/[^0-9]/", "", microtime(TRUE));
+
+    // Transfer data
     $this->setBases($bases);
     $this->setBase($base);
     $this->update();
@@ -59,7 +64,6 @@ class baseSelector {
 
     $this->pathMapping= array();
     $selected= $this->base == $config->current['BASE']?"Selected":"";
-    $this->tree= "<div class='treeList'><a class='treeList$selected' href='#'>"._("Root")."</a><ul class='treeList'>\n";
     $first= true;
     $last_indent= 2;
 
@@ -80,9 +84,10 @@ class baseSelector {
   function update()
   {
     global $config;
+    $this->tree= "<input type='text' size='30' name='bs_input_".$this->pid."' id='bs_input_".$this->pid."' onfocus=\"\$('bs_".$this->pid."').hide()\" onmouseover=\"\$('bs_".$this->pid."').show();pos = Element.positionedOffset('bs_input_".$this->pid."');\$('bs_".$this->pid."').setStyle({left: (pos[0]), top: (pos[1]+ Element.getHeight('bs_input_".$this->pid."'))});\" onmouseout=\"rtimer= Element.hide.delay(0.25, 'bs_".$this->pid."')\" value='".$this->pathMapping[$this->base]."'>";
 
     $selected= $this->base == $config->current['BASE']?"Selected":"";
-    $this->tree= "<div class='treeList'><a class='treeList$selected' href='#'>"._("Root")."</a><ul class='treeList'>\n";
+    $this->tree.= "<div class='treeList' style='display:none' id='bs_".$this->pid."' onmouseover=\"window.clearTimeout(rtimer);\" onmouseout=\"rtimer= Element.hide.delay(0.25, 'bs_".$this->pid."')\"><a class='treeList$selected' href='#'>/ ["._("Root")."]</a><ul class='treeList'>\n";
     $first= true;
     $last_indent= 2;
 
@@ -110,7 +115,7 @@ class baseSelector {
         $this->tree.= "</li>\n";
       }
       $selected= $this->base == $base?" class='treeListSelected'":"";
-      $this->tree.= "<li><a$selected href='#'>".ldap::fix(preg_replace('/^[a-z0-9]+=([^,]+),.*$/i', '$1', $base))."</a>";
+      $this->tree.= "<li><a$selected href='#'>".str_replace(' ', '&nbsp;', ldap::fix(preg_replace('/^[a-z0-9]+=([^,]+),.*$/i', '$1', $base)))."</a>";
 
       $last_indent= $indent;
       $first= false;
@@ -121,14 +126,12 @@ class baseSelector {
       $this->tree.= "</li></ul>\n";
     }
     $this->tree.= "</div>\n";
-
-echo $this->tree;
   }
 
   function render()
   {
     $result= "";
-    return $result;
+    return $this->tree;
   }
 
 
index 106e4995a53766703f923e1711e06c1d52c303d8..52b22958330de79d5cc734492635314902891040 100644 (file)
@@ -739,7 +739,7 @@ class config  {
       foreach($types as $t => $data){
         if(in_array($data['OC'],$attrs['objectClass'])){
           $type_data = $data;
-          break;    
+          break;
         }
       }
 
@@ -765,7 +765,6 @@ class config  {
       if ($dn == $ignore_dn){
         continue;
       }
-
       $c_dn = convert_department_dn($dn)." (".$type_data['ATTR'].")";
 
       /* Only assign non-root departments */