Code

Updated smarty html-object factory
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 27 Jul 2010 12:41:56 +0000 (12:41 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 27 Jul 2010 12:41:56 +0000 (12:41 +0000)
-Added ability to disable generated fields

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19167 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/smarty/plugins/function.factory.php

index 7de9c138a442aa97a213ce09517e19fe3c2054ba..10b15ffc56bf66791342f1c3d747a17246e00f52 100644 (file)
@@ -11,6 +11,9 @@ function smarty_function_factory($params, &$smarty)
         $$tmp = (isset($params[$var]))? "{$var}=\"{$params[$var]}\"" : "";
     }
 
+    $disabled = (isset($params['disabled']))? 'disabled' : "";
+
+
     $str = "";
     switch($type){
 
@@ -20,7 +23,7 @@ function smarty_function_factory($params, &$smarty)
             // Maxlength has a default of 40 characters
             $maxlengthReady = (empty($maxlength))?'maxlength="40"': $maxlengthReady; 
             $str .= "<input {$nameReady} {$idReady} {$valueReady} {$maxlengthReady}
-            {$titleReady} {$onfocusReady} {$onkeyupReady} type='password'
+            {$titleReady} {$onfocusReady} {$onkeyupReady} {$disabled} type='password'
             onkeypress=\"
                 if (capslock(event)){
                     $('{$id}').style.backgroundImage='url(images/caps.png)'