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