Code

Updated folder Widget
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 3 Nov 2010 10:11:54 +0000 (10:11 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 3 Nov 2010 10:11:54 +0000 (10:11 +0000)
-Allow to hide buttons

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20176 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/groupware/personal/groupware/FolderWidget/FolderWidget-list.tpl
gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc

index 44dcd716e50bf218a27cf1fa3008fabc0c0d5768..803cf152f03e17c22bbd67486bdd422d8ada2fcf 100644 (file)
 </div>
 
 <div class="clear"></div>
+
+{if $SHOW_BUTTONS}
 <hr>
 <div class='plugin-actions'>
     <button name='FolderWidget_ok'>{msgPool type=okButton}</button>
     <button name='FolderWidget_cancel'>{msgPool type=cancelButton}</button>
 </div>
+{/if}
index 368e3b06de17d59ea6b2fab2035e316957b4a58c..e907e8a713257bce09551feea17413e9995da7a1 100644 (file)
@@ -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){