Skip to content

Commit

Permalink
Added support to survey-download action in restore.
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Apr 10, 2005
1 parent c3cc897 commit da423e1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mod/survey/restorelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,19 @@ function survey_restore_logs($restore,$log) {
$log->url = "index.php?id=".$log->course;
$status = true;
break;
case "download":
if ($log->cmid) {
//Get the new_id of the module (to recode the info field)
$mod = backup_getid($restore->backup_unique_code,$log->module,$log->info);
if ($mod) {
//Rebuild the url, extracting the type (txt, xls)
$filetype = substr($log->url,-3);
$log->url = "download.php?id=".$log->cmid."&type=".$filetype;
$log->info = $mod->new_id;
$status = true;
}
}
break;
default:
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
break;
Expand Down

0 comments on commit da423e1

Please sign in to comment.