Code

Updated styles, autoselector and base selector
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 3 Feb 2010 18:37:34 +0000 (18:37 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 3 Feb 2010 18:37:34 +0000 (18:37 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15583 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 7db6f25736b178d5b0abb932edf584c0fc38441c..caaa3a0c137d2be62b6ad30767a358f232e6a62a 100644 (file)
@@ -36,13 +36,29 @@ if (!session::global_is_set('ui')){
 
 /* Base completition or filter completition? */
 if (isset($_GET['type']) && $_GET['type'] == "base") {
+
+  // Find dn based on name and description
   if (session::is_set("pathMapping") && count($_POST) == 1) {
     $res= "";
     $pathMapping= session::get("pathMapping");
     $search= preg_replace('/&quot;/', '"', current($_POST));
-    foreach ($pathMapping as $key => $value) {
-      if (mb_stristr($value, $search) !== false) {
-        $res.= "<li>$value</li>";
+
+    $config = session::global_get('config');
+    foreach ($config->department_info as $dn => $info) {
+      if (!isset($pathMapping[$dn])) {
+        continue;
+      }
+      if (mb_stristr($info['name'], $search) !== false) {
+        $res.= "<li>".$pathMapping[$dn].($info['description']==''?"":"<span class='informal'> [".$info['description']."]</span>")."</li>";
+        continue;
+      }
+      if (mb_stristr($info['description'], $search) !== false) {
+        $res.= "<li>".$pathMapping[$dn].($info['description']==''?"":"<span class='informal'> [".$info['description']."]</span>")."</li>";
+        continue;
+      }
+      if (mb_stristr($pathMapping[$dn], $search) !== false) {
+        $res.= "<li>".$pathMapping[$dn].($info['description']==''?"":"<span class='informal'> [".$info['description']."]</span>")."</li>";
+        continue;
       }
     }
 
@@ -54,7 +70,6 @@ if (isset($_GET['type']) && $_GET['type'] == "base") {
 
 } else {
 
-  $config = session::global_get('config');
   $ui = session::global_get('ui');
 
   /* Is there a filter object arround? */
index 74e8185e60dd3f11503fb6a1922e136a2501d065..302d4f1fd9eb60061a7d233dc698ae8b8d28d1db 100644 (file)
@@ -1998,8 +1998,12 @@ overflow-y:auto;
 float:left;
 }
 
+span.informal {
+color:#444;
+font-style:italic;
+}
+
 /* Max height for IE */
 * html div.treeList {
-   height: expression( this.scrollHeight > 500 ? "500px" : "auto" );
+height: expression( this.scrollHeight > 500 ? "500px" : "auto" );
 }
-
index 4a41a8dc0db2596efd1a16bf04dd87ed74ae353d..d0b9eab7b568bba5f1659c2f5b265d3880e46a33 100644 (file)
@@ -186,9 +186,9 @@ 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'].']'))).
+                    "<img class='center' src='".$config->department_info[$base]['img']."'>&nbsp;".
+                    $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;
@@ -213,6 +213,13 @@ class baseSelector {
     return true;
   }
 
+
+  function gennonbreaks($string)
+  {
+    return str_replace('-', '&#8209;', str_replace(' ', '&nbsp;', $string));
+  }
+
+
   function render()
   {
     return $this->tree;