mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-14617 removed old legacy function emulations
This commit is contained in:
parent
a648b6a8f1
commit
7a3fafb6b4
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user