MDL-14129, fix print_error call
This commit is contained in:
+5
-5
@@ -375,10 +375,10 @@
|
||||
}
|
||||
}
|
||||
} 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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,10 +448,10 @@
|
||||
}
|
||||
}
|
||||
} 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) {
|
||||
@@ -590,7 +590,7 @@
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
+6
-6
@@ -53,23 +53,23 @@
|
||||
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 [email protected]
|
||||
@@ -118,7 +118,7 @@
|
||||
|
||||
//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
|
||||
@@ -161,7 +161,7 @@
|
||||
} 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);
|
||||
|
||||
@@ -2445,7 +2445,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
|
||||
} 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);
|
||||
@@ -8192,7 +8192,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
|
||||
//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");
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
|
||||
//Check site
|
||||
if (!$site = get_site()) {
|
||||
print_error("Site not found!");
|
||||
print_error("cannotfindsite");
|
||||
}
|
||||
|
||||
//Check necessary functions exists. Thanks to [email protected]
|
||||
|
||||
@@ -7,10 +7,12 @@ $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['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.';
|
||||
@@ -121,6 +123,8 @@ $string['moduledoesnotexist'] = 'The instance of this module doesn\'t exist';
|
||||
$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!';
|
||||
@@ -180,6 +184,8 @@ $string['usernotupdatedadmin'] = 'Can not update admin accounts.';
|
||||
$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.';
|
||||
|
||||
Reference in New Issue
Block a user