Code

Added error message if tab type is missing
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Jan 2010 08:16:52 +0000 (08:16 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Jan 2010 08:16:52 +0000 (08:16 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15345 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_management.inc

index 26cd2d037801d70495f0f9b193e19db72af3ae3a..f1a8ae6c36fead8f415e9ce11357e4ba338429c8 100644 (file)
@@ -574,10 +574,14 @@ class management
     if(empty($tabClass) || empty($tabType)){
       // No tab type defined
     }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!");
+      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!");
+      } else {
+        msg_dialog::display(_("Error"), sprintf(_("No tab declaration for '%s' found in your configuration file. Cannot create plugin instance!"), $tabType), ERROR_DIALOG);
+      }
     }
   }