index cc280955a39345d54e9375f375fa364f65fda6ef..520f03d75f69c16a75815cfa09dcd24ea76351e0 100644 (file)
class pathNavigator
{
- static function registerPlugin($class)
+ static function registerPlugin($class, $title= "")
{
$str = "";
// In case of tabs add the 'dn' of the entry
if($class instanceOf tabs){
- $str = $class->dn;
+
+ // Convert dn to cn
+ if(isset($class->dn)){
+ 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];
+ }
+ session::set("pathNavigator::registerPlugin:{$class->dn}", $str);
+ }
+ $str = session::get("pathNavigator::registerPlugin:{$class->dn}");
+ if(empty($title)){
+ $title = $class->dn;
+ }
+ }
}
// Simple string given
if(!empty($str)){
$cur = session::get('pathNavigator::position');
- if(empty($cur)){
- $cur.= "<li class='left path-element'>{$str}</li>";
- }else{
- $cur.= "<li class='left path-element'>{$str}</li>";
- }
+
+ if(!empty($title)) $title = " title='{$title}' ";
+
+ $cur.= "\n<li {$title} class='left path-element'>{$str}</li>";
session::set('pathNavigator::position', $cur);
}
}