MDL-83995 mod_glossary: support export/import of entry trusted text.

This commit is contained in:
Paul Holden
2025-01-08 13:44:19 +00:00
parent c58bc49a07
commit 60f37890fb
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -188,6 +188,11 @@ if ($xml = glossary_read_imported_file($result)) {
throw new \moodle_exception('errorparsingxml', 'glossary');
}
$newentry->definition = trusttext_strip($definition);
if (isset($xmlentry['#']['DEFINITIONTRUST'][0]['#'])) {
$newentry->definitiontrust = !empty($xmlentry['#']['DEFINITIONTRUST'][0]['#']) && trusttext_trusted($context);
}
if ( isset($xmlentry['#']['CASESENSITIVE'][0]['#']) ) {
$newentry->casesensitive = $xmlentry['#']['CASESENSITIVE'][0]['#'];
} else {
+1
View File
@@ -2363,6 +2363,7 @@ function glossary_generate_export_file($glossary, $ignored = "", $hook = 0) {
$co .= glossary_full_tag("CONCEPT",4,false,trim($entry->concept));
$co .= glossary_full_tag("DEFINITION",4,false,$entry->definition);
$co .= glossary_full_tag("FORMAT",4,false,$entry->definitionformat); // note: use old name for BC reasons
$co .= glossary_full_tag('DEFINITIONTRUST', 4, false, $entry->definitiontrust);
$co .= glossary_full_tag("USEDYNALINK",4,false,$entry->usedynalink);
$co .= glossary_full_tag("CASESENSITIVE",4,false,$entry->casesensitive);
$co .= glossary_full_tag("FULLMATCH",4,false,$entry->fullmatch);