1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-25 10:26:17 +02:00

chat MDL-19804 Upgraded deprecated calls

This commit is contained in:
samhemelryk 2009-10-16 03:19:32 +00:00
parent bbe0bd9899
commit d32229555f
2 changed files with 11 additions and 3 deletions

@ -755,7 +755,7 @@ function chat_update_chat_times($chatid=0) {
* @return bool|string Returns HTML or false
*/
function chat_format_message_manually($message, $courseid, $sender, $currentuser, $chat_lastrow=NULL) {
global $CFG, $USER;
global $CFG, $USER, $OUTPUT;
$output = new object();
$output->beep = false; // by default
@ -774,7 +774,15 @@ function chat_format_message_manually($message, $courseid, $sender, $currentuser
$USER->timezone = $tz;
$message->strtime = userdate($message->timestamp, get_string('strftimemessage', 'chat'), $tz);
$message->picture = print_user_picture($sender->id, $courseid, $sender->picture, false, true, false);
$userpic = new moodle_user_picture();
$userpic->user = $sender;
$userpic->courseid = $courseid;
$userpic->size = false;
$userpic->link = false;
$userpic->alttext = true;
$userpic->image->src = $sender->picture;
$message->picture = $OUTPUT->user_picture($userpic);
if ($courseid) {
$message->picture = "<a onclick=\"window.open('$CFG->wwwroot/user/view.php?id=$sender->id&amp;course=$courseid')\" href=\"$CFG->wwwroot/user/view.php?id=$sender->id&amp;course=$courseid\">$message->picture</a>";
}

@ -72,7 +72,7 @@
$title = $course->shortname . ': ' . format_string($chat->name);
$buttons = '<table><tr><td>'.update_module_button($cm->id, $course->id, get_string('modulename', 'chat')).'</td>';
$buttons = '<table><tr><td>'.$OUTPUT->update_module_button($cm->id, $cm->modname).'</td>';
if ($PAGE->user_allowed_editing() && !empty($CFG->showblocksonmodpages)) {
$buttons .= '<td><form '.$CFG->frametarget.' method="get" action="view.php"><div>'.
'<input type="hidden" name="id" value="'.$cm->id.'" />'.