"MDL-14129, fix print_error"

This commit is contained in:
dongsheng
2008-06-06 08:46:48 +00:00
parent e348793639
commit 2f52a088bf
10 changed files with 51 additions and 51 deletions
+10 -10
View File
@@ -13,30 +13,30 @@
if ($id) {
if (! $cm = get_coursemodule_from_id('chat', $id)) {
print_error('Course Module ID was incorrect');
print_error('invalidcoursemodule');
}
if (! $course = get_record('course', 'id', $cm->course)) {
print_error('Course is misconfigured');
if (! $course = $DB->get_record('course', array('id'=>$cm->course))) {
print_error('coursemisconf');
}
chat_update_chat_times($cm->instance);
if (! $chat = get_record('chat', 'id', $cm->instance)) {
print_error('Course module is incorrect');
if (! $chat = $DB->get_record('chat', array('id'=>$cm->instance))) {
print_error('invalidid', 'chat');
}
} else {
chat_update_chat_times($c);
if (! $chat = get_record('chat', 'id', $c)) {
print_error('Course module is incorrect');
if (! $chat = $DB->get_record('chat', array('id'=>$c))) {
print_error('coursemisconf');
}
if (! $course = get_record('course', 'id', $chat->course)) {
print_error('Course is misconfigured');
if (! $course = get_record('course', array('id'=>$chat->course))) {
print_error('coursemisconf');
}
if (! $cm = get_coursemodule_from_instance('chat', $chat->id, $course->id)) {
print_error('Course Module ID was incorrect');
print_error('invalidcoursemodule');
}
}