Index: temp_moodle_dev/moodle/mod/forum/post.php =================================================================== RCS file: /usr/local/cvsroot/temp_moodle_dev/moodle/mod/forum/post.php,v diff -u -r1.1 -r1.2 --- temp_moodle_dev/moodle/mod/forum/post.php 14 Nov 2008 06:30:16 -0000 1.1 +++ temp_moodle_dev/moodle/mod/forum/post.php 10 Dec 2008 23:42:38 -0000 1.2 @@ -14,6 +14,7 @@ $name = optional_param('name', '', PARAM_CLEAN); $confirm = optional_param('confirm', 0, PARAM_INT); $groupid = optional_param('groupid', null, PARAM_INT); + $editing = optional_param('editing', 0, PARAM_INT); // 1 if editing in Lams //these page_params will be passed as hidden variables later in the form. @@ -58,14 +59,19 @@ } $navigation = build_navigation('', $cm); - print_header($course->shortname, $course->fullname, $navigation, '' , '', true, "", navmenu($course, $cm)); - + //if in Lams sequence don't display Moodle's navigation header + if($cm->is_lams==1){ + print_header(); + }else{ + print_header($course->shortname, $course->fullname, $navigation, '' , '', true, "", navmenu($course, $cm)); + } + notice_yesno(get_string('noguestpost', 'forum').'

'.get_string('liketologin'), $wwwroot, get_referer(false)); - print_footer($course); + //we pass a new parameter to the function so it won't we printed if is_lams=1 + print_footer($course,null, false,$cm->is_lams); exit; } - require_login(0, false); // Script is useless unless they're logged in if (!empty($forum)) { // User is starting a new discussion in a forum @@ -184,6 +190,8 @@ if (!(substr($post->subject, 0, strlen($strre)) == $strre)) { $post->subject = $strre.' '.$post->subject; } + + unset($SESSION->fromdiscussion); @@ -337,7 +345,8 @@ } } - print_footer($course); + //we pass a new parameter to the function so it won't we printed if is_lams=1 + print_footer($course,null, false,$cm->is_lams); die; @@ -413,8 +422,13 @@ $navlinks[] = array('name' => format_string($post->subject, true), 'link' => "discuss.php?d=$discussion->id", 'type' => 'title'); $navlinks[] = array('name' => get_string("prune", "forum"), 'link' => '', 'type' => 'title'); $navigation = build_navigation($navlinks, $cm); - print_header_simple(format_string($discussion->name).": ".format_string($post->subject), "", $navigation, '', "", true, "", navmenu($course, $cm)); - + + //we pass a new parameter to the function so it won't we printed if is_lams=1 + print_header_simple(format_string($discussion->name).": ".format_string($post->subject), "", $navigation, '', "", true, "", navmenu($course, $cm),false,'',false,$cm->is_lams); + + + + print_heading(get_string('pruneheading', 'forum')); echo '
'; @@ -423,7 +437,8 @@ forum_print_post($post, $discussion, $forum, $cm, $course, false, false, false); echo '
'; } - print_footer($course); + //we pass a new parameter to the function so it won't we printed if is_lams=1 + print_footer($course,null, false,$cm->is_lams); die; } else { error("No operation specified"); @@ -457,6 +472,10 @@ //$fromform->attachment = isset($_FILES['attachment']) ? $_FILES['attachment'] : NULL; trusttext_after_edit($fromform->message, $modcontext); + + if($editing==0&&$cm->is_lams==1){//lams: if you are a learner and have add a post to the forum display next activity button to continue the activities in Lams + include('showlamsnext.php'); + } if ($fromform->edit) { // Updating a post unset($fromform->groupid); @@ -516,7 +535,7 @@ "$discussionurl&parent=$fromform->id", "$fromform->id", $cm->id); redirect(forum_go_back_to("$discussionurl"), $message.$subscribemessage, $timemessage); - + exit; @@ -556,7 +575,7 @@ "$discussionurl&parent=$fromform->id", "$fromform->id", $cm->id); redirect(forum_go_back_to("$discussionurl#p$fromform->id"), $message.$subscribemessage, $timemessage); - + } else { print_error("couldnotadd", "forum", $errordestination); } @@ -604,7 +623,7 @@ if ($subscribemessage = forum_post_subscription($discussion, $forum)) { $timemessage = 4; } - + redirect(forum_go_back_to("view.php?f=$fromform->forum"), $message.$subscribemessage, $timemessage); } else { @@ -668,11 +687,16 @@ $navlinks[] = array('name' => format_string($toppost->subject), 'link' => '', 'type' => 'title'); } $navigation = build_navigation($navlinks, $cm); + // if in Lams sequence don't display moodle navigation headers + if($cm->is_lams==1){ + print_header(); + }else{ + print_header("$course->shortname: $strdiscussionname ". + format_string($toppost->subject), $course->fullname, + $navigation, $mform_post->focus($forcefocus), "", true, "", navmenu($course, $cm)); + } + - print_header("$course->shortname: $strdiscussionname ". - format_string($toppost->subject), $course->fullname, - $navigation, $mform_post->focus($forcefocus), "", true, "", navmenu($course, $cm)); - // checkup if (!empty($parent) && !forum_user_can_see_post($forum, $discussion, $post, null, $cm)) { error("You cannot reply to this post"); @@ -725,7 +749,8 @@ } else { $data->name = fullname($USER); $post->message .= "\n\n(".get_string('editedby', 'forum', $data).')'; - } + } + } //load data into form @@ -778,7 +803,8 @@ $mform_post->display(); - print_footer($course); + //we pass a new parameter to the function so it won't we printed if is_lams=1 + print_footer($course,null, false,$cm->is_lams); ?>