You are here

function smarty_function_html_options_optoutput in Quiz 6.5

Same name and namespace in other branches
  1. 6.6 includes/moodle/lib/smarty/plugins/function.html_options.php \smarty_function_html_options_optoutput()
2 calls to smarty_function_html_options_optoutput()
smarty_function_html_options in includes/moodle/lib/smarty/plugins/function.html_options.php
Smarty {html_options} function plugin
smarty_function_html_options_optgroup in includes/moodle/lib/smarty/plugins/function.html_options.php

File

includes/moodle/lib/smarty/plugins/function.html_options.php, line 97

Code

function smarty_function_html_options_optoutput($key, $value, $selected) {
  if (!is_array($value)) {
    $_html_result = '<option label="' . smarty_function_escape_special_chars($value) . '" value="' . smarty_function_escape_special_chars($key) . '"';
    if (in_array((string) $key, $selected)) {
      $_html_result .= ' selected="selected"';
    }
    $_html_result .= '>' . smarty_function_escape_special_chars($value) . '</option>' . "\n";
  }
  else {
    $_html_result = smarty_function_html_options_optgroup($key, $value, $selected);
  }
  return $_html_result;
}