Code

Updated shared folder handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 13 Oct 2010 08:01:02 +0000 (08:01 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 13 Oct 2010 08:01:02 +0000 (08:01 +0000)
-Fixed folder/prefix usage.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20014 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/groupware/admin/groups/GroupwareSharedFolder/class_GroupwareSharedFolder.inc

index 46470007d226b854c3531e885fa1bb526cf90aff..d5f7b6a4db018da6f535e36dca478eab42bea821 100644 (file)
@@ -43,6 +43,7 @@ class GroupwareSharedFolder extends plugin
     // Feature handling
     private $featuresEnabled = array();
     private $FolderWidget = NULL;
+    private $folderPrefix = "shared/";
 
 
     /*! \brief  Constructs the plugin, loads required parent values 
@@ -59,6 +60,8 @@ class GroupwareSharedFolder extends plugin
         }
         $this->orig_cn = $this->cn;
 
+        $this->folderPrefix = "shared/{$this->cn}";
+
         // Initialize the distribution list using the gosa-ng backend 
         $this->init();
     }
@@ -139,26 +142,6 @@ class GroupwareSharedFolder extends plugin
     }
 
 
-    // Returns a dummy folder list . #Fixme remove this.
-    function getFolderList()
-    {
-        $folders = array(
-                "shared/Favorites",
-                "shared/All Public Folders",
-                "shared/All Public Folders/Internet Newsgroups",
-                "shared/All Public Folders/testordner",
-                "shared/All Public Folders/testordner/klaus ist auch ein ordner",
-                "shared/All Public Folders/testordner/klaus ist auch ein ordner/testordner",
-                "shared/All Public Folders/testordner/klaus ist auch ein ordner/testordner/xcbdxfgh");
-
-        $ret = array();
-        foreach($folders as $folder){
-            $name = preg_replace("/^.*\//","",$folder);
-            $ret[$folder] = array('status' => '', 'name' => $name, 'acls' => array());
-        } 
-        return($ret);
-    }
-
     function execute()
     {
         plugin::execute();
@@ -217,7 +200,7 @@ class GroupwareSharedFolder extends plugin
             }
         }
         if(isset($_POST['configureFolder'])){
-            $this->FolderWidget = new FolderWidget($this->config,$this->folderList, "shared/");
+            $this->FolderWidget = new FolderWidget($this->config,$this->folderList, $this->folderPrefix);
             $this->FolderWidget->setPermissions($this->getPermissions());
             $this->FolderWidget->acl_base = $this->acl_base;
             $this->FolderWidget->acl_category = $this->acl_category;
@@ -282,8 +265,8 @@ class GroupwareSharedFolder extends plugin
         $messages = plugin::check();
 
         // Get current object-group name maybe it is invalid for us.
-        if(isset($this->parent->by_object['ogroup']->cn)){
-            $this->cn = &$this->parent->by_object['ogroup']->cn;
+        if(isset($this->parent->by_object['group']->cn)){
+            $this->cn = &$this->parent->by_object['group']->cn;
         }
         return($messages);
     }
@@ -308,7 +291,7 @@ class GroupwareSharedFolder extends plugin
     }
 
 
-    // Should come from the sever later.  #FIXME
+    // #Fixme: Put this in a separate class
     function getPermissions()
     {
         $ret[GROUPWARE_RIGHTS_NONE] = _("None");
@@ -319,5 +302,26 @@ class GroupwareSharedFolder extends plugin
         $ret[GROUPWARE_RIGHTS_ALL] = _("All");
         return($ret);
     }
+
+
+    // Returns a dummy folder list . #Fixme remove this.
+    function getFolderList()
+    {
+        $folders = array(
+                "shared/{$this->cn}/Favorites",
+                "shared/{$this->cn}/All Public Folders",
+                "shared/{$this->cn}/All Public Folders/Internet Newsgroups",
+                "shared/{$this->cn}/All Public Folders/testordner",
+                "shared/{$this->cn}/All Public Folders/testordner/klaus ist auch ein ordner",
+                "shared/{$this->cn}/All Public Folders/testordner/klaus ist auch ein ordner/testordner",
+                "shared/{$this->cn}/All Public Folders/testordner/klaus ist auch ein ordner/testordner/xcbdxfgh");
+
+        $ret = array();
+        foreach($folders as $folder){
+            $name = preg_replace("/^.*\//","",$folder);
+            $ret[$folder] = array('status' => '', 'name' => $name, 'acls' => array());
+        } 
+        return($ret);
+    }
 }
 ?>