Code

Updated config flags
[gosa.git] / gosa-core / include / class_pathNavigator.inc
index ba458c1ef3b8648a45c181cd34867934cea5bba9..6140e0e0146290e591bf152726ecba82c2dccc21 100644 (file)
@@ -61,7 +61,18 @@ class pathNavigator
 
   static function getCurrentPath()
   {
+    // Ensure that we've a position value initialized. 
+    if(!session::is_set('pathNavigator::position')) {
+        session::set('pathNavigator::position',array());
+    }
+
+    // Get position and validate its value
     $list = session::get('pathNavigator::position');
+    if(!is_array($list)){
+        $list = array();
+    }
+
+    // Build up title and path string.
     $path = "";
     $sTitle = "";
     foreach($list as $entry){
@@ -70,6 +81,7 @@ class pathNavigator
         $sTitle .= " - ".$entry['NAME'];
     }
 
+    // If no path is given then show a simple 'Welcome to GOsa' string.
     if(empty($path)){
       $path = "<li class='left path-element'>"._("Welcome to GOsa")."</li>";
     }
@@ -81,8 +93,7 @@ class pathNavigator
 
   static function clear()
   {
-    session::set('pathNavigator::position','');
-    session::set('pathNavigator::title','');
+    session::set('pathNavigator::position', array());
   }
 }