Source for file function.html_checkboxes.php
Documentation is available at function.html_checkboxes.php
* Smarty {html_checkboxes} function plugin
* File: function.html_checkboxes.php<br>
* Name: html_checkboxes<br>
* Purpose: Prints out a list of checkbox input types<br>
* - name (optional) - string default "checkbox"
* - values (required) - array
* - options (optional) - associative array
* - checked (optional) - array default not set
* - separator (optional) - ie <br> or
* - output (optional) - without this one the buttons don't have names
* {html_checkboxes values=$ids output=$names}
* {html_checkboxes values=$ids name='box' separator='<br>' output=$names}
* {html_checkboxes values=$ids checked=$checked separator='<br>' output=$names}
* @link http://smarty.php.net/manual/en/language.function.html.checkboxes.php {html_checkboxes}
* @author Christopher Kvarme <christopher.kvarme@flashjab.com>
* @author credits to Monte Ohrt <monte@ispi.net>
* @uses smarty_function_escape_special_chars()
require_once $smarty->_get_plugin_filepath ('shared','escape_special_chars');
foreach($params as $_key => $_val) {
$smarty->trigger_error('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', E_USER_WARNING );
$smarty->trigger_error(" html_checkboxes: extra attribute '$_key' cannot be an array" , E_USER_NOTICE );
if (!isset ($options) && !isset ($values))
return ''; /* raise error here? */
foreach ($options as $_key=> $_val)
foreach ($values as $_i=> $_key) {
$_val = isset ($output[$_i]) ? $output[$_i] : '';
if ($labels) $_output .= '<label>';
$_output .= '<input type="checkbox" name="'
$_output .= ' checked="checked"';
$_output .= $extra . ' />' . $output;
if ($labels) $_output .= '</label>';
$_output .= $separator . "\n";
Documentation generated on Mon, 25 Jun 2007 14:02:24 -0400 by phpDocumentor 1.3.2. PEAR Logo Copyright © PHP Group 2004.
|