Code

Added initial smarty acl block function
[gosa.git] / include / smarty / plugins / block.render.php
1 <?php
3 function smarty_block_render($params, $text, &$smarty)
4 {
5         $text = stripslashes($text);
7         if (isset($params['acl'])) {
8                 $acl = $params['acl'];
9                 unset($params['acl']);
10         }
12         if(preg_match("/w/i",$acl)){
13                 
14                 /* Read / Write*/
16         }elseif(preg_match("/r/i",$acl)){
17                 
18                 /* Read only */
19                 $from   =  array("/name=/i");
20                 $to     =  array("disabled name=");
21                 $text = preg_replace($from,$to,$text);
23         }elseif(empty($acl)){
24                 
25                 /* No rights */
26                 $text= "&nbsp;";
27                 
28         }else{
29                 // unknown
30                 $text ="&nbsp;";
31         }
32                 
34         return $text;
35 }
37 ?>