From e425fb16218233c9610d73b6dab5d5adee8109a2 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Sun, 19 Oct 2003 22:00:41 +0000 Subject: [PATCH] Splited one function into two :-) --- mod/glossary/backuplib.php | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/mod/glossary/backuplib.php b/mod/glossary/backuplib.php index 94d1f82adb..e75d9dfd2b 100644 --- a/mod/glossary/backuplib.php +++ b/mod/glossary/backuplib.php @@ -89,16 +89,8 @@ fwrite ($bf,full_tag("GLOSSARYID",6,false,$glo_cat->glossaryid)); fwrite ($bf,full_tag("NAME",6,false,$glo_cat->name)); - $entries = get_records("glossary_entries_categories","categoryid",$glo_cat->id); - if ($entries) { - $status =fwrite ($bf,start_tag("ENTRIES",6,true)); - foreach ($entries as $entry) { - fwrite ($bf,start_tag("ENTRY",7,true)); - fwrite ($bf,full_tag("ENTRYID",8,false,$entry->entryid)); - $status =fwrite ($bf,end_tag("ENTRY",7,true)); - } - $status =fwrite ($bf,end_tag("ENTRIES",6,true)); - } + $status = backup_glossary_entries_categories ($bf,$preferences,$glo_cat->id); + $status =fwrite ($bf,end_tag("CATEGORY",5,true)); } @@ -108,6 +100,26 @@ return $status; } + //Backup entries_categories contents (executed from backup_glossary_categories) + function backup_glossary_entries_categories ($bf,$preferences,$categoryid) { + + global $CFG; + + $status = true; + + $entries = get_records("glossary_entries_categories","categoryid",$categoryid); + if ($entries) { + $status =fwrite ($bf,start_tag("ENTRIES",6,true)); + foreach ($entries as $entry) { + fwrite ($bf,start_tag("ENTRY",7,true)); + fwrite ($bf,full_tag("ENTRYID",8,false,$entry->entryid)); + $status =fwrite ($bf,end_tag("ENTRY",7,true)); + } + $status =fwrite ($bf,end_tag("ENTRIES",6,true)); + } + return $status; + } + //Backup glossary_entries contents (executed from glossary_backup_mods) function backup_glossary_entries ($bf,$preferences,$glossary, $userinfo) { -- 2.39.5