//This function encode things to make backup multi-site fully functional
//It does this conversions:
- // - $CFG->wwwroot/file.php/courseid ----------------------> $@FILEPHP@$
- // - Links to forums everywhere (DB) are encoded.
+ // - $CFG->wwwroot/file.php/courseid ------------------> $@FILEPHP@$ (slasharguments links)
+ // - $CFG->wwwroot/file.php?file=/courseid ------------> $@FILEPHP@$ (non-slasharguments links)
+ // - Every module xxxx_encode_content_links() is executed too
//
function backup_encode_absolute_links($content) {
}
//First, we check for every call to file.php inside the course
- $search = array($CFG->wwwroot."/file.php/".$mypreferences->backup_course);
+ $search = array($CFG->wwwroot.'/file.php/'.$mypreferences->backup_course,
+ $CFG->wwwroot.'/file.php?file=/'.$mypreferences->backup_course);
- $replace = array("$@FILEPHP@$");
+ $replace = array('$@FILEPHP@$','$@FILEPHP@$');
$result = str_replace($search,$replace,$content);
//This function decode things to make restore multi-site fully functional
//It does this conversions:
- // - $@FILEPHP@$ -------------------------------> $CFG->wwwroot/file.php/courseid
+ // - $@FILEPHP@$ ---|------------> $CFG->wwwroot/file.php/courseid (slasharguments on)
+ // |------------> $CFG->wwwroot/file.php?file=/courseid (slasharguments off)
//
//Note: Inter-activities linking is being implemented as a final
//step in the restore execution, because we need to have it
//Now decode wwwroot and file.php calls
$search = array ("$@FILEPHP@$");
+
+ //Check for the status of the slasharguments config variable
+ $slash = $CFG->slasharguments;
- $replace = array ($CFG->wwwroot."/file.php/".$restore->course_id);
+ //Build the replace string as needed
+ if ($slash == 1) {
+ $replace = array ($CFG->wwwroot."/file.php/".$restore->course_id);
+ } else {
+ $replace = array ($CFG->wwwroot."/file.php?file=/".$restore->course_id);
+ }
$result = str_replace($search,$replace,$content);
// database (backup_version) to determine whether upgrades should
// be performed (see db/backup_*.php)
-$backup_version = 2004070800; // The current version is a date (YYYYMMDDXX)
+$backup_version = 2004071600; // The current version is a date (YYYYMMDDXX)
$backup_release = "1.4 development"; // User-friendly version number