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
|
// display course overview files
|
||||||
|
$contentimages = $contentfiles = '';
|
||||||
foreach ($course->get_course_overviewfiles() as $file) {
|
foreach ($course->get_course_overviewfiles() as $file) {
|
||||||
$isimage = $file->is_valid_image();
|
$isimage = $file->is_valid_image();
|
||||||
$url = file_encode_url("$CFG->wwwroot/pluginfile.php",
|
$url = file_encode_url("$CFG->wwwroot/pluginfile.php",
|
||||||
'/'. $file->get_contextid(). '/'. $file->get_component(). '/'.
|
'/'. $file->get_contextid(). '/'. $file->get_component(). '/'.
|
||||||
$file->get_filearea(). $file->get_filepath(). $file->get_filename(), !$isimage);
|
$file->get_filearea(). $file->get_filepath(). $file->get_filename(), !$isimage);
|
||||||
if ($isimage) {
|
if ($isimage) {
|
||||||
$content .= html_writer::tag('div',
|
$contentimages .= html_writer::tag('div',
|
||||||
html_writer::empty_tag('img', array('src' => $url)),
|
html_writer::empty_tag('img', array('src' => $url)),
|
||||||
array('class' => 'courseimage'));
|
array('class' => 'courseimage'));
|
||||||
} else {
|
} else {
|
||||||
$content .= html_writer::tag('div',
|
$image = $this->output->pix_icon(file_file_icon($file, 24), $file->get_filename(), 'moodle');
|
||||||
html_writer::link($url, $file->get_filename()),
|
$filename = html_writer::tag('span', $image, array('class' => 'fp-icon')).
|
||||||
array('class' => 'coursefile'));
|
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()
|
// display course contacts. See course_in_list::get_course_contacts()
|
||||||
if ($course->has_course_contacts()) {
|
if ($course->has_course_contacts()) {
|
||||||
|
@ -1367,7 +1372,10 @@ class core_course_renderer extends plugin_renderer_base {
|
||||||
|
|
||||||
// Courses
|
// Courses
|
||||||
if ($chelper->get_show_courses() > core_course_renderer::COURSECAT_SHOW_COURSES_COUNT) {
|
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')) {
|
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)
|
// 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)) {
|
if ($viewmoreurl->compare(new moodle_url('/course/index.php'), URL_MATCH_BASE)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue