mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
"MDL-14129, fix print_error"
This commit is contained in:
parent
02dc703298
commit
b121a4eed9
8 changed files with 23 additions and 20 deletions
|
@ -176,7 +176,7 @@
|
|||
|
||||
if ($wdir == "/backupdata") {
|
||||
if (! make_upload_directory("$course->id/backupdata")) { // Backup folder
|
||||
print_error("nopermissiontomkdir");
|
||||
print_error('cannotcreatebackupdir');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ require_once('lib.php');
|
|||
$groupingid = required_param('id', PARAM_INT);
|
||||
|
||||
if (!$grouping = get_record('groupings', 'id', $groupingid)) {
|
||||
print_error('Incorrect group id');
|
||||
print_error('invalidgroupid');
|
||||
}
|
||||
|
||||
if (! $course = get_record('course', 'id', $grouping->courseid)) {
|
||||
|
|
|
@ -19,7 +19,7 @@ if (!defined('AUTOGROUP_MIN_RATIO')) {
|
|||
$courseid = required_param('courseid', PARAM_INT);
|
||||
|
||||
if (!$course = get_record('course', 'id', $courseid)) {
|
||||
print_error('invalidcourse');
|
||||
print_error('invalidcourseid');
|
||||
}
|
||||
|
||||
// Make sure that the user has permissions to manage groups.
|
||||
|
@ -82,7 +82,7 @@ if ($editform->is_cancelled()) {
|
|||
case 'idnumber':
|
||||
$orderby = 'idnumber'; break;
|
||||
default:
|
||||
print_error('Unknown ordering');
|
||||
print_error('unknoworder');
|
||||
}
|
||||
$users = groups_get_potential_members($data->courseid, $data->roleid, $orderby);
|
||||
$usercnt = count($users);
|
||||
|
|
|
@ -21,23 +21,23 @@ $confirm = optional_param('confirm', 0, PARAM_BOOL);
|
|||
|
||||
if ($id) {
|
||||
if (!$group = get_record('groups', 'id', $id)) {
|
||||
print_error('Group ID was incorrect');
|
||||
print_error('invalidgroupid');
|
||||
}
|
||||
$group->description = clean_text($group->description);
|
||||
if (empty($courseid)) {
|
||||
$courseid = $group->courseid;
|
||||
|
||||
} else if ($courseid != $group->courseid) {
|
||||
print_error('Course ID was incorrect');
|
||||
print_error('invalidcourseid');
|
||||
}
|
||||
|
||||
if (!$course = get_record('course', 'id', $courseid)) {
|
||||
print_error('Course ID was incorrect');
|
||||
print_error('invalidcourseid');
|
||||
}
|
||||
|
||||
} else {
|
||||
if (!$course = get_record('course', 'id', $courseid)) {
|
||||
print_error('Course ID was incorrect');
|
||||
print_error('invalidcourseid');
|
||||
}
|
||||
$group = new object();
|
||||
$group->courseid = $course->id;
|
||||
|
@ -83,11 +83,11 @@ if ($editform->is_cancelled()) {
|
|||
|
||||
if ($data->id) {
|
||||
if (!groups_update_group($data, $editform->_upload_manager)) {
|
||||
print_error('Error updating group');
|
||||
print_error('cannotupdategroup');
|
||||
}
|
||||
} else {
|
||||
if (!$id = groups_create_group($data, $editform->_upload_manager)) {
|
||||
print_error('Error creating group');
|
||||
print_error('cannotcreategroup');
|
||||
}
|
||||
$returnurl = $CFG->wwwroot.'/group/index.php?id='.$course->id.'&group='.$id;
|
||||
}
|
||||
|
|
|
@ -20,23 +20,23 @@ $confirm = optional_param('confirm', 0, PARAM_BOOL);
|
|||
|
||||
if ($id) {
|
||||
if (!$grouping = get_record('groupings', 'id', $id)) {
|
||||
print_error('Group ID was incorrect');
|
||||
print_error('invalidgroupid');
|
||||
}
|
||||
$grouping->description = clean_text($grouping->description);
|
||||
if (empty($courseid)) {
|
||||
$courseid = $grouping->courseid;
|
||||
|
||||
} else if ($courseid != $grouping->courseid) {
|
||||
print_error('Course ID was incorrect');
|
||||
print_error('invalidcourseid');
|
||||
}
|
||||
|
||||
if (!$course = get_record('course', 'id', $courseid)) {
|
||||
print_error('Course ID was incorrect');
|
||||
print_error('invalidcourseid');
|
||||
}
|
||||
|
||||
} else {
|
||||
if (!$course = get_record('course', 'id', $courseid)) {
|
||||
print_error('Course ID was incorrect');
|
||||
print_error('invalidcourseid');
|
||||
}
|
||||
$grouping = new object();
|
||||
$grouping->courseid = $course->id;
|
||||
|
@ -84,12 +84,12 @@ if ($editform->is_cancelled()) {
|
|||
|
||||
if ($data->id) {
|
||||
if (!groups_update_grouping($data)) {
|
||||
print_error('Error updating grouping');
|
||||
print_error('cannotupdategroup');
|
||||
}
|
||||
|
||||
} else {
|
||||
if (!groups_create_grouping($data)) {
|
||||
print_error('Error creating grouping');
|
||||
print_error('cannotcreategroup');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ switch ($action) {
|
|||
|
||||
default: //ERROR.
|
||||
if (debugging()) {
|
||||
print_error('Error, unknown button/action. Probably a user-interface bug!', '', $returnurl);
|
||||
print_error('unknowaction', '', $returnurl);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ function groups_param_action($prefix = 'act_') {
|
|||
}
|
||||
if ($action && !preg_match('/^\w+$/', $action)) {
|
||||
$action = false;
|
||||
print_error('Action had wrong type.');
|
||||
print_error('unknowaction');
|
||||
}
|
||||
///if (debugging()) echo 'Debug: '.$action;
|
||||
return $action;
|
||||
|
|
|
@ -22,7 +22,7 @@ if ($showall) {
|
|||
}
|
||||
|
||||
if (!$group = get_record('groups', 'id', $groupid)) {
|
||||
print_error('Incorrect group id');
|
||||
print_error('invalidgroupid');
|
||||
}
|
||||
|
||||
if (!$course = get_record('course', 'id', $group->courseid)) {
|
||||
|
|
|
@ -18,6 +18,7 @@ $string['cannotaddcmtosection'] = 'Could not add the new course module to that s
|
|||
$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['cannotcreategroup'] = 'Error creating group';
|
||||
$string['cannotcreatelangdir'] = 'Cannot create lang dir.';
|
||||
$string['cannotcreatelangbase'] = 'Error: Could not create base lang directory.';
|
||||
$string['cannotcreatetempdir'] = 'Cannot create temp dir.';
|
||||
|
@ -61,6 +62,7 @@ $string['cannotunzipfile'] = 'Cannot unzip file.';
|
|||
$string['cannotupdatecategory'] = 'Could not update the category ($a)';
|
||||
$string['cannotupdatecm'] = 'Could not update the course module with the correct section';
|
||||
$string['cannotupdatelevel'] = 'Could not update the indent level on that course module';
|
||||
$string['cannotupdategroup'] = 'Error updating group';
|
||||
$string['cannotupdaterecord'] = 'Could not update record ID $a';
|
||||
$string['cannotupdaterole'] = 'Cannot update role!';
|
||||
$string['cannotupdatemod'] = 'Could not update the $a';
|
||||
|
@ -236,6 +238,7 @@ $string['unknowncourseidnumber'] = 'Unknown Course ID \"$a\"';
|
|||
$string['unknowngroup'] = 'Unknown group \"$a\"';
|
||||
$string['unknownrole'] = 'Unknown role \"$a\"';
|
||||
$string['unknownuseraction'] = 'Sorry, I do not understand this user action.';
|
||||
$string['unknoworder'] = 'Unknown ordering';
|
||||
$string['unsupportedevent'] = 'Unsupported event type';
|
||||
$string['upgraderequires19'] = 'ERROR: New Moodle version was installed on server, unfortunately upgrade from the previous version is not supported.<br />Please upgrade first to latest 1.9.x release. You can also return to previous version by reinstalling original files.';
|
||||
$string['urlnotdefinerss'] = 'URL not defined for rss feed';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue