From: skodak Date: Thu, 1 May 2008 22:03:15 +0000 (+0000) Subject: MDL-14617 removed old legacy function emulations X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=7a3fafb6b4829d7ee6bf8ba706fe2cbd59b4f6a8;p=moodle.git MDL-14617 removed old legacy function emulations --- diff --git a/mod/hotpot/lib.php b/mod/hotpot/lib.php index fcea20a8d2..a4b2a63c42 100644 --- a/mod/hotpot/lib.php +++ b/mod/hotpot/lib.php @@ -2400,89 +2400,6 @@ function hotpot_get_post_actions() { return array('attempt','review','submit'); } -if (!function_exists('file_get_contents')) { - // add this function for php version<4.3 - function file_get_contents($filepath) { - $contents = file($filepath); - if (is_array($contents)) { - $contents = implode('', $contents); - } - return $contents; - } -} -if (!function_exists('html_entity_decode')) { - // add this function for php version<4.3 - function html_entity_decode($str) { - $t = get_html_translation_table(HTML_ENTITIES); - $t = array_flip($t); - return strtr($str, $t); - } - -} - -// required for Moodle 1.x -if (!isset($CFG->pixpath)) { - $CFG->pixpath = "$CFG->wwwroot/pix"; -} - -if (!function_exists('fullname')) { - // add this function for Moodle 1.x - function fullname($user) { - return "$user->firstname $user->lastname"; - } -} -if (!function_exists('get_user_preferences')) { - // add this function for Moodle 1.x - function get_user_preferences($name=NULL, $default=NULL, $userid=NULL) { - return $default; - } -} -if (!function_exists('set_user_preference')) { - // add this function for Moodle 1.x - function set_user_preference($name, $value, $otheruser=NULL) { - return false; - } -} -if (!function_exists('get_coursemodule_from_id')) { - // add this function for Moodle < 1.5.4 - function get_coursemodule_from_id($modulename, $cmid, $courseid=0) { - global $CFG; - return get_record_sql(" - SELECT - cm.*, m.name, md.name as modname - FROM - {$CFG->prefix}course_modules cm, - {$CFG->prefix}modules md, - {$CFG->prefix}$modulename m - WHERE - ".($courseid ? "cm.course = '$courseid' AND " : '')." - cm.id = '$cmid' AND - cm.instance = m.id AND - md.name = '$modulename' AND - md.id = cm.module - "); - } -} -if (!function_exists('get_coursemodule_from_instance')) { - // add this function for Moodle < 1.5.4 - function get_coursemodule_from_instance($modulename, $instance, $courseid=0) { - global $CFG; - return get_record_sql(" - SELECT - cm.*, m.name, md.name as modname - FROM - {$CFG->prefix}course_modules cm, - {$CFG->prefix}modules md, - {$CFG->prefix}$modulename m - WHERE - ".($courseid ? "cm.course = '$courseid' AND" : '')." - cm.instance = m.id AND - md.name = '$modulename' AND - md.id = cm.module AND - m.id = '$instance' - "); - } -} function hotpot_utf8_to_html_entity($char) { // http://www.zend.com/codex.php?id=835&single=1