From 7cb1a1adfee6bd8095972aac5bdfc7eedf880ccf Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Thu, 20 Aug 2009 08:41:47 +0000 Subject: [PATCH] MDL-19801 upgraded calls to print_table, print_single_button, print_user_picture, print_container* and notice_yesno --- message/discussion.php | 5 ++++- message/history.php | 10 ++++++++-- message/lib.php | 36 +++++++++++++++++++++++------------- message/user.php | 5 ++++- 4 files changed, 39 insertions(+), 17 deletions(-) diff --git a/message/discussion.php b/message/discussion.php index 82b3c4f8f0..ba86cf85b7 100644 --- a/message/discussion.php +++ b/message/discussion.php @@ -136,7 +136,10 @@ echo '
'; echo '
'; - echo print_user_picture($user, SITEID, $user->picture, 48, true, true, 'userwindow'); + $userpic = moodle_user_picture::make($user, SITEID); + $userpic->size = 48; + $userpic->link = true; + echo $OUTPUT->user_picture($userpic); echo '

'.$userfullname.'

'; echo '
    '; if ($contact = $DB->get_record('message_contacts', array('userid'=>$USER->id, 'contactid'=>$user->id))) { diff --git a/message/history.php b/message/history.php index 8942b6dfd9..b6d7255408 100644 --- a/message/history.php +++ b/message/history.php @@ -57,7 +57,10 @@ echo $OUTPUT->box_start('center'); echo ''; echo ''; echo ''; echo ''; echo '
    '; - echo print_user_picture($user1, SITEID, $user1->picture, 100, true, true, 'userwindow').'
    '; + $userpic = moodle_user_picture::make($user1, SITEID); + $userpic->size = 100; + $userpic->link = true; + echo $OUTPUT->user_picture($userpic).'
    '; echo fullname($user1); echo '
    '; @@ -65,7 +68,10 @@ echo ''.get_string('to').''; echo ''; - echo print_user_picture($user2, SITEID, $user2->picture, 100, true, true, 'userwindow').'
    '; + $userpic = moodle_user_picture::make($user2, SITEID); + $userpic->size = 100; + $userpic->link = true; + echo $OUTPUT->user_picture($userpic).'
    '; echo fullname($user2); echo '
    '; diff --git a/message/lib.php b/message/lib.php index ddfb9b981b..5da50782d6 100644 --- a/message/lib.php +++ b/message/lib.php @@ -19,7 +19,7 @@ if (!isset($CFG->message_offline_time)) { function message_print_contacts() { - global $USER, $CFG, $DB, $PAGE; + global $USER, $CFG, $DB, $PAGE, $OUTPUT; $timetoshowusers = 300; //Seconds default if (isset($CFG->block_online_users_timetosee)) { @@ -152,13 +152,13 @@ function message_print_contacts() { $PAGE->requires->js('message/message.js'); $PAGE->requires->js_function_call('refresh_page', Array(60*1000, $PAGE->url->out())); - echo '
    '; + echo $OUTPUT->container_start('messagejsautorefresh note center'); echo get_string('pagerefreshes', 'message', $CFG->message_contacts_refresh); - echo '
    '; + echo $OUTPUT->container_end(); - echo '
    '; - echo print_single_button('index.php', false, get_string('refresh')); - echo '
    '; + echo $OUTPUT->container_start('messagejsmanualrefresh aligncenter'); + echo $OUTPUT->button(html_form::make_button('index.php', false, get_string('refresh'))); + echo $OUTPUT->container_end(); } @@ -332,7 +332,10 @@ function message_print_search_results($frm) { $strhistory = message_history_link($user->id, 0, true, '', '', 'icon'); echo ''; - print_user_picture($user, SITEID, $user->picture, 20, false, true, 'userwindow'); + $userpic = moodle_user_picture::make($user, SITEID); + $userpic->size = 20; + $userpic->link = true; + echo $OUTPUT->user_picture($userpic); echo ''; echo ''; link_to_popup_window("/message/discussion.php?id=$user->id", "message_$user->id", fullname($user), @@ -486,18 +489,22 @@ function message_print_search_results($frm) { } echo '
    '; - print_single_button('index.php', array( 'tab' => 'search'), get_string('newsearch', 'message') ); + echo $OUTPUT->button(html_form::make_button('index.php', array( 'tab' => 'search'), get_string('newsearch', 'message'))); echo '
'; } function message_print_user ($user=false, $iscontact=false, $isblocked=false) { - global $USER; + global $USER, $OUTPUT; + $userpic = moodle_user_picture::make($USER, SITEID); + $userpic->size = 20; + $userpic->link = true; + if ($user === false) { - print_user_picture($USER, SITEID, $USER->picture, 20, false, true, 'userwindow'); + echo $OUTPUT->user_picture($userpic); } else { - print_user_picture($user, SITEID, $user->picture, 20, false, true, 'userwindow'); + echo $OUTPUT->user_picture($userpic); echo ' '; if ($iscontact) { message_contact_link($user->id, 'remove'); @@ -987,7 +994,7 @@ function message_get_participants() { /** * Print a row of contactlist displaying user picture, messages waiting and * block links etc - * @param $contact contact object containing all fields required for print_user_picture() + * @param $contact contact object containing all fields required for $OUTPUT->user_picture() * @param $incontactlist is the user a contact of ours? */ function message_print_contactlist_user($contact, $incontactlist = true){ @@ -1011,7 +1018,10 @@ function message_print_contactlist_user($contact, $incontactlist = true){ $strhistory = message_history_link($contact->id, 0, true, '', '', 'icon'); echo ''; - print_user_picture($contact, SITEID, $contact->picture, 20, false, true, 'userwindow'); + $userpic = moodle_user_picture::make($contact, SITEID); + $userpic->size = 20; + $userpic->link = true; + echo $OUTPUT->user_picture($userpic); echo ''; echo ''; diff --git a/message/user.php b/message/user.php index 478770140f..f86a99f295 100644 --- a/message/user.php +++ b/message/user.php @@ -54,7 +54,10 @@ echo $OUTPUT->header(); echo ''; echo ''; + $userpic = moodle_user_picture::make($user, SITEID); + $userpic->size = 48; + $userpic->link = true; + echo $OUTPUT->user_picture($userpic) .''; echo '
'; - echo print_user_picture($user, SITEID, $user->picture, true, true, true, 'userwindow').''; echo '
'.fullname($user).'
'; -- 2.39.5