From df56485031bd1b8d1bfbe07c60da18c6b8dd2e8c Mon Sep 17 00:00:00 2001 From: Matheus Garcia Date: Fri, 21 Jun 2019 15:02:05 -0300 Subject: [PATCH] =?UTF-8?q?URL=20do=20logotipo=20do=20curso=20=C3=A9=20pas?= =?UTF-8?q?sada=20para=20web=20service=20de=20registro=20de=20curso=20na?= =?UTF-8?q?=20EVL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/util.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/classes/util.php b/classes/util.php index 9db05f1..7bae729 100644 --- a/classes/util.php +++ b/classes/util.php @@ -127,11 +127,27 @@ function atualizaCursoEVL($curso, $visivel = null) { $obj = new StdClass(); + // Obtem a imagem do curso + $urlLogo = ''; + //$course = $DB->get_record('course', array('id'=>$curso->id)); + if ($curso instanceof stdClass) { + $course = new core_course_list_element($curso); + } + foreach ($course->get_course_overviewfiles() as $file) { + $isimage = $file->is_valid_image(); + if($isimage) { + $urlLogo = file_encode_url("$CFG->wwwroot/pluginfile.php", + '/'. $file->get_contextid(). '/'. $file->get_component(). '/'. + $file->get_filearea(). $file->get_filepath(). $file->get_filename(), !$isimage); + } + break; + } + $camposCurso = array( "name" => $curso->fullname, "url" => "", "description" => $curso->summary, - "logo" => "", + "logo" => "$urlLogo", "ead_id" => $curso->id, "visible" => $visivel, "conteudista" => "",