summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 14f41a7)
raw | patch | inline | side by side (parent: 14f41a7)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 8 Oct 2010 09:02:31 +0000 (09:02 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 8 Oct 2010 09:02:31 +0000 (09:02 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19949 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/groupware/personal/groupware/FolderWidget/FolderWidget-list.xml b/gosa-plugins/groupware/personal/groupware/FolderWidget/FolderWidget-list.xml
index 52335f43d77ce0088cdc5ee2d19525affc038f30..10d9e60781945f61713c089f9043f99acc75ed2d 100644 (file)
</action>
<action>
- <name>edit</name>
+ <name>editEntry</name>
<type>entry</type>
<image>images/lists/edit.png</image>
<label>Edit Sudo role</label>
diff --git a/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc b/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc
index 65c4875e162667f45ef2b2f612e18e5ba1da1449..fc94f2818b8c1fa2e8a6ced252926499ec8403ef 100644 (file)
function __construct(&$config)
{
$this->rootBase = $this->fakeCnAttr.$this->rootName;
- $this->FolderWidgetListing = new FolderWidgetListing($this->config, get_userinfo(), $this->rootBase);
+ $this->FolderWidgetListing = new FolderWidgetListing($this->config, get_userinfo(), $this->rootBase, $this);
$this->FolderWidgetListing->setBase($this->rootBase);
$this->FolderWidgetListing->setFolderRoot($this->rootBase);
}
}
+ function removeByBase($base)
+ {
+ $this->_recursiveRemoveByBase($this->folderList['recursive'], $base);
+ $this->_recursiveRemoveByBase($this->folderList['linear'], $base);
+ $this->FolderWidgetListing->setFolderList($this->folderList);
+ }
+
+ function _recursiveRemoveByBase(&$arr, $base)
+ {
+ $ret = array();
+ foreach($arr as $path => $item){
+ if($item['base'] == $base){
+
+ // remove all children too
+ if(isset($item['children']) && count($item['children'])){
+ foreach($item['children'] as $child){
+ $this->_recursiveRemoveByBase($this->folderList['recursive'], $child['base']);
+ }
+ }
+
+ $arr[$path]['status'] = 'removed';
+ }elseif(isset($item['children']) && count($item['children'])){
+ $ret = array_merge($ret, $this->_recursiveRemoveByBase($arr[$path]['children'], $base));
+ }
+ }
+ return($ret);
+
+ }
+
function _saveRecursive($arr)
{
$ret = array();
function execute()
{
session::set('FolderWidgetListing::folderList', $this->folderList);
+
$this->FolderWidgetListing->setFolderList($this->folderList);
return($this->FolderWidgetListing->execute());
}
diff --git a/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidgetListing.inc b/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidgetListing.inc
index 14bdf17fe8f40a62b0613d399ac99a8f6b5f6e58..cafff0943bb480391d14b826e9b3c5a0312cbbcf 100644 (file)
private $folderList = array();
private $rootBase = '';
+ private $parent;
- function __construct($config,$ui, $rootBase)
+ function __construct($config,$ui, $rootBase, $parent)
{
$this->config = $config;
$this->ui = $ui;
$this->storagePoints = array("");
$this->rootBase = $rootBase;
+ $this->parent = &$parent;
// Build filter
if (FALSE && session::global_is_set(get_class($this)."_filter")){
{
$this->setBase($targets[0]);
}
-
+
+ function editEntry($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="")
+ {
+ print_a($all);
+ }
+
+ protected function removeEntryRequested($action="",$target=array(),$all=array())
+ {
+ foreach($target as $tar){
+ $this->parent->removeByBase($tar);
+ if($tar == $this->base) $this->setBase($this->rootBase);
+ }
+ }
function setFolderList($folderList)
{
{
$ret = array($this->rootBase => '/');
foreach($arr as $path => $entry){
- $ret[$entry['base']] = $entry['name'];
- if(isset($entry['children'])){
- $ret = array_merge($ret, $this->getSimpleFolderList($entry['children']));
+ if($entry['status'] != 'removed'){
+ $ret[$entry['base']] = $entry['name'];
+ if(isset($entry['children'])){
+ $ret = array_merge($ret, $this->getSimpleFolderList($entry['children']));
+ }
}
}
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 f6f82a114d76db5e867ed852ad9ee3220fd56c29..6d51669080980355da3de7cc84b7ac1dba012c87 100644 (file)
static function addEntry(&$ret, $item, $recursive = FALSE, $filter)
{
- if(preg_match("/".$filter."/",$item['name'])){
+ if(preg_match("/".$filter."/",$item['name']) && $item['status'] != 'removed'){
$entry = array();
$entry['dn'] = $item['base'];
$entry[] = 'dn';