if (!empty($id)) {
require_login($id);
if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_COURSE, $id))) {
- print_error("You need to be a teacher or admin user to use this page.", '', "$CFG->wwwroot/login/index.php");
+ print_error('cannotusepage', 'error', "$CFG->wwwroot/login/index.php");
}
} else {
require_login();
if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_SYSTEM))) {
- print_error("You need to be an admin user to use this page.", '', "$CFG->wwwroot/login/index.php");
+ print_error('cannotusepage', 'error', "$CFG->wwwroot/login/index.php");
}
}
if (!empty($to)) {
if (!has_capability('moodle/site:backup', 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('cannotusepage', 'error', "$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('unknowncourseidnumber','error');
}
//Print header
$string['blockdoesnotexist'] = 'This block does not exist';
$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['cannotassignrole'] = 'Cannot assign role in course';
$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['cannotsetupsite'] = 'Serious Error! Could not set up the site!';
$string['cannotunzipfile'] = 'Cannot unzip file.';
$string['cannotupdaterole'] = 'Cannot update role!';
+$string['cannotusepage'] = 'Only teacher and administrator can use this page.';
$string['cannotviewprofile'] = 'You can not view the profile of this user.';
$string['cantunenrollfrommetacourse'] = 'You can not unenrol from this meta course.';
$string['cantunenrollinthisrole'] = 'You can not unenrol from this course while you are in your current role.';