From 3057b7c840af1c07d2e13762212acdfa5012a813 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 11 Mar 2010 08:41:53 +0000 Subject: [PATCH] Added pathNavigator git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16403 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/html/main.php | 4 ++- gosa-core/include/class_management.inc | 2 ++ gosa-core/include/class_pathNavigator.inc | 36 +++++++++++++++++++++++ gosa-core/include/class_plugin.inc | 2 ++ gosa-core/include/class_pluglist.inc | 8 +++-- gosa-core/include/class_tabs.inc | 2 ++ 6 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 gosa-core/include/class_pathNavigator.inc diff --git a/gosa-core/html/main.php b/gosa-core/html/main.php index 0e0a5eac0..11fa7dc5e 100644 --- a/gosa-core/html/main.php +++ b/gosa-core/html/main.php @@ -41,6 +41,8 @@ session::set('errorsAlreadyPosted',array()); session::global_set('runtime_cache',array()); session::set('limit_exceeded',FALSE); +pathNavigator::clear(); + if ($_SERVER["REQUEST_METHOD"] == "POST"){ @DEBUG (DEBUG_POST, __LINE__, __FUNCTION__, __FILE__, $_POST, "_POST"); } @@ -301,7 +303,6 @@ if($reload_navigation){ $plist->menu=""; } $smarty->assign ("menu", $plist->gen_menu()); -$smarty->assign ("pathMenu", $plist->genPathMenu()); $smarty->assign ("plug", "$plug"); $smarty->assign("iePngWorkaround", $config->get_cfg_value("iePngWorkaround","false" ) == "true"); @@ -355,6 +356,7 @@ if (is_file("$plugin_dir/main.inc")){ /* Print_out last ErrorMessage repeated string. */ $smarty->assign("msg_dialogs", msg_dialog::get_dialogs()); +$smarty->assign ("pathMenu", $plist->genPathMenu()); $smarty->assign("contents", $display); /* If there's some post, take a look if everything is there... */ diff --git a/gosa-core/include/class_management.inc b/gosa-core/include/class_management.inc index b15a12462..a1d935eb3 100644 --- a/gosa-core/include/class_management.inc +++ b/gosa-core/include/class_management.inc @@ -132,6 +132,8 @@ class management $vars = array('/^act$/','/^listing/','/^PID$/','/^FILTER_PID$/'); session::set('LOCK_VARS_TO_USE',$vars); + pathNavigator::registerPlugin($this); + /* Display the copy & paste dialog, if it is currently open */ $ret = $this->copyPasteHandler("",array()); if($ret){ diff --git a/gosa-core/include/class_pathNavigator.inc b/gosa-core/include/class_pathNavigator.inc new file mode 100644 index 000000000..83872cc9e --- /dev/null +++ b/gosa-core/include/class_pathNavigator.inc @@ -0,0 +1,36 @@ +".$class->plHeadline.""; + }elseif($class instanceOf plugin){ + $str = $class->plHeadline; + }elseif($class instanceOf tabs){ + $str = $class->dn; + } + + if(!empty($str)){ + $cur = session::get('pathNavigator::position'); + $cur.= "
  • {$str}
  • "; + session::set('pathNavigator::position', $cur); + } + } + + static function getCurrentPath() + { + return(session::get('pathNavigator::position')); + } + + static function clear() + { + session::set('pathNavigator::position',''); + } +} + +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: +?> diff --git a/gosa-core/include/class_plugin.inc b/gosa-core/include/class_plugin.inc index 333ae0a7e..75da65582 100644 --- a/gosa-core/include/class_plugin.inc +++ b/gosa-core/include/class_plugin.inc @@ -276,6 +276,8 @@ class plugin session::set('LOCK_VARS_USED_GET',array()); session::set('LOCK_VARS_USED_POST',array()); session::set('LOCK_VARS_USED_REQUEST',array()); + + pathNavigator::registerPlugin($this); } /*! \brief Removes object from parent diff --git a/gosa-core/include/class_pluglist.inc b/gosa-core/include/class_pluglist.inc index 41fbd1d38..64cd42ef2 100644 --- a/gosa-core/include/class_pluglist.inc +++ b/gosa-core/include/class_pluglist.inc @@ -323,7 +323,7 @@ class pluglist "\n
  • ". "\n ". "\n
  • ". - "\n
  • Welcome to GOsa
  • "; + "\n %navigator%"; // Check if we've at least one entry defined ih the pathmenu if(isset($this->config->data['PATHMENU'])){ @@ -336,8 +336,10 @@ class pluglist } $this->pathMenu.= "\n "; $this->pathMenu.= "\n "; - } - return($this->pathMenu); + } + + $menu = pathNavigator::getCurrentPath(); + return(preg_replace("/%navigator%/", $menu, $this->pathMenu)); } diff --git a/gosa-core/include/class_tabs.inc b/gosa-core/include/class_tabs.inc index 9f52e45a6..af356229f 100644 --- a/gosa-core/include/class_tabs.inc +++ b/gosa-core/include/class_tabs.inc @@ -114,6 +114,8 @@ class tabs $this->current = key($this->by_name); } + pathNavigator::registerPlugin($this); + // Rotate current to last $this->last= $this->current; -- 2.30.2