Browse files

Chat module support for my moodle page

  • Loading branch information...
1 parent 101e9ca commit 9ca0187e162f9f76ac0f51da96bc633d69c73d36 patrickslee committed Mar 14, 2006
Showing with 28 additions and 0 deletions.
  1. +1 −0 lang/en_utf8/chat.php
  2. +27 −0 mod/chat/lib.php
View
1 lang/en_utf8/chat.php
@@ -39,6 +39,7 @@
$string['nextsession'] = 'Next scheduled session';
$string['noguests'] = 'The chat is not open to guests';
$string['nomessages'] = 'No messages yet';
+$string['noscheduledsession'] = 'No scheduled session';
$string['repeatdaily'] = 'At the same time every day';
$string['repeatnone'] = 'No repeats - publish the specified time only';
$string['repeattimes'] = 'Repeat sessions';
View
27 mod/chat/lib.php
@@ -636,4 +636,31 @@ function chat_get_post_actions() {
return array('talk');
}
+function chat_print_overview($courses, &$htmlarray) {
+ global $USER, $CFG;
+
+ 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');
+ $strnoscheduledsession = get_string('noscheduledsession', 'chat');
+
+ foreach ($chats as $chat) {
+ $str = '<a '.($chat->visible?'':' class="dimmed"').' href="'.$CFG->wwwroot.'/mod/chat/view.php?id='.$chat->coursemodule.'">'
+ .$strchat.': '.$chat->name.'</a><br />';
+ if ($chat->chattime and $chat->schedule) { // A chat is scheduled
+ $str .= "$strnextsession: ".userdate($chat->chattime).' ('.usertimezone($USER->timezone).')<br />';
+ } else {
+ $str .= $strnoscheduledsession.'<br />';
+ }
+ $htmlarray[$chat->course]['chat'] .= $str;
+ }
+}
+
?>

0 comments on commit 9ca0187

Please sign in to comment.