MDL-24859 adding missing glossary ajax text formatting (patch by Jason Platts) + adding missing context param to formatting options
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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\">» <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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user