fixed trailing whitespace in last commit :-(; merged from MOODLE_16_STABLE

This commit is contained in:
skodak 2006-08-22 22:12:17 +00:00
parent 860b55463f
commit 868ca14f1f

View file

@ -30,20 +30,20 @@ $helpfound = false;
if (!empty($file)) { if (!empty($file)) {
// The help to display is from a help file. // The help to display is from a help file.
// Get the list of parent languages. // Get the list of parent languages.
if (empty($forcelang)) { if (empty($forcelang)) {
$langs = array(current_language(), get_string('parentlanguage'), 'en_utf8'); // Fallback $langs = array(current_language(), get_string('parentlanguage'), 'en_utf8'); // Fallback
} else { } else {
$langs = array($forcelang); $langs = array($forcelang);
} }
// Work through the possible languages, starting with the most specific. // Work through the possible languages, starting with the most specific.
foreach ($langs as $lang) { foreach ($langs as $lang) {
if (empty($lang)) { if (empty($lang)) {
continue; continue;
} }
// Work out which directory the help files live in. // Work out which directory the help files live in.
if ($lang == 'en_utf8') { if ($lang == 'en_utf8') {
$helpdir = $CFG->dirroot; $helpdir = $CFG->dirroot;
@ -51,13 +51,13 @@ if (!empty($file)) {
$helpdir = $CFG->dataroot; $helpdir = $CFG->dataroot;
} }
$helpdir .= "/lang/$lang/help"; $helpdir .= "/lang/$lang/help";
// Then which file in there we should be serving. // Then which file in there we should be serving.
if ($module == 'moodle') { if ($module == 'moodle') {
$filepath = "$helpdir/$file"; $filepath = "$helpdir/$file";
} else { } else {
$filepath = "$helpdir/$module/$file"; $filepath = "$helpdir/$module/$file";
// If that does not exist, try a fallback into the module code folder. // If that does not exist, try a fallback into the module code folder.
if (!file_exists($filepath)) { if (!file_exists($filepath)) {
$filepath = "$CFG->dirroot/mod/$module/lang/$lang/help/$module/$file"; $filepath = "$CFG->dirroot/mod/$module/lang/$lang/help/$module/$file";
@ -69,7 +69,7 @@ if (!empty($file)) {
$helpfound = true; $helpfound = true;
@include($filepath); // The actual helpfile @include($filepath); // The actual helpfile
// Now, we process some special cases. // Now, we process some special cases.
if ($module == 'moodle' and ($file == 'index.html' or $file == 'mods.html')) { if ($module == 'moodle' and ($file == 'index.html' or $file == 'mods.html')) {
include_help_for_each_module($file, $langs, $helpdir); include_help_for_each_module($file, $langs, $helpdir);
} }
@ -178,7 +178,7 @@ function include_help_for_each_assignment_type() {
require_once($CFG->dirroot .'/mod/assignment/lib.php'); require_once($CFG->dirroot .'/mod/assignment/lib.php');
$typelist = assignment_types(); $typelist = assignment_types();
foreach ($typelist as $type => $name) { foreach ($typelist as $type => $name) {
echo '<p><b>'.$name.'</b></p>'; echo '<p><b>'.$name.'</b></p>';
echo get_string('help'.$type, 'assignment'); echo get_string('help'.$type, 'assignment');