ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilHelpDataSet.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once("./Services/DataSet/classes/class.ilDataSet.php");
6 
14 class ilHelpDataSet extends ilDataSet
15 {
22  public function getSupportedVersions()
23  {
24  return array("4.3.0");
25  }
26 
33  function getXmlNamespace($a_entity, $a_schema_version)
34  {
35  return "http://www.ilias.de/xml/Services/Help/".$a_entity;
36  }
37 
44  protected function getTypes($a_entity, $a_version)
45  {
46  if ($a_entity == "help_map")
47  {
48  switch ($a_version)
49  {
50  case "4.3.0":
51  return array(
52  "Chap" => "integer",
53  "Component" => "text",
54  "ScreenId" => "text",
55  "ScreenSubId" => "text",
56  "Perm" => "text"
57  );
58  }
59  }
60 
61  if ($a_entity == "help_tooltip")
62  {
63  switch ($a_version)
64  {
65  case "4.3.0":
66  return array(
67  "Id" => "integer",
68  "TtText" => "text",
69  "TtId" => "text",
70  "Comp" => "text",
71  "Lang" => "text"
72  );
73  }
74  }
75 
76  }
77 
84  function readData($a_entity, $a_version, $a_ids, $a_field = "")
85  {
86  global $ilDB;
87 
88  if (!is_array($a_ids))
89  {
90  $a_ids = array($a_ids);
91  }
92 
93  if ($a_entity == "help_map")
94  {
95  switch ($a_version)
96  {
97  case "4.3.0":
98  $this->getDirectDataFromQuery("SELECT chap, component, screen_id, screen_sub_id, perm ".
99  " FROM help_map ".
100  "WHERE ".
101  $ilDB->in("chap", $a_ids, false, "integer"));
102  break;
103  }
104  }
105 
106  if ($a_entity == "help_tooltip")
107  {
108  switch ($a_version)
109  {
110  case "4.3.0":
111  $this->getDirectDataFromQuery("SELECT id, tt_text, tt_id, comp, lang FROM help_tooltip");
112  break;
113  }
114  }
115 
116  }
117 
121  protected function getDependencies($a_entity, $a_version, $a_rec, $a_ids)
122  {
123  return false;
124  }
125 
126 
133  function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
134  {
135  switch ($a_entity)
136  {
137  case "help_map":
138 
139  include_once("./Services/Help/classes/class.ilHelpMapping.php");
140 
141  // without module ID we do nothing
142  $module_id = $a_mapping->getMapping('Services/Help','help_module', 0);
143  $t = $a_mapping->getAllMappings();
144  if ($module_id)
145  {
146  $new_chap = $a_mapping->getMapping('Services/Help', 'help_chap',
147  $a_rec["Chap"]);
148 
149  // new import (5.1): get chapter from learning module import mapping
150  if ($new_chap == 0)
151  {
152  $new_chap = $a_mapping->getMapping('Modules/LearningModule', 'lm_tree',
153  $a_rec["Chap"]);
154  }
155 
156  if ($new_chap > 0)
157  {
159  $a_rec["Component"],
160  $a_rec["ScreenId"],
161  $a_rec["ScreenSubId"],
162  $a_rec["Perm"],
163  $module_id
164  );
165  }
166  }
167  break;
168 
169  case "help_tooltip":
170 
171  include_once("./Services/Help/classes/class.ilHelp.php");
172 
173  // without module ID we do nothing
174  $module_id = $a_mapping->getMapping('Services/Help','help_module',0);
175  if ($module_id)
176  {
177  ilHelp::addTooltip($a_rec["TtId"], $a_rec["TtText"], $module_id);
178  }
179  break;
180  }
181  }
182 }
183 ?>
getXmlNamespace($a_entity, $a_schema_version)
Get xml namespace.
getDirectDataFromQuery($a_query, $a_convert_to_leading_upper=true, $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
Help system data set class.
getDependencies($a_entity, $a_version, $a_rec, $a_ids)
Determine the dependent sets of data.
importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
Import record.
Create styles array
The data for the language used.
getTypes($a_entity, $a_version)
Get field types for entity.
global $ilDB
getSupportedVersions()
Get supported versions.
readData($a_entity, $a_version, $a_ids, $a_field="")
Read data.
A dataset contains in data in a common structure that can be shared and transformed for different pur...
static addTooltip($a_tt_id, $a_text, $a_module_id=0)
Add tooltip.
static saveMappingEntry($a_chap, $a_comp, $a_screen_id, $a_screen_sub_id, $a_perm, $a_module_id=0)
Save mapping entry.