index 1ebb7d42acc980ef69030ddb0a6b879eca2f34d1..1fe3908b5408d893c99baccf40de7ecceb898392 100644 (file)
class pathNavigator
{
- static function registerPlugin($class)
+ static function registerPlugin($class, $title= "")
{
- $str = $title = "";
+ $str = "";
// Display headline of management plugins
if($class instanceOf management && isset($class->plHeadline)){
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}");
- $title = $class->dn;
+ if(empty($title)){
+ $title = $class->dn;
+ }
}
}
if(!empty($title)) $title = " title='{$title}' ";
- if(empty($cur)){
- $cur.= "\n<li {$title} class='left path-element'>{$str}</li>";
- }else{
- $cur.= "\n<li {$title} class='left path-element'>{$str}</li>";
- }
+ $cur.= "\n<li {$title} class='left path-element'>{$str}</li>";
session::set('pathNavigator::position', $cur);
}
}