mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-12235 deprecated document_file function. Not found anywhere in core.
This commit is contained in:
parent
85edee26f3
commit
4258003130
2 changed files with 39 additions and 38 deletions
|
@ -1577,4 +1577,43 @@ function sql_primary_role_subselect() {
|
||||||
) ';
|
) ';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Can include a given document file (depends on second
|
||||||
|
* parameter) or just return info about it.
|
||||||
|
*
|
||||||
|
* @uses $CFG
|
||||||
|
* @param string $file ?
|
||||||
|
* @param bool $include ?
|
||||||
|
* @return ?
|
||||||
|
* @todo Finish documenting this function
|
||||||
|
*/
|
||||||
|
function document_file($file, $include=true) {
|
||||||
|
global $CFG;
|
||||||
|
|
||||||
|
debugging('The document_file() function is deprecated.', DEBUG_DEVELOPER);
|
||||||
|
|
||||||
|
$file = clean_filename($file);
|
||||||
|
|
||||||
|
if (empty($file)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$langs = array(current_language(), get_string('parentlanguage'), 'en');
|
||||||
|
|
||||||
|
foreach ($langs as $lang) {
|
||||||
|
$info = new object();
|
||||||
|
$info->filepath = $CFG->dirroot .'/lang/'. $lang .'/docs/'. $file;
|
||||||
|
$info->urlpath = $CFG->wwwroot .'/lang/'. $lang .'/docs/'. $file;
|
||||||
|
|
||||||
|
if (file_exists($info->filepath)) {
|
||||||
|
if ($include) {
|
||||||
|
include($info->filepath);
|
||||||
|
}
|
||||||
|
return $info;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -5693,44 +5693,6 @@ function get_list_of_currencies() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Can include a given document file (depends on second
|
|
||||||
* parameter) or just return info about it.
|
|
||||||
*
|
|
||||||
* @uses $CFG
|
|
||||||
* @param string $file ?
|
|
||||||
* @param bool $include ?
|
|
||||||
* @return ?
|
|
||||||
* @todo Finish documenting this function
|
|
||||||
*/
|
|
||||||
function document_file($file, $include=true) {
|
|
||||||
global $CFG;
|
|
||||||
|
|
||||||
$file = clean_filename($file);
|
|
||||||
|
|
||||||
if (empty($file)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$langs = array(current_language(), get_string('parentlanguage'), 'en');
|
|
||||||
|
|
||||||
foreach ($langs as $lang) {
|
|
||||||
$info = new object();
|
|
||||||
$info->filepath = $CFG->dirroot .'/lang/'. $lang .'/docs/'. $file;
|
|
||||||
$info->urlpath = $CFG->wwwroot .'/lang/'. $lang .'/docs/'. $file;
|
|
||||||
|
|
||||||
if (file_exists($info->filepath)) {
|
|
||||||
if ($include) {
|
|
||||||
include($info->filepath);
|
|
||||||
}
|
|
||||||
return $info;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// ENCRYPTION ////////////////////////////////////////////////
|
/// ENCRYPTION ////////////////////////////////////////////////
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue