Code

Added diabled picture to render funktion
[gosa.git] / include / smarty / plugins / block.render.php
index e201ba7fb863be83b8f114790b86387b4662ae56..831009fda1921b1a682ff363cb8c8dd14f841a1d 100755 (executable)
@@ -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 */