ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilCalendarFileHandler Class Reference

Calendar file handler. More...

+ Collaboration diagram for ilCalendarFileHandler:

Public Member Functions

 __construct ()
 Constructor. More...
 
 downloadFilesForEvents ($a_events)
 Download files for events. More...
 

Detailed Description

Calendar file handler.

Author
Alex Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de
Version
$Id$

Definition at line 10 of file class.ilCalendarFileHandler.php.

Constructor & Destructor Documentation

◆ __construct()

ilCalendarFileHandler::__construct ( )

Constructor.

Definition at line 17 of file class.ilCalendarFileHandler.php.

18 {
19 }

Member Function Documentation

◆ downloadFilesForEvents()

ilCalendarFileHandler::downloadFilesForEvents (   $a_events)

Download files for events.

Parameters

Definition at line 26 of file class.ilCalendarFileHandler.php.

27 {
28 include_once("./Services/Calendar/classes/FileHandler/class.ilAppointmentFileHandlerFactory.php");
29 foreach ($a_events as $event) {
30
31 //WARNING!! TODO: it's taken more events than expected....
32 ilLoggerFactory::getRootLogger()->debug("event tile " . $event['event']->getTitle());
33
35 foreach ($fh->getFiles() as $file) {
36 // just for demonstration we provide only the last file
37 $last_file = $file;
38
39 // @todo: collect all files
40 }
41
42 // @todo: copy zip all files using background
43
44 /*
45 global $DIC;
46
47 $factory = $DIC->backgroundTasks()->taskFactory();
48 $taskManager = $DIC->backgroundTasks()->taskManager();
49
50 // We create a bucket that will be scheduled and set the user that should observe the bucket.
51 $bucket = new BasicBucket();
52 $bucket->setUserId($DIC->user()->getId());
53
54 // Combine the tasks. This will create a task that looks like this: (1 + 1) + (1 + 2).
55 include_once("./Services/Calendar/FileHandler/classes/class.ilCalFileZipJob.php");
56 $a = $factory->createTask(ilCalFileZipJob::class, [$last_file]);
57 // Note the integer 1 will automatically be wrapped in a IntegerValue class. All scalars can be wrapped automatically.
58 // The above is the same as:
59 // $a = $factory->createTask(PlusJob::class, [new IntegerValue(1), new IntegerValue(1)]);
60 //$b = $factory->createTask(PlusJob::class, [1, 2]);
61 //$c = $factory->createTask(PlusJob::class, [$a, $b]);
62
63 // The last task is a user interaction that allows the user to download the result calculated above.
64 $userInteraction = $factory->createTask(DownloadInteger::class, [$c]);
65
66 // We put the combined task into the bucket and add some description
67 $bucket->setTask($userInteraction);
68 $bucket->setTitle("Some calculation.");
69 $bucket->setDescription("We calculate 5!");
70
71 // We schedule the task.
72 $taskManager->run($bucket);
73
74 // We redirect somewhere.
75 $this->ctrl->redirect($this, "showContent");
76 */
77
78
79
80
81 // just for demonstration: send last file
82 if (is_file($last_file)) {
83 require_once('./Services/FileDelivery/classes/class.ilFileDelivery.php');
84 global $DIC;
85 $ilClientIniFile = $DIC['ilClientIniFile'];
86
87 $ilFileDelivery = new ilFileDelivery($last_file);
88 $ilFileDelivery->setDisposition(ilFileDelivery::DISP_ATTACHMENT);
89 //$ilFileDelivery->setMimeType($this->guessFileType($file));
90 $ilFileDelivery->setConvertFileNameToAsci((bool) !$ilClientIniFile->readVariable('file_access', 'disable_ascii'));
91 //$ilFileDelivery->setDownloadFileName();
92 $ilFileDelivery->deliver();
93 exit;
94 }
95 }
96 }
Class ilFileDelivery.
static getRootLogger()
The unique root logger has a fixed error level.
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file
global $DIC
Definition: saml.php:7

References $DIC, $fh, $file, ilFileDelivery\DISP_ATTACHMENT, exit, ilAppointmentFileHandlerFactory\getInstance(), and ilLoggerFactory\getRootLogger().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: