"MDL-14129, fix print_error call under course/, see tracker"

This commit is contained in:
dongsheng 2008-05-07 06:02:51 +00:00
parent 211c6890c5
commit ba6018a902
17 changed files with 146 additions and 117 deletions

View file

@ -19,7 +19,7 @@
$context = $sysctx;
if (!$site = get_site()) {
print_error('Site isn\'t defined!');
print_error('siteisnotdefined', 'debug');
}
if ($CFG->forcelogin) {
@ -120,7 +120,7 @@
if ($childcats = get_records('course_categories', 'parent', $deletecat->id)) {
foreach ($childcats as $childcat) {
if (! set_field('course_categories', 'parent', $deletecat->parent, 'id', $childcat->id)) {
print_error('Could not update a child category!', 'index.php');
print_error('cannotupdatesubcate', '', 'index.php');
}
}
}
@ -131,7 +131,7 @@
if ($childcourses = get_records('course', 'category', $deletecat->id)) {
foreach ($childcourses as $childcourse) {
if (! set_field('course', 'category', $deletecat->parent, 'id', $childcourse->id)) {
print_error('Could not update a child course!', 'index.php');
print_error('cannotupdatesubcourse', '', 'index.php');
}
}
}
@ -163,7 +163,7 @@
unset($tempcat);
$tempcat->name = get_string('miscellaneous');
if (!$tempcat->id = insert_record('course_categories', $tempcat)) {
print_error('Serious error: Could not create a default category!');
print_error('cannotsetupcategory');
}
$tempcat->context = get_context_instance(CONTEXT_COURSECAT, $tempcat->id);
mark_context_dirty('/'.SYSCONTEXTID);