Code

Updated TemplateEngine itself to support ACLs
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 19 May 2011 09:27:29 +0000 (09:27 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 19 May 2011 09:27:29 +0000 (09:27 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20883 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto-ng/admin/newConfigManagement/TemplateEngine/TemplateEngine.tpl
gosa-plugins/goto-ng/admin/newConfigManagement/TemplateEngine/class_TemplateEngine.inc

index 99be426283e73d90046dccb3fba0899f5d60cb1d..4484bb2e241b5aa062b84727f69d2894e06dd9ec 100644 (file)
@@ -7,6 +7,8 @@
 <hr>
 
 <div class='plugin-actions'>
-    <button name='saveItemEdit'>{msgPool type=okButton}</button>
+    {if $hasWriteAcls}
+        <button name='saveItemEdit'>{msgPool type=okButton}</button>
+    {/if}
     <button name='cancelItemEdit'>{msgPool type=cancelButton}</button>
 </div>
index b88c03a5ee28e728e43e614956a966372f5cf821..5809525a434f8023427fd83cb7cb2a2761ab1669 100644 (file)
@@ -10,7 +10,7 @@ class TemplateEngine
     private $template = "";
     private $itemType = '';
     private $widgets = array();
-
+    private $hasWriteAcls = FALSE;
 
     /*! \brief  Constructs the template engine. 
      *  @param  Config  The GOsa configuration object.
@@ -77,6 +77,7 @@ class TemplateEngine
     function setAcls($acls)
     {
         $this->acls = $acls;
+        $this->hasWriteAcls = preg_match("/w/", implode($acls));
     }
  
 
@@ -165,6 +166,7 @@ class TemplateEngine
     {
         $smarty = get_smarty();
         $smarty->assign("type", $this->itemType);
+        $smarty->assign("hasWriteAcls", $this->hasWriteAcls);
         $smarty->assign("typeData", $this->data[$this->itemType]);
 
         // Tell smarty the HTML-content for each widget and the name that should be