Code

Removed debug output
[gosa.git] / gosa-core / include / class_management.inc
index d418c31f1072767f5ec9eeebca37119e465c7091..6bdd603ca37cd0519a890868d897bbb648e12251 100644 (file)
@@ -119,6 +119,8 @@ class management
     $this->registerAction("saveSnapshot","saveSnapshot");
     $this->registerAction("restoreSnapshot","restoreSnapshot");
     $this->registerAction("cancelSnapshot","closeDialogs");
+
+    $this->registerAction("config-filter","editFilter");
   }
 
   /*! \brief  Execute this plugin
@@ -141,9 +143,6 @@ class management
       $this->filter->update();
       session::global_set(get_class($this)."_filter", $this->filter);
       session::set('autocomplete', $this->filter);
-      if (!$this->filter->isValid()){
-        msg_dialog::display(_("Filter error"), _("The filter is incomplete!"), ERROR_DIALOG);
-      }
     }
 
     // Handle actions (POSTs and GETs)
@@ -180,11 +179,17 @@ class management
 
       $this->snapHandler->setSnapshotBases($bases);
     }
-    
+  
     // Display list
     return($this->renderList());
   }
-  
+  function editFilter()
+  {
+    $headpage = $this->getHeadpage();
+    $this->dialogObject = new userFilter($this->config,$headpage->categories);
+  }
   function renderList()
   {
     $this->headpage->update();
@@ -207,16 +212,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("");
   }
 
 
@@ -376,6 +373,8 @@ class management
     if(isset($_POST['edit_cancel'])) $action['action'] = "cancel";    
     if(isset($_POST['delete_confirmed'])) $action['action'] = "removeConfirmed";   
     if(isset($_POST['delete_cancel'])) $action['action'] = "cancelDelete";   
+    if(isset($_POST['saveFilter'])) $action['action'] = "save";   
+    if(isset($_POST['cancelFilter'])) $action['action'] = "cancel";   
 
     // Detect Snapshot actions
     if(isset($_POST['CreateSnapshot'])) $action['action'] = "saveSnapshot";   
@@ -922,6 +921,31 @@ class management
   {
     return(is_object($this->tabObject) || is_object($this->dialogObject));
   }
+
+
+  /*! \brief    Forward command execution request
+   *             to the correct method.
+   */
+  function handle_post_events($mode, $addAttrs= array())
+  {
+    if(!in_array($mode, array('add','remove','modify'))){
+      trigger_error(sprintf("Invalid post event type given '%s'! Valid types are [add,modify,remove].", $mode));
+      return;
+    }
+    switch ($mode){
+      case "add":
+        plugin::callHook($this,"POSTCREATE", $addAttrs);
+      break;
+
+      case "modify":
+        plugin::callHook($this,"POSTMODIFY", $addAttrs);
+      break;
+
+      case "remove":
+        plugin::callHook($this,"POSTREMOVE", $addAttrs);
+      break;
+    }
+  }
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: