$string['entrysaved'] = 'This entry has been saved';
$string['entryupdated'] = 'This entry has been updated';
$string['entryusedynalink'] = 'This entry should be automatically linked';
+$string['errorparsingxml'] = 'Errors occurred while parsing the file. Make sure it is valid XML syntax.';
$string['explainaddentry'] = 'Add a new entry to the current glossary.<br />Concept and definition are mandatory fields.';
$string['explainall'] = 'Shows ALL entries on one page';
$string['explainalphabet'] = 'Browse the glossary using this index';
$string['importedcategories'] = 'Imported categories';
$string['importedentries'] = 'Imported entries';
$string['importentries'] = 'Import entries';
+$string['importentriesfromxml'] = 'Import entries from XML file';
$string['isglobal'] = 'Is this glossary global?';
$string['linkcategory'] = 'Automatically link this category';
$string['linking'] = 'Auto-linking';
xml_parser_free($parser);
$i = 0;
+
+ if (empty($vals)) {
+ // XML file is invalid or empty, return false
+ return false;
+ }
$tagname = $vals[$i]['tag'];
if ( isset ($vals[$i]['attributes'] ) )
}
-?>
\ No newline at end of file
+?>
$strsearchconcept = get_string("searchconcept", "glossary");
$strsearchindefinition = get_string("searchindefinition", "glossary");
$strsearch = get_string("search");
- $strimportentries = get_string('importentries', 'glossary');
+ $strimportentries = get_string('importentriesfromxml', 'glossary');
print_header_simple(format_string($glossary->name), "",
"<a href=\"index.php?id=$course->id\">$strglossaries</a> -> " .
}
print_box_end();
} else {
- notify("Error while trying to read the file.");
+ notice(get_string('errorparsingxml', 'glossary'));
}
/// Finish the page