option for the each checkbox field * @uses string $vars['default'] The default value to send if nothing is checked. * Optional, defaults to 0. Set to FALSE for no default. * @uses bool $vars['disabled'] Make all input elements disabled. Optional. * @uses string $vars['value'] The current value. Single value or array. Optional. * @uses string $vars['class'] Additional class of the list. Optional. * @uses string $vars['align'] 'horizontal' or 'vertical' Default: 'vertical' * */ $defaults = array( 'align' => 'vertical', 'value' => array(), 'default' => 0, 'disabled' => false, 'options' => array(), 'name' => '', ); $vars = array_merge($defaults, $vars); $class = "elgg-input-checkboxes elgg-{$vars['align']}"; if (isset($vars['class'])) { $class .= " {$vars['class']}"; unset($vars['class']); } $id = ''; if (isset($vars['id'])) { $id = "id=\"{$vars['id']}\""; unset($vars['id']); } if (is_array($vars['value'])) { $values = array_map('elgg_strtolower', $vars['value']); } else { $values = array(elgg_strtolower($vars['value'])); } $input_vars = $vars; $input_vars['default'] = false; if ($vars['name']) { $input_vars['name'] = "{$vars['name']}[]"; } unset($input_vars['align']); unset($input_vars['options']); if (count($vars['options']) > 0) { // include a default value so if nothing is checked 0 will be passed. if ($vars['name'] && $vars['default'] !== false) { echo ""; } echo "