X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fclass_pathNavigator.inc;h=6140e0e0146290e591bf152726ecba82c2dccc21;hb=f04b7b95f6468a806353f05cdd3faf97dd744d5c;hp=44eb075908c00f5738f228ef0a997709a7018811;hpb=7579c5bc57892bfc08c460400803e1ae77dde007;p=gosa.git diff --git a/gosa-core/include/class_pathNavigator.inc b/gosa-core/include/class_pathNavigator.inc index 44eb07590..6140e0e01 100644 --- a/gosa-core/include/class_pathNavigator.inc +++ b/gosa-core/include/class_pathNavigator.inc @@ -3,40 +3,97 @@ class pathNavigator { - static function registerPlugin($class) + static function registerPlugin($class, $title= "") { $str = ""; + + // Display headline of management plugins if($class instanceOf management && isset($class->plHeadline)){ - $str = ""._($class->plHeadline).""; - }elseif($class instanceOf plugin && isset($class->plHeadline)){ -# $str = _($class->plHeadline); - }elseif($class instanceOf plugin && !isset($class->plHeadline)){ - $str = "{".get_class($class)."}"; - }elseif($class instanceOf tabs){ - $str = $class->dn; - }elseif(is_string($class)){ + $str= _($class->plHeadline); + } + + // Shown title of sub dialogs (They have no plHeadline set.) + if($class instanceOf plugin && !isset($class->plHeadline)){ + if(!empty($class->pathTitle)){ + $str = _($class->pathTitle); + } + } + + // In case of tabs add the 'dn' of the entry + if($class instanceOf tabs){ + + // Convert dn to cn + if(isset($class->dn)){ + if(!session::is_set("pathNavigator::registerPlugin:{$class->dn}")){ + global $config; + $ldap = $config->get_ldap_link(); + + 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); + } + } + $str = session::get("pathNavigator::registerPlugin:{$class->dn}"); + if(empty($title)){ + $title = $class->dn; + } + } + } + + // Simple string given + if(is_string($class)){ $str = $class; } if(!empty($str)){ $cur = session::get('pathNavigator::position'); - $cur.= "