Project

General

Profile

Analysis #6816

Display image of course in student listing

Added by Instituto CRIAP about 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
12/11/2013
Due date:
% Done:

0%

Estimated time:

Description

Hello i want to display image defined in course apears in listing of student course.

I make some modifications in core in file course.lib.php in line +- 3148

@while ($course = Database::fetch_array($result)) {
$course_info = api_get_course_info($course['code']);
//$course['id_session'] = null;
$course_info['id_session'] = null;
$course_info['status'] = $course['status'];

//In order to avoid doubles
if (in_array($course_info['real_id'], $course_list)) {
continue;
} else {
$course_list[] = $course_info['real_id'];
}
// For each course, get if there is any notification icon to show
// (something that would have changed since the user's last visit).
$show_notification = Display :: show_notification($course_info);
I write this lines:
///////imagem listagem de formações
$PastaCursosWeb =
api_get_path(WEB_COURSE_PATH).htmlentities(strip_tags($_GET['coursePath']));
$CodigoCurso = $course['code'];
$PastaCursoImagemWeb = $PastaCursosWeb.$CodigoCurso.'/course-pic85x85.png';
$PastaCursos = api_get_path(SYS_PATH).'courses/';
$PastaCursoImagem = $PastaCursos.$CodigoCurso.'/course-pic85x85.png';
if (file_exists($PastaCursoImagem)) {
//existe
$status_icon =
'<img src="'.$PastaCursoImagemWeb.'"
alt="'.$course_info['title'].'" title="'.$course_info['title'].'" width="100"
style="width:100px">';
} else {
//não existe
$status_icon =
Display::return_icon('blackboard.png',
$course_info['title'], array(), ICON_SIZE_LARGE);
}
@

I dont find another solution without change this file.
My results are:

Also available in: Atom PDF