2009-11-04 08:11:02 +00:00
|
|
|
<?php
|
2003-08-11 07:48:03 +00:00
|
|
|
|
|
|
|
/// Displays external information about a course
|
|
|
|
|
|
|
|
require_once("../config.php");
|
|
|
|
require_once("lib.php");
|
|
|
|
|
2005-11-18 10:57:36 +00:00
|
|
|
$id = optional_param('id', false, PARAM_INT); // Course id
|
|
|
|
$name = optional_param('name', false, PARAM_RAW); // Course short name
|
2003-08-11 07:48:03 +00:00
|
|
|
|
|
|
|
if (!$id and !$name) {
|
2008-05-07 06:02:51 +00:00
|
|
|
print_error("unspecifycourseid");
|
2003-08-11 07:48:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($name) {
|
2008-06-01 18:17:38 +00:00
|
|
|
if (!$course = $DB->get_record("course", array("shortname"=>$name))) {
|
2008-05-07 06:02:51 +00:00
|
|
|
print_error("invalidshortname");
|
2003-08-11 07:48:03 +00:00
|
|
|
}
|
|
|
|
} else {
|
2008-06-02 08:13:24 +00:00
|
|
|
if (!$course = $DB->get_record("course", array("id"=>$id))) {
|
2008-05-07 06:02:51 +00:00
|
|
|
print_error("invalidcourseid");
|
2003-08-11 07:48:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$site = get_site();
|
|
|
|
|
2004-05-16 10:26:04 +00:00
|
|
|
if ($CFG->forcelogin) {
|
|
|
|
require_login();
|
|
|
|
}
|
|
|
|
|
2012-07-23 15:59:04 +08:00
|
|
|
$context = context_course::instance($course->id);
|
MDL-21782 reworked enrolment framework, the core infrastructure is in place, the basic plugins are all implemented; see the tracker issue for list of unfinished bits, expect more changes and improvements during the next week
AMOS START
MOV [sendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage,enrol_self]
MOV [configsendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage_desc,enrol_self]
MOV [enrolstartdate,core],[enrolstartdate,enrol_self]
MOV [enrolenddate,core],[enrolenddate,enrol_self]
CPY [welcometocourse,core],[welcometocourse,enrol_self]
CPY [welcometocoursetext,core],[welcometocoursetext,enrol_self]
MOV [notenrollable,core],[notenrollable,core_enrol]
MOV [enrolenddaterror,core],[enrolenddaterror,enrol_self]
MOV [enrolmentkeyhint,core],[passwordinvalidhint,enrol_self]
MOV [coursemanager,core_admin],[coursecontact,core_admin]
MOV [configcoursemanager,core_admin],[coursecontact_desc,core_admin]
MOV [enrolledincourserole,core],[enrolledincourserole,enrol_manual]
MOV [enrolme,core],[enrolme,core_enrol]
MOV [unenrol,core],[unenrol,core_enrol]
MOV [unenrolme,core],[unenrolme,core_enrol]
MOV [enrolmentnew,core],[enrolmentnew,core_enrol]
MOV [enrolmentnewuser,core],[enrolmentnewuser,core_enrol]
MOV [enrolments,core],[enrolments,core_enrol]
MOV [enrolperiod,core],[enrolperiod,core_enrol]
MOV [unenrolroleusers,core],[unenrolroleusers,core_enrol]
AMOS END
2010-06-21 15:30:49 +00:00
|
|
|
if (!$course->visible and !has_capability('moodle/course:viewhiddencourses', $context)) {
|
2009-08-10 04:53:59 +00:00
|
|
|
print_error('coursehidden', '', $CFG->wwwroot .'/');
|
|
|
|
}
|
|
|
|
|
2013-03-28 12:20:44 +11:00
|
|
|
$PAGE->set_course($course);
|
2014-09-02 14:44:24 +12:00
|
|
|
$PAGE->set_pagelayout('incourse');
|
2010-01-16 15:39:56 +00:00
|
|
|
$PAGE->set_url('/course/info.php', array('id' => $course->id));
|
2009-09-03 08:47:24 +00:00
|
|
|
$PAGE->set_title(get_string("summaryof", "", $course->fullname));
|
2012-02-23 15:52:21 +08:00
|
|
|
$PAGE->set_heading(get_string('courseinfo'));
|
2009-09-11 07:58:09 +00:00
|
|
|
$PAGE->navbar->add(get_string('summary'));
|
|
|
|
|
2009-09-03 08:47:24 +00:00
|
|
|
echo $OUTPUT->header();
|
2003-08-11 07:48:03 +00:00
|
|
|
|
2010-08-18 09:02:05 +00:00
|
|
|
// print enrol info
|
|
|
|
if ($texts = enrol_get_course_description_texts($course)) {
|
2009-08-10 04:53:59 +00:00
|
|
|
echo $OUTPUT->box_start('generalbox icons');
|
2010-08-18 09:02:05 +00:00
|
|
|
echo implode($texts);
|
2009-08-10 04:53:59 +00:00
|
|
|
echo $OUTPUT->box_end();
|
2010-08-18 09:02:05 +00:00
|
|
|
}
|
2003-08-11 07:48:03 +00:00
|
|
|
|
2012-07-21 21:00:24 +02:00
|
|
|
$courserenderer = $PAGE->get_renderer('core', 'course');
|
|
|
|
echo $courserenderer->course_info_box($course);
|
2003-08-11 07:48:03 +00:00
|
|
|
|
|
|
|
echo "<br />";
|
|
|
|
|
2009-08-06 14:10:33 +00:00
|
|
|
echo $OUTPUT->footer();
|
2003-08-11 07:48:03 +00:00
|
|
|
|
2009-11-04 08:11:02 +00:00
|
|
|
|