cvs: smarty / NEWS /libs/plugins function.html_checkboxes.php function.html_radios.php function.mailto.php

"Monte Ohrt" <[email protected]>
Newsgroups gmane.comp.php.cvs.smarty
Message-ID <cvsmohrt1088777670@cvsserver>
mohrt		Fri Jul  2 10:14:30 2004 EDT

  Modified files:              
    /smarty	NEWS 
    /smarty/libs/plugins	function.html_checkboxes.php 
                        	function.html_radios.php function.mailto.php 
  Log:
  add assign attribute to html_checkboxes and html_radios
  
  
http://cvs.php.net/diff.php/smarty/NEWS?r1=1.460&r2=1.461&ty=u
Index: smarty/NEWS
diff -u smarty/NEWS:1.460 smarty/NEWS:1.461
--- smarty/NEWS:1.460	Thu Jul  1 11:48:40 2004
+++ smarty/NEWS	Fri Jul  2 10:14:29 2004
@@ -1,3 +1,9 @@
+  - add assign attribute to html_checkboxes and html_radios
+    (pcg, Monte)
+  - remove non-xhtml conformant tag from mailto function
+    (tacker, Monte)
+  - handle date_format codes %e, %T and %D for windows (tip,
+    Monte)
   - fix unnecessary call to smarty_core_get_include_path() inside
     Smarty::_get_auto_filename() (c960657, messju)
   - add error-messages when anything else than an identifier is passed
http://cvs.php.net/diff.php/smarty/libs/plugins/function.html_checkboxes.php?r1=1.13&r2=1.14&ty=u
Index: smarty/libs/plugins/function.html_checkboxes.php
diff -u smarty/libs/plugins/function.html_checkboxes.php:1.13 smarty/libs/plugins/function.html_checkboxes.php:1.14
--- smarty/libs/plugins/function.html_checkboxes.php:1.13	Tue Dec  9 15:02:06 2003
+++ smarty/libs/plugins/function.html_checkboxes.php	Fri Jul  2 10:14:30 2004
@@ -20,7 +20,8 @@
  *           - options    (optional) - associative array
  *           - checked    (optional) - array default not set
  *           - separator  (optional) - ie <br> or &nbsp;
- *           - output     (optional) - without this one the buttons don't have names
+ *           - output     (optional) - the output next to each checkbox
+ *           - assign     (optional) - assign the output as an array to this variable
  * Examples:
  * <pre>
  * {html_checkboxes values=$ids output=$names}
@@ -95,23 +96,27 @@
         return ''; /* raise error here? */
 
     settype($selected, 'array');
-    $_html_result = '';
+    $_html_result = array();
 
     if (is_array($options)) {
 
         foreach ($options as $_key=>$_val)
-            $_html_result .= smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
+            $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
 
 
     } else {
         foreach ($values as $_i=>$_key) {
             $_val = isset($output[$_i]) ? $output[$_i] : '';
-            $_html_result .= smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
+            $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
         }
 
     }
 
-    return $_html_result;
+    if(!empty($params['assign'])) {
+        $smarty->assign($params['assign'], $_html_result);
+    } else {
+        return implode("\n",$_html_result);
+    }
 
 }
 
@@ -127,7 +132,7 @@
     }
     $_output .= $extra . ' />' . $output;
     if ($labels) $_output .= '</label>';
-    $_output .=  $separator . "\n";
+    $_output .=  $separator;
 
     return $_output;
 }
http://cvs.php.net/diff.php/smarty/libs/plugins/function.html_radios.php?r1=1.16&r2=1.17&ty=u
Index: smarty/libs/plugins/function.html_radios.php
diff -u smarty/libs/plugins/function.html_radios.php:1.16 smarty/libs/plugins/function.html_radios.php:1.17
--- smarty/libs/plugins/function.html_radios.php:1.16	Tue Dec  9 14:30:29 2003
+++ smarty/libs/plugins/function.html_radios.php	Fri Jul  2 10:14:30 2004
@@ -20,7 +20,8 @@
  *           - options    (optional) - associative array
  *           - checked    (optional) - array default not set
  *           - separator  (optional) - ie <br> or &nbsp;
- *           - output     (optional) - without this one the buttons don't have names
+ *           - output     (optional) - the output next to each radio button
+ *           - assign     (optional) - assign the output as an array to this variable
  * Examples:
  * <pre>
  * {html_radios values=$ids output=$names}
@@ -98,23 +99,27 @@
     if (!isset($options) && !isset($values))
         return ''; /* raise error here? */
 
-    $_html_result = '';
+    $_html_result = array();
 
     if (isset($options) && is_array($options)) {
 
         foreach ((array)$options as $_key=>$_val)
-            $_html_result .= smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
+            $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
 
     } else {
 
         foreach ((array)$values as $_i=>$_key) {
             $_val = isset($output[$_i]) ? $output[$_i] : '';
-            $_html_result .= smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
+            $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
         }
 
     }
 
-    return $_html_result;
+    if(!empty($params['assign'])) {
+        $smarty->assign($params['assign'], $_html_result);
+    } else {
+        return implode("\n",$_html_result);
+    }
 
 }
 
@@ -130,7 +135,7 @@
     }
     $_output .= $extra . ' />' . $output;
     if ($labels) $_output .= '</label>';
-    $_output .=  $separator . "\n";
+    $_output .=  $separator;
 
     return $_output;
 }
http://cvs.php.net/diff.php/smarty/libs/plugins/function.mailto.php?r1=1.11&r2=1.12&ty=u
Index: smarty/libs/plugins/function.mailto.php
diff -u smarty/libs/plugins/function.mailto.php:1.11 smarty/libs/plugins/function.mailto.php:1.12
--- smarty/libs/plugins/function.mailto.php:1.11	Fri May 28 04:44:46 2004
+++ smarty/libs/plugins/function.mailto.php	Fri Jul  2 10:14:30 2004
@@ -105,7 +105,7 @@
             $js_encode .= '%' . bin2hex($string[$x]);
         }
 
-        return '<script type="text/javascript" language="javascript">eval(unescape(\''.$js_encode.'\'))</script>';
+        return '<script type="text/javascript">eval(unescape(\''.$js_encode.'\'))</script>';
 
     } elseif ($encode == 'hex') {
 

-- 
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.