From: hickert Date: Thu, 7 Oct 2010 14:02:59 +0000 (+0000) Subject: Updated folder listing X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e444bddfd81c1950abf347c0ff201c1f2f33f357;p=gosa.git Updated folder listing git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19936 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc b/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc index 904714ff7..e51f4c09e 100644 --- a/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc +++ b/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc @@ -36,13 +36,23 @@ class FolderWidget extends plugin function buildRecursiveList($arr, $seperator) { $data = array(); - $base = &$data; - $last = NULL; $ret = array(); + + // Add root Entry + $data['cn=/'] = array(); + $data['cn=/']['name'] = '/'; + $data['cn=/']['status'] = ''; + $data['cn=/']['path'] = '/'; + $data['cn=/']['type'] = 'manual'; + $data['cn=/']['base'] = 'cn=/'; + $data['cn=/']['children'] = array(); + $ret['linear']['cn=/'] = &$data['cn=/']; + + $base = &$data['cn=/']['children']; + $last = NULL; foreach($arr as $path => $entry){ $current = &$base; $pathSteps = preg_split("/".preg_quote($seperator,'/')."/", $path); - $entryPath = ""; $entryBase = "cn=/"; foreach($pathSteps as $name){ @@ -56,9 +66,7 @@ class FolderWidget extends plugin $current[$entryPath]['status'] = ''; $current[$entryPath]['type'] = 'manual'; $current[$entryPath]['base'] = $entryBase; - $ret['linear'][$entryPath] = &$current[$entryPath]; - $this->baseEntryMap[$entryBase] = $entryPath; } $last = &$current[$entryPath]; @@ -68,9 +76,7 @@ class FolderWidget extends plugin $last['name'] = $entry['name']; $last['type'] = 'real'; $last['status'] = $entry['status']; - $ret['linear'][$path] = &$last; - } $ret['recursive'] = $data; return($ret); diff --git a/gosa-plugins/groupware/personal/groupware/FolderWidget/class_filterFolderWidget.inc b/gosa-plugins/groupware/personal/groupware/FolderWidget/class_filterFolderWidget.inc index 17af6b550..aba8249bf 100644 --- a/gosa-plugins/groupware/personal/groupware/FolderWidget/class_filterFolderWidget.inc +++ b/gosa-plugins/groupware/personal/groupware/FolderWidget/class_filterFolderWidget.inc @@ -13,10 +13,13 @@ class filterFolderWidget { // Detect starting position in folder tree. $items = $data['recursive']; + $parent = NULL; foreach($data['linear'] as $item){ if($item['base'] == $base){ $items = $item['children']; + break; } + $parent = $item; } // Add entries