ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilAppointmentCourseFileHandler.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2017 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5include_once("./Services/Calendar/interfaces/interface.ilAppointmentFileHandler.php");
6include_once("./Services/Calendar/classes/FileHandler/class.ilAppointmentBaseFileHandler.php");
7
15{
22 public function getFiles()
23 {
24 $cat_info = $this->getCatInfo();
25
26 //checking permissions of the parent object.
27 // get course ref id (this is possible, since courses only have one ref id)
28 $refs = ilObject::_getAllReferences($cat_info['obj_id']);
29 $crs_ref_id = current($refs);
30
31 $files = array();
32 if ($this->access->checkAccessOfUser($this->user->getId(), "read", "", $crs_ref_id)) {
33 include_once "./Modules/Course/classes/class.ilCourseFile.php";
34 $course_files = ilCourseFile::_readFilesByCourse($cat_info['obj_id']);
35
36 foreach ($course_files as $course_file) {
37 $file_name_system_path = $course_file->getInfoDirectory() . "/" . $course_file->getFileId();
38 $file_name_web = $course_file->getInfoDirectory() . "/" . $course_file->getFileName();
39 $files[$file_name_system_path] = $file_name_web;
40 }
41 }
42
43 return $files;
44 }
45}
$files
Definition: add-vimline.php:18
An exception for terminatinating execution or to throw for unit testing.
Base file handler class for appointment classes.
static _readFilesByCourse($a_course_id)
static _getAllReferences($a_id)
get all reference ids of object
Appointemtn file handler interface.