Code

Updated lists'n images
[gosa.git] / gosa-core / include / class_management.inc
index 26cd2d037801d70495f0f9b193e19db72af3ae3a..2769a57458d14dfc453cd63976f743640248fab0 100644 (file)
@@ -84,7 +84,7 @@ class management
   protected $actions = array();
 
   // Attributes managed by this plugin, can be used in post events;
-  protected $attributes = array(); 
+  public $attributes = array(); 
 
   function  __construct(&$config,$ui,$plugname, $headpage)
   {
@@ -207,16 +207,8 @@ class management
    */
   protected function getHeader()
   {
-    if($this->skipHeader) return("");
-
-    if (get_object_info() != ""){
-      $display= print_header(get_template_path($this->plIcon),_($this->plDescription),
-          "<img alt=\"\" class=\"center\" src=\"".get_template_path('images/lists/locked.png')."\">".
-          LDAP::fix(get_object_info()));
-    } else {
-      $display= print_header(get_template_path($this->plIcon),_($this->plDescription));
-    }
-    return($display);
+    // We do not display any headers right now.
+    if(1 || $this->skipHeader) return("");
   }
 
 
@@ -439,7 +431,8 @@ class management
    *  @param  Array   'all'     A combination of both 'action' and 'target'.
    */
   function saveSnapshot($action="",$target=array(),$all=array())
-  {
+  { 
+    if(!is_object($this->dialogObject)) return;
     $this->dialogObject->save_object();
     $msgs = $this->dialogObject->check();
     if(count($msgs)){
@@ -574,10 +567,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);
+      }
     }
   }