MDL-23204 fixed import/export format issues
This commit is contained in:
@@ -92,6 +92,7 @@ if ($xml = glossary_read_imported_file($result)) {
|
||||
$glossary->course = $course->id;
|
||||
$glossary->globalglossary = ($xmlglossary['GLOBALGLOSSARY'][0]['#']);
|
||||
$glossary->intro = ($xmlglossary['INTRO'][0]['#']);
|
||||
$glossary->introformat = isset($xmlglossary['INTROFORMAT'][0]['#']) ? $xmlglossary['INTROFORMAT'][0]['#'] : FORMAT_MOODLE;
|
||||
$glossary->showspecial = ($xmlglossary['SHOWSPECIAL'][0]['#']);
|
||||
$glossary->showalphabet = ($xmlglossary['SHOWALPHABET'][0]['#']);
|
||||
$glossary->showall = ($xmlglossary['SHOWALL'][0]['#']);
|
||||
@@ -213,14 +214,14 @@ if ($xml = glossary_read_imported_file($result)) {
|
||||
}
|
||||
} else {
|
||||
$permissiongranted = 0;
|
||||
}
|
||||
}
|
||||
if ($permissiongranted) {
|
||||
$newentry->glossaryid = $glossary->id;
|
||||
$newentry->sourceglossaryid = 0;
|
||||
$newentry->approved = 1;
|
||||
$newentry->userid = $USER->id;
|
||||
$newentry->teacherentry = 1;
|
||||
$newentry->format = $xmlentry['#']['FORMAT'][0]['#'];
|
||||
$newentry->definitionformat = $xmlentry['#']['FORMAT'][0]['#'];
|
||||
$newentry->timecreated = time();
|
||||
$newentry->timemodified = time();
|
||||
|
||||
|
||||
@@ -1932,6 +1932,7 @@ function glossary_generate_export_file($glossary, $hook = "", $hook = 0) {
|
||||
$co .= glossary_start_tag("INFO",1,true);
|
||||
$co .= glossary_full_tag("NAME",2,false,$glossary->name);
|
||||
$co .= glossary_full_tag("INTRO",2,false,$glossary->intro);
|
||||
$co .= glossary_full_tag("INTROFORMAT",2,false,$glossary->introformat);
|
||||
$co .= glossary_full_tag("ALLOWDUPLICATEDENTRIES",2,false,$glossary->allowduplicatedentries);
|
||||
$co .= glossary_full_tag("DISPLAYFORMAT",2,false,$glossary->displayformat);
|
||||
$co .= glossary_full_tag("SHOWSPECIAL",2,false,$glossary->showspecial);
|
||||
@@ -1973,7 +1974,7 @@ function glossary_generate_export_file($glossary, $hook = "", $hook = 0) {
|
||||
$co .= glossary_start_tag("ENTRY",3,true);
|
||||
$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);
|
||||
$co .= glossary_full_tag("FORMAT",4,false,$entry->definitionformat); // note: use old name for BC reasons
|
||||
$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);
|
||||
|
||||
Reference in New Issue
Block a user