You are here

function get_string_from_file in Quiz 6.6

Same name and namespace in other branches
  1. 6.5 includes/moodle_support.php \get_string_from_file()
1 call to get_string_from_file()
get_string in includes/moodle_support.php
Moodle localized string function from moodle/lib/moodlelib.php reimplemented hackedly for within the Drupal Quiz module e.g. get_string("wronggrade", "quiz", $nLineCounter).' '.get_string("fractionsnomax",…

File

includes/moodle_support.php, line 120

Code

function get_string_from_file($identifier, $langfile, $destination) {
  static $strings;

  // Keep the strings cached in memory.
  if (empty($strings[$langfile])) {
    $string = array();
    include $langfile;
    $strings[$langfile] = $string;
  }
  else {
    $string =& $strings[$langfile];
  }
  if (!isset($string[$identifier])) {
    return false;
  }
  return $destination . '= sprintf("' . $string[$identifier] . '");';
}