id, $resource->course)) { error('Course Module ID was incorrect'); } } else if ($id) { if (! $cm = get_coursemodule_from_id('resource', $id)) { error('Course Module ID was incorrect'); } if (! $resource = get_record('resource', 'id', $cm->instance)) { error('Resource ID was incorrect'); } } else { error('No valid parameters!!'); } if (! $course = get_record('course', 'id', $cm->course)) { error('Incorrect course id'); } require_course_login($course, true, $cm); require ($CFG->dirroot.'/mod/resource/type/'.$resource->type.'/resource.class.php'); $resourceclass = 'resource_'.$resource->type; $resourceinstance = new $resourceclass($cm->id); $resourceinstance->display(); ?>