From: stronk7 Date: Sun, 21 Sep 2003 23:40:42 +0000 (+0000) Subject: Some cosmetical updates plus one error selecting glossary_categories_entries X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=0eb61c5e87ff3c8ab0f7e838912716ee99695fc5;p=moodle.git Some cosmetical updates plus one error selecting glossary_categories_entries solved. No backup is working ok... I think. --- diff --git a/mod/glossary/backuplib.php b/mod/glossary/backuplib.php index 121c76fded..d7c42f8ed4 100644 --- a/mod/glossary/backuplib.php +++ b/mod/glossary/backuplib.php @@ -66,33 +66,33 @@ $status = true; $glossary_categories = get_records("glossary_categories","glossaryid",$glossary,"id"); - //If there is submissions + //If there is categories if ($glossary_categories) { $status =fwrite ($bf,start_tag("CATEGORIES",4,true)); //Iterate over each category foreach ($glossary_categories as $glo_cat) { //Start category - //Print submission contents - $status =fwrite ($bf,start_tag("CATEGORY",5,true)); - - fwrite ($bf,full_tag("ID",6,false,$glo_cat->id)); - 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,"glossaryid"); - if ($entries) { - $status =fwrite ($bf,start_tag("ENTRIES",6,true)); - foreach ($entries as $entry) { - fwrite ($bf,full_tag("ENTRYID",7,false,$entry->entryid)); - } - $status =fwrite ($bf,end_tag("ENTRIES",6,true)); + //Print category contents + $status =fwrite ($bf,start_tag("CATEGORY",5,true)); + + fwrite ($bf,full_tag("ID",6,false,$glo_cat->id)); + 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,"entryid"); + if ($entries) { + $status =fwrite ($bf,start_tag("ENTRIES",6,true)); + foreach ($entries as $entry) { + fwrite ($bf,full_tag("ENTRYID",7,false,$entry->entryid)); } - $status =fwrite ($bf,end_tag("CATEGORY",5,true)); + $status =fwrite ($bf,end_tag("ENTRIES",6,true)); + } + $status =fwrite ($bf,end_tag("CATEGORY",5,true)); } - //Write end tag - $status =fwrite ($bf,end_tag("CATEGORIES",4,true)); + //Write end tag + $status =fwrite ($bf,end_tag("CATEGORIES",4,true)); } return $status; }