From cd9d591ae95e99b3a4c9700c4f9e1728f78606c2 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 20 Jul 2006 04:30:23 +0000 Subject: [PATCH] Added diabled picture to render funktion git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4240 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/smarty/plugins/block.render.php | 10 +++++++++- plugins/personal/generic/generic.tpl | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/smarty/plugins/block.render.php b/include/smarty/plugins/block.render.php index e201ba7fb..831009fda 100755 --- a/include/smarty/plugins/block.render.php +++ b/include/smarty/plugins/block.render.php @@ -24,10 +24,18 @@ function smarty_block_render($params, $text, &$smarty) } /* Disable objects, but keep those active that have mode=read_active */ - if(!(isset($params['mode']) && $params['mode']=='read_active')){ + if(!(isset($params['mode']) && $params['mode']=='readable')){ $from = array("/name=/i"); $to = array("disabled name="); $text = preg_replace($from,$to,$text); + + /* Replace picture if object is disabled */ + if(isset($params['disable_picture'])){ + $syn = "/src=['\"][a-z0-9\/.]*['\"]/i"; + $new = "src=\"".$params['disable_picture']."\""; + $text = preg_replace($syn,$new,$text); + } + } /* Read only */ diff --git a/plugins/personal/generic/generic.tpl b/plugins/personal/generic/generic.tpl index c79dccdf6..d27930c6b 100644 --- a/plugins/personal/generic/generic.tpl +++ b/plugins/personal/generic/generic.tpl @@ -148,6 +148,8 @@ + {/render} + {render acl=$baseACL disable_picture='images/folder_gray.png'} {/render} -- 2.30.2