From 0da2ae21d14e2b2fd7cf434a902bc4b8a549e33a Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Thu, 6 Sep 2012 13:24:37 +0800 Subject: [PATCH] MDL-30909 Accessibility: Improved access to reply form in forums --- mod/forum/lib.php | 2 +- mod/forum/post.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mod/forum/lib.php b/mod/forum/lib.php index f66fc7964d0..4d3a84dcdba 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -3353,7 +3353,7 @@ function forum_print_post($post, $discussion, $forum, &$cm, $course, $ownpost=fa } if ($reply) { - $commands[] = array('url'=>new moodle_url('/mod/forum/post.php', array('reply'=>$post->id)), 'text'=>$str->reply); + $commands[] = array('url'=>new moodle_url('/mod/forum/post.php#mformforum', array('reply'=>$post->id)), 'text'=>$str->reply); } if ($CFG->enableportfolios && ($cm->cache->caps['mod/forum:exportpost'] || ($ownpost && $cm->cache->caps['mod/forum:exportownpost']))) { diff --git a/mod/forum/post.php b/mod/forum/post.php index 2d11a2ef1be..c2bbbfe128d 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -507,7 +507,7 @@ if (!isset($forum->maxattachments)) { // TODO - delete this once we add a field require_once('post_form.php'); -$mform_post = new mod_forum_post_form('post.php', array('course'=>$course, 'cm'=>$cm, 'coursecontext'=>$coursecontext, 'modcontext'=>$modcontext, 'forum'=>$forum, 'post'=>$post)); +$mform_post = new mod_forum_post_form('post.php', array('course'=>$course, 'cm'=>$cm, 'coursecontext'=>$coursecontext, 'modcontext'=>$modcontext, 'forum'=>$forum, 'post'=>$post), 'post', '', array('id' => 'mformforum')); $draftitemid = file_get_submitted_draft_itemid('attachments'); file_prepare_draft_area($draftitemid, $modcontext->id, 'mod_forum', 'attachment', empty($post->id)?null:$post->id, mod_forum_post_form::attachment_options($forum)); @@ -528,8 +528,10 @@ if ($USER->id != $post->userid) { // Not the original author, so add a message unset($data); } +$formheading = ''; if (!empty($parent)) { $heading = get_string("yourreply", "forum"); + $formheading = get_string('reply', 'forum'); } else { if ($forum->type == 'qanda') { $heading = get_string('yournewquestion', 'forum'); @@ -888,6 +890,9 @@ if (!empty($parent)) { } } +if (!empty($formheading)) { + echo $OUTPUT->heading($formheading, 2, array('class' => 'accesshide')); +} $mform_post->display(); echo $OUTPUT->footer();