<?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
//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));
var $finished = false; //Flag to say xml_parse to stop
function startElement($parser, $tagName, $attrs) {
- $this->tree[$this->level] = $tagName;
- //echo str_repeat(" ",$this->level*2)."<".$tagName."><br>\n";
$this->level++;
+ $this->tree[$this->level] = $tagName;
+ echo $this->level.str_repeat(" ",$this->level*2)."<".$tagName."><br>\n"; //Debug
}
function endElement($parser, $tagName) {
- if (trim($this->content)) {
- //echo utf8_decode(str_repeat(" ",$this->level*2).$this->content."<br>\n");
- }
+ if (trim($this->content)) //Debug
+ echo "C".utf8_decode(str_repeat(" ",($this->level+2)*2).$this->content."<br>\n"); //Debug
+ echo $this->level.str_repeat(" ",$this->level*2)."</".$tagName."><br>\n"; //Debug
$this->level--;
- //echo str_repeat(" ",$this->level*2)."</".$tagName."><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) {