}
// display course overview files
+ $contentimages = $contentfiles = '';
foreach ($course->get_course_overviewfiles() as $file) {
$isimage = $file->is_valid_image();
$url = file_encode_url("$CFG->wwwroot/pluginfile.php",
'/'. $file->get_contextid(). '/'. $file->get_component(). '/'.
$file->get_filearea(). $file->get_filepath(). $file->get_filename(), !$isimage);
if ($isimage) {
- $content .= html_writer::tag('div',
+ $contentimages .= html_writer::tag('div',
html_writer::empty_tag('img', array('src' => $url)),
array('class' => 'courseimage'));
} else {
- $content .= html_writer::tag('div',
- html_writer::link($url, $file->get_filename()),
- array('class' => 'coursefile'));
+ $image = $this->output->pix_icon(file_file_icon($file, 24), $file->get_filename(), 'moodle');
+ $filename = html_writer::tag('span', $image, array('class' => 'fp-icon')).
+ html_writer::tag('span', $file->get_filename(), array('class' => 'fp-filename'));
+ $contentfiles .= html_writer::tag('span',
+ html_writer::link($url, $filename),
+ array('class' => 'coursefile fp-filename-icon'));
}
}
+ $content .= $contentimages. $contentfiles;
// display course contacts. See course_in_list::get_course_contacts()
if ($course->has_course_contacts()) {
// Courses
if ($chelper->get_show_courses() > core_course_renderer::COURSECAT_SHOW_COURSES_COUNT) {
- $courses = $coursecat->get_courses($chelper->get_courses_display_options());
+ $courses = array();
+ if (!$chelper->get_courses_display_option('nodisplay')) {
+ $courses = $coursecat->get_courses($chelper->get_courses_display_options());
+ }
if ($viewmoreurl = $chelper->get_courses_display_option('viewmoreurl')) {
// the option for 'View more' link was specified, display more link (if it is link to category view page, add category id)
if ($viewmoreurl->compare(new moodle_url('/course/index.php'), URL_MATCH_BASE)) {