summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4b1e776)
raw | patch | inline | side by side (parent: 4b1e776)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 8 Oct 2010 11:21:38 +0000 (11:21 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 8 Oct 2010 11:21:38 +0000 (11:21 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19952 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
--- /dev/null
@@ -0,0 +1,7 @@
+adsf
+
+<hr>
+<div class='plugin-actions'>
+ <button name="FolderEditDialog_ok">{msgPool type='okButton'}</button>
+ <button name="FolderEditDialog_cancel">{msgPool type='cancelButton'}</button>
+</div>
diff --git a/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderEditDialog.inc b/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderEditDialog.inc
--- /dev/null
@@ -0,0 +1,22 @@
+<?php
+
+class FolderEditDialog extends plugin
+{
+ private $item = NULL;
+
+ function __construct($config, $item)
+ {
+ $this->config = $config;
+ $this->item = $item;
+ }
+
+ function execute()
+ {
+ $smarty = get_smarty();
+ $smarty->assign('item', $this->item);
+ return($smarty->fetch(get_template_path("FolderEditDialog.tpl", TRUE, dirname(__FILE__))));
+ }
+}
+
+
+?>
diff --git a/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc b/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc
index 488e761dd204186caf8e8691c8f78b7902b2fcff..fdbb6ac492d67461ca678b740c4414eb8ec9c433 100644 (file)
class FolderWidget extends plugin
{
- private $pathSeperator = "/";
+ private $pathSeparator = "/";
private $rootName = "/";
private $fakeCnAttr = "cn=";
private $rootBase = "";
function __construct(&$config, $folderList, $accountPrefix)
{
+ $this->config = $config;
// The rootBase is a dn-like representation of the root path
// e.g. rootPath is '/' then is the rootBase 'cn=/'
// These are just internally used variables and should not have an
function pathToDn($path)
{
$dn ="";
- $list = preg_split("/".preg_quote($this->pathSeperator,'/')."/", $path,0,PREG_SPLIT_NO_EMPTY);
+ $list = preg_split("/".preg_quote($this->pathSeparator,'/')."/", $path,0,PREG_SPLIT_NO_EMPTY);
foreach($list as $entry){
$dn ="cn={$entry},{$dn}";
}
*/
function setFolderList($arr)
{
- $this->folderList = $this->buildRecursiveList($arr, $this->pathSeperator);
- print_a($this->folderList);
+ $this->folderList = $this->buildRecursiveList($arr, $this->pathSeparator);
}
* @param Array The folder list
* @return Array A hierarchical representation of the input array.
*/
- function buildRecursiveList($arr, $seperator)
+ function buildRecursiveList($arr, $separator)
{
$data = array();
$ret = array();
if(!preg_match("/^".preg_quote($this->accountPrefix,'/')."/", $path)) continue;
$current = &$base;
- $pathSteps = preg_split("/".preg_quote($seperator,'/')."/", $path);
+ $pathSteps = preg_split("/".preg_quote($separator,'/')."/", $path);
$entryPath = "";
$parentPath = "";
$entryBase = "";
foreach($pathSteps as $name){
$parentPath = $entryPath;
- $entryPath = (empty($entryPath)) ? $name : "{$entryPath}{$seperator}{$name}";
+ $entryPath = (empty($entryPath)) ? $name : "{$entryPath}{$separator}{$name}";
$entryBase = $this->pathToDn($entryPath);
// Add eventually missing subFolders, to enable the navigation
return($ret);
}
+
+ function editByBase($base)
+ {
+ $item = NULL;
+ foreach($this->folderList['linear'] as $item){
+ if($item['base'] == $base){
+ break;
+ }
+ }
+ if($item){
+ $this->currentlyEditedItem = $item;
+ $this->dialog = new FolderEditDialog($this->config, $item);
+ }
+ }
+
function removeByBase($base)
{
function execute()
{
+ // Generate the listing output
session::set('FolderWidgetListing::folderList', $this->folderList);
-
$this->FolderWidgetListing->setFolderList($this->folderList);
- return($this->FolderWidgetListing->execute());
+ $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());
+ }
+
+ // Return listing HTML
+ return($str);
}
function save_object()
diff --git a/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidgetListing.inc b/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidgetListing.inc
index cafff0943bb480391d14b826e9b3c5a0312cbbcf..fbbf7a2dbf249e8823bb3ac5253b09c3ec910d23 100644 (file)
function editEntry($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="")
{
- print_a($all);
+ $this->parent->editByBase($target[0]);
}
protected function removeEntryRequested($action="",$target=array(),$all=array())