print_error('invalidevent');
}
if(!calendar_edit_event_allowed($event)) {
- print_error('You are not authorized to do this');
+ print_error('nopermissions');
}
break;
$repeats = optional_param('repeats', 0, PARAM_INT);
if($event === false) {
- print_error('Invalid event');
+ print_error('invalidevent');
}
if(!calendar_edit_event_allowed($event)) {
- print_error('You are not authorized to do this');
+ print_error('nopermissions');
}
if($form = data_submitted()) {
$form->timeduration = 0;
}
if(!calendar_add_event_allowed($form)) {
- print_error('You are not authorized to do this');
+ print_error('nopermissions');
}
validate_form($form, $err);
if (count($err) == 0) {
case 'select':
break;
default:
- print_error('Unsupported event type');
+ print_error('unsupportedevent');
}
$form->format = $defaultformat;
$courseid = SITEID;
}
if (!$course = get_record('course', 'id', $courseid)) {
- print_error('Incorrect course ID');
+ print_error('invalidcourse');
}
$groupid = groups_get_course_group($course);
// Timestamps must be >= course startdate
$course = get_record('course', 'id', $form->courseid);
if($course === false) {
- print_error('Event belongs to invalid course');
+ print_error('invalidcourse');
}
else if($form->timestart < $course->startdate) {
$err['timestart'] = get_string('errorbeforecoursestart', 'calendar');
// TODO: rewrite this hack somehow
if (!calendar_edit_event_allowed($event)){ // cannot manage entries, eg. student
if(!$assignment = get_record('assignment','id',$event->instance)){
- // print_error("assignment ID was incorrect");
+ // print_error("invalidid", 'assignment');
continue;
}
// assign assignment to assignment object to use hidden_is_hidden method
if (!empty($moveto) and $data = data_submitted() and confirm_sesskey()) { // Some courses are being moved
if (! $destcategory = get_record("course_categories", "id", $data->moveto)) {
- print_error("Error finding the category");
+ print_error('cannotfindcategory', '', '', $data->moveto);
}
$courses = array();
if (!empty($blocklist) and confirm_sesskey()) {
$blockid = $blocklist;
if (!$blocks = get_records('block_instance', 'blockid', $blockid)) {
- print_error( "Could not read data for blockid=$blockid" );
+ print_error( 'blockcannotread', '', '', $blockid);
}
// run through blocks and get (unique) courses
continue;
}
if (!$course = get_record('course', 'id', $courseid)) {
- print_error( "Could not read data for courseid=$courseid" );
+ print_error('invalidcourseid', '', '', $courseid);
}
$courses[$courseid] = $course;
}
elseif (!empty($modulelist) and confirm_sesskey()) {
$modulename = $modulelist;
if (!$modules = get_records($modulename)) {
- print_error( "Could not read data for module=$modulename" );
+ print_error('invalidmodulename', '', '', $modulename);
}
// run through modules and get (unique) courses
continue;
}
if (!$course = get_record('course', 'id', $courseid)) {
- print_error( "Could not read data for courseid=$courseid" );
+ print_error('invalidcourseid', '', '', $courseid);
}
$courses[$courseid] = $course;
}
}
if (! $course = get_record('course', 'id', $id) ) {
- print_error('Invalid course id');
+ print_error('invalidcourseid');
}
if (! $context = get_context_instance(CONTEXT_COURSE, $course->id)) {
- print_error('Invalid context');
+ print_error('invalidcontext');
}
require_login($course->id);
// verify user may unassign all roles at course context
foreach($roles as $role) {
if (!user_can_assign($context, $role->roleid)) {
- print_error('Can not unassign this user from role id:'.$role->roleid);
+ print_error('cannotunassignrolefrom', '', '',
+ $role->roleid);
}
}
if ($confirm and confirm_sesskey()) {
if ($userid) {
if (! role_unassign(0, $userid, 0, $context->id)) {
- print_error("An error occurred while trying to unenrol that person.");
+ print_error("unenrolerror");
}
add_to_log($course->id, 'course', 'unenrol', "view.php?id=$course->id", $userid);
} else {
if (! role_unassign(0, $USER->id, 0, $context->id)) {
- print_error("An error occurred while trying to unenrol you.");
+ print_error("unenrolerror");
}
// force a refresh of mycourses
if ($userid) {
if (!$user = get_record('user', 'id', $userid)) {
- print_error('That user does not exist!');
+ print_error('nousers');
}
$strunenrolsure = get_string('unenrolsure', '', fullname($user, true));
notice_yesno($strunenrolsure, "unenrol.php?id=$id&user=$user->id&confirm=yes&sesskey=".sesskey(),
a zipped web site, or anything you ask them to submit.</p>';
$string['hideintro'] = 'Hide description before available date';
$string['itemstocount'] = 'Count';
+$string['invalidid'] = 'assignment ID was incorrect';
$string['late'] = '$a late';
$string['maximumgrade'] = 'Maximum grade';
$string['maximumsize'] = 'Maximum size';
$string['adminprimarynoedit'] = 'The primary admin cannot be edited by others';
$string['blockdoesnotexist'] = 'This block does not exist';
$string['blockcannotinistantiate'] = 'Problem in instantiating block object';
+$string['blockcannotread'] = 'Could not read data for blockid= $a ';
$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['cannotunassignrolefrom'] = 'Can not unassign this user from role id: $a';
$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['invalidcourse'] = 'Invalid course';
$string['invalidcourseid'] = 'You are tring to use an invalid course ID: ($a)';
$string['invalidcoursemodule'] = 'Bad course module ID';
+$string['invalidcontext'] = 'Invalid context';
$string['invalidevent'] = 'Invalid event';
$string['invalidcoursenameshort'] = 'Invalid short course name';
$string['invalidevent'] = 'Invalid event';
$string['invalidgroupid'] = 'INcorrect group id specified.';
$string['invalidipformat'] = 'Invalid IP address format';
$string['invalidmd5'] = 'Invalid md5';
-$string['invalidmodule'] = 'Invalid module ID';
+$string['invalidmodule'] = 'Invalid module';
+$string['invalidmoduleid'] = 'Invalid module ID: $a';
+$string['invalidmodulename'] = 'Invalid module name: $a';
$string['invalidpagesize'] = 'Invalid page size';
$string['invalidrequest'] = 'Invalid request';
$string['invalidrole'] = 'Invalid role';
$string['unspecifycourseid'] = 'Must specify course id, short name or idnumber';
$string['statsnodata'] = 'There is no available data for that combination of course and time period.';
$string['statsdisable'] = 'Stats is not enabled.';
+$string['unenrolerror'] = 'An error occurred while trying to unenrol that person.';
$string['unknowaction']= 'Unknown action!';
$string['unknowncourse'] = 'Unknown course named \"$a\"';
$string['unknowncourseidnumber'] = 'Unknown Course ID \"$a\"';