. /** * Page module version information * * @package mod_palestra * @copyright 2021 Interlegis (https://www.interlegis.leg.br) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require('../../config.php'); require_once($CFG->dirroot.'/mod/palestra/lib.php'); require_once($CFG->libdir.'/completionlib.php'); $id = optional_param('id', 0, PARAM_INT); // Course Module ID $p = optional_param('p', 0, PARAM_INT); // Palestra instance ID if ($p) { if (!$palestra = $DB->get_record('palestra', array('id'=>$p))) { print_error('invalidaccessparameter'); } $cm = get_coursemodule_from_instance('palestra', $palestra->id, $palestra->course, false, MUST_EXIST); } else { if (!$cm = get_coursemodule_from_id('palestra', $id)) { print_error('invalidcoursemodule'); } $palestra = $DB->get_record('palestra', array('id'=>$cm->instance), '*', MUST_EXIST); } $course = $DB->get_record('course', array('id'=>$cm->course), '*', MUST_EXIST); require_course_login($course, true, $cm); $context = context_module::instance($cm->id); require_capability('mod/palestra:view', $context); // Completion and trigger events. palestra_view($palestra, $course, $cm, $context); $PAGE->set_url('/mod/palestra/view.php', array('id' => $cm->id)); $PAGE->set_title($course->shortname.': '.$palestra->name); $PAGE->set_heading($course->fullname); $PAGE->set_activity_record($palestra); $PAGE->requires->jquery(); echo $OUTPUT->header(); echo $OUTPUT->heading(format_string($palestra->name), 2); if (trim(strip_tags($palestra->intro))) { echo $OUTPUT->box_start('mod_introbox', 'pageintro'); echo format_module_intro('palestra', $palestra, $cm->id); echo $OUTPUT->box_end(); } echo $OUTPUT->box("", "generalbox center clearfix text-center"); $stream = ""; if ($palestra->includechat) { $parse = parse_url($CFG->wwwroot); $domain = $parse['host']; $chat = ""; if ($palestra->chatdisposition =='S') { echo '