ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilLearningModuleExportOptionXML.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;
26
27class ilLearningModuleExportOptionXML extends ilLegacyExportOption
28{
29 protected ilLanguage $lng;
30 protected ilDBInterface $db;
31
32 public function init(Container $DIC): void
33 {
34 $this->lng = $DIC->language();
35 $this->db = $DIC->database();
37 }
38
39 public function getExportType(): string
40 {
41 return 'xml';
42 }
43
44 public function getExportOptionId(): string
45 {
46 return 'lm_exp_option_xml';
47 }
48
49 public function getSupportedRepositoryObjectTypes(): array
50 {
51 return ["lm"];
52 }
53
54 public function isObjectSupported(
55 ObjectId $object_id
56 ): bool {
57 $ot = (new TranslationsRepository($this->db))->getFor($object_id->toInt());
58 return $ot->getContentTranslationActivated();
59 }
60
61 public function isPublicAccessPossible(): bool
62 {
63 return true;
64 }
65
66 public function getLabel(): string
67 {
68 $this->lng->loadLanguageModule('exp');
69 return $this->lng->txt("exp_format_dropdown-xml") . " (" . $this->lng->txt('cont_master_language_only_no_media') . ")";
70 }
71
72 public function onExportOptionSelected(\ILIAS\Export\ExportHandler\I\Consumer\Context\HandlerInterface $context): void
73 {
74 $this->ctrl->redirectToURL($this->ctrl->getLinkTargetByClass(ilObjContentObjectGUI::class, "showExportOptionsXML"));
75 }
76}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
language()
Get interface to the i18n service.
Definition: Container.php:95
language handling
onExportOptionSelected(\ILIAS\Export\ExportHandler\I\Consumer\Context\HandlerInterface $context)
Interface ilDBInterface.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
global $DIC
Definition: shib_login.php:26
$context
Definition: webdav.php:31