From: willcast Date: Tue, 4 Nov 2003 03:54:01 +0000 (+0000) Subject: - Basic export/import functionality.. Does not export nor import the attached files. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=748b1932aa168714bc53e9ac037b64126a751e8a;p=moodle.git - Basic export/import functionality.. Does not export nor import the attached files. --- diff --git a/lang/en/glossary.php b/lang/en/glossary.php index f72ed0ad10..6a1836bec2 100644 --- a/lang/en/glossary.php +++ b/lang/en/glossary.php @@ -17,6 +17,10 @@ $string['attachment'] = "Attachment"; $string['back'] = "Back"; $string['casesensitive'] = "This entry is case sensitive"; $string['categories'] = "Categories"; +$string['importedcategories'] = "Imported categories"; +$string['cantinsertcat'] = "Can't insert category'"; +$string['cantinsertrec'] = "Can't insert record'"; +$string['cantinsertrel'] = "Can't insert relation category-entry'"; $string['categoryview'] = "Browse by category"; $string['category'] = "Category"; $string['categorydeleted'] = "Category deleted"; @@ -35,6 +39,7 @@ $string['cnfcasesensitive'] = "Define if an entry, when linked, is case sensitiv $string['cnffullmatch'] = "Define if an entry, when linked, should match the case in the target text by default"; $string['concept'] = "Concept"; $string['concepts'] = "Concepts"; +$string['currentglossary'] = "Current glosssary"; $string['dateview'] = "Browse by date"; $string['deletingcomment'] = "Deleting comment"; $string['defaultapproval'] = "Default approval status"; @@ -43,6 +48,7 @@ $string['definitions'] = "Definitions"; $string['deleteentry'] = "Delete entry"; $string['deletingnoneemptycategory'] = "Deleting this category will not delete the entries it contains - they will be marked as uncategorised."; $string['descending'] = "(descending)"; +$string['destination'] = "Destination"; $string['displayformat'] = "Display format"; $string['displayformatdefault'] = "Simple, dictionary style"; $string['displayformatcontinuous'] = "Continuous without author"; @@ -50,11 +56,13 @@ $string['displayformat2'] = "Full with author"; $string['displayformat3'] = "Encyclopedia"; $string['displayformat4'] = "FAQ"; $string['displayformat5'] = "Full without author"; +$string['duplicateentry'] = "Duplicate entry"; $string['editcategories'] = "Edit categories"; $string['editalias'] = "Edit alias"; $string['editentry'] = "Edit entry"; $string['editingcomment'] = "Editing comment"; $string['entries'] = "Entries"; +$string['importedentries'] = "Imported entries"; $string['entrieswithoutcategory'] = "Entries without category"; $string['entry'] = "Entry"; $string['entryalreadyexist'] = "Entry already exists"; @@ -63,30 +71,40 @@ $string['entrydeleted'] = "Entry deleted"; $string['entryishidden'] = "(this entry is currently hidden)"; $string['entryusedynalink'] = "This entry should be automatically linked"; $string['entryexported'] = "Entry succesfully exported"; +$string['rejectionrpt'] = "Rejection Report"; $string['explainspecial'] = "Shows entries that do not begin with a letter"; $string['explainalphabet'] = "Browse the glossary using this index"; $string['explainall'] = "Shows ALL entries on one page"; $string['explainaddentry'] = "Add a new entry to the current glossary.
Concept and definition are mandatory fields."; +$string['explainimport'] = "You must specify the file to import and define the criteria of the process.

Submit your request and review the results."; +$string['explainexport'] = "A file has been generated.
Download it and keep it safe. You can import it anytime you wish in this or other course."; $string['exportedentry'] = "Exported entry"; +$string['exportedfile'] = "Exported file"; $string['exportglossary'] = "Export glossary"; $string['exporttomainglossary'] = "Export to main glossary"; +$string['filetoimport'] = "File to import"; $string['fillfields'] = "Concept and definition are mandatory fields."; $string['fullmatch'] = "Match whole words only
(when automatically linked)"; $string['glossarytype'] = "Glossary Type"; $string['glosssaryexported'] = "Glossary exported."; +$string['importcategories'] = "Import categories"; $string['isglobal'] = "Is this glossary global?"; $string['mainglossary'] = "Main glossary"; $string['modulename'] = "Glossary"; $string['modulenameplural'] = "Glossaries"; $string['maxtimehaspassed'] = "Sorry, but the maximum time for editing this comment (\$a) has passed!"; +$string['newglossary'] = "New glossary"; $string['newglossaryentries'] = "New glossary entries:"; +$string['newglossarycreated'] = "New glossary created."; $string['notcategorised'] = "Not categorised"; $string['nocomment'] = "No comment found"; +$string['noconceptfound'] = "No concept or definition found."; $string['nocomments'] = "(No comments found on this entry)"; $string['noentries'] = "No entries found in this section"; $string['noentry'] = "No entry found."; $string['printerfriendly'] = "Printer-friendly version"; $string['question'] = "Question"; +$string['rejectedentries'] = "Rejected entries"; $string['searchindefinition'] = "Search full text"; $string['secondaryglossary'] = "Secondary glossary"; $string['showspecial'] = "Show 'Special' link"; @@ -98,6 +116,7 @@ $string['sortbycreation'] = "By creation date"; $string['sortbylastupdate'] = "By last update"; $string['standardview'] = "Browse by alphabet"; $string['studentcanpost'] = "Students can add entries"; +$string['totalentries'] = "Total entries"; $string['usedynalink'] = "Automatically link glossary entries"; $string['warningstudentcapost'] = "(Applies only if the glossary is not the main one)"; $string['waitingapproval'] = "Waiting approval"; diff --git a/mod/glossary/export.php b/mod/glossary/export.php index 84d8ae9533..06fe42c880 100644 --- a/mod/glossary/export.php +++ b/mod/glossary/export.php @@ -2,11 +2,12 @@ require_once("../../config.php"); require_once("lib.php"); + global $CFG, $USER; require_variable($id); // Course Module ID - optional_variable($tab,GLOSSARY_STANDARD_VIEW); optional_variable($l,"ALL"); + optional_variable($cat,0); if (! $cm = get_record("course_modules", "id", $id)) { error("Course Module ID was incorrect"); @@ -25,7 +26,42 @@ error("You must be a teacher to use this page."); } - glossary_generate_export_file($glossary); - redirect("view.php?id=$cm->id&tab=$tab&l=$l",get_string("glosssaryexported","glossary"),1); - die; + $strglossaries = get_string("modulenameplural", "glossary"); + $strglossary = get_string("modulename", "glossary"); + $strallcategories = get_string("allcategories", "glossary"); + $straddentry = get_string("addentry", "glossary"); + $strnoentries = get_string("noentries", "glossary"); + $strsearchconcept = get_string("searchconcept", "glossary"); + $strsearchindefinition = get_string("searchindefinition", "glossary"); + $strsearch = get_string("search"); + + print_header(strip_tags("$course->shortname: $glossary->name"), "$course->fullname", + "$navigation id>$strglossaries -> $glossary->name", + "", "", true, update_module_button($cm->id, $course->id, $strglossary), + navmenu($course, $cm)); + + echo '

' . stripslashes_safe($glossary->name); + echo '

'; + +/// Info box + + if ( $glossary->intro ) { + print_simple_box_start('center','70%'); + echo format_text($glossary->intro); + print_simple_box_end(); + } + +/// Tabbed browsing sections + $tab = GLOSSARY_EXPORT_VIEW; + include("tabs.html"); + + glossary_generate_export_file($glossary,$l,$cat); + print_string("glosssaryexported","glossary"); + + if ($CFG->slasharguments) { + $ffurl = "../../file.php/$course->id/glossary/" . clean_filename($glossary->name) ."/glossary.xml"; + } else { + $ffurl = "../../file.php?file=/$course->id/glossary/" . clean_filename($glossary->name) ."/glossary.xml"; + } + echo '

' . get_string("exportedfile","glossary") . '

' ?> \ No newline at end of file diff --git a/mod/glossary/import.html b/mod/glossary/import.html new file mode 100644 index 0000000000..157422ee1a --- /dev/null +++ b/mod/glossary/import.html @@ -0,0 +1,51 @@ +

+ + + + + + + + + + + +

:

+ +
+ +
+ + + + + + + +
+

:

+

:

+
+ + + + + +
+

">

">
+
+ + + + +
\ No newline at end of file diff --git a/mod/glossary/import.php b/mod/glossary/import.php new file mode 100644 index 0000000000..58aeb26fcd --- /dev/null +++ b/mod/glossary/import.php @@ -0,0 +1,304 @@ +course)) { + error("Course is misconfigured"); + } + + if (! $glossary = get_record("glossary", "id", $cm->instance)) { + error("Course module is incorrect"); + } + + require_login($course->id); + if (!isteacher($course->id)) { + error("You must be a teacher to use this page."); + } + + if ($course->category) { + $navigation = "id\">$course->shortname ->"; + } + + if ($dest != 'new' and $dest != 'current') { + $dest = 'current'; + } + $strglossaries = get_string("modulenameplural", "glossary"); + $strglossary = get_string("modulename", "glossary"); + $strallcategories = get_string("allcategories", "glossary"); + $straddentry = get_string("addentry", "glossary"); + $strnoentries = get_string("noentries", "glossary"); + $strsearchconcept = get_string("searchconcept", "glossary"); + $strsearchindefinition = get_string("searchindefinition", "glossary"); + $strsearch = get_string("search"); + + print_header(strip_tags("$course->shortname: $glossary->name"), "$course->fullname", + "$navigation id>$strglossaries -> $glossary->name", + "", "", true, update_module_button($cm->id, $course->id, $strglossary), + navmenu($course, $cm)); + + echo '

' . stripslashes_safe($glossary->name); + echo '

'; + +/// Info box + + if ( $glossary->intro ) { + print_simple_box_start('center','70%'); + echo format_text($glossary->intro); + print_simple_box_end(); + } + +/// Tabbed browsing sections + $tab = GLOSSARY_IMPORT_VIEW; + include("tabs.html"); + + if ( !$step ) { + include("import.html"); + + glossary_print_tabbed_table_end(); + print_footer($course); + exit; + } + + $form = data_submitted(); + $file = $_FILES["file"]; +// if ($xml = glossary_read_imported_file("C:\\download\\moodle\\moodle\\cursos\\10\\glossary\\Testing_Glossary\\glossary.xml") ) { + if ($xml = glossary_read_imported_file($file['tmp_name']) ) { + + $importedentries = 0; + $importedcats = 0; + $entriesrejected = 0; + $rejections = ''; + if ($dest == 'new') { + // If the user chose to create a new glossary + $xmlglossary = $xml['GLOSSARY']['#']['INFO'][0]['#']; + + if ( $xmlglossary['NAME'][0]['#'] ) { + unset($glossary); + $glossary->name = $xmlglossary['NAME'][0]['#']; + $glossary->course = $course->id; + $glossary->globalglossary = $xmlglossary['GLOBALGLOSSARY'][0]['#']; + $glossary->intro = $xmlglossary['INTRO'][0]['#']; + $glossary->showspecial = $xmlglossary['SHOWSPECIAL'][0]['#']; + $glossary->showalphabet = $xmlglossary['SHOWALPHABET'][0]['#']; + $glossary->showall = $xmlglossary['SHOWALL'][0]['#']; + $glossary->timecreated = time(); + $glossary->timemodified = time(); + + // Setting the default values if no values were passed + if ( isset($xmlglossary['STUDENTCANPOST'][0]['#']) ) { + $glossary->studentcanpost = $xmlglossary['STUDENTCANPOST'][0]['#']; + } else { + $glossary->studentcanpost = $CFG->cnfstudentcanpost; + } + if ( isset($xmlglossary['ALLOWDUPLICATEDENTRIES'][0]['#']) ) { + $glossary->allowduplicatedentries = $xmlglossary['ALLOWDUPLICATEDENTRIES'][0]['#']; + } else { + $glossary->allowduplicatedentries = $CFG->cnfallowdupentries; + } + if ( isset($xmlglossary['ALLOWCOMMENTS'][0]['#']) ) { + $glossary->allowcomments = $xmlglossary['ALLOWCOMMENTS'][0]['#']; + } else { + $glossary->allowcomments = $CFG->cnfallowcomments; + } + if ( isset($xmlglossary['USEDYNALINK'][0]['#']) ) { + $glossary->usedynalink = $xmlglossary['USEDYNALINK'][0]['#']; + } else { + $glossary->usedynalink = $CFG->cnflinkglossaries; + } + if ( isset($xmlglossary['DEFAULTAPPROVAL'][0]['#']) ) { + $glossary->defaultapproval = $xmlglossary['DEFAULTAPPROVAL'][0]['#']; + } else { + $glossary->defaultapproval = $CFG->cnfapprovalstatus; + } + + // Include new glossary and return the new ID + if ( !$glossary->id = glossary_add_instance($glossary) ) { + notify("Error while trying to create the new glossary."); + glossary_print_tabbed_table_end(); + print_footer($course); + exit; + } else { + print_simple_box(get_string("newglossarycreated","glossary"),"center","70%"); + echo '

'; + } + } else { + notify("Error while trying to create the new glossary."); + glossary_print_tabbed_table_end(); + print_footer($course); + exit; + } + } + + $xmlentries = $xml['GLOSSARY']['#']['INFO'][0]['#']['ENTRIES'][0]['#']['ENTRY']; + for($i = 0; $i < sizeof($xmlentries); $i++) { + // Inserting the entries + $xmlentry = $xmlentries[$i]; + + unset($newentry); + $newentry->concept = $xmlentry['#']['CONCEPT'][0]['#']; + $newentry->definition = $xmlentry['#']['DEFINITION'][0]['#']; + + $permissiongranted = 1; + if ( $newentry->concept and $newentry->definition ) { + if ( !$glossary->allowduplicatedentries ) { + // checking if the entry is valid (checking if it is duplicated when should not be) + if ( $glossary->casesensitive ) { + $dupentry = get_record("glossary_entries","concept",$newentry->concept,"glossaryid",$glossary->id); + } else { + $dupentry = get_record("glossary_entries","ucase(concept)",strtoupper($newentry->concept),"glossaryid",$glossary->id); + } + if ($dupentry) { + $permissiongranted = 0; + } + } + } else { + $permissiongranted = 0; + } + if ($permissiongranted) { + $newentry->glossaryid = $glossary->id; + $newentry->sourceglossaryid = 0; + $newentry->approved = 1; + $newentry->userid = $USER->id; + $newentry->format = $xmlentry['#']['FORMAT'][0]['#']; + $newentry->timecreated = time(); + $newentry->timemodified = time(); + $newentry->teacherentry = $xmlentry['#']['TEACHERENTRY'][0]['#']; + + // Setting the default values if no values were passed + if ( isset($xmlentry['#']['USEDYNALINK'][0]['#']) ) { + $newentry->usedynalink = $xmlentry['#']['USEDYNALINK'][0]['#']; + } else { + $newentry->usedynalink = $CFG->cnfusedynalink; + } + if ( isset($xmlentry['#']['CASESENSITIVE'][0]['#']) ) { + $newentry->casesensitive = $xmlentry['#']['CASESENSITIVE'][0]['#']; + } else { + $newentry->casesensitive = $CFG->cnfcasesensitive; + } + if ( isset($xmlentry['#']['FULLMATCH'][0]['#']) ) { + $newentry->fullmatch = $xmlentry['#']['FULLMATCH'][0]['#']; + } else { + $newentry->fullmatch = $CFG->cnffullmatch; + } + + if ( $newentry->id = insert_record("glossary_entries",$newentry) ) { + $importedentries++; + if ( $catsincl ) { + // If the categories must be imported... + $xmlcats = $xmlentry['#']['CATEGORIES'][0]['#']['CATEGORY']; + for($k = 0; $k < sizeof($xmlcats); $k++) { + $xmlcat = $xmlcats[$k]; + unset($newcat); + + $newcat->name = $xmlcat['#']['NAME'][0]['#']; + if ( !$category = get_record("glossary_categories","glossaryid",$glossary->id,"name",$newcat->name) ) { + // Create the category if it does not exist + unset($category); + $category->name = $newcat->name; + $category->glossaryid = $glossary->id; + if ( !$category->id = insert_record("glossary_categories",$category)) { + // add to exception report (can't insert category) + $rejections .= " " . get_string("category","glossary") . ":$newcat->name" . + "" . get_string("cantinsertcat","glossary"). ""; + } else { + $importedcats++; + } + } + if ( $category ) { + // inserting the new relation + unset($entrycat); + $entrycat->entryid = $newentry->id; + $entrycat->categoryid = $category->id; + if ( !insert_record("glossary_entries_categories",$entrycat) ) { + // add to exception report (can't insert relation) + $rejections .= " " . get_string("category","glossary") . ":$newcat->name" . + "" . get_string("cantinsertrel","glossary"). ""; + } + } + } + } + } else { + $entriesrejected++; + // add to exception report (can't insert new record) + $rejections .= "$newentry->concept" . + "" . get_string("cantinsertrec","glossary"). ""; + } + } else { + $entriesrejected++; + if ( $newentry->concept and $newentry->definition ) { + // add to exception report (duplicated entry)) + $rejections .= "$newentry->concept" . + "" . get_string("duplicateentry","glossary"). ""; + } else { + // add to exception report (no concept or definition found)) + $rejections .= "---" . + "" . get_string("noconceptfound","glossary"). ""; + } + } + } + // processed entries + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + if ( $catsincl ) { + echo ''; + echo ''; + echo ''; + echo ''; + } + echo '
'; + echo get_string("totalentries","glossary"); + echo ':'; + echo $importedentries + $entriesrejected; + echo '
'; + echo get_string("importedentries","glossary"); + echo ':'; + echo $importedentries; + if ( $entriesrejected ) { + echo ' (' . get_string("rejectedentries","glossary") . ": $entriesrejected)"; + } + echo '
'; + echo get_string("importedcategories","glossary"); + echo ':'; + echo $importedcats; + echo '


'; + + // rejected entries + if ($rejections) { + echo '
'; + echo ''; + echo $rejections; + echo '
' . get_string("rejectionrpt","glossary") . '


'; + } + } else { + notify("Error while trying to read the file."); + } + + glossary_print_tabbed_table_end(); + +/// Finish the page + print_footer($course); + +?> \ No newline at end of file diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index f807b501ee..0374145d18 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -837,6 +837,14 @@ function glossary_print_addentry_menu($cm, $glossary, $l, $sortkey, $sortorder = echo '
' . get_string("explainaddentry","glossary") . '

'; } +function glossary_print_import_menu($cm, $glossary, $l, $sortkey, $sortorder = "", $tab=GLOSSARY_STANDARD_VIEW) { + echo '

' . get_string("explainimport","glossary") . '

'; +} + +function glossary_print_export_menu($cm, $glossary, $l, $sortkey, $sortorder = "", $tab=GLOSSARY_STANDARD_VIEW) { + echo '

' . get_string("explainexport","glossary") . '

'; +} + function glossary_print_alphabet_menu($cm, $glossary, $l, $sortkey, $sortorder = "", $tab=GLOSSARY_STANDARD_VIEW) { if ( $tab != GLOSSARY_DATE_VIEW ) { if ($glossary->showalphabet and $glossary->displayformat != GLOSSARY_FORMAT_CONTINUOUS) { @@ -1096,7 +1104,7 @@ function glossary_print_dynaentry($courseid, $entries) { echo "

"; } -function glossary_generate_export_file($glossary) { +function glossary_generate_export_file($glossary,$l, $cat) { global $CFG; glossary_check_moddata_dir($glossary); $h = glossary_open_xml($glossary); @@ -1113,43 +1121,42 @@ global $CFG; fwrite ($h,glossary_full_tag("USEDYNALINK",2,false,$glossary->usedynalink)); fwrite ($h,glossary_full_tag("DEFAULTAPPROVAL",2,false,$glossary->defaultapproval)); fwrite ($h,glossary_full_tag("GLOBALGLOSSARY",2,false,$glossary->globalglossary)); - $status =fwrite ($h,glossary_end_tag("INFO",1,true)); - if ( $entries = get_records("glossary_entries","glossaryid",$glossary->id) ) { - $status = fwrite ($h,glossary_start_tag("ENTRIES",1,true)); - foreach ($entries as $entry) { - if ( $entry->approved ) { - $status = fwrite($h,glossary_start_tag("ENTRY",2,true)); - fwrite($h,glossary_full_tag("ID",3,false,$entry->id)); - fwrite($h,glossary_full_tag("CONCEPT",3,false,$entry->concept)); - fwrite($h,glossary_full_tag("DEFINITION",3,false,$entry->definition)); - fwrite($h,glossary_full_tag("FORMAT",3,false,$entry->format)); - fwrite($h,glossary_full_tag("ATTACHMENT",3,false,$entry->attachment)); - fwrite($h,glossary_full_tag("USEDYNALINK",3,false,$entry->usedynalink)); - fwrite($h,glossary_full_tag("CASESENSITIVE",3,false,$entry->casesensitive)); - fwrite($h,glossary_full_tag("FULLMATCH",3,false,$entry->fullmatch)); - $status =fwrite($h,glossary_end_tag("ENTRY",2,true)); - } - } - $status =fwrite ($h,glossary_end_tag("ENTRIES",1,true)); - } + if ( $entries = get_records("glossary_entries","glossaryid",$glossary->id) ) { + $status = fwrite ($h,glossary_start_tag("ENTRIES",2,true)); + foreach ($entries as $entry) { + if ( $entry->approved ) { + $status = fwrite($h,glossary_start_tag("ENTRY",3,true)); + fwrite($h,glossary_full_tag("CONCEPT",4,false,$entry->concept)); + fwrite($h,glossary_full_tag("DEFINITION",4,false,$entry->definition)); + fwrite($h,glossary_full_tag("FORMAT",4,false,$entry->format)); + fwrite($h,glossary_full_tag("USEDYNALINK",4,false,$entry->usedynalink)); + fwrite($h,glossary_full_tag("CASESENSITIVE",4,false,$entry->casesensitive)); + fwrite($h,glossary_full_tag("FULLMATCH",4,false,$entry->fullmatch)); + fwrite($h,glossary_full_tag("TEACHERENTRY",4,false,$entry->teacherentry)); + + if ( $catentries = get_records("glossary_entries_categories","entryid",$entry->id) ) { + $status = fwrite ($h,glossary_start_tag("CATEGORIES",4,true)); + foreach ($catentries as $catentry) { + $category = get_record("glossary_categories","id",$catentry->categoryid); + + $status = fwrite ($h,glossary_start_tag("CATEGORY",5,true)); + fwrite($h,glossary_full_tag("NAME",6,false,$category->name)); + $status = fwrite($h,glossary_end_tag("CATEGORY",5,true)); + } + $status = fwrite($h,glossary_end_tag("CATEGORIES",4,true)); + } - if ( $categories = get_records("glossary_categories","glossaryid",$glossary->id) ) { - $status = fwrite ($h,glossary_start_tag("CATEGORIES",1,true)); - foreach ($categories as $category) { - $status = fwrite ($h,glossary_start_tag("CATEGORY",2,true)); - fwrite($h,glossary_full_tag("NAME",3,false,$category->name)); - if ( $catentries = get_records("glossary_entries_categories","categoryid",$category->id) ) { - $count = 0; - foreach ($catentries as $catentry) { - fwrite($h,glossary_full_tag("ENTRYID$count",3,false,$catentry->entryid)); - $count++; + $status =fwrite($h,glossary_end_tag("ENTRY",3,true)); } } - $status = fwrite($h,glossary_end_tag("CATEGORY",2,true)); + $status =fwrite ($h,glossary_end_tag("ENTRIES",2,true)); + } - $status = fwrite($h,glossary_end_tag("CATEGORIES",1,true)); - } + + + $status =fwrite ($h,glossary_end_tag("INFO",1,true)); + $h = glossary_close_xml($h); } // Functions designed by Eloy Lafuente @@ -1177,6 +1184,19 @@ function glossary_open_xml($glossary) { } } +function glossary_read_imported_file($file) { +require_once "../../lib/xmlize.php"; + $h = fopen($file,"r"); + $line = ''; + if ($h) { + while ( !feof($h) ) { + $char = fread($h,1024); + $line .= $char; + } + fclose($h); + } + return xmlize($line); +} //Close the file function glossary_close_xml($h) { $status = fwrite ($h,glossary_end_tag("GLOSSARY",0,true)); diff --git a/mod/glossary/tabs.html b/mod/glossary/tabs.html index 4c0673621f..db3d0b93aa 100644 --- a/mod/glossary/tabs.html +++ b/mod/glossary/tabs.html @@ -23,8 +23,8 @@ $data[GLOSSARY_IMPORT_VIEW]->caption = "Import Entries"; $data[GLOSSARY_EXPORT_VIEW]->caption = "Export Entries"; -// $data[GLOSSARY_IMPORT_VIEW]->link = "import.php?id=$cm->id&tab=$tab"; -// $data[GLOSSARY_EXPORT_VIEW]->link = "export.php?id=$cm->id&tab=$tab"; + $data[GLOSSARY_IMPORT_VIEW]->link = "import.php?id=$cm->id"; + $data[GLOSSARY_EXPORT_VIEW]->link = "export.php?id=$cm->id&l=$l&cat=$cat&tab=".GLOSSARY_CATEGORY_VIEW; } $data[GLOSSARY_DATE_VIEW]->link = "view.php?id=$id&tab=".GLOSSARY_DATE_VIEW; @@ -65,6 +65,16 @@ $l = ""; glossary_print_addentry_menu($cm, $glossary, $l, $sortkey, $sortorder,$tab); break; + case GLOSSARY_IMPORT_VIEW: + $search = ""; + $l = ""; + glossary_print_import_menu($cm, $glossary, $l, $sortkey, $sortorder,$tab); + break; + case GLOSSARY_EXPORT_VIEW: + $search = ""; + $l = ""; + glossary_print_export_menu($cm, $glossary, $l, $sortkey, $sortorder,$tab); + break; case GLOSSARY_DATE_VIEW: if (!$sortkey) { $sortkey = 'UPDATE';