Splited one function into two :-)
authorstronk7 <stronk7>
Sun, 19 Oct 2003 22:00:41 +0000 (22:00 +0000)
committerstronk7 <stronk7>
Sun, 19 Oct 2003 22:00:41 +0000 (22:00 +0000)
mod/glossary/backuplib.php

index 94d1f82adbaae0d58a3fe3d3307fb35cd02e2e9b..e75d9dfd2b67a708d88e8fbb030c235ef010e8f4 100644 (file)
                 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));
 
             }
         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) {