Moodle release 3.4.7
[moodle.git] / mod / feedback / print.php
blobd9448fd335f578dfdc6da4ed8c9b14ee3ebe2ff5
1 <?php
2 // This file is part of Moodle - http://moodle.org/
3 //
4 // Moodle is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // Moodle is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
17 /**
18 * print a printview of feedback-items
20 * @author Andreas Grabs
21 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
22 * @package mod_feedback
25 require_once("../../config.php");
26 require_once("lib.php");
28 $id = required_param('id', PARAM_INT);
29 $courseid = optional_param('courseid', false, PARAM_INT); // Course where this feedback is mapped to - used for return link.
31 $PAGE->set_url('/mod/feedback/print.php', array('id'=>$id));
33 list($course, $cm) = get_course_and_cm_from_cmid($id, 'feedback');
34 require_course_login($course, true, $cm);
36 $feedback = $PAGE->activityrecord;
37 $feedbackstructure = new mod_feedback_structure($feedback, $cm, $courseid);
39 $PAGE->set_pagelayout('popup');
41 // Print the page header.
42 $strfeedbacks = get_string("modulenameplural", "feedback");
43 $strfeedback = get_string("modulename", "feedback");
45 $feedback_url = new moodle_url('/mod/feedback/index.php', array('id'=>$course->id));
46 $PAGE->navbar->add($strfeedbacks, $feedback_url);
47 $PAGE->navbar->add(format_string($feedback->name));
49 $PAGE->set_title($feedback->name);
50 $PAGE->set_heading($course->fullname);
51 echo $OUTPUT->header();
53 // Print the main part of the page.
54 echo $OUTPUT->heading(format_string($feedback->name));
56 $continueurl = new moodle_url('/mod/feedback/view.php', array('id' => $id));
57 if ($courseid) {
58 $continueurl->param('courseid', $courseid);
61 $form = new mod_feedback_complete_form(mod_feedback_complete_form::MODE_PRINT,
62 $feedbackstructure, 'feedback_print_form');
63 echo $OUTPUT->continue_button($continueurl);
64 $form->display();
65 echo $OUTPUT->continue_button($continueurl);
67 // Finish the page.
68 echo $OUTPUT->footer();