You are here

function smarty_function_html_checkboxes_output in Quiz 6.5

Same name and namespace in other branches
  1. 6.6 includes/moodle/lib/smarty/plugins/function.html_checkboxes.php \smarty_function_html_checkboxes_output()
1 call to smarty_function_html_checkboxes_output()
smarty_function_html_checkboxes in includes/moodle/lib/smarty/plugins/function.html_checkboxes.php
Smarty {html_checkboxes} function plugin

File

includes/moodle/lib/smarty/plugins/function.html_checkboxes.php, line 126

Code

function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels) {
  $_output = '';
  if ($labels) {
    $_output .= '<label>';
  }
  $_output .= '<input type="checkbox" name="' . smarty_function_escape_special_chars($name) . '[]" value="' . smarty_function_escape_special_chars($value) . '"';
  if (in_array((string) $value, $selected)) {
    $_output .= ' checked="checked"';
  }
  $_output .= $extra . ' />' . $output;
  if ($labels) {
    $_output .= '</label>';
  }
  $_output .= $separator;
  return $_output;
}