moodle/mod/resource/view.php

27 lines
664 B
PHP
Raw Normal View History

<?php // $Id$
require_once("../../config.php");
require_once("lib.php");
require_variable($id); // Course Module ID
if (!empty($CFG->forcelogin)) {
require_login();
}
if (! $cm = get_record("course_modules", "id", $id)) {
error("Course Module ID was incorrect");
}
if (! $resource = get_record("resource", "id", $cm->instance)) {
error("Resource ID was incorrect");
}
require ("$CFG->dirroot/mod/resource/type/$resource->type/resource.class.php");
2004-07-28 06:56:59 +00:00
$resourceclass = "resource_$resource->type";
$resourceinstance = new $resourceclass($cm->id);
2004-01-09 06:36:43 +00:00
$resourceinstance->display();
?>