course = sloodle_get_record('course', 'id', $id)) error('Could not find course.'); $this->sloodle_course = new SloodleCourse(); if (!$this->sloodle_course->load($this->course)) 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()) error(get_string('noguestaccess', 'sloodle')); add_to_log($this->course->id, 'course', 'view sloodle data', '', "{$this->course->id}"); // Ensure the user is allowed to update information on this course $this->course_context = get_context_instance(CONTEXT_COURSE, $this->course->id); 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); } } ?>