}
}
} else {
- print_error("Upgrade of backup system failed! (Could not update version in config table)");
+ print_error("upgradeversionfail");
}
} else {
- print_error("Backup tables could NOT be set up successfully!");
+ print_error("backuptablefail");
}
}
}
}
} else {
- print_error("Upgrade of backup system failed! (Could not update version in config table)");
+ print_error("upgradeversionfail");
}
} else {
- print_error("Upgrade failed! See backup/version.php");
+ print_error('upgradefail', '', '','See backup/version.php');
}
} else if ($backup_version < $CFG->backup_version) {
if(!function_exists('utf8_encode')) {
if (empty($justcheck)) {
- print_error('You need to add XML support to your PHP installation');
+ print_error('needphpext', '', '', 'XML');
} else {
return false;
}
require_login($id);
if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_COURSE, $id))) {
if (empty($to)) {
- print_error("You need to be a teacher or admin user to use this page.", '', "$CFG->wwwroot/login/index.php");
+ print_error("cannotuseadminadminorteacher", '', "$CFG->wwwroot/login/index.php");
} else {
if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_COURSE, $to))
&& !has_capability('moodle/site:import', get_context_instance(CONTEXT_COURSE, $to))) {
- print_error("You need to be a teacher or admin user to use this page.", '', "$CFG->wwwroot/login/index.php");
+ print_error("cannotuseadminadminorteacher", '', "$CFG->wwwroot/login/index.php");
}
}
}
} else {
if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
- print_error("You need to be an admin user to use this page.", '', "$CFG->wwwroot/login/index.php");
+ print_error("cannotuseadmin", '', "$CFG->wwwroot/login/index.php");
}
}
//Check site
if (!$site = get_site()) {
- print_error("Site not found!");
+ print_error("cannotfindsite");
}
//Check necessary functions exists. Thanks to gregb@crowncollege.edu
//Get and check course
if (! $course = get_record("course", "id", $id)) {
- print_error("Course ID was incorrect (can't find it)");
+ print_error('invalidcourseid', '', '', $id);
}
//Print header
} else if ($launch == "execute") {
//Prevent multiple restore executions...
if (empty($SESSION->cancontinue)) {
- print_error("Multiple restore execution not allowed!");
+ print_error('multiplerestorenotallow');
}
//Unset this for the future
unset($SESSION->cancontinue);
} else {
// should not happen, as we check in restore_chech.php
// but handle the error if it does
- print_error("This backup file contains external Moodle Network Hosts that are not configured locally.");
+ print_error('backupcontainexternal', 'error');
}
}
unset($user->mnethosturl);
//Open file for writing
//First, we check the course_id backup data folder exists and create it as necessary in CFG->dataroot
if (!$dest_dir = make_upload_directory("$restore->course_id/backupdata")) { // Backup folder
- print_error("Could not create backupdata folder. The site administrator needs to fix the file permissions");
+ print_error('cannotcreatebackupdir');
}
$status = check_dir_exists($dest_dir,true);
$restorelog_file = fopen("$dest_dir/restorelog.html","a");
//Check site
if (!$site = get_site()) {
- print_error("Site not found!");
+ print_error("cannotfindsite");
}
//Check necessary functions exists. Thanks to gregb@crowncollege.edu
$string['blockcannotinistantiate'] = 'Problem in instantiating block object';
$string['blockcannotconfig'] = 'This block does not support global configuration';
$string['backupcontainexternal'] = 'This backup file contains external Moodle Network Hosts that are not configured locally.';
+$string['backuptablefail'] = 'Backup tables could NOT be set up successfully!';
$string['cannotassignrole'] = 'Cannot assign role in course';
$string['cannotaddrss'] = 'You do not have permission to add rss feeds';
$string['cannotsaveconfig'] = 'Problem saving config \"$a[0]\" as \"$a[1]\" for plugin \"$a[2]\"';
$string['cannotsavefile'] = 'Cannot save the file\"$a[0]\/$a[1]\"!';
+$string['cannotcreatebackupdir'] = 'Could not create backupdata folder. The site administrator needs to fix the file permissions';
$string['cannotcreatelangdir'] = 'Cannot create lang dir.';
$string['cannotcreatelangbase'] = 'Error: Could not create base lang directory.';
$string['cannotcreatetempdir'] = 'Cannot create temp dir.';
$string['modulemissingcode'] = 'Module $a is missing the code needed to perform this function';
$string['modulerequirementsnotmet'] = 'Module \"$a->modulename\" ($a->moduleversion) could not be installed. It requires a newer version of Moodle (currently you are using $a->currentmoodle, you need $a->requiremoodle).';
$string['mustbeteacher'] = 'You must be a teacher to look at this page';
+$string['multiplerestorenotallow'] = 'Multiple restore execution not allowed!';
+$string['needphpext'] = 'You need to add $a support to your PHP installation';
$string['noblocks'] = 'No blocks found!';
$string['nocontext'] = 'Sorry, but that course is not a valid context';
$string['noinstances'] = 'There are no instances of $a in this course!';
$string['usernotupdatederror'] = 'User not updated - error.';
$string['usernotupdatednotexists'] = 'User not updated - does not exist.';
$string['updatersserror'] = 'There was an error trying to update rss feed with id: $a';
+$string['upgradeversionfail'] = 'Upgrade of backup system failed! (Could not update version in config table)';
+$string['upgradefail'] = 'Upgrade failed! $a';
$string['wrongcall'] = 'This script is called wrongly';
$string['wrongcontextid'] = 'Context ID was incorrect (cannot find it)';
$string['wrongdestpath'] = 'Wrong destination path.';