ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilLearningModuleDataSet Class Reference

LearningModule Data set class. More...

+ Inheritance diagram for ilLearningModuleDataSet:
+ Collaboration diagram for ilLearningModuleDataSet:

Public Member Functions

 setMasterLanguageOnly ($a_val)
 Set master language only (export) More...
 
 getMasterLanguageOnly ()
 Get master language only (export) More...
 
 setTranslationImportMode ($a_lm, $a_lang="")
 Set translation import mode. More...
 
 getTranslationImportMode ()
 Get translation import mode. More...
 
 getTranslationLM ()
 Get translation lm (import. More...
 
 getTranslationLang ()
 Get translation language (import. More...
 
 getSupportedVersions ()
 Get supported versions. More...
 
 getXmlNamespace ($a_entity, $a_schema_version)
 Get xml namespace. More...
 
 readData ($a_entity, $a_version, $a_ids, $a_field="")
 Read data. More...
 
 importRecord ($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
 Import record. More...
 
- Public Member Functions inherited from ilDataSet
 __construct ()
 Constructor. More...
 
 init ($a_entity, $a_schema_version)
 Init. More...
 
 getSupportedVersions ()
 Get supported version. More...
 
 readData ($a_entity, $a_version, $a_ids)
 Read data from DB. More...
 
 setExportDirectories ($a_relative, $a_absolute)
 Set export directories. More...
 
 setImportDirectory ($a_val)
 Set import directory. More...
 
 getImportDirectory ()
 Get import directory. More...
 
 setDSPrefix ($a_val)
 Set XML dataset namespace prefix. More...
 
 getDSPrefix ()
 Get XML dataset namespace prefix. More...
 
 getDSPrefixString ()
 
 getDirectDataFromQuery ($a_query, $a_convert_to_leading_upper=true)
 Get data from query.This is a standard procedure, all db field names are directly mapped to abstract fields. More...
 
 convertToLeadingUpper ($a_str)
 Make xyz_abc a XyzAbc string. More...
 
 getJsonRepresentation ()
 Get json representation. More...
 
 getXmlRepresentation ($a_entity, $a_schema_version, $a_ids, $a_field="", $a_omit_header=false, $a_omit_types=false)
 Get xml representation <dataset install_id="123" install_url="..."> <types entity="table_name" version="4.0.1"> <ftype name="field_1" type="text" > <ftype name="field_2" type="date" > <ftype name="field_3" type="integer" > </types> <types ...> ... </types> <set entity="table_name"> <rec> <field_1>content</field_1> <field_2>my_date</field_2> <field_3>my_number</field_3> </rec> ... </set> </dataset> More...
 
 addRecordsXml ($a_writer, $a_prefixes, $a_entity, $a_schema_version, $a_ids, $a_field="")
 Add records xml. More...
 
 afterXmlRecordWriting ($a_entity, $a_version, $a_set)
 After xml record writing hook record. More...
 
 getNamespaces (&$namespaces, $a_entity, $a_schema_version)
 Get xml namespaces. More...
 
 getXmlRecord ($a_entity, $a_version, $a_set)
 Get xml record for version. More...
 
 getJsonRecord ($a_set)
 Get json record for version. More...
 
 getXmlTypes ($a_entity, $a_version)
 Get xml types. More...
 
 getJsonTypes ($a_entity, $a_version)
 Get json types. More...
 
 getXMLEntityName ($a_entity, $a_version)
 Get entity name for xml (may be overwritten) More...
 
 getXMLEntityTag ($a_entity, $a_schema_version)
 Get entity tag. More...
 
 getJsonEntityName ($a_entity, $a_version)
 Get entity name for json (may be overwritten) More...
 
 setImport ($a_val)
 Set import object. More...
 
 getImport ()
 Get import object. More...
 
 setCurrentInstallationId ($a_val)
 Set current installation id. More...
 
 getCurrentInstallationId ()
 Get current installation id. More...
 

Protected Member Functions

 getTypes ($a_entity, $a_version)
 Get field types for entity. More...
 
 getDependencies ($a_entity, $a_version, $a_rec, $a_ids)
 Determine the dependent sets of data. More...
 
- Protected Member Functions inherited from ilDataSet
 getTypes ($a_entity, $a_version)
 Get (abstract) types for (abstract) field names. More...
 
 getXmlNamespace ($a_entity, $a_schema_version)
 Get xml namespace. More...
 
 createObjectExportId ($a_type, $a_id)
 Build ilias export id. More...
 
 parseObjectExportId ($a_id, $a_fallback_id=NULL)
 Parse export id. More...
 

Protected Attributes

 $master_lang_only = false
 
 $transl_into = false
 
 $transl_into_lm = null
 
 $transl_lang = ""
 
- Protected Attributes inherited from ilDataSet
 $current_installation_id = ""
 

Additional Inherited Members

- Data Fields inherited from ilDataSet
 $dircnt
 
const EXPORT_NO_INST_ID = 1
 
const EXPORT_ID_ILIAS_LOCAL = 2
 
const EXPORT_ID_ILIAS_LOCAL_INVALID = 3
 
const EXPORT_ID_ILIAS_REMOTE = 4
 
const EXPORT_ID_ILIAS_REMOTE_INVALID = 5
 
const EXPORT_ID = 6
 
const EXPORT_ID_INVALID = 7
 

Detailed Description

LearningModule Data set class.

This class implements the following entities:

  • lm: data from content_object
  • lm_tree: data from lm_tree/lm_data
  • lm_data_transl: data from lm_data_transl
  • lm_menu: data from lm_menu
Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 19 of file class.ilLearningModuleDataSet.php.

Member Function Documentation

◆ getDependencies()

ilLearningModuleDataSet::getDependencies (   $a_entity,
  $a_version,
  $a_rec,
  $a_ids 
)
protected

Determine the dependent sets of data.

Definition at line 363 of file class.ilLearningModuleDataSet.php.

364 {
365 switch ($a_entity)
366 {
367 case "lm":
368 return array (
369 "lm_tree" => array("ids" => $a_rec["Id"]),
370 "lm_menu" => array("ids" => $a_rec["Id"])
371 );
372
373 case "lm_tree":
374 if ($this->getMasterLanguageOnly())
375 {
376 return false;
377 }
378 else
379 {
380 return array (
381 "lm_data_transl" => array("ids" => $a_rec["Child"])
382 );
383 }
384 }
385
386 return false;
387 }
getMasterLanguageOnly()
Get master language only (export)

References getMasterLanguageOnly().

+ Here is the call graph for this function:

◆ getMasterLanguageOnly()

ilLearningModuleDataSet::getMasterLanguageOnly ( )

Get master language only (export)

Returns
bool export only master language

Definition at line 42 of file class.ilLearningModuleDataSet.php.

References $master_lang_only.

Referenced by getDependencies(), and readData().

+ Here is the caller graph for this function:

◆ getSupportedVersions()

ilLearningModuleDataSet::getSupportedVersions ( )

Get supported versions.

Parameters

return

Reimplemented from ilDataSet.

Definition at line 103 of file class.ilLearningModuleDataSet.php.

104 {
105 return array("5.1.0");
106 }

◆ getTranslationImportMode()

ilLearningModuleDataSet::getTranslationImportMode ( )

Get translation import mode.

Returns
bool check if translation import is activated

Definition at line 72 of file class.ilLearningModuleDataSet.php.

References $transl_into.

Referenced by importRecord().

+ Here is the caller graph for this function:

◆ getTranslationLang()

ilLearningModuleDataSet::getTranslationLang ( )

Get translation language (import.

Returns
string language

Definition at line 92 of file class.ilLearningModuleDataSet.php.

References $transl_lang.

Referenced by importRecord().

+ Here is the caller graph for this function:

◆ getTranslationLM()

ilLearningModuleDataSet::getTranslationLM ( )

Get translation lm (import.

Returns
ilObjLearningModule learning module

Definition at line 82 of file class.ilLearningModuleDataSet.php.

References $transl_into_lm.

Referenced by importRecord().

+ Here is the caller graph for this function:

◆ getTypes()

ilLearningModuleDataSet::getTypes (   $a_entity,
  $a_version 
)
protected

Get field types for entity.

Parameters
string$a_entityentity
string$a_versionversion number
Returns
array types array

Reimplemented from ilDataSet.

Definition at line 126 of file class.ilLearningModuleDataSet.php.

127 {
128 if ($a_entity == "lm")
129 {
130 switch ($a_version)
131 {
132 case "5.1.0":
133 return array(
134 "Id" => "integer",
135 "Title" => "text",
136 "Description" => "text",
137 "DefaultLayout" => "text",
138 "PageHeader" => "text",
139 "TocActive" => "text",
140 "LMMenuActive" => "text",
141 "TOCMode" => "text",
142 "PrintViewActive" => "text",
143 "Numbering" => "text",
144 "HistUserComments" => "text",
145 "PublicAccessMode" => "text",
146 "PubNotes" => "text",
147 "HeaderPage" => "integer",
148 "FooterPage" => "integer",
149 "LayoutPerPage" => "integer",
150 "Rating" => "integer",
151 "HideHeadFootPrint" => "integer",
152 "DisableDefFeedback" => "integer",
153 "RatingPages" => "integer",
154 "ProgrIcons" => "integer",
155 "StoreTries" => "integer",
156 "RestrictForwNav" => "integer",
157 "Comments" => "integer",
158 "ForTranslation" => "integer",
159 "StyleId" => "integer"
160 );
161 }
162 }
163
164 if ($a_entity == "lm_tree")
165 {
166 switch ($a_version)
167 {
168 case "5.1.0":
169 return array(
170 "LmId" => "integer",
171 "Child" => "integer",
172 "Parent" => "integer",
173 "Depth" => "integer",
174 "Type" => "text",
175 "Title" => "text",
176 "PublicAccess" => "text",
177 "Active" => "text",
178 "Layout" => "text",
179 "ImportId" => "text"
180 );
181 }
182 }
183
184 if ($a_entity == "lm_menu")
185 {
186 switch ($a_version)
187 {
188 case "5.1.0":
189 return array(
190 "LmId" => "integer",
191 "LinkType" => "text",
192 "Title" => "text",
193 "Target" => "text",
194 "LinkRefId" => "text",
195 "Active" => "text"
196 );
197 }
198 }
199
200 if ($a_entity == "lm_data_transl")
201 {
202 switch ($a_version)
203 {
204 case "5.1.0":
205 return array(
206 "Id" => "integer",
207 "Lang" => "text",
208 "Title" => "text"
209 );
210 }
211 }
212
213 }

◆ getXmlNamespace()

ilLearningModuleDataSet::getXmlNamespace (   $a_entity,
  $a_schema_version 
)

Get xml namespace.

Parameters

return

Reimplemented from ilDataSet.

Definition at line 114 of file class.ilLearningModuleDataSet.php.

115 {
116 return "http://www.ilias.de/xml/Modules/LearningModule/".$a_entity;
117 }

◆ importRecord()

ilLearningModuleDataSet::importRecord (   $a_entity,
  $a_types,
  $a_rec,
  $a_mapping,
  $a_schema_version 
)

Import record.

Parameters

return

Definition at line 396 of file class.ilLearningModuleDataSet.php.

397 {
398//var_dump($a_rec);
399
400 switch ($a_entity)
401 {
402 case "lm":
403
404 if ($this->getTranslationImportMode())
405 {
406 return;
407 }
408
409 include_once("./Modules/LearningModule/classes/class.ilObjLearningModule.php");
410 if($new_id = $a_mapping->getMapping('Services/Container','objs',$a_rec['Id']))
411 {
412 $newObj = ilObjectFactory::getInstanceByObjId($new_id,false);
413 }
414 else
415 {
416 $newObj = new ilObjLearningModule();
417 $newObj->setType("lm");
418 $newObj->create(true);
419 $newObj->createLMTree();
420 }
421
422 $newObj->setTitle($a_rec["Title"]);
423 $newObj->setDescription($a_rec["Description"]);
424 $newObj->setLayout($a_rec["DefaultLayout"]);
425 $newObj->setPageHeader($a_rec["PageHeader"]);
426 $newObj->setActiveTOC(ilUtil::yn2tf($a_rec["TocActive"]));
427 $newObj->setActiveLMMenu(ilUtil::yn2tf($a_rec["LmMenuActive"]));
428 $newObj->setTOCMode($a_rec["TOCMode"]);
429 $newObj->setActivePrintView(ilUtil::yn2tf($a_rec["PrintViewActive"]));
430 $newObj->setActiveNumbering(ilUtil::yn2tf($a_rec["Numbering"]));
431 $newObj->setHistoryUserComments(ilUtil::yn2tf($a_rec["HistUserComments"]));
432 $newObj->setPublicAccessMode($a_rec["PublicAccessMode"]);
433 $newObj->setPublicNotes(ilUtil::yn2tf($a_rec["PubNotes"]));
434 // Header Page/ Footer Page ???
435 $newObj->setLayoutPerPage($a_rec["LayoutPerPage"]);
436 $newObj->setRating($a_rec["Rating"]);
437 $newObj->setHideHeaderFooterPrint($a_rec["HideHeadFootPrint"]);
438 $newObj->setDisableDefaultFeedback($a_rec["DisableDefFeedback"]);
439 $newObj->setRatingPages($a_rec["RatingPages"]);
440 $newObj->setForTranslation($a_rec["ForTranslation"]);
441 $newObj->setProgressIcons($a_rec["ProgrIcons"]);
442 $newObj->setStoreTries($a_rec["StoreTries"]);
443 $newObj->setRestrictForwardNavigation($a_rec["RestrictForwNav"]);
444 if ($a_rec["HeaderPage"] > 0)
445 {
446 $a_mapping->addMapping("Modules/LearningModule", "lm_header_page", $a_rec["HeaderPage"], "-");
447 }
448 if ($a_rec["FooterPage"] > 0)
449 {
450 $a_mapping->addMapping("Modules/LearningModule", "lm_footer_page", $a_rec["FooterPage"], "-");
451 }
452
453 $newObj->update(true);
454 $this->current_obj = $newObj;
455
456 // activated comments
457 include_once("./Services/Notes/classes/class.ilNote.php");
458 ilNote::activateComments($newObj->getId(), 0, "lm", (int) $a_rec["Comments"]);
459
460 $a_mapping->addMapping("Modules/LearningModule", "lm", $a_rec["Id"], $newObj->getId());
461 $a_mapping->addMapping("Modules/LearningModule", "lm_style", $newObj->getId(), $a_rec["StyleId"]);
462 $a_mapping->addMapping("Services/Object", "obj", $a_rec["Id"], $newObj->getId());
463 $a_mapping->addMapping("Services/MetaData", "md",
464 $a_rec["Id"].":0:lm", $newObj->getId().":0:lm");
465 break;
466
467 case "lm_tree":
468 if (!$this->getTranslationImportMode())
469 {
470 include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
471 include_once("./Modules/LearningModule/classes/class.ilStructureObject.php");
472 include_once("./Modules/LearningModule/classes/class.ilLMPageObject.php");
473 switch ($a_rec["Type"])
474 {
475 case "st":
476 $parent = (int) $a_mapping->getMapping("Modules/LearningModule", "lm_tree", $a_rec["Parent"]);
477 $st_obj = new ilStructureObject($this->current_obj);
478 $st_obj->setType("st");
479 $st_obj->setLMId($this->current_obj->getId());
480 $st_obj->setTitle($a_rec["Title"]);
481 $st_obj->setImportId($a_rec["ImportId"]);
482 $st_obj->create(true);
483 ilLMObject::putInTree($st_obj, $parent, IL_LAST_NODE);
484 $a_mapping->addMapping("Modules/LearningModule", "lm_tree", $a_rec["Child"],
485 $st_obj->getId());
486 $a_mapping->addMapping("Services/MetaData", "md",
487 $a_rec["LmId"].":".$a_rec["Child"].":st", $this->current_obj->getId().":".$st_obj->getId().":st");
488 break;
489
490 case "pg":
491 $parent = (int) $a_mapping->getMapping("Modules/LearningModule", "lm_tree", $a_rec["Parent"]);
492 $pg_obj = new ilLMPageObject($this->current_obj);
493 $pg_obj->setType("pg");
494 $pg_obj->setLMId($this->current_obj->getId());
495 $pg_obj->setTitle($a_rec["Title"]);
496 $pg_obj->setImportId($a_rec["ImportId"]);
497 $pg_obj->create(true, true);
498 ilLMObject::putInTree($pg_obj, $parent, IL_LAST_NODE);
499 $a_mapping->addMapping("Modules/LearningModule", "lm_tree", $a_rec["Child"],
500 $pg_obj->getId());
501 $a_mapping->addMapping("Modules/LearningModule", "pg", $a_rec["Child"], $pg_obj->getId());
502 $a_mapping->addMapping("Services/COPage", "pg", "lm:".$a_rec["Child"],
503 "lm:".$pg_obj->getId());
504 $a_mapping->addMapping("Services/MetaData", "md",
505 $a_rec["LmId"].":".$a_rec["Child"].":pg", $this->current_obj->getId().":".$pg_obj->getId().":pg");
506 break;
507
508 // add free pages #18976
509 case "free_pg":
510 $pg_obj = new ilLMPageObject($this->current_obj);
511 $pg_obj->setType("pg");
512 $pg_obj->setLMId($this->current_obj->getId());
513 $pg_obj->setTitle($a_rec["Title"]);
514 $pg_obj->setImportId($a_rec["ImportId"]);
515 $pg_obj->create(true, true);
516 $a_mapping->addMapping("Modules/LearningModule", "lm_tree", $a_rec["Child"],
517 $pg_obj->getId());
518 $a_mapping->addMapping("Modules/LearningModule", "pg", $a_rec["Child"], $pg_obj->getId());
519 $a_mapping->addMapping("Services/COPage", "pg", "lm:".$a_rec["Child"],
520 "lm:".$pg_obj->getId());
521 $a_mapping->addMapping("Services/MetaData", "md",
522 $a_rec["LmId"].":".$a_rec["Child"].":pg", $this->current_obj->getId().":".$pg_obj->getId().":pg");
523 break;
524 }
525 }
526 else
527 {
528 include_once("./Modules/LearningModule/classes/class.ilLMObjTranslation.php");
529 switch ($a_rec["Type"])
530 {
531 case "st":
532 //"il_inst_st_66"
533 $imp_id = explode("_", $a_rec["ImportId"]);
534 if ($imp_id[0] == "il" &&
535 (int) $imp_id[1] == (int) IL_INST_ID &&
536 $imp_id[2] == "st"
537 )
538 {
539 $st_id = $imp_id[3];
540 if (ilLMObject::_lookupContObjId($st_id) == $this->getTranslationLM()->getId())
541 {
542 $trans = new ilLMObjTranslation($st_id, $this->getTranslationLang());
543 $trans->setTitle($a_rec["Title"]);
544 $trans->save();
545 $a_mapping->addMapping("Modules/LearningModule", "link",
546 "il_".$this->getCurrentInstallationId()."_".$a_rec["Type"]."_".$a_rec["Child"], $a_rec["ImportId"]);
547 }
548 }
549 // no meta-data mapping, since we do not want to import metadata
550 break;
551
552 case "pg":
553 //"il_inst_pg_66"
554 $imp_id = explode("_", $a_rec["ImportId"]);
555 if ($imp_id[0] == "il" &&
556 (int) $imp_id[1] == (int) IL_INST_ID &&
557 $imp_id[2] == "pg"
558 )
559 {
560 $pg_id = $imp_id[3];
561 if (ilLMObject::_lookupContObjId($pg_id) == $this->getTranslationLM()->getId())
562 {
563 $trans = new ilLMObjTranslation($pg_id, $this->getTranslationLang());
564 $trans->setTitle($a_rec["Title"]);
565 $trans->save();
566 $a_mapping->addMapping("Modules/LearningModule", "pg", $a_rec["Child"], $pg_id);
567 $a_mapping->addMapping("Modules/LearningModule", "link",
568 "il_".$this->getCurrentInstallationId()."_".$a_rec["Type"]."_".$a_rec["Child"], $a_rec["ImportId"]);
569 $a_mapping->addMapping("Services/COPage", "pg", "lm:".$a_rec["Child"],
570 "lm:".$pg_id);
571 }
572 }
573 // no meta-data mapping, since we do not want to import metadata
574 break;
575 }
576 }
577 break;
578
579 case "lm_data_transl":
580 include_once("./Modules/LearningModule/classes/class.ilLMObjTranslation.php");
581 if (!$this->getTranslationImportMode())
582 {
583 // save page/chapter title translation
584 $lm_obj_id = $a_mapping->getMapping("Modules/LearningModule", "lm_tree", $a_rec["Id"]);
585 if ($lm_obj_id > 0)
586 {
587 $t = new ilLMObjTranslation($lm_obj_id, $a_rec["Lang"]);
588 $t->setTitle($a_rec["Title"]);
589 $t->save();
590 }
591 }
592 break;
593 }
594 }
const IL_LAST_NODE
Definition: class.ilTree.php:4
getCurrentInstallationId()
Get current installation id.
Translation information on lm object.
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
put this object into content object tree
Class ilLMPageObject.
getTranslationLang()
Get translation language (import.
getTranslationLM()
Get translation lm (import.
getTranslationImportMode()
Get translation import mode.
static activateComments($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_activate=true)
Activate notes feature.
Class ilObjLearningModule.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Class ilStructreObject.
static yn2tf($a_yn)
convert "y"/"n" to true/false

References $t, ilNote\activateComments(), ilDataSet\getCurrentInstallationId(), ilObjectFactory\getInstanceByObjId(), getTranslationImportMode(), getTranslationLang(), getTranslationLM(), IL_LAST_NODE, ilLMObject\putInTree(), and ilUtil\yn2tf().

+ Here is the call graph for this function:

◆ readData()

ilLearningModuleDataSet::readData (   $a_entity,
  $a_version,
  $a_ids,
  $a_field = "" 
)

Read data.

Parameters

return

Definition at line 221 of file class.ilLearningModuleDataSet.php.

222 {
223 global $ilDB;
224
225 if (!is_array($a_ids))
226 {
227 $a_ids = array($a_ids);
228 }
229
230 if ($a_entity == "lm")
231 {
232 switch ($a_version)
233 {
234 case "5.1.0":
235 $q = "SELECT id, title, description,".
236 " default_layout, page_header, toc_active, lm_menu_active, toc_mode, print_view_active, numbering,".
237 " hist_user_comments, public_access_mode, header_page, footer_page, layout_per_page, rating, ".
238 " hide_head_foot_print, disable_def_feedback, rating_pages, store_tries, restrict_forw_nav, progr_icons, stylesheet style_id".
239 " FROM content_object JOIN object_data ON (content_object.id = object_data.obj_id)".
240 " WHERE ".$ilDB->in("id", $a_ids, false, "integer");
241
242 $set = $ilDB->query($q);
243 $this->data = array();
244 while ($rec = $ilDB->fetchAssoc($set))
245 {
246 // comments activated?
247 include_once("./Services/Notes/classes/class.ilNote.php");
248 $rec["comments"] = ilNote::commentsActivated($rec["id"], 0, "lm");
249
250 if ($this->getMasterLanguageOnly())
251 {
252 $rec["for_translation"] = 1;
253 }
254 $tmp = array();
255 foreach ($rec as $k => $v)
256 {
257 $tmp[$this->convertToLeadingUpper($k)]
258 = $v;
259 }
260 $rec = $tmp;
261
262 $this->data[] = $rec;
263 }
264 break;
265
266
267 break;
268 }
269 }
270
271 if ($a_entity == "lm_tree")
272 {
273 switch ($a_version)
274 {
275 case "5.1.0":
276 // the order by lft is very important, this ensures that parent nodes are written before
277 // their childs and that the import can add nodes simply with a "add at last child" target
278 $q = "SELECT lm_tree.lm_id, child, parent, depth, type, title, public_access, active, layout, import_id".
279 " FROM lm_tree JOIN lm_data ON (lm_tree.child = lm_data.obj_id)".
280 " WHERE ".$ilDB->in("lm_tree.lm_id", $a_ids, false, "integer").
281 " ORDER BY lft";
282
283 $set = $ilDB->query($q);
284 $this->data = array();
285 $obj_ids = array();
286 while ($rec = $ilDB->fetchAssoc($set))
287 {
288 $set2 = $ilDB->query("SELECT for_translation FROM content_object WHERE id = ".$ilDB->quote($rec["lm_id"], "integer"));
289 $rec2 = $ilDB->fetchAssoc($set2);
290 if (!$rec2["for_translation"])
291 {
292 $rec["import_id"] = "il_".IL_INST_ID."_".$rec["type"]."_".$rec["child"];
293 }
294 $tmp = array();
295 foreach ($rec as $k => $v)
296 {
297 $tmp[$this->convertToLeadingUpper($k)]
298 = $v;
299 }
300 $rec = $tmp;
301 $obj_ids[] = $rec["Child"];
302 $this->data[] = $rec;
303 }
304
305 // add free pages #18976
306 $set3 = $ilDB->query($q = "SELECT lm_id, type, title, public_access, active, layout, import_id, obj_id child FROM lm_data ".
307 "WHERE ".$ilDB->in("lm_id", $a_ids, false, "integer").
308 " AND ".$ilDB->in("obj_id", $obj_ids, true, "integer").
309 " AND type = ".$ilDB->quote("pg", "text"));
310 while ($rec3 = $ilDB->fetchAssoc($set3))
311 {
312 $set2 = $ilDB->query("SELECT for_translation FROM content_object WHERE id = ".$ilDB->quote($rec3["lm_id"], "integer"));
313 $rec2 = $ilDB->fetchAssoc($set2);
314 if (!$rec2["for_translation"])
315 {
316 $rec3["import_id"] = "il_".IL_INST_ID."_pg_".$rec3["child"];
317 }
318 $rec3["type"] = "free_pg";
319 $rec3["depth"] = 0;
320 $rec3["parent"] = 0;
321 $tmp = array();
322 foreach ($rec3 as $k => $v)
323 {
324 $tmp[$this->convertToLeadingUpper($k)]
325 = $v;
326 }
327 $this->data[] = $tmp;
328 }
329 break;
330 }
331 }
332
333 if ($a_entity == "lm_menu")
334 {
335 switch ($a_version)
336 {
337 case "5.1.0":
338 $this->getDirectDataFromQuery("SELECT lm_id, link_type, title, target, link_ref_id, active".
339 " FROM lm_menu ".
340 " WHERE ".$ilDB->in("lm_id", $a_ids, false, "integer"));
341 break;
342 }
343 }
344
345 if ($a_entity == "lm_data_transl")
346 {
347 switch ($a_version)
348 {
349 case "5.1.0":
350 $this->getDirectDataFromQuery("SELECT id, lang, title".
351 " FROM lm_data_transl ".
352 " WHERE ".$ilDB->in("id", $a_ids, false, "integer"));
353 break;
354 }
355 }
356
357
358 }
getDirectDataFromQuery($a_query, $a_convert_to_leading_upper=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
convertToLeadingUpper($a_str)
Make xyz_abc a XyzAbc string.
static commentsActivated($a_rep_obj_id, $a_obj_id, $a_obj_type)
Are comments activated for object?
global $ilDB

References $ilDB, ilNote\commentsActivated(), ilDataSet\convertToLeadingUpper(), ilDataSet\getDirectDataFromQuery(), and getMasterLanguageOnly().

+ Here is the call graph for this function:

◆ setMasterLanguageOnly()

ilLearningModuleDataSet::setMasterLanguageOnly (   $a_val)

Set master language only (export)

Parameters
bool$a_valexport only master language

Definition at line 32 of file class.ilLearningModuleDataSet.php.

33 {
34 $this->master_lang_only = $a_val;
35 }

◆ setTranslationImportMode()

ilLearningModuleDataSet::setTranslationImportMode (   $a_lm,
  $a_lang = "" 
)

Set translation import mode.

Parameters
ilObjLearningModule$a_lmlearning module
string$a_langlanguage

Definition at line 53 of file class.ilLearningModuleDataSet.php.

54 {
55 if ($a_lm != null)
56 {
57 $this->transl_into = true;
58 $this->transl_into_lm = $a_lm;
59 $this->transl_lang = $a_lang;
60 }
61 else
62 {
63 $this->transl_into = false;
64 }
65 }

Field Documentation

◆ $master_lang_only

ilLearningModuleDataSet::$master_lang_only = false
protected

Definition at line 21 of file class.ilLearningModuleDataSet.php.

Referenced by getMasterLanguageOnly().

◆ $transl_into

ilLearningModuleDataSet::$transl_into = false
protected

Definition at line 22 of file class.ilLearningModuleDataSet.php.

Referenced by getTranslationImportMode().

◆ $transl_into_lm

ilLearningModuleDataSet::$transl_into_lm = null
protected

Definition at line 23 of file class.ilLearningModuleDataSet.php.

Referenced by getTranslationLM().

◆ $transl_lang

ilLearningModuleDataSet::$transl_lang = ""
protected

Definition at line 24 of file class.ilLearningModuleDataSet.php.

Referenced by getTranslationLang().


The documentation for this class was generated from the following file: