summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 77a400a)
raw | patch | inline | side by side (parent: 77a400a)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 8 Oct 2010 11:42:53 +0000 (11:42 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 8 Oct 2010 11:42:53 +0000 (11:42 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19953 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/groupware/personal/groupware/FolderWidget/FolderEditDialog.tpl b/gosa-plugins/groupware/personal/groupware/FolderWidget/FolderEditDialog.tpl
index eec1e9e30710d5e6f1111f473e6aa9eed37d3c12..7182206cffc260184dd76f1476f1b096fae1f9fa 100644 (file)
-adsf
+<h3>{t}Folder editing dialog{/t}</h3>
+
+<table>
+ <tr>
+ <td>{t}Name{/t}: </td>
+ <td>{$folderItem.name}</td>
+ </tr>
+ <tr>
+ <td>{t}Path{/t}: </td>
+ <td>{$folderItem.path}</td>
+ </tr>
+</table>
+
+<hr>
+
+<h3>{t}Permissions{/t}</h3>
+
+<table>
+ <tr>
+ <td style='width:120px;'>{t}Name{/t}</td>
+ <td style='width:180px;'>{t}Permission{/t}</td>
+ <td style='width:180px;'>{t}Type{/t}</td>
+ </tr>
+ {foreach from=$folderItem.acls item=item key=key}
+ <tr>
+ <td>{$item.type}</td>
+ <td><input type='text' name="permission_{$key}_name" value="{$item.name}"></td>
+ <td><input type='text' name="permission_{$key}_acl" value="{$item.acl}"></td>
+ <td><button name="permission_{$key}_del">{msgPool type=delButton}</button></td>
+ </tr>
+ {/foreach}
+ <tr>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td><button name="permission_add">{msgPool type=addButton}</button></td>
+ </tr>
+</table>
<hr>
<div class='plugin-actions'>
diff --git a/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderEditDialog.inc b/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderEditDialog.inc
index 3363021b93e3f7eb85e2075b25408de656960c93..0f5f6d9fe0a20f86f186a2247e9b0e67c45ee6c0 100644 (file)
class FolderEditDialog extends plugin
{
- private $item = NULL;
+ private $folderItem = NULL;
- function __construct($config, $item)
+ function __construct($config, $folderItem)
{
$this->config = $config;
- $this->item = $item;
+ $this->folderItem = $folderItem;
}
function execute()
{
$smarty = get_smarty();
- $smarty->assign('item', $this->item);
+ $smarty->assign('folderItem', $this->folderItem);
return($smarty->fetch(get_template_path("FolderEditDialog.tpl", TRUE, dirname(__FILE__))));
}
-}
+ function save_object()
+ {
+ // Get all posted value modifications
+ foreach($this->folderItem['acls'] as $id => $aclEntry){
+
+ // Name or ACL modified?
+ if(isset($_POST["permission_{$id}_name"])) {
+ $this->folderItem['acls'][$id]['name'] = get_post("permission_{$id}_name");
+ }
+ if(isset($_POST["permission_{$id}_acl"])) {
+ $this->folderItem['acls'][$id]['acl'] = get_post("permission_{$id}_acl");
+ }
+
+ // Check if entry has to be removed.
+ if(isset($_POST["permission_{$id}_del"])){
+ unset($this->folderItem['acls'][$id]);
+ }
+ }
+
+ // New ACL entry to add?
+ if(isset($_POST['permission_add'])){
+ $this->folderItem['acls'][] = array('name' => '', 'acl' => 0, 'type' => 'user');
+ }
+ $this->folderItem['acls'] = array_values($this->folderItem['acls']);
+ }
+
+ function save()
+ {
+ return($this->folderItem);
+ }
+}
+
?>
diff --git a/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc b/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc
index fdbb6ac492d67461ca678b740c4414eb8ec9c433..6bba3f0eba616d2936e7fc54e2c042c45abf2242 100644 (file)
$this->FolderWidgetListing->setFolderList($this->folderList);
$str = $this->FolderWidgetListing->execute();
- // Handle dialogs
- if(isset($_POST['FolderEditDialog_ok'])){
- $this->dialog = NULL;
- }
- if(isset($_POST['FolderEditDialog_cancel'])){
- $this->dialog = NULL;
- }
if($this->dialog){
$this->dialog->save_object();
return($this->dialog->execute());
function save_object()
{
$this->FolderWidgetListing->save_object();
+
+ // Handle dialogs
+ if(isset($_POST['FolderEditDialog_ok'])){
+
+ $this->dialog->save_object();
+ $msgs = $this->dialog->check();
+ if(count($msgs)){
+ msg_dialog::displayChecks($msgs);
+ }else{
+ $newItem = $this->dialog->save();
+ $path = $this->currentlyEditedItem['path'];
+ $this->folderList['linear'][$path]['acls'] = $newItem['acls'];
+ $this->dialog = NULL;
+ }
+ }
+ if(isset($_POST['FolderEditDialog_cancel'])){
+ $this->dialog = NULL;
+ }
}
}