ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.ilLearningModuleExportOptionXML.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
24 use ILIAS\Export\ExportHandler\I\Consumer\Context\HandlerInterface as ilExportHandlerConsumerContextInterface;
26 
27 class 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();
36  parent::init($DIC);
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 }
$context
Definition: webdav.php:31
database()
Get interface to the Database.
Definition: Container.php:42
Interface Observer Contains several chained tasks and infos about them.
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
global $DIC
Definition: shib_login.php:26
language()
Get interface to the i18n service.
Definition: Container.php:95
onExportOptionSelected(\ILIAS\Export\ExportHandler\I\Consumer\Context\HandlerInterface $context)