]> git.mjollnir.org Git - moodle.git/commitdiff
chat MDL-19804 Upgraded deprecated calls
authorsamhemelryk <samhemelryk>
Fri, 16 Oct 2009 03:19:32 +0000 (03:19 +0000)
committersamhemelryk <samhemelryk>
Fri, 16 Oct 2009 03:19:32 +0000 (03:19 +0000)
mod/chat/lib.php
mod/chat/view.php

index 938e054bca2f0ec0e6d99538a81f96261b7ba6eb..a2090cabdbc2ad3404a82aee22f9c6a44d436afc 100644 (file)
@@ -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>";
     }
index a173fd210295f0f123ba6a2f06c8eca0a7ee2287..d69d9efb0de43a0d85c00ccd65efa504acc523ee 100644 (file)
@@ -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.'" />'.