MDL-24859 adding missing glossary ajax text formatting (patch by Jason Platts) + adding missing context param to formatting options

This commit is contained in:
Petr Skoda
2010-10-26 15:05:04 +00:00
parent b52d96018b
commit ea7a9614e7
2 changed files with 15 additions and 4 deletions
+5 -4
View File
@@ -845,6 +845,7 @@ function glossary_print_entry_default ($entry, $glossary, $cm) {
$options = new stdClass();
$options->para = false;
$options->trusted = $entry->definitiontrust;
$options->context = $context;
$definition = format_text($definition, $entry->definitionformat, $options);
echo ($definition);
echo '<br /><br />';
@@ -895,13 +896,13 @@ function glossary_print_entry_definition($entry, $glossary, $cm) {
}
}
$options = new stdClass();
$options->para = false;
$options->trusted = $entry->definitiontrust;
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
$definition = file_rewrite_pluginfile_urls($definition, 'pluginfile.php', $context->id, 'mod_glossary', 'entry', $entry->id);
$options = new stdClass();
$options->para = false;
$options->trusted = $entry->definitiontrust;
$options->context = $context;
$text = format_text($definition, $entry->definitionformat, $options);
// Stop excluding concepts from autolinking
+10
View File
@@ -59,6 +59,16 @@ if ($entries) {
continue;
}
}
$context = get_context_instance(CONTEXT_MODULE, $entry->cmid);
$definition = file_rewrite_pluginfile_urls($entry->definition, 'pluginfile.php', $context->id, 'mod_glossary', 'entry', $entry->id);
$options = new stdClass();
$options->para = false;
$options->trusted = $entry->definitiontrust;
$options->context = $context;
$entries[$key]->definition = format_text($definition, $entry->definitionformat, $options);
$entries[$key]->footer = "<p style=\"text-align:right\">&raquo;&nbsp;<a href=\"$CFG->wwwroot/mod/glossary/view.php?g=$entry->glossaryid\">".format_string($entry->glossaryname,true)."</a></p>";
add_to_log($entry->courseid, 'glossary', 'view entry', "showentry.php?eid=$entry->id", $entry->id, $entry->cmid);
}