Code

Added save method to filter widget
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 8 Oct 2010 07:53:07 +0000 (07:53 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 8 Oct 2010 07:53:07 +0000 (07:53 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19947 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc

index 2f8e122f6c0b2e0a6c038c99562d3ac75437681e..65c4875e162667f45ef2b2f612e18e5ba1da1449 100644 (file)
@@ -55,6 +55,7 @@ class FolderWidget extends plugin
         $data[$this->rootBase] = array(); 
         $data[$this->rootBase]['name'] = $this->rootName;
         $data[$this->rootBase]['status'] = '';
+        $data[$this->rootBase]['acls'] = array();
         $data[$this->rootBase]['path'] = $this->rootName;
         $data[$this->rootBase]['type'] = 'manual';
         $data[$this->rootBase]['base'] = $this->rootBase;
@@ -80,6 +81,7 @@ class FolderWidget extends plugin
                     $current[$entryPath]['name'] = $name;
                     $current[$entryPath]['path'] = $path;
                     $current[$entryPath]['status'] = '';
+                    $current[$entryPath]['acls'] = array();
                     $current[$entryPath]['type'] = 'manual';
                     $current[$entryPath]['base'] = $entryBase;
                     $current[$entryPath]['parentPath'] = $entryPath;
@@ -102,6 +104,29 @@ class FolderWidget extends plugin
     }
 
 
+    function _saveRecursive($arr)
+    {
+        $ret = array();
+        foreach($arr as $path => $item){
+            if($item['type'] == 'real'){ 
+                $ret[$path] = array(
+                        'name' => $item['name'],
+                        'status' => $item['status'],
+                        'acls' => $item['acls'],
+                        );
+            }
+            if(isset($item['children']) && count($item['children'])){
+                $ret = array_merge($ret, $this->_saveRecursive($item['children']));
+            }
+        }
+        return($ret);
+    }
+
+    function save()
+    {
+        return($this->_saveRecursive($this->folderList['recursive']));
+    }
+
     function execute()
     {
         session::set('FolderWidgetListing::folderList', $this->folderList);