Browse files

MDL-34129 show course info on enrolment page

  • Loading branch information...
1 parent ccbdbc7 commit 249f07e6169f1e1f9006d19df714fb62e77b9b43 @skodak skodak committed with danpoltawski Jul 21, 2012
Showing with 28 additions and 0 deletions.
  1. +28 −0 enrol/index.php
View
28 enrol/index.php
@@ -84,6 +84,34 @@
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('enrolmentoptions','enrol'));
+echo $OUTPUT->box_start('generalbox info');
+
+$summary = file_rewrite_pluginfile_urls($course->summary, 'pluginfile.php', $context->id, 'course', 'summary', null);
+echo format_text($summary, $course->summaryformat, array('overflowdiv'=>true), $course->id);
+if (!empty($CFG->coursecontact)) {
+ $coursecontactroles = explode(',', $CFG->coursecontact);
+ foreach ($coursecontactroles as $roleid) {
+ $role = $DB->get_record('role', array('id'=>$roleid));
+ $roleid = (int) $roleid;
+ if ($users = get_role_users($roleid, $context, true)) {
+ foreach ($users as $teacher) {
+ $fullname = fullname($teacher, has_capability('moodle/site:viewfullnames', $context));
+ $namesarray[] = format_string(role_get_name($role, $context)).': <a href="'.$CFG->wwwroot.'/user/view.php?id='.
+ $teacher->id.'&amp;course='.SITEID.'">'.$fullname.'</a>';
+ }
+ }
+ }
+
+ if (!empty($namesarray)) {
+ echo "<ul class=\"teachers\">\n<li>";
+ echo implode('</li><li>', $namesarray);
+ echo "</li></ul>";
+ }
+}
+
+echo $OUTPUT->box_end();
+
+
//TODO: find if future enrolments present and display some info
foreach ($forms as $form) {

0 comments on commit 249f07e

Please sign in to comment.