course = sloodle_get_record('course', 'id', $id)) print_error('Could not find course.'); $this->sloodle_course = new SloodleCourse(); if (!$this->sloodle_course->load($this->course)) print_error(get_string('failedcourseload', 'sloodle')); } /** * Check that the user is logged-in and has permission to alter course settings. */ function check_permission() { // Ensure the user logs in require_login($this->course->id); if (isguestuser()) print_error(get_string('noguestaccess', 'sloodle')); //add_to_log($this->course->id, 'course', 'view sloodle data', '', "{$this->course->id}"); sloodle_add_to_log($this->course->id, 'module_viewed', 'view.php', array('_type'=>'logs','id'=>$this->course->id), 'logs: view sloodle data'); // Ensure the user is allowed to update information on this course //$this->course_context = get_context_instance(CONTEXT_COURSE, $this->course->id); $this->course_context = context_course::instance($this->course->id, IGNORE_MISSING); require_capability('moodle/course:update', $this->course_context); } /** * Print the course settings page header. */ function sloodle_print_header() { global $CFG; $navigation = "wwwroot}/mod/sloodle/view_logs.php?id={$this->course->id}\">".get_string('logs:view', 'sloodle').""; sloodle_print_header_simple(get_string('logs:view','sloodle'), " ", $navigation, "", "", true, '', false); } /** * Render the view of the module or feature. * This MUST be overridden to provide functionality. */ function render() { global $CFG; global $sloodle; // Display info about Sloodle course configuration echo "
wwwroot}/course/view.php?id={$this->course->id}\"><<< ".get_string('backtocoursepage','sloodle').""; sloodle_print_footer($this->course); } }