MDL-57487 mod_chat: final deprecation xxx_print_overview

This commit is contained in:
Sara Arjona 2019-06-12 19:40:33 +02:00
parent 2af4a2c193
commit cd1d59a974

View File

@ -1136,44 +1136,10 @@ function chat_get_post_actions() {
}
/**
* @deprecated since 3.3
* @todo The final deprecation of this function will take place in Moodle 3.7 - see MDL-57487.
* @global object
* @global object
* @param array $courses
* @param array $htmlarray Passed by reference
* @deprecated since Moodle 3.3, when the block_course_overview block was removed.
*/
function chat_print_overview($courses, &$htmlarray) {
global $USER, $CFG;
debugging('The function chat_print_overview() is now deprecated.', DEBUG_DEVELOPER);
if (empty($courses) || !is_array($courses) || count($courses) == 0) {
return array();
}
if (!$chats = get_all_instances_in_courses('chat', $courses)) {
return;
}
$strchat = get_string('modulename', 'chat');
$strnextsession = get_string('nextsession', 'chat');
foreach ($chats as $chat) {
if ($chat->chattime and $chat->schedule) { // A chat is scheduled.
$str = '<div class="chat overview"><div class="name">'.
$strchat.': <a '.($chat->visible ? '' : ' class="dimmed"').
' href="'.$CFG->wwwroot.'/mod/chat/view.php?id='.$chat->coursemodule.'">'.
$chat->name.'</a></div>';
$str .= '<div class="info">'.$strnextsession.': '.userdate($chat->chattime).'</div></div>';
if (empty($htmlarray[$chat->course]['chat'])) {
$htmlarray[$chat->course]['chat'] = $str;
} else {
$htmlarray[$chat->course]['chat'] .= $str;
}
}
}
function chat_print_overview() {
throw new coding_exception('chat_print_overview() can not be used any more and is obsolete.');
}