From 822a10631986afdecac32ecc432e44753215cffb Mon Sep 17 00:00:00 2001
From: dhawes ";
+ echo ' ';
echo clean_text($text);
- echo "'.format_text(implode('', file($pathname)), FORMAT_MOODLE, $options, $courseid).'
';
- header("Content-length: ".strlen($output));
- header("Content-type: text/html");
+ $output = ''. format_text(implode('', file($pathname)), FORMAT_MOODLE, $options, $courseid) .'
';
+ header('Content-length: '. strlen($output));
+ header('Content-type: text/html');
echo $output;
} else { /// Just send it out raw
- header("Content-length: ".filesize($pathname));
- header("Content-type: $mimetype");
+ header('Content-length: '. filesize($pathname));
+ header('Content-type: '. $mimetype);
readfile($pathname);
}
}
} else {
- header("HTTP/1.0 404 not found");
- error(get_string("filenotfound", "error"), "$CFG->wwwroot/course/view.php?id=$courseid");
+ header('HTTP/1.0 404 not found');
+ error(get_string('filenotfound', 'error'), $CFG->wwwroot .'/course/view.php?id='. $courseid);
}
exit;
-?>
+?>
\ No newline at end of file
diff --git a/help.php b/help.php
index 49426df277..269dd103f7 100644
--- a/help.php
+++ b/help.php
@@ -1,50 +1,60 @@
-dirroot/lang/$lang/help/$file";
+ if ($module == 'moodle') {
+ $filepath = $CFG->dirroot .'/lang/'. $lang .'/help/'. $file;
} else {
- $filepath = "$CFG->dirroot/lang/$lang/help/$module/$file";
+ $filepath = $CFG->dirroot .'/lang/'. $lang .'/help/'. $module .'/'. $file;
}
- if (file_exists("$filepath")) {
+ if (file_exists($filepath)) {
$helpfound = true;
- include("$filepath"); // The actual helpfile
+ include($filepath); // The actual helpfile
- if ($module == "moodle" and ($file == "index.html" or $file == "mods.html")) {
+ if ($module == 'moodle' and ($file == 'index.html' or $file == 'mods.html')) {
// include file for each module
- if (!$modules = get_records("modules", "visible", 1)) {
- error("No modules found!!"); // Should never happen
+ if (!$modules = get_records('modules', 'visible', 1)) {
+ error('No modules found!!'); // Should never happen
}
foreach ($modules as $mod) {
- $strmodulename = get_string("modulename", "$mod->name");
+ $strmodulename = get_string('modulename', $mod->name);
$modulebyname[$strmodulename] = $mod;
}
ksort($modulebyname);
@@ -54,19 +64,19 @@
if (empty($lang)) {
continue;
}
- $filepath = "$CFG->dirroot/lang/$lang/help/$mod->name/$file";
+ $filepath = $CFG->dirroot .'/lang/'. $lang .'/help/'. $mod->name .'/'. $file;
- if (file_exists("$filepath")) {
+ if (file_exists($filepath)) {
echo '
';
- include("$filepath"); // The actual helpfile
+ include($filepath); // The actual helpfile
break;
}
}
}
}
- if ($module == "moodle" and ($file == "resource/types.html")) { // RESOURCES
- require_once("$CFG->dirroot/mod/resource/lib.php");
+ if ($module == 'moodle' and ($file == 'resource/types.html')) { // RESOURCES
+ require_once($CFG->dirroot .'/mod/resource/lib.php');
$typelist = resource_get_resource_types();
$typelist['label'] = get_string('resourcetypelabel', 'resource');
@@ -75,10 +85,10 @@
if (empty($lang)) {
continue;
}
- $filepath = "$CFG->dirroot/lang/$lang/help/resource/type/$type.html";
- if (file_exists("$filepath")) {
+ $filepath = $CFG->dirroot .'/lang/'. $lang .'/help/resource/type/'. $type .'.html';
+ if (file_exists($filepath)) {
echo '
';
- include("$filepath"); // The actual helpfile
+ include($filepath); // The actual helpfile
break;
}
}
@@ -88,9 +98,9 @@
}
}
} else {
- echo "