Permalink
Browse files

MDL-37009 Display single course info box using new course listings re…

…nderer

Header is removed from /course/info.php because it is now part of renderer function
  • Loading branch information...
1 parent 43e389e commit e2d70cca57f4dcff768251a95d592a807f311cec @marinaglancy marinaglancy committed Mar 19, 2013
Showing with 4 additions and 34 deletions.
  1. +0 −1 course/info.php
  2. +4 −33 course/renderer.php
View
@@ -42,7 +42,6 @@
$PAGE->navbar->add(get_string('summary'));
echo $OUTPUT->header();
- echo $OUTPUT->heading('<a href="view.php?id='.$course->id.'">'.format_string($course->fullname) . '</a><br />(' . format_string($course->shortname, true, array('context' => $context)) . ')');
// print enrol info
if ($texts = enrol_get_course_description_texts($course)) {
View
@@ -107,45 +107,16 @@ protected function add_modchoosertoggle() {
/**
* Renders course info box.
*
- * @param stdClass $course
+ * @param stdClass|course_in_list $course
* @return string
*/
public function course_info_box(stdClass $course) {
- global $CFG;
-
- $context = context_course::instance($course->id);
-
$content = '';
$content .= $this->output->box_start('generalbox info');
-
- $summary = file_rewrite_pluginfile_urls($course->summary, 'pluginfile.php', $context->id, 'course', 'summary', null);
- $content .= format_text($summary, $course->summaryformat, array('overflowdiv'=>true), $course->id);
- if (!empty($CFG->coursecontact)) {
- $coursecontactroles = explode(',', $CFG->coursecontact);
- foreach ($coursecontactroles as $roleid) {
- if ($users = get_role_users($roleid, $context, true, '', null, false)) {
- foreach ($users as $teacher) {
- $role = new stdClass();
- $role->id = $teacher->roleid;
- $role->name = $teacher->rolename;
- $role->shortname = $teacher->roleshortname;
- $role->coursealias = $teacher->rolecoursealias;
- $fullname = fullname($teacher, has_capability('moodle/site:viewfullnames', $context));
- $namesarray[] = role_get_name($role, $context).': <a href="'.$CFG->wwwroot.'/user/view.php?id='.
- $teacher->id.'&amp;course='.SITEID.'">'.$fullname.'</a>';
- }
- }
- }
-
- if (!empty($namesarray)) {
- $content .= "<ul class=\"teachers\">\n<li>";
- $content .= implode('</li><li>', $namesarray);
- $content .= "</li></ul>";
- }
- }
-
+ $chelper = new coursecat_helper();
+ $chelper->set_show_courses(self::COURSECAT_SHOW_COURSES_EXPANDED);
+ $content .= $this->coursecat_coursebox($chelper, $course);
$content .= $this->output->box_end();
-
return $content;
}

0 comments on commit e2d70cc

Please sign in to comment.