Skip to content

Commit

Permalink
MDL-19808 Added set_url and fixed minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasconnault committed Sep 11, 2009
1 parent 29b64a2 commit d355865
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
8 changes: 8 additions & 0 deletions mod/forum/discuss.php
Expand Up @@ -12,6 +12,14 @@
$mark = optional_param('mark', '', PARAM_ALPHA); // Used for tracking read posts if user initiated.
$postid = optional_param('postid', 0, PARAM_INT); // Used for tracking read posts if user initiated.

$PAGE->set_url('/mod/forum/post.php', array(
'd' => $d,
'parent' => $parent,
'mode' => $mode,
'mark' => $mark,
'postid' => $postid
));

if (!$discussion = $DB->get_record('forum_discussions', array('id' => $d))) {
print_error('invaliddiscussionid', 'forum');
}
Expand Down
16 changes: 14 additions & 2 deletions mod/forum/post.php
Expand Up @@ -14,6 +14,16 @@
$confirm = optional_param('confirm', 0, PARAM_INT);
$groupid = optional_param('groupid', null, PARAM_INT);

$PAGE->set_url('/mod/forum/post.php', array(
'reply' => $reply,
'forum' => $forum,
'edit' => $edit,
'delete'=> $delete,
'prune' => $prune,
'name' => $name,
'confirm'=>$confirm,
'groupid'=>$groupid,
));
//these page_params will be passed as hidden variables later in the form.
$page_params = array('reply'=>$reply, 'forum'=>$forum, 'edit'=>$edit);

Expand Down Expand Up @@ -52,7 +62,7 @@

$PAGE->set_title($course->shortname);
$PAGE->set_heading($course->fullname);

echo $OUTPUT->header();
echo $OUTPUT->confirm(get_string('noguestpost', 'forum').'<br /><br />'.get_string('liketologin'), get_login_url(), get_referer(false));
echo $OUTPUT->footer();
Expand Down Expand Up @@ -748,8 +758,10 @@

$forcefocus = empty($reply) ? NULL : 'message';

if (!empty($discussion->id)) {
$PAGE->navbar->add(format_string($toppost->subject, true), "discuss.php?d=$discussion->id");
}

$PAGE->navbar->add(format_string($toppost->subject, true), "discuss.php?d=$discussion->id");
if ($post->parent) {
$PAGE->navbar->add(get_string('editing', 'forum'));
}
Expand Down

0 comments on commit d355865

Please sign in to comment.