--- backup/backuplib.php 2008-12-16 14:56:00.000000000 -0800 +++ backup/backuplib.php 2009-01-09 11:55:00.000000000 -0800 @@ -2354,6 +2354,25 @@ } } + // For the current course format call its encode_content_links method (if it exists) + static $format_function_name; + if (!isset($format_function_name)) { + $format_function_name = false; + if ($format = get_field('course', 'format', 'id', $mypreferences->backup_course)) { + if (file_exists("$CFG->dirroot/course/format/$format/backuplib.php")) { + include_once("$CFG->dirroot/course/format/$format/backuplib.php"); + $function_name = $format.'_encode_format_content_links'; + if (function_exists($function_name)) { + $format_function_name = $function_name; + } + } + } + } + // If the above worked - then we have a function to call + if ($format_function_name) { + $result = $format_function_name($result, $mypreferences); + } + // For each block, call its encode_content_links method. // This encodes forexample links to blocks/something/viewphp?id=666 // that are stored in other activities. --- backup/restorelib.php 2009-01-07 11:29:15.000000000 -0800 +++ backup/restorelib.php 2009-01-09 12:01:10.000000000 -0800 @@ -148,6 +148,23 @@ } } + // For the course format call its decode_content_links method (if it exists) + $format = get_field('course', 'format', 'id', $restore->course_id); + if (file_exists("$CFG->dirroot/course/format/$format/restorelib.php")) { + include_once("$CFG->dirroot/course/format/$format/restorelib.php"); + $function_name = $format.'_decode_format_content_links_caller'; + + if (function_exists($function_name)) { + if (!defined('RESTORE_SILENTLY')) { + echo "