]> git.mjollnir.org Git - moodle.git/commitdiff
implemented fix for restore problem given in bug #1589
authorgustav_delius <gustav_delius>
Sat, 15 Jan 2005 21:49:22 +0000 (21:49 +0000)
committergustav_delius <gustav_delius>
Sat, 15 Jan 2005 21:49:22 +0000 (21:49 +0000)
mod/wiki/backuplib.php
mod/wiki/restorelib.php

index 64ca2a954d79359257f8299bc6d0a744dffcba5a..d404fe57103c4a827ae3f1aa1ccd69c54d4b9ee1 100644 (file)
@@ -41,7 +41,7 @@
                 fwrite ($bf,full_tag("PAGENAME",4,false,$wiki->wtype));
                 fwrite ($bf,full_tag("WTYPE",4,false,$wiki->wtype));
                 fwrite ($bf,full_tag("EWIKIPRINTTITLE",4,false,$wiki->ewikiprinttitle));
-                fwrite ($bf,full_tag("HTMLMODE",4,false,$wiki->allowsafehtml));
+                fwrite ($bf,full_tag("HTMLMODE",4,false,$wiki->htmlmode));
                 fwrite ($bf,full_tag("EWIKIACCEPTBINARY",4,false,$wiki->ewikiacceptbinary));
                 fwrite ($bf,full_tag("INITIALCONTENT",4,false,$wiki->initialcontent));
                 fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$wiki->timemodified));
@@ -88,7 +88,7 @@
             foreach ($wiki_entries as $wik_ent) {
                 //Start entry
                 //Print submission contents
-               if ($userinfo) {
+            if ($userinfo) {
                     $dumped_entries++;
                     if ($dumped_entries == 1) {
                         //Write start tag
                 }
             }
             if ( $dumped_entries > 0 ) {
-               //Write end tag
-               $status =fwrite ($bf,end_tag("ENTRIES",4,true));
+            //Write end tag
+                $status =fwrite ($bf,end_tag("ENTRIES",4,true));
             }
         }
         return $status;
index 85e3c1eb7ecbb86defe48483346707da4e4a1610..4a4505599642e41ee75200fe999ffa96567b775d 100644 (file)
@@ -45,7 +45,7 @@
             $wiki->pagename = backup_todb($info['MOD']['#']['PAGENAME']['0']['#']);
             $wiki->wtype = backup_todb($info['MOD']['#']['WTYPE']['0']['#']);
             $wiki->ewikiprinttitle = backup_todb($info['MOD']['#']['EWIKIPRINTTITLE']['0']['#']);
-            $wiki->ewikiallowsafehtml = backup_todb($info['MOD']['#']['HTMLMODE']['0']['#']);
+            $wiki->htmlmode = backup_todb($info['MOD']['#']['HTMLMODE']['0']['#']);
             $wiki->ewikiacceptbinary = backup_todb($info['MOD']['#']['EWIKIACCEPTBINARY']['0']['#']);
             $wiki->initialcontent = backup_todb($info['MOD']['#']['INITIALCONTENT']['0']['#']);
             $wiki->timemodified = backup_todb($info['MOD']['#']['TIMEMODIFIED']['0']['#']);
             //If userinfo was selected, restore the entry
             if ($restore->mods['wiki']->userinfo) {
                 //The structure is equal to the db, so insert the wiki_entries
-               $newid = insert_record ("wiki_entries",$entry);
+                $newid = insert_record ("wiki_entries",$entry);
 
-               //Do some output
-               if (($i+1) % 50 == 0) {
-                   echo ".";
-                   if (($i+1) % 1000 == 0) {
+                //Do some output
+            if (($i+1) % 50 == 0) {
+                    echo ".";
+                    if (($i+1) % 1000 == 0) {
                         echo "<br />";
-                   }
-                   backup_flush(300);
+                }
+                    backup_flush(300);
                 }
                 if ($newid) {
-                   //We have the newid, update backup_ids
+                    //We have the newid, update backup_ids
                     backup_putid($restore->backup_unique_code,"wiki_entries",$oldid,$newid);
                     //Get old wiki id from backup_ids
                     $rec = get_record("backup_ids","backup_code",$restore->backup_unique_code,
                     //Restore wiki_pages
                     $status = wiki_pages_restore_mods($oldid,$newid,$ent_info,$restore);
                 } else {
-                   $status = false;
-               }
+                    $status = false;
+            }
             }
         }
         return $status;