From cc3acf76ce74c0e73614999a95cf79f028a88dd4 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 26 May 2010 08:40:21 +0000 Subject: [PATCH] Updated plugin deactivation -Deactivate Icon Menu entries too. -Do not allow to instantiate tabs while base plugin is not available git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18746 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_management.inc | 20 +- gosa-core/include/class_pluglist.inc | 14 +- .../plugins/personal/generic/class_user.inc | 2 +- gosa-core/plugins/personal/myaccount/main.inc | 215 ++++++++++-------- 4 files changed, 142 insertions(+), 109 deletions(-) diff --git a/gosa-core/include/class_management.inc b/gosa-core/include/class_management.inc index 837688dc5..77f07307f 100644 --- a/gosa-core/include/class_management.inc +++ b/gosa-core/include/class_management.inc @@ -625,11 +625,21 @@ class management if(empty($tabClass) || empty($tabType)){ // No tab type defined }else{ - if (isset($this->config->data['TABS'][$tabType])) { - $this->tabObject= new $tabClass($this->config,$this->config->data['TABS'][$tabType], $this->dn, $aclCategory); - $this->tabObject->set_acl_base($this->headpage->getBase()); - $this->tabObject->parent = &$this; - @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$this->dn,"Create new entry initiated!"); + + if (isset($this->config->data['TABS'][$tabType])) { + + // Check if the base plugin is available - it is mostly responsible for object creation and removal. + $first = $this->config->data['TABS'][$tabType][0]; + if(!class_available($first['CLASS'])){ + msg_dialog::display(_("Internal error"), + sprintf(_("Cannot instantiate tabbed-plugin, the base plugin (%s) is not available!"), $first['CLASS']), + ERROR_DIALOG); + }else{ + $this->tabObject= new $tabClass($this->config,$this->config->data['TABS'][$tabType], $this->dn, $aclCategory); + $this->tabObject->set_acl_base($this->headpage->getBase()); + $this->tabObject->parent = &$this; + @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$this->dn,"Create new entry initiated!"); + } } else { msg_dialog::display(_("Error"), sprintf(_("No tab definition for %s found in configuration file: cannot create plugin instance!"), bold($tabType)), ERROR_DIALOG); } diff --git a/gosa-core/include/class_pluglist.inc b/gosa-core/include/class_pluglist.inc index 3bf9caa74..83fd3c6ef 100644 --- a/gosa-core/include/class_pluglist.inc +++ b/gosa-core/include/class_pluglist.inc @@ -186,7 +186,7 @@ class pluglist } } - $disabledPlugins = $this->config->configRegistry->getDisabledPlugins(); + $disabledPlugins = $this->config->configRegistry->getDisabledPlugins(); $cfg= $this->config->data['MENU']; $menu = "\n