Code

Updated Export
[gosa.git] / gosa-core / include / class_pathNavigator.inc
index 520f03d75f69c16a75815cfa09dcd24ea76351e0..a7af83ec2247c815e65a37460ce46b42e660bc4b 100644 (file)
@@ -5,7 +5,6 @@ class pathNavigator
 
   static function registerPlugin($class, $title= "")
   {
-    
     $str = "";
 
     // Display headline of management plugins
@@ -15,9 +14,7 @@ class pathNavigator
 
     // Shown title of sub dialogs (They have no plHeadline set.)
     if($class instanceOf plugin && !isset($class->plHeadline)){
-      if(empty($class->pathTitle)){
-        $str = "Missing: ".get_class($class);
-      }else{
+      if(!empty($class->pathTitle)){
         $str = _($class->pathTitle);
       }
     }
@@ -30,12 +27,17 @@ class pathNavigator
         if(!session::is_set("pathNavigator::registerPlugin:{$class->dn}")){
           global $config;
           $ldap = $config->get_ldap_link();
-          $ldap->cat($class->dn, array('cn'));
-          if($ldap->count()){
-            $attrs = $ldap->fetch();
-            $str = $attrs['cn'][0];
+
+          if(!empty($class->dn)){
+            $namingAttr = preg_replace("/^([^=]*)=.*$/","\\1",$class->dn);
+
+            $ldap->cat($class->dn, array($namingAttr));
+            if($ldap->count()){
+              $attrs = $ldap->fetch();
+              $str = $attrs[$namingAttr][0];
+            }
+            session::set("pathNavigator::registerPlugin:{$class->dn}", $str);
           }
-          session::set("pathNavigator::registerPlugin:{$class->dn}", $str);
         }
         $str = session::get("pathNavigator::registerPlugin:{$class->dn}");
         if(empty($title)){
@@ -65,6 +67,7 @@ class pathNavigator
     if(empty($path)){
       $path = "<li class='left path-element'>"._("Welcome to GOsa")."</li>";
     }
+
     return($path);
   }