summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 17d20f6)
raw | patch | inline | side by side (parent: 17d20f6)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 8 Oct 2010 09:49:21 +0000 (09:49 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 8 Oct 2010 09:49:21 +0000 (09:49 +0000) |
-Thing were messed up
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19951 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19951 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc | patch | blob | history |
diff --git a/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc b/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc
index eacf21e51a502c99bdc5b5fab5461e7c415988c4..488e761dd204186caf8e8691c8f78b7902b2fcff 100644 (file)
<?php
-
-
-
class FolderWidget extends plugin
{
// These are just internally used variables and should not have an
// effect on the results.
$this->rootBase = $this->fakeCnAttr.$this->rootName;
-
+
$this->accountPrefix = rtrim($accountPrefix,'/').'/';
+ $this->rootBase = $this->pathToDn($accountPrefix);
// Update the folder list, initially.
$this->setFolderList($folderList);
$this->FolderWidgetListing->setFolderRoot($this->rootBase);
}
+ function pathToDn($path)
+ {
+ $dn ="";
+ $list = preg_split("/".preg_quote($this->pathSeperator,'/')."/", $path,0,PREG_SPLIT_NO_EMPTY);
+ foreach($list as $entry){
+ $dn ="cn={$entry},{$dn}";
+ }
+ return(rtrim($dn, ','));
+ }
+
function getFolderType($item)
{
if(preg_match("/^user\//", $item['path'])) return('userFolder');
function setFolderList($arr)
{
$this->folderList = $this->buildRecursiveList($arr, $this->pathSeperator);
+ print_a($this->folderList);
}
$ret = array();
// Add root Entry
- $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;
- $data[$this->rootBase]['parentPath'] = "";
- $data[$this->rootBase]['children'] = array();
- $ret['linear'][$this->rootBase] = &$data[$this->rootBase];
-
- $base = &$data[$this->rootBase]['children'];
+ $data[$this->accountPrefix] = array();
+ $data[$this->accountPrefix]['name'] = $this->rootName;
+ $data[$this->accountPrefix]['status'] = '';
+ $data[$this->accountPrefix]['acls'] = array();
+ $data[$this->accountPrefix]['path'] = $this->rootName;
+ $data[$this->accountPrefix]['type'] = 'manual';
+ $data[$this->accountPrefix]['base'] = $this->rootBase;
+ $data[$this->accountPrefix]['parentPath'] = "";
+ $data[$this->accountPrefix]['children'] = array();
+ $ret['linear'][$this->accountPrefix] = &$data[$this->accountPrefix];
+
+ $base = &$data[$this->accountPrefix]['children'];
$last = NULL;
foreach($arr as $path => $entry){
$pathSteps = preg_split("/".preg_quote($seperator,'/')."/", $path);
$entryPath = "";
$parentPath = "";
- $entryBase = $this->rootBase;
+ $entryBase = "";
foreach($pathSteps as $name){
$parentPath = $entryPath;
$entryPath = (empty($entryPath)) ? $name : "{$entryPath}{$seperator}{$name}";
- $entryBase = trim("cn={$name},{$entryBase}", ' ,');
+ $entryBase = $this->pathToDn($entryPath);
// Add eventually missing subFolders, to enable the navigation
// into these folders via the management lists.