5 require_once
"./Services/Object/classes/class.ilObject2.php";
33 parent::__construct();
36 $this->db = $DIC->database();
58 $ilDB = $DIC->database();
62 $ilDB->manipulate(
"INSERT INTO help_module " .
80 $ilDB = $DIC->database();
83 "UPDATE help_module SET " .
84 " lm_id = " .
$ilDB->quote($a_lm_id,
"integer") .
85 " WHERE id = " .
$ilDB->quote($a_id,
"integer")
109 include_once(
"./Services/Export/classes/class.ilImport.php");
111 $conf = $imp->getConfig(
"Services/Help");
112 $conf->setModuleId(
$id);
113 $new_id = $imp->importObject(
"", $a_file[
"tmp_name"], $a_file[
"name"],
"lm",
"Modules/LearningModule");
116 self::writeHelpModuleLmId(
$id, $newObj->getId());
119 $t = $imp->getTemporaryImportDir();
122 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
124 $newObj->setType(
"lm");
125 $newObj->setTitle(
"Help Module");
126 $newObj->create(
true);
127 $newObj->createLMTree();
129 $mess = $newObj->importFromDirectory(
$t,
false);
136 if (is_int(strpos($file[
"entry"],
"__help_")) &&
137 is_int(strpos($file[
"entry"],
".zip"))) {
138 include_once(
"./Services/Export/classes/class.ilImport.php");
140 $imp->getMapping()->addMapping(
'Services/Help',
'help_module', 0,
$id);
141 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
143 foreach ($chaps as $chap) {
144 $chap_arr = explode(
"_", $chap[
"import_id"]);
145 $imp->getMapping()->addMapping(
148 $chap_arr[count($chap_arr) - 1],
153 $dir .
"/" . $file[
"entry"],
165 self::writeHelpModuleLmId(
$id, $newObj->getId());
169 $GLOBALS[
'ilAppEventHandler']->raise(
189 $set =
$ilDB->query(
"SELECT * FROM help_module");
192 while ($rec =
$ilDB->fetchAssoc($set)) {
214 $ilDB = $DIC->database();
217 "SELECT * FROM help_module " .
218 " WHERE id = " .
$ilDB->quote($a_id,
"integer")
220 $rec =
$ilDB->fetchAssoc($set);
237 $ilDB = $DIC->database();
240 "SELECT lm_id FROM help_module " .
241 " WHERE id = " .
$ilDB->quote($a_id,
"integer")
243 $rec =
$ilDB->fetchAssoc($set);
244 return $rec[
"lm_id"];
259 if ($a_id == (
int)
$ilSetting->get(
"help_module")) {
264 "SELECT * FROM help_module " .
265 " WHERE id = " .
$ilDB->quote($a_id,
"integer")
267 $rec =
$ilDB->fetchAssoc($set);
271 include_once(
"./Modules/LearningModule/classes/class.ilObjLearningModule.php");
277 include_once(
"./Services/Help/classes/class.ilHelpMapping.php");
281 include_once(
"./Services/Help/classes/class.ilHelp.php");
285 $ilDB->manipulate(
"DELETE FROM help_module WHERE " .
286 " id = " .
$ilDB->quote($a_id,
"integer"));
299 $ilDB = $DIC->database();
302 "SELECT id FROM help_module " .
303 " WHERE lm_id = " .
$ilDB->quote($a_lm_id,
"integer")
305 if ($rec =
$ilDB->fetchAssoc($set)) {
Class ilObjLearningModule.
__construct()
Constructor.
static deleteEntriesOfModule($a_id)
Delete entries of module.
deleteModule($a_id)
Delete module.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
static _lookupTitle($a_id)
lookup object title
static isHelpLM($a_lm_id)
Check if LM is a help LM.
static deleteTooltipsOfModule($a_id)
Delete tooltips of module.
static lookupModuleTitle($a_id)
lookup module title
Help settings application class.
static writeHelpModuleLmId($a_id, $a_lm_id)
Write help module lm id.
static _lookupCreationDate($a_id)
Lookup creation date.
uploadHelpModule($a_file)
Upload help file.
manifest.xml file not found-exception for import
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
getHelpModules()
Get help modules.
static lookupModuleLmId($a_id)
lookup module lm id
Class ilObject2 This is an intermediate progress of ilObject class.
static createHelpModule()
Create help module.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
Class ilObjContentObject.
static getObjectList($lm_id, $type="")
static
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively