ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
class.ilHelpExporter.php
Go to the documentation of this file.
1<?php
2
25{
27 protected \ILIAS\Help\InternalDomainService $help_domain;
28
29 public function init(): void
30 {
31 global $DIC;
32
33 $this->ds = new ilHelpDataSet();
34 $this->ds->initByExporter($this);
35 $this->ds->setDSPrefix("ds");
36 $this->help_domain = $DIC->help()->internal()->domain();
37 }
38
40 string $a_entity,
41 string $a_target_release,
42 array $a_ids
43 ): array {
44 if ($a_entity === "help") {
45 $lm_node_ids = array();
46 foreach ($a_ids as $lm_id) {
47 $chaps = ilLMObject::getObjectList($lm_id, "st");
48 foreach ($chaps as $chap) {
49 $lm_node_ids[] = $chap["obj_id"];
50 }
51 }
52
53 return array(
54 array(
55 "component" => "components/ILIAS/Help",
56 "entity" => "help_map",
57 "ids" => $lm_node_ids),
58 array(
59 "component" => "components/ILIAS/Help",
60 "entity" => "help_tooltip",
61 "ids" => $a_ids)
62 );
63 }
64
65 if ($a_entity === "gdtr") {
66 $res = [];
67 // step pages
68 $pg_ids = [];
69 $step_ids = [];
70 foreach ($a_ids as $id) {
71 foreach ($this->help_domain->guidedTour()->step()->getStepsOfTour((int) $id) as $step) {
72 $pg_ids[] = "gdtr:" . $step->getId();
73 $step_ids[] = $step->getId();
74 }
75 }
76 if (count($pg_ids)) {
77 $res[] = [
78 "component" => "components/ILIAS/Help",
79 "entity" => "gdtr_step",
80 "ids" => $step_ids];
81 $res[] = array(
82 "component" => "components/ILIAS/COPage",
83 "entity" => "pg",
84 "ids" => $pg_ids
85 );
86 }
87 return $res;
88 }
89
90
91 return array();
92 }
93
94 public function getXmlRepresentation(
95 string $a_entity,
96 string $a_schema_version,
97 string $a_id
98 ): string {
99 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, [$a_id], "", true, true);
100 }
101
102 public function getValidSchemaVersions(string $a_entity): array
103 {
104 return array(
105 "10.0" => array(
106 "namespace" => "https://www.ilias.de/Services/Help/help/10_0",
107 "xsd_file" => "ilias_help_10.xsd",
108 "uses_dataset" => true,
109 "min" => "10.0",
110 "max" => ""),
111 "4.3.0" => array(
112 "namespace" => "https://www.ilias.de/Services/Help/help/4_3",
113 "xsd_file" => "ilias_help_4_3.xsd",
114 "uses_dataset" => true,
115 "min" => "4.3.0",
116 "max" => "")
117 );
118 }
119}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
return true
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...
getXmlExportTailDependencies(string $a_entity, string $a_target_release, array $a_ids)
Get tail dependencies.
ILIAS Help InternalDomainService $help_domain
getValidSchemaVersions(string $a_entity)
Returns schema versions that the component can export to.
getXmlRepresentation(string $a_entity, string $a_schema_version, string $a_id)
static getObjectList(int $lm_id, string $type="")
Xml Exporter class.
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$res
Definition: ltiservices.php:69
if(!file_exists('../ilias.ini.php'))
global $DIC
Definition: shib_login.php:26