From 1cc2dff20cea8e7e5f77d30baaf3f15c4b149cd7 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 12 Oct 2010 12:36:33 +0000 Subject: [PATCH] Added Folder list handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20000 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../class_GroupwareSharedFolder.inc | 113 ++++++++++++++++-- 1 file changed, 103 insertions(+), 10 deletions(-) diff --git a/gosa-plugins/groupware/admin/groups/GroupwareSharedFolder/class_GroupwareSharedFolder.inc b/gosa-plugins/groupware/admin/groups/GroupwareSharedFolder/class_GroupwareSharedFolder.inc index 16b508347..f1a8d802c 100644 --- a/gosa-plugins/groupware/admin/groups/GroupwareSharedFolder/class_GroupwareSharedFolder.inc +++ b/gosa-plugins/groupware/admin/groups/GroupwareSharedFolder/class_GroupwareSharedFolder.inc @@ -1,5 +1,28 @@ config->getRpcHandle(); # $capabilities = $rpc->gwGetCapabilities(); @@ -61,18 +94,17 @@ class GroupwareSharedFolder extends plugin # $rpc->get_error()); # msg_dialog::display(_("Error"),msgPool::rpcError($message), ERROR_DIALOG); # return; -# } -# -# // Detect features we can use -# $map['folder'] = array("folderList","folderAdd","folderDel","folderExists"); -# $map['members'] = array("folderGetMembers","folderSetMembers","folderAddMember","folderDelMember"); -# foreach($map as $name => $required){ -# $this->featuresEnabled[$name] = TRUE; -# foreach($required as $func){ -# $this->featuresEnabled[$name] &= isset($capabilities[$func]) && $capabilities[$func]; -# } # } + // Detect features we can use + $map['folder'] = array("folderList","folderAdd","folderDel","folderExists"); + $map['members'] = array("folderGetMembers","folderSetMembers","folderAddMember","folderDelMember"); + foreach($map as $name => $required){ + $this->featuresEnabled[$name] = TRUE; + foreach($required as $func){ + $this->featuresEnabled[$name] &= isset($capabilities[$func]) && $capabilities[$func]; + } + } // If we're creating a new ogroup, then we definately have no extension yet. $this->rpcError = FALSE; @@ -102,11 +134,44 @@ class GroupwareSharedFolder extends plugin $this->initialized = TRUE; } + 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 getPermissions() + { + $ret[GROUPWARE_RIGHTS_NONE] = _("None"); + $ret[RIGHTS_GROUPWARE_READ] = _("Read"); + $ret[RIGHTS_GROUPWARE_POST] = _("Post"); + $ret[GROUPWARE_RIGHTS_APPEND] = _("Append"); + $ret[RIGHTS_GROUPWARE_WRITE] = _("Write"); + $ret[GROUPWARE_RIGHTS_ALL] = _("All"); + return($ret); + } + + function execute() { plugin::execute(); + $this->folderList = $this->getFolderList(); + // Initialization failed - Display a stripped template which allows // to retry initialization if(!$this->initialized){ @@ -143,6 +208,34 @@ class GroupwareSharedFolder extends plugin } } + /**************** + Folder editor + ****************/ + + if(isset($_POST['FolderWidget_cancel'])) $this->FolderWidget = NULL; + if(isset($_POST['FolderWidget_ok'])){ + $this->FolderWidget->save_object(); + $msgs = $this->FolderWidget->check(); + if(count($msgs)){ + msg_dialog::displayChecks($msgs); + }else{ + $this->folderList = $this->FolderWidget->save(); + $this->FolderWidget = NULL; + } + } + if(isset($_POST['configureFolder'])){ + $this->FolderWidget = new FolderWidget($this->config,$this->folderList, "shared/"); + $this->FolderWidget->setPermissions($this->getPermissions()); + $this->FolderWidget->acl_base = $this->acl_base; + $this->FolderWidget->acl_category = $this->acl_category; + } + $this->dialog = FALSE; + if($this->FolderWidget instanceOf FolderWidget){ + $this->FolderWidget->save_object(); + $this->dialog = TRUE; + return($this->FolderWidget->execute()); + } + /**************** Generate HTML output -- 2.30.2