ILIAS  release_8 Revision v8.24
class.ilHelpDataSet.php
Go to the documentation of this file.
1<?php
2
25{
26 public function getSupportedVersions(): array
27 {
28 return array("4.3.0");
29 }
30
31 protected function getXmlNamespace(string $a_entity, string $a_schema_version): string
32 {
33 return "https://www.ilias.de/xml/Services/Help/" . $a_entity;
34 }
35
36 protected function getTypes(string $a_entity, string $a_version): array
37 {
38 if ($a_entity === "help_map") {
39 switch ($a_version) {
40 case "4.3.0":
41 return array(
42 "Chap" => "integer",
43 "Component" => "text",
44 "ScreenId" => "text",
45 "ScreenSubId" => "text",
46 "Perm" => "text"
47 );
48 }
49 }
50
51 if ($a_entity === "help_tooltip") {
52 switch ($a_version) {
53 case "4.3.0":
54 return array(
55 "Id" => "integer",
56 "TtText" => "text",
57 "TtId" => "text",
58 "Comp" => "text",
59 "Lang" => "text"
60 );
61 }
62 }
63 return [];
64 }
65
66 public function readData(string $a_entity, string $a_version, array $a_ids): void
67 {
69
70 if ($a_entity === "help_map") {
71 switch ($a_version) {
72 case "4.3.0":
73 $this->getDirectDataFromQuery("SELECT chap, component, screen_id, screen_sub_id, perm " .
74 " FROM help_map " .
75 "WHERE " .
76 $ilDB->in("chap", $a_ids, false, "integer"));
77 break;
78 }
79 }
80
81 if ($a_entity === "help_tooltip") {
82 switch ($a_version) {
83 case "4.3.0":
84 $this->getDirectDataFromQuery("SELECT id, tt_text, tt_id, comp, lang FROM help_tooltip " .
85 " WHERE module_id = " . $ilDB->quote(0, "integer"));
86 break;
87 }
88 }
89 }
90
91 public function importRecord(
92 string $a_entity,
93 array $a_types,
94 array $a_rec,
95 ilImportMapping $a_mapping,
96 string $a_schema_version
97 ): void {
98 $a_rec = $this->stripTags($a_rec);
99 switch ($a_entity) {
100 case "help_map":
101
102 // without module ID we do nothing
103 $module_id = $a_mapping->getMapping('Services/Help', 'help_module', 0);
104 $t = $a_mapping->getAllMappings();
105 if ($module_id) {
106 $new_chap = $a_mapping->getMapping(
107 'Services/Help',
108 'help_chap',
109 $a_rec["Chap"]
110 );
111
112 // new import (5.1): get chapter from learning module import mapping
113 if ((int) $new_chap === 0) {
114 $new_chap = $a_mapping->getMapping(
115 'Modules/LearningModule',
116 'lm_tree',
117 $a_rec["Chap"]
118 );
119 }
120
121 if ($new_chap > 0) {
123 $new_chap,
124 $a_rec["Component"],
125 $a_rec["ScreenId"],
126 $a_rec["ScreenSubId"],
127 $a_rec["Perm"],
128 $module_id
129 );
130 }
131 }
132 break;
133
134 case "help_tooltip":
135
136 // without module ID we do nothing
137 $module_id = $a_mapping->getMapping('Services/Help', 'help_module', 0);
138 if ($module_id) {
139 ilHelp::addTooltip($a_rec["TtId"], $a_rec["TtText"], $module_id);
140 }
141 break;
142 }
143 }
144}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
stripTags(array $rec, array $omit_keys=[])
getDirectDataFromQuery(string $a_query, bool $a_convert_to_leading_upper=true, bool $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
ilDBInterface $db
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getTypes(string $a_entity, string $a_version)
Get (abstract) types for (abstract) field names.
importRecord(string $a_entity, array $a_types, array $a_rec, ilImportMapping $a_mapping, string $a_schema_version)
Needs to be overwritten for import use case.
readData(string $a_entity, string $a_version, array $a_ids)
Read data from DB.
getXmlNamespace(string $a_entity, string $a_schema_version)
static saveMappingEntry(int $a_chap, string $a_comp, string $a_screen_id, string $a_screen_sub_id, string $a_perm, int $a_module_id=0)
static addTooltip(string $a_tt_id, string $a_text, int $a_module_id=0)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getMapping(string $a_comp, string $a_entity, string $a_old_id)