From 6e02c9945d07db2a6232259470245d5db1cb32e6 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 3 Nov 2010 10:11:54 +0000 Subject: [PATCH] Updated folder Widget -Allow to hide buttons git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20176 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../FolderWidget/FolderWidget-list.tpl | 3 +++ .../FolderWidget/class_FolderWidget.inc | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/gosa-plugins/groupware/personal/groupware/FolderWidget/FolderWidget-list.tpl b/gosa-plugins/groupware/personal/groupware/FolderWidget/FolderWidget-list.tpl index 44dcd716e..803cf152f 100644 --- a/gosa-plugins/groupware/personal/groupware/FolderWidget/FolderWidget-list.tpl +++ b/gosa-plugins/groupware/personal/groupware/FolderWidget/FolderWidget-list.tpl @@ -18,8 +18,11 @@
+ +{if $SHOW_BUTTONS}
+{/if} diff --git a/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc b/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc index 368e3b06d..e907e8a71 100644 --- a/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc +++ b/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc @@ -47,6 +47,8 @@ class FolderWidget extends plugin private $baseEntryMap = array(); private $permissions = array(); + protected $displayButtons = TRUE; + /*! \brief Constructs the widget and initializes all required sub-widgets. */ @@ -72,6 +74,12 @@ class FolderWidget extends plugin } + function showButtons($bool = TRUE) + { + $this->displayButtons = $bool; + } + + /*! \brief Updates the list of all selectable ACLs * @param Array The list of acls to use * Syntax is [ 'ACLname'] => 'diplayName', 0=>'None',1=>'Read',...] @@ -253,6 +261,12 @@ class FolderWidget extends plugin } + function dialogOpened() + { + return($this->dialog != FALSE); + } + + /*! \brief Removes a given folder, internally it is just marked with status => 'removed'; */ function removeByBase($base) @@ -341,6 +355,9 @@ class FolderWidget extends plugin // Generate the listing output session::set('FolderWidgetListing::folderList', $this->folderList); $this->FolderWidgetListing->setFolderList($this->folderList); + + $smarty = get_smarty(); + $smarty->assign("SHOW_BUTTONS", $this->displayButtons); $str = $this->FolderWidgetListing->execute(); if($this->dialog){ -- 2.30.2