Code

Added mechanisms to disable/deactivate plugins if requirements are not fulfilled.
[gosa.git] / gosa-core / include / functions.inc
index 1e86262c188944812ca5d06c28c1e1642224c707..da98e1f39e56afda8c68a36086a29a6c2780d7bb 100644 (file)
@@ -144,8 +144,14 @@ spl_autoload_register('__gosa_autoload');
  */
 function class_available($name)
 {
-  global $class_mapping;
-  return(isset($class_mapping[$name]));
+  global $class_mapping, $config;
+    
+  $disabled = array();
+  if($config instanceOf config && $config->configRegistry instanceOf configRegistry){
+    $disabled = $config->configRegistry->getDisabledPlugins();
+  }
+
+  return(isset($class_mapping[$name]) && !isset($disabled[$name]));
 }
 
 
@@ -3501,8 +3507,8 @@ function image($path, $action= "", $title= "", $align= "middle")
     if (isset ($config)){
       $theme= $config->get_cfg_value("core","theme");
     } else {
-      # For debuging - avoid that there's no theme set
-      die("config not set!");
+
+      // Fall back to default theme
       $theme= "default";
     }