require_once('delete_category_form.php');
if (!$deletecat = $DB->get_record('course_categories', array('id'=>$delete))) {
- error('Incorrect category id', 'index.php');
+ print_error('invalidcategoryid');
}
$heading = get_string('deletecategory', '', format_string($deletecat->name));
$matches=array();
if (!preg_match('/^mod_([^_]+)_mod_form$/', $this->_formname, $matches)) {
debugging('Use $modname parameter or rename form to mod_xx_mod_form, where xx is name of your module');
- error('Unknown module name for form');
+ print_error('unknownmodulename');
}
$modname=$matches[1];
}
// Get course
$course=$DB->get_record('course',array('id'=>required_param('course',PARAM_INT)));
if(!$course) {
- error('Specified course not found');
+ print_error('invalidcourseid');
}
// Sort (default lastname, optionally firstname)
case COMPLETION_INCOMPLETE:
break;
default:
- error('Unsupported completion state');
+ print_error('unsupportedstate');
}
$fromajax=optional_param('fromajax',0,PARAM_INT);
function error_or_ajax($message) {
global $fromajax;
if($fromajax) {
- print $message;
+ print get_string($message, 'error');
exit;
} else {
- error($message);
+ print_error($message);
}
}
// Get course-modules entry
if(!($cm=$DB->get_record('course_modules',array('id'=>$cmid)))) {
- error_or_ajax('Activity ID unknown');
+ error_or_ajax('invalidactivityid');
}
if(!($course=$DB->get_record('course',array('id'=>$cm->course)))) {
- error_or_ajax('Missing course (database corrupt?)');
+ error_or_ajax('invalidcourseid');
}
// Check user is logged in
// Check completion state is manual
if($cm->completion!=COMPLETION_TRACKING_MANUAL) {
- error_or_ajax('Activity does not provide manual completion tracking');
+ error_or_ajax('cannotmanualctrack');
}
// Now change state
$string['cannotgradeuser'] = 'Cannot grade this user';
$string['cannothaveparentcate'] = 'Course category cannot have parent!';
$string['cannotmailconfirm'] = 'Error sending password change confirmation email';
+$string['cannotmanualctrack'] = 'Activity does not provide manual completion tracking';
$string['cannotmapfield'] = 'Mapping collision detected - two fields maps to the same grade item $a';
$string['cannotmarktopic'] = 'Could not mark that topic for this course';
$string['cannotmoverolewithid'] = 'Cannot move role with ID $a';
$string['guestnoeditprofileother'] = 'The guest user profile cannot be edited';
$string['hashpoolproblem'] = 'Incorrect pool file content $a.';
$string['invalidaction'] = 'Invalid action parameter';
+$string['invalidactivityid'] = 'Invalid Activity ID';
$string['invalidarguments'] = 'No valid arguments supplied';
$string['invalidargorconf'] = 'No valid arguments supplied or incorrect server configuration';
$string['invalidaccessparameter'] = 'Invalid access parameter';
$string['unknowngroup'] = 'Unknown group \"$a\"';
$string['unknownrole'] = 'Unknown role \"$a\"';
$string['unknownuseraction'] = 'Sorry, I do not understand this user action';
+$string['unknownmodulename'] = 'Unknown module name for form';
$string['unknoworder'] = 'Unknown ordering';
$string['unknowparamtype'] = 'Unknown parameter type: $a';
$string['unknowquestiontype'] = 'Unsupported question type $a';
$string['unknowuploadaction'] = 'Error: Unknown upload action ($a)';
$string['unsupportedevent'] = 'Unsupported event type';
+$string['unsupportedstate'] = 'Unsupported completion state';
$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';
$string['userautherror'] = 'Unknown auth plugin';