while (!$helpfound && (list($locationprefix, $locationsuffix) = each($locations))) { $filepath = $locationprefix . $lang . '/help/' . $locationsuffix; // Now, try to include the help text from this file, if we can. if (file_exists_and_readable($filepath)) { $helpfound = true; @(include $filepath); // The actual helpfile // Now, we process some special cases. $helpdir = $locationprefix . $lang . '/help'; if ($module == 'moodle' and ($file == 'index.html' or $file == 'mods.html')) { include_help_for_each_module($file, $langs, $helpdir); } // The remaining horrible hardcoded special cases should be delegated to modules somehow. if ($module == 'moodle' and $file == 'resource/types.html') { // RESOURCES include_help_for_each_resource($file, $langs, $helpdir); } if ($module == 'moodle' and $file == 'assignment/types.html') { // ASSIGNMENTS include_help_for_each_assignment_type(); } } } reset($locations); } } else { // The help to display was given as an argument to this function. echo '<p>' . s($text) . '</p>'; // This param was already cleaned $helpfound = true; }
list($filepath, $foundlang) = string_manager::instance()->find_help_file($file, $module, $forcelang, $skiplocal); if ($filepath) { $helpfound = true; @(include $filepath); // The actual helpfile // Now, we process some special cases. if ($module == 'moodle' and ($file == 'index.html' or $file == 'mods.html')) { include_help_for_each_module($file, $forcelang, $skiplocal); } if ($module == 'question' && $file == 'types.html') { include_help_for_each_qtype(); } // The remaining horrible hardcoded special cases should be delegated to modules somehow. if ($module == 'moodle' && $file == 'resource/types.html') { // RESOURCES include_help_for_each_resource($forcelang, $skiplocal); } if ($module == 'moodle' && $file == 'assignment/types.html') { // ASSIGNMENTS include_help_for_each_assignment_type($forcelang, $skiplocal); } } } else { // The help to display was given as an argument to this function. echo '<p>' . s($text) . '</p>'; // This param was already cleaned $helpfound = true; } // Finish buffer $output = ob_get_contents(); ob_end_clean();