Skip to content

Commit

Permalink
MDL-30909 Accessibility: Improved access to reply form in forums
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Massart committed Sep 18, 2012
1 parent 28c7749 commit 0da2ae2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mod/forum/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']))) {
Expand Down
7 changes: 6 additions & 1 deletion mod/forum/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@

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));
Expand All @@ -528,8 +528,10 @@
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');
Expand Down Expand Up @@ -888,6 +890,9 @@
}
}

if (!empty($formheading)) {
echo $OUTPUT->heading($formheading, 2, array('class' => 'accesshide'));
}
$mform_post->display();

echo $OUTPUT->footer();
Expand Down

0 comments on commit 0da2ae2

Please sign in to comment.