mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
Return info to know what modules process...
This commit is contained in:
parent
0b1473f971
commit
04b353e4d6
@ -155,7 +155,7 @@ Restore Details:
|
||||
x separate every mod..............................DONE
|
||||
x xmlize (to array) and serialize it..............DONE
|
||||
x save to db (backup_ids).........................DONE
|
||||
- Mods Info..........................................NO EXISTS
|
||||
- Mods Info..........................................IN PROGRESS
|
||||
x assignments.....................................NO EXISTS
|
||||
+ course data..................................NO EXISTS
|
||||
+ user data....................................NO EXISTS
|
||||
@ -176,10 +176,10 @@ Restore Details:
|
||||
+ course data..................................NO EXISTS
|
||||
+ user data....................................NO EXISTS
|
||||
+ files........................................NO EXISTS
|
||||
x resources.......................................NO EXISTS
|
||||
+ course data..................................NO EXISTS
|
||||
+ user data....................................NO EXISTS
|
||||
+ files........................................NO EXISTS
|
||||
x resources.......................................IN PROGRESS
|
||||
+ course data..................................IN PROGRESS
|
||||
+ user data....................................IN PROGRESS
|
||||
+ files.(ARE COURSE FILES !!!).................DONE
|
||||
x surveys.........................................NO EXISTS
|
||||
+ course data..................................NO EXISTS
|
||||
+ user data....................................NO EXISTS
|
||||
|
@ -657,11 +657,22 @@
|
||||
}
|
||||
//Get info from xml
|
||||
if ($status) {
|
||||
//info will contain the old_id of every module
|
||||
//info will contain the id and modtype of every module
|
||||
//in backup_ids->info will be the real info (serialized)
|
||||
$info = restore_read_xml_modules($restore,$xml_file);
|
||||
}
|
||||
|
||||
//Now, if we have anything in info, we have to restore that mods
|
||||
//from backup_ids (calling every mod restore function)
|
||||
if ($info) {
|
||||
print_object($info);
|
||||
|
||||
} else {
|
||||
$status = false;
|
||||
}
|
||||
|
||||
return $status;
|
||||
|
||||
}
|
||||
|
||||
//=====================================================================================
|
||||
@ -677,7 +688,8 @@
|
||||
var $tree = array(); //Array of levels we are
|
||||
var $content = ""; //Content under current level
|
||||
var $todo = ""; //What we hav to do when parsing
|
||||
var $info = ""; //Information collected. Temp storage.
|
||||
var $info = ""; //Information collected. Temp storage. Used to return data after parsing.
|
||||
var $temp = ""; //Temp storage.
|
||||
var $preferences = ""; //Preferences about what to load !!
|
||||
var $finished = false; //Flag to say xml_parse to stop
|
||||
|
||||
@ -740,7 +752,7 @@
|
||||
// echo $this->level.str_repeat(" ",$this->level*2)."<".$tagName."><br>\n"; //Debug
|
||||
//If we are under a MOD tag under a MODULES zone, accumule it
|
||||
if (($this->tree[4] == "MOD") and ($this->tree[3] == "MODULES")) {
|
||||
$this->info .= "<".$tagName.">";
|
||||
$this->temp .= "<".$tagName.">";
|
||||
}
|
||||
}
|
||||
|
||||
@ -1202,11 +1214,11 @@
|
||||
//echo $this->level.str_repeat(" ",$this->level*2)."</".$tagName."><br>\n"; //Debug
|
||||
//Acumulate data to info (content + close tag)
|
||||
//Reconvert it to utf & htmlchars and trim to generate xml data
|
||||
$this->info .= utf8_encode(htmlspecialchars(trim($this->content)))."</".$tagName.">";
|
||||
$this->temp .= utf8_encode(htmlspecialchars(trim($this->content)))."</".$tagName.">";
|
||||
//If we've finished a mod, xmlize it an save to db
|
||||
if (($this->level == 4) and ($tagName == "MOD")) {
|
||||
//Prepend XML standard header to info gathered
|
||||
$xml_data = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n".$this->info;
|
||||
$xml_data = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n".$this->temp;
|
||||
//Call to xmlize for this portion of xml data (one MOD)
|
||||
$data = xmlize($xml_data);
|
||||
//traverse_xmlize($data); //Debug
|
||||
@ -1225,14 +1237,12 @@
|
||||
//Save to db
|
||||
backup_putid($this->preferences->backup_unique_code,$mod_type,$mod_id,
|
||||
null,$sla_mod_temp);
|
||||
//Create returning info
|
||||
$this->info[] = array(id => $mod_id,modtype => $mod_type);
|
||||
}
|
||||
//Reset info to empty
|
||||
$this->info = "";
|
||||
$this->temp = "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//Stop parsing if todo = MODULES and tagName = MODULES (en of the tag, of course)
|
||||
|
Loading…
x
Reference in New Issue
Block a user