Code

Made headpage and filter private
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 6 Nov 2009 07:36:27 +0000 (07:36 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 6 Nov 2009 07:36:27 +0000 (07:36 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14769 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_management.inc
gosa-core/plugins/admin/departments/class_departmentManagement.inc

index 6a4675e50651be9edbe13e081c4f40d0815524d3..4439b559abb49c2a550fcce68b4cefe0c6ca699a 100644 (file)
@@ -70,8 +70,8 @@ class management
   protected $snapHandler = null;
 
   // The listing handlers
-  protected $headpage = null;
-  protected $filter = null;
+  private $headpage = null;
+  private $filter = null;
 
   // A list of configured actions/events
   protected $actions = array();
@@ -166,13 +166,27 @@ class management
       }
       $this->snapHandler->setSnapshotBases($bases);
     }
-
+    
+    // Display list
+    return($this->renderList());
+  }
+  
+  function renderList()
+  {
     $this->headpage->update();
     $display = $this->headpage->render();
     return($this->getHeader().$display);
   }
 
+  function getHeadpage()
+  {
+    return($this->headpage);
+  }
 
+  function getFilter()
+  {
+    return($this->filter);
+  }
 
   /*! \brief  Generates the plugin header which is displayed whenever a tab object is 
    *           opened.
@@ -333,6 +347,10 @@ class management
    */
   function detectPostActions()
   {
+    if(!is_object($this->headpage)){
+      trigger_error("No valid headpage given....!");
+      return(array());
+    }
     $action= $this->headpage->getAction();
     if(isset($_POST['edit_apply']))  $action['action'] = "apply";    
     if(isset($_POST['edit_finish'])) $action['action'] = "save";    
index e3bf7e75997a40c3442049646595ea4a0814bf7c..ac40ce0629b5351a7497c663b7cdb23f05460b31 100644 (file)
@@ -101,7 +101,8 @@ class departmentManagement extends management
   function editEntry($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="")
   {
     $types= $this->get_support_departments();
-    $type = $this->headpage->getType($target[0]);
+    $headpage = $this->getHeadpage();
+    $type = $headpage->getType($target[0]);
     return(management::editEntry($action,$target,$all,$this->tabClass,$types[$type]['TAB'],$this->aclCategory));
   }
 
@@ -115,7 +116,8 @@ class departmentManagement extends management
     $config->get_departments();
     $config->make_idepartments();
     $this->config = $config;
-    $this->headpage->refreshBasesList();
+    $headpage = $this->getHeadpage();
+    $headpage->refreshBasesList();
 
     $plugname = $this->last_tabObject->base_name;
     if($this->last_tabObject->by_object[$plugname]->must_be_tagged()){
@@ -130,7 +132,8 @@ class departmentManagement extends management
   // An action handler which enables to switch into deparmtment by clicking the names.
   function openEntry($action,$entry)
   {
-    $this->headpage->setBase(array_pop($entry));
+    $headpage = $this->getHeadpage();
+    $headpage->setBase(array_pop($entry));
   }