summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a27bc36)
raw | patch | inline | side by side (parent: a27bc36)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 17 Jul 2006 07:56:30 +0000 (07:56 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 17 Jul 2006 07:56:30 +0000 (07:56 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4175 594d385d-05f5-0310-b6e9-bd551577e9d8
include/smarty/plugins/block.render.php | [new file with mode: 0755] | patch | blob |
diff --git a/include/smarty/plugins/block.render.php b/include/smarty/plugins/block.render.php
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+
+function smarty_block_render($params, $text, &$smarty)
+{
+ $text = stripslashes($text);
+
+ if (isset($params['acl'])) {
+ $acl = $params['acl'];
+ unset($params['acl']);
+ }
+
+ if(preg_match("/w/i",$acl)){
+
+ /* Read / Write*/
+
+ }elseif(preg_match("/r/i",$acl)){
+
+ /* Read only */
+ $from = array("/name=/i");
+ $to = array("disabled name=");
+ $text = preg_replace($from,$to,$text);
+
+ }elseif(empty($acl)){
+
+ /* No rights */
+ $text= " ";
+
+ }else{
+ // unknown
+ $text =" ";
+ }
+
+
+ return $text;
+}
+
+?>