You are here

function Config_File::get_var_names in Quiz 6.6

Same name and namespace in other branches
  1. 6.5 includes/moodle/lib/smarty/Config_File.class.php \Config_File::get_var_names()

Get all global or section variable names.

Parameters

string $file_name config file to get info for:

string $section_name (optional) section to get info for:

Return value

array an array of variables names from the specified file/section

File

includes/moodle/lib/smarty/Config_File.class.php, line 190

Class

Config_File
Config file reading class @package Smarty

Code

function get_var_names($file_name, $section = NULL) {
  if (empty($file_name)) {
    $this
      ->_trigger_error_msg('Empty config file name');
    return;
  }
  else {
    if (!isset($this->_config_data[$file_name])) {
      $this
        ->_trigger_error_msg("Unknown config file '{$file_name}'");
      return;
    }
  }
  if (empty($section)) {
    return array_keys($this->_config_data[$file_name]["vars"]);
  }
  else {
    return array_keys($this->_config_data[$file_name]["sections"][$section]["vars"]);
  }
}