MDL-19808 upgraded calls to print_table, print_single_button, print_user_picture, print_container* and notice_yesno
This commit is contained in:
+16
-6
@@ -49,6 +49,7 @@
|
||||
|
||||
// Start of the table for General Forums
|
||||
|
||||
$generaltable = new html_table();
|
||||
$generaltable->head = array ($strforum, $strdescription, $strdiscussions);
|
||||
$generaltable->align = array ('left', 'left', 'center');
|
||||
|
||||
@@ -183,9 +184,13 @@
|
||||
} else {
|
||||
$options = array('id'=>$forum->id);
|
||||
if (!isset($untracked[$forum->id])) {
|
||||
$trackedlink = print_single_button($CFG->wwwroot.'/mod/forum/settracking.php', $options, $stryes, 'post', '_self', true, $strnotrackforum);
|
||||
$form = html_form::make_button($CFG->wwwroot.'/mod/forum/settracking.php', $options, $stryes);
|
||||
$form->button->title = $strnotrackforum;
|
||||
$trackedlink = $OUTPUT->button($form);
|
||||
} else {
|
||||
$trackedlink = print_single_button($CFG->wwwroot.'/mod/forum/settracking.php', $options, $strno, 'post', '_self', true, $strtrackforum);
|
||||
$form = html_form::make_button($CFG->wwwroot.'/mod/forum/settracking.php', $options, $strno);
|
||||
$form->button->title = $strtrackforum;
|
||||
$trackedlink = $OUTPUT->button($form);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -240,6 +245,7 @@
|
||||
|
||||
|
||||
// Start of the table for Learning Forums
|
||||
$learningtable = new html_table();
|
||||
$learningtable->head = array ($strforum, $strdescription, $strdiscussions);
|
||||
$learningtable->align = array ('left', 'left', 'center');
|
||||
|
||||
@@ -305,9 +311,13 @@
|
||||
} else {
|
||||
$options = array('id'=>$forum->id);
|
||||
if (!isset($untracked[$forum->id])) {
|
||||
$trackedlink = print_single_button($CFG->wwwroot.'/mod/forum/settracking.php', $options, $stryes, 'post', '_self', true, $strnotrackforum);
|
||||
$form = html_form::make_button($CFG->wwwroot.'/mod/forum/settracking.php', $options, $stryes);
|
||||
$form->button->title = $strnotrackforum;
|
||||
$trackedlink = $OUTPUT->button($form);
|
||||
} else {
|
||||
$trackedlink = print_single_button($CFG->wwwroot.'/mod/forum/settracking.php', $options, $strno, 'post', '_self', true, $strtrackforum);
|
||||
$form = html_form::make_button($CFG->wwwroot.'/mod/forum/settracking.php', $options, $strno);
|
||||
$form->button->title = $strtrackforum;
|
||||
$trackedlink = $OUTPUT->button($form);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -394,12 +404,12 @@
|
||||
|
||||
if ($generalforums) {
|
||||
echo $OUTPUT->heading(get_string('generalforums', 'forum'));
|
||||
print_table($generaltable);
|
||||
echo $OUTPUT->table($generaltable);
|
||||
}
|
||||
|
||||
if ($learningforums) {
|
||||
echo $OUTPUT->heading(get_string('learningforums', 'forum'));
|
||||
print_table($learningtable);
|
||||
echo $OUTPUT->table($learningtable);
|
||||
}
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
+14
-11
@@ -3074,7 +3074,7 @@ function forum_get_course_forum($courseid, $type) {
|
||||
function forum_make_mail_post($course, $cm, $forum, $discussion, $post, $userfrom, $userto,
|
||||
$ownpost=false, $reply=false, $link=false, $rate=false, $footer="") {
|
||||
|
||||
global $CFG;
|
||||
global $CFG, $OUTPUT;
|
||||
|
||||
if (!isset($userto->viewfullnames[$forum->id])) {
|
||||
if (!$cm = get_coursemodule_from_instance('forum', $forum->id, $course->id)) {
|
||||
@@ -3094,7 +3094,7 @@ function forum_make_mail_post($course, $cm, $forum, $discussion, $post, $userfro
|
||||
$output = '<table border="0" cellpadding="3" cellspacing="0" class="forumpost">';
|
||||
|
||||
$output .= '<tr class="header"><td width="35" valign="top" class="picture left">';
|
||||
$output .= print_user_picture($userfrom, $course->id, $userfrom->picture, false, true);
|
||||
$output .= $OUTPUT->user_picture(moodle_user_picture::make($userfrom, $course->id));
|
||||
$output .= '</td>';
|
||||
|
||||
if ($post->parent) {
|
||||
@@ -3312,7 +3312,7 @@ function forum_print_post($post, $discussion, $forum, &$cm, $course, $ownpost=fa
|
||||
$postuser->picture = $post->picture;
|
||||
|
||||
echo '<tr class="header"><td class="picture left">';
|
||||
print_user_picture($postuser, $course->id);
|
||||
echo $OUTPUT->user_picture(moodle_user_picture::make($postuser, $course->id));
|
||||
echo '</td>';
|
||||
|
||||
if ($post->parent) {
|
||||
@@ -3620,7 +3620,7 @@ function forum_print_discussion_header(&$post, $forum, $group=-1, $datestring=""
|
||||
$postuser->picture = $post->picture;
|
||||
|
||||
echo '<td class="picture">';
|
||||
print_user_picture($postuser, $forum->course);
|
||||
echo $OUTPUT->user_picture(moodle_user_picture::make($postuser, $forum->course));
|
||||
echo "</td>\n";
|
||||
|
||||
// User name
|
||||
@@ -4915,7 +4915,7 @@ function forum_post_subscription($post, $forum) {
|
||||
* @return string
|
||||
*/
|
||||
function forum_get_subscribe_link($forum, $context, $messages = array(), $cantaccessagroup = false, $fakelink=true, $backtoindex=false, $subscribed_forums=null) {
|
||||
global $CFG, $USER, $PAGE;
|
||||
global $CFG, $USER, $PAGE, $OUTPUT;
|
||||
$defaultmessages = array(
|
||||
'subscribed' => get_string('unsubscribe', 'forum'),
|
||||
'unsubscribed' => get_string('subscribe', 'forum'),
|
||||
@@ -4960,8 +4960,9 @@ function forum_get_subscribe_link($forum, $context, $messages = array(), $cantac
|
||||
$link = "<noscript>";
|
||||
}
|
||||
$options ['id'] = $forum->id;
|
||||
$link .= print_single_button($CFG->wwwroot . '/mod/forum/subscribe.php',
|
||||
$options, $linktext, 'post', '_self', true, $linktitle);
|
||||
$form = html_form::make_button($CFG->wwwroot.'/mod/forum/subscribe.php', $options, $linktext);
|
||||
$form->button->title = $linktitle;
|
||||
$link .= $OUTPUT->button($form);
|
||||
if ($fakelink) {
|
||||
$link .= '</noscript>';
|
||||
}
|
||||
@@ -4983,7 +4984,7 @@ function forum_get_subscribe_link($forum, $context, $messages = array(), $cantac
|
||||
* @return string
|
||||
*/
|
||||
function forum_get_tracking_link($forum, $messages=array(), $fakelink=true) {
|
||||
global $CFG, $USER, $PAGE;
|
||||
global $CFG, $USER, $PAGE, $OUTPUT;
|
||||
|
||||
static $strnotrackforum, $strtrackforum;
|
||||
|
||||
@@ -5015,8 +5016,10 @@ function forum_get_tracking_link($forum, $messages=array(), $fakelink=true) {
|
||||
// use <noscript> to print button in case javascript is not enabled
|
||||
$link .= '<noscript>';
|
||||
}
|
||||
$link .= print_single_button($CFG->wwwroot . '/mod/forum/settracking.php?id=' . $forum->id,
|
||||
'', $linktext, 'post', '_self', true, $linktitle);
|
||||
$form = html_form::make_button($CFG->wwwroot.'/mod/forum/settracking.php?id=' . $forum->id, $options, $linktext);
|
||||
$form->button->title = $linktitle;
|
||||
$link .= $OUTPUT->button($form);
|
||||
|
||||
if ($fakelink) {
|
||||
$link .= '</noscript>';
|
||||
}
|
||||
@@ -6123,7 +6126,7 @@ function forum_print_recent_mod_activity($activity, $courseid, $detail, $modname
|
||||
echo '<table border="0" cellpadding="3" cellspacing="0" class="forum-recent">';
|
||||
|
||||
echo "<tr><td class=\"userpicture\" valign=\"top\">";
|
||||
print_user_picture($activity->user, $courseid);
|
||||
echo $OUTPUT->user_picture(moodle_user_picture::make($activity->user, $courseid));
|
||||
echo "</td><td class=\"$class\">";
|
||||
|
||||
echo '<div class="title">';
|
||||
|
||||
@@ -35,8 +35,7 @@
|
||||
if (isguest()) { // Guests can't change forum
|
||||
$navigation = build_navigation('', $cm);
|
||||
print_header($course->shortname, $course->fullname, $navigation, '', '', true, "", navmenu($course, $cm));
|
||||
notice_yesno(get_string('noguesttracking', 'forum').'<br /><br />'.get_string('liketologin'),
|
||||
get_login_url(), $returnto);
|
||||
echo $OUTPUT->confirm(get_string('noguesttracking', 'forum').'<br /><br />'.get_string('liketologin'), get_login_url(), $returnto);
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
}
|
||||
|
||||
+5
-6
@@ -53,8 +53,7 @@
|
||||
$navigation = build_navigation('', $cm);
|
||||
print_header($course->shortname, $course->fullname, $navigation, '' , '', true, "", navmenu($course, $cm));
|
||||
|
||||
notice_yesno(get_string('noguestpost', 'forum').'<br /><br />'.get_string('liketologin'),
|
||||
get_login_url(), get_referer(false));
|
||||
echo $OUTPUT->confirm(get_string('noguestpost', 'forum').'<br /><br />'.get_string('liketologin'), get_login_url(), get_referer(false));
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
}
|
||||
@@ -316,8 +315,8 @@
|
||||
forum_go_back_to("discuss.php?d=$post->discussion"));
|
||||
}
|
||||
print_header();
|
||||
notice_yesno(get_string("deletesureplural", "forum", $replycount+1),
|
||||
"post.php?delete=$delete&confirm=$delete&sesskey=".sesskey(),
|
||||
echo $OUTPUT->confirm(get_string("deletesureplural", "forum", $replycount+1),
|
||||
"post.php?delete=$delete&confirm=$delete",
|
||||
$CFG->wwwroot.'/mod/forum/discuss.php?d='.$post->discussion.'#p'.$post->id);
|
||||
|
||||
forum_print_post($post, $discussion, $forum, $cm, $course, false, false, false);
|
||||
@@ -329,8 +328,8 @@
|
||||
}
|
||||
} else {
|
||||
print_header();
|
||||
notice_yesno(get_string("deletesure", "forum", $replycount),
|
||||
"post.php?delete=$delete&confirm=$delete&sesskey=".sesskey(),
|
||||
echo $OUTPUT->confirm(get_string("deletesure", "forum", $replycount),
|
||||
"post.php?delete=$delete&confirm=$delete",
|
||||
$CFG->wwwroot.'/mod/forum/discuss.php?d='.$post->discussion.'#p'.$post->id);
|
||||
forum_print_post($post, $discussion, $forum, $cm, $course, false, false, false);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
foreach ($ratings as $rating) {
|
||||
echo '<tr class="forumpostheader">';
|
||||
echo "<td>";
|
||||
print_user_picture($rating->id, $forum->course, $rating->picture);
|
||||
echo $OUTPUT->user_picture(moodle_user_picture::make($rating, $forum->course));
|
||||
echo '</td><td>'.fullname($rating).'</td>';
|
||||
echo '<td style="white-space:nowrap" align="center" class="rating">'.$scalemenu[$rating->rating]."</td>";
|
||||
echo '<td style="white-space:nowrap" align="center" class="time">'.userdate($rating->time)."</td>";
|
||||
|
||||
@@ -50,8 +50,8 @@
|
||||
$navigation = build_navigation('', $cm);
|
||||
print_header($course->shortname, $course->fullname, $navigation, '', '', true, "", navmenu($course, $cm));
|
||||
|
||||
notice_yesno(get_string('noguestsubscribe', 'forum').'<br /><br />'.get_string('liketologin'),
|
||||
get_login_url(), $_SERVER['HTTP_REFERER']);
|
||||
echo $OUTPUT->confirm(get_string('noguestsubscribe', 'forum').'<br /><br />'.get_string('liketologin'),
|
||||
get_login_url(), new moodle_url());
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
echo '<table align="center" cellpadding="5" cellspacing="5">';
|
||||
foreach ($users as $user) {
|
||||
echo '<tr><td>';
|
||||
print_user_picture($user, $course->id);
|
||||
echo $OUTPUT->user_picture(moodle_user_picture::make($user, $course->id));
|
||||
echo '</td><td>';
|
||||
echo fullname($user);
|
||||
echo '</td><td>';
|
||||
|
||||
@@ -34,7 +34,7 @@ if (data_submitted() and $confirm and confirm_sesskey()) {
|
||||
|
||||
if ($a) {
|
||||
$msg = get_string('unsubscribeallconfirm', 'forum', $a);
|
||||
notice_yesno($msg, 'unsubscribeall.php', $return, array('confirm'=>1, 'sesskey'=>sesskey()), NULL, 'post', 'get');
|
||||
echo $OUTPUT->confirm($msg, new moodle_url('unsubscribeall.php', array('confirm'=>1)), $return);
|
||||
echo $OUTPUT->footer();
|
||||
die;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user