]> git.mjollnir.org Git - moodle.git/commitdiff
Debug a bit
authorstronk7 <stronk7>
Sat, 17 May 2003 08:56:53 +0000 (08:56 +0000)
committerstronk7 <stronk7>
Sat, 17 May 2003 08:56:53 +0000 (08:56 +0000)
backup/restore.php
backup/restorelib.php

index a3e32033ae54be674b9972cc9cf3cb924bdcea0b..9b562d34641d64c1d96ff811556a9954ae1f6738 100644 (file)
@@ -1,5 +1,5 @@
 <?PHP //$Id$
-    //This script is used to configure and execute the backup proccess.
+    //This script is used to configure and execute the restore proccess.
 
     //Define some globals for all the script
 
@@ -56,7 +56,7 @@
     //Print header
     print_header("$site->shortname: $strcourserestore", $site->fullname,
                  "<A HREF=\"$moodle_home/$CFG->admin/index.php\">$stradministration</A> ->
-                  <A HREF=\"backup.php\">$strcourserestore</A> -> ".basename($file));
+                  <A HREF=\"restore.php?file=".$file."\">$strcourserestore</A> -> ".basename($file));
 
     //Print form
     print_heading("$strcourserestore: ".basename($file));
index f5433b9056671e1fc618cc2d698b1176489f57cf..d6c9c4577aa6edf4b0ed2d1055e24e4b6f46a404 100644 (file)
         var $finished = false; //Flag to say xml_parse to stop
 
         function startElement($parser, $tagName, $attrs) {
-            $this->tree[$this->level] = $tagName;
-            //echo str_repeat("&nbsp;",$this->level*2)."&lt;".$tagName."&gt;<br>\n";
             $this->level++;
+            $this->tree[$this->level] = $tagName;
+            echo $this->level.str_repeat("&nbsp;",$this->level*2)."&lt;".$tagName."&gt;<br>\n";   //Debug
         }
 
         function endElement($parser, $tagName) {
-            if (trim($this->content)) {
-                //echo utf8_decode(str_repeat("&nbsp;",$this->level*2).$this->content."<br>\n");
-            }
+            if (trim($this->content))                                                                     //Debug
+                echo "C".utf8_decode(str_repeat("&nbsp;",($this->level+2)*2).$this->content."<br>\n");    //Debug
+            echo $this->level.str_repeat("&nbsp;",$this->level*2)."&lt;/".$tagName."&gt;<br>\n";          //Debug
             $this->level--;
-            //echo str_repeat("&nbsp;",$this->level*2)."&lt;/".$tagName."&gt;<br>\n";
             $this->tree[$this->level] = "";
             $this->content = "";
 
-            //Stop parsing if todo = INFO and tagName = INFO
+            //Stop parsing if todo = INFO and tagName = INFO (en of the tag, of course)
             //Speed up a lot (avoid parse all)
-            //echo $tagName."<br>";
             if (($this->todo == "INFO") and ($tagName == "INFO")) {
                 $this->finished = true;
             }
                                     xml_get_current_line_number($xml_parser)));
             fclose($fp);
         }
+        //Get info from parser
+        $info = $moodle_parser->info;
+        
+        //Clear parser mem
         xml_parser_free($xml_parser);
 
         if ($Status) {