ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilOrgUnitExportOptionXML.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
24use ILIAS\Export\ExportHandler\I\Consumer\Context\HandlerInterface as ilExportHandlerConsumerContextInterface;
26use ILIAS\Export\ExportHandler\I\Info\File\CollectionInterface as ilExportHandlerFileInfoCollectionInterface;
27use ILIAS\Export\ExportHandler\I\Consumer\File\Identifier\CollectionInterface as ilExportHandlerConsumerFileIdentifierCollectionInterface;
28use ILIAS\Export\ExportHandler\I\Consumer\File\Identifier\HandlerInterface as ilExportHandlerConsumerFileIdentifierInterface;
29
30class ilOrgUnitExportOptionXML extends ilBasicExportOption
31{
32 protected ilLanguage $lng;
34
35 public function init(Container $DIC): void
36 {
37 $this->lng = $DIC->language();
38 $this->ctrl = $DIC->ctrl();
39 }
40
41 public function getExportType(): string
42 {
43 return "simple xml";
44 }
45
46 public function getExportOptionId(): string
47 {
48 return "orgu_exp_option_simple_xml";
49 }
50
51 public function getSupportedRepositoryObjectTypes(): array
52 {
53 return ["orgu"];
54 }
55
56 public function isObjectSupported(ObjectId $object_id): bool
57 {
58 //Simple XML and Simple XLS Export should only be available in the root orgunit folder as it always exports the whole tree
59 return $object_id->toInt() === ilObjOrgUnit::getRootOrgId();
60 }
61
62 public function getLabel(): string
63 {
64 $this->lng->loadLanguageModule('exp');
65 return $this->lng->txt('simple_xml');
66 }
67
68 public function onExportOptionSelected(ilExportHandlerConsumerContextInterface $context): void
69 {
70 $this->ctrl->redirect($context->exportGUIObject(), "simpleExport");
71 }
72
73 public function onDeleteFiles(
74 ilExportHandlerConsumerContextInterface $context,
75 ilExportHandlerConsumerFileIdentifierCollectionInterface $file_identifiers
76 ): void {
77 # Direct download on export creation, no local files
78 }
79
80 public function onDownloadFiles(
81 ilExportHandlerConsumerContextInterface $context,
82 ilExportHandlerConsumerFileIdentifierCollectionInterface $file_identifiers
83 ): void {
84 # Direct download on export creation, no local files
85 }
86
87 public function onDownloadWithLink(
88 ReferenceId $reference_id,
89 ilExportHandlerConsumerFileIdentifierInterface $file_identifier
90 ): void {
91 # Direct download on export creation, no local files
92 }
93
94 public function getFiles(
95 ilExportHandlerConsumerContextInterface $context
96 ): ilExportHandlerFileInfoCollectionInterface {
97 # Direct download on export creation, no local files
98 return $context->fileCollectionBuilder()->collection();
99 }
100
101 public function getFileSelection(
102 ilExportHandlerConsumerContextInterface $context,
103 ilExportHandlerConsumerFileIdentifierCollectionInterface $file_identifiers
104 ): ilExportHandlerFileInfoCollectionInterface {
105 # Direct download on export creation, no local files
106 return $context->fileCollectionBuilder()->collection();
107 }
108}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
language()
Get interface to the i18n service.
Definition: Container.php:95
ctrl()
Get the interface to the control structure.
Definition: Container.php:63
language handling
getFiles(ilExportHandlerConsumerContextInterface $context)
onExportOptionSelected(ilExportHandlerConsumerContextInterface $context)
getFileSelection(ilExportHandlerConsumerContextInterface $context, ilExportHandlerConsumerFileIdentifierCollectionInterface $file_identifiers)
onDownloadWithLink(ReferenceId $reference_id, ilExportHandlerConsumerFileIdentifierInterface $file_identifier)
onDownloadFiles(ilExportHandlerConsumerContextInterface $context, ilExportHandlerConsumerFileIdentifierCollectionInterface $file_identifiers)
onDeleteFiles(ilExportHandlerConsumerContextInterface $context, ilExportHandlerConsumerFileIdentifierCollectionInterface $file_identifiers)
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:26
$context
Definition: webdav.php:31