mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Merge branch 'wip-MDL-39305-master' of git://github.com/marinaglancy/moodle
This commit is contained in:
commit
75358cf3c5
1 changed files with 13 additions and 5 deletions
|
@ -1134,21 +1134,26 @@ class core_course_renderer extends plugin_renderer_base {
|
|||
}
|
||||
|
||||
// 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()) {
|
||||
|
@ -1367,7 +1372,10 @@ class core_course_renderer extends plugin_renderer_base {
|
|||
|
||||
// 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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue