From: nicolasconnault Date: Thu, 20 Aug 2009 08:45:12 +0000 (+0000) Subject: MDL-19810 upgraded calls to print_table, print_single_button, print_user_picture... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=cf4d502665013d2552f1c1d180a10cee6a8a1eb7;p=moodle.git MDL-19810 upgraded calls to print_table, print_single_button, print_user_picture, print_container* and notice_yesno --- diff --git a/mod/hotpot/index.php b/mod/hotpot/index.php index 0ba4995fbb..46bce06793 100644 --- a/mod/hotpot/index.php +++ b/mod/hotpot/index.php @@ -257,6 +257,7 @@ $strregraderequired = get_string('regraderequired', 'hotpot'); // column headings and attributes + $table = new html_table(); $table->head = array(); $table->align = array(); @@ -399,7 +400,7 @@ echo "
"; - print_table($table); + echo $OUTPUT->table($table); // Finish the page echo $OUTPUT->footer(); diff --git a/mod/hotpot/lib.php b/mod/hotpot/lib.php index 57b866ca1d..5e2ec5b573 100644 --- a/mod/hotpot/lib.php +++ b/mod/hotpot/lib.php @@ -1262,7 +1262,7 @@ function hotpot_print_recent_mod_activity($activity, $course, $detail=false) { print ''; print ''; - print_user_picture($activity->user->userid, $course, $activity->user->picture); + echo $OUTPUT->user_picture(moodle_user_picture::make($activity->user, $course)); print '
'; if ($detail) { diff --git a/mod/hotpot/report/overview/report.php b/mod/hotpot/report/overview/report.php index 266ee9d21c..73ae4da87a 100644 --- a/mod/hotpot/report/overview/report.php +++ b/mod/hotpot/report/overview/report.php @@ -9,7 +9,7 @@ class hotpot_report extends hotpot_default_report { return true; } function create_overview_table(&$hotpot, &$cm, &$course, &$users, &$attempts, &$questions, &$options, &$tables) { - global $CFG; + global $CFG, $OUTPUT; $strtimeformat = get_string('strftimedatetime'); $is_html = ($options['reportformat']=='htm'); $spacer = $is_html ? ' ' : ' '; @@ -48,7 +48,7 @@ class hotpot_report extends hotpot_default_report { $picture = ''; $name = fullname($u); if ($is_html) { - $picture = print_user_picture($u->userid, $course->id, $u->picture, false, true); + $picture = $OUTPUT->user_picture(moodle_user_picture::make($u->userid, $course->id)); $name = ''.$name.''; } $grade = isset($user->grade) && $user->grade<>' ' ? $user->grade : $spacer; diff --git a/mod/hotpot/report/simplestat/report.php b/mod/hotpot/report/simplestat/report.php index 1cda711c66..3c17612272 100644 --- a/mod/hotpot/report/simplestat/report.php +++ b/mod/hotpot/report/simplestat/report.php @@ -10,7 +10,7 @@ class hotpot_report extends hotpot_default_report { return true; } function create_scores_table(&$hotpot, &$course, &$users, &$attempts, &$questions, &$options, &$tables) { - global $CFG; + global $CFG, $OUTPUT; $download = ($options['reportformat']=='htm') ? false : true; $is_html = ($options['reportformat']=='htm'); $blank = ($download ? '' : ' '); @@ -57,8 +57,8 @@ class hotpot_report extends hotpot_default_report { $picture = ''; $name = fullname($u); if ($is_html) { - $picture = print_user_picture($u->userid, $course->id, $u->picture, false, true); - $name = ''.$name.''; + $picture = $OUTPUT->user_picture(moodle_user_picture::make($u, $course->id)); + $name = $OUTPUT->link($CFG->wwwroot.'/user/view.php?id='.$u->userid.'&course='.$course->id, $name); } if (isset($user->grade)) { $grade = $user->grade; diff --git a/mod/hotpot/review.php b/mod/hotpot/review.php index 617ffa45d9..ef194add69 100644 --- a/mod/hotpot/review.php +++ b/mod/hotpot/review.php @@ -131,16 +131,16 @@ function hotpot_print_attempt_summary(&$hotpot, &$attempt) { echo $OUTPUT->box_end(); } function hotpot_print_review_buttons(&$course, &$hotpot, &$attempt, $context) { - global $DB; + global $DB, $OUTPUT; print "\n".''; print "\n\n".'\n".'\n".'
'; - print_single_button("report.php?hp=$hotpot->id", NULL, get_string('continue'), 'post'); + echo $OUTPUT->button(html_form::make_button("report.php?hp=$hotpot->id", NULL, get_string('continue'))); if (has_capability('mod/hotpot:viewreport',$context) && $DB->record_exists('hotpot_details', array('attempt'=>$attempt->id))) { print "'; - print_single_button("review.php?hp=$hotpot->id&attempt=$attempt->id&action=showxmlsource", NULL, get_string('showxmlsource', 'hotpot'), 'post'); + echo $OUTPUT->button(html_form::make_button("review.php?hp=$hotpot->id&attempt=$attempt->id&action=showxmlsource", NULL, get_string('showxmlsource', 'hotpot'))); print "'; - print_single_button("review.php?hp=$hotpot->id&attempt=$attempt->id&action=showxmltree", NULL, get_string('showxmltree', 'hotpot'), 'post'); + echo $OUTPUT->button(html_form::make_button("review.php?hp=$hotpot->id&attempt=$attempt->id&action=showxmltree", NULL, get_string('showxmltree', 'hotpot'))); $colspan = 3; } else { $colspan = 1;