Code

Hide select options if no acls are given
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 20 Jul 2006 05:31:01 +0000 (05:31 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 20 Jul 2006 05:31:01 +0000 (05:31 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4244 594d385d-05f5-0310-b6e9-bd551577e9d8

include/smarty/plugins/block.render.php

index c29621f2dd8c2c0ada487c669aaf7754633b0406..dbbc4a9b69e60e8335e9a8cb7e4da5960e04d3f1 100755 (executable)
@@ -25,9 +25,11 @@ function smarty_block_render($params, $text, &$smarty)
 
        /* Disable objects, but keep those active that have mode=read_active */
        if(!(isset($params['mode']) && $params['mode']=='readable')){
-               $from   =  array("/name=/i");
-               $to     =  array(" disabled name=");
-               $text = preg_replace($from,$to,$text);
+
+               /* Disable options */
+               $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'])){
@@ -35,7 +37,6 @@ function smarty_block_render($params, $text, &$smarty)
                        $new = "src=\"".$params['disable_picture']."\"";
                        $text = preg_replace($syn,$new,$text);
                }
-
        }               
 
        /* Read only */
@@ -50,6 +51,11 @@ function smarty_block_render($params, $text, &$smarty)
                $text = preg_replace("/value=['\" ].*['\" ]/","",$text);
        }
 
+       /* Remove select options */
+       $from   = array("#<option.*<\/option>#i");
+       $to     = array(" ");
+       $text   = preg_replace($from,$to,$text);
+
        return $text;
 }