Code

cc280955a39345d54e9375f375fa364f65fda6ef
[gosa.git] / gosa-core / include / class_pathNavigator.inc
1 <?php
3 class pathNavigator
4 {
6   static function registerPlugin($class)
7   {
8     
9     $str = "";
11     // Display headline of management plugins
12     if($class instanceOf management && isset($class->plHeadline)){
13       $str= _($class->plHeadline);
14     }
16     // Shown title of sub dialogs (They have no plHeadline set.)
17     if($class instanceOf plugin && !isset($class->plHeadline)){
18       if(empty($class->pathTitle)){
19         $str = "Missing: ".get_class($class);
20       }else{
21         $str = _($class->pathTitle);
22       }
23     }
24   
25     // In case of tabs add the 'dn' of the entry 
26     if($class instanceOf tabs){
27       $str = $class->dn;
28     }
30     // Simple string given 
31     if(is_string($class)){
32       $str = $class;
33     }
34     
35     if(!empty($str)){
36       $cur = session::get('pathNavigator::position');
37       if(empty($cur)){
38         $cur.= "<li class='left path-element'>{$str}</li>";
39       }else{
40         $cur.= "<li class='left path-element'>{$str}</li>";
41       }
42       session::set('pathNavigator::position', $cur);
43     }
44   }
46   static function getCurrentPath()
47   {
48     $path = session::get('pathNavigator::position');
49     if(empty($path)){
50       $path = "<li class='left path-element'>"._("Welcome to GOsa")."</li>";
51     }
52     return($path);
53   }
55   static function clear()
56   {
57     session::set('pathNavigator::position','');
58   }
59 }
61 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
62 ?>