ILIAS  release_8 Revision v8.24
ilLPCollectionOfLMChapters Class Reference

LP collection of learning module chapters. More...

+ Inheritance diagram for ilLPCollectionOfLMChapters:
+ Collaboration diagram for ilLPCollectionOfLMChapters:

Public Member Functions

 getPossibleItems (int $a_ref_id)
 
 getTableGUIData (int $a_parent_ref_id)
 
- Public Member Functions inherited from ilLPCollection
 __construct (int $a_obj_id, int $a_mode)
 
 hasSelectableItems ()
 
 cloneCollection (int $a_target_id, int $a_copy_id)
 
 getItems ()
 
 delete ()
 
 isAssignedEntry (int $a_item_id)
 
 deactivateEntries (array $a_item_ids)
 
 activateEntries (array $a_item_ids)
 

Static Protected Attributes

static array $possible_items = array()
 

Additional Inherited Members

- Static Public Member Functions inherited from ilLPCollection
static getInstanceByMode (int $a_obj_id, int $a_mode)
 
static getCollectionModes ()
 
- Protected Member Functions inherited from ilLPCollection
 read (int $a_obj_id)
 
 validateEntry (int $a_item_id)
 
 addEntry (int $a_item_id)
 
 deleteEntry (int $a_item_id)
 
- Protected Attributes inherited from ilLPCollection
int $obj_id
 
int $mode
 
array $items = []
 
ilDBInterface $db
 
ilLogger $logger
 

Detailed Description

LP collection of learning module chapters.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 12 of file class.ilLPCollectionOfLMChapters.php.

Member Function Documentation

◆ getPossibleItems()

ilLPCollectionOfLMChapters::getPossibleItems ( int  $a_ref_id)
Returns
array|mixed

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

20 {
21 if (!isset(self::$possible_items[$a_ref_id])) {
23
24 $items = array();
25
26 // only top-level chapters
27 $tree = new ilTree($obj_id);
28 $tree->setTableNames('lm_tree', 'lm_data');
29 $tree->setTreeTablePK("lm_id");
30 foreach ($tree->getChilds($tree->readRootId()) as $child) {
31 if ($child["type"] == "st") {
33 $obj_id,
34 $child["obj_id"]
35 );
36 $items[$child["obj_id"]] = $child;
37 }
38 }
39
40 self::$possible_items[$a_ref_id] = $items;
41 }
42
43 return self::$possible_items[$a_ref_id];
44 }
static _getTypicalLearningTimeSeconds(int $a_rbac_id, int $a_obj_id=0)
static _lookupObjectId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilLPCollection\$items, ilLPCollection\$obj_id, ilMDEducational\_getTypicalLearningTimeSeconds(), and ilObject\_lookupObjectId().

Referenced by getTableGUIData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTableGUIData()

ilLPCollectionOfLMChapters::getTableGUIData ( int  $a_parent_ref_id)
Returns
array

Definition at line 49 of file class.ilLPCollectionOfLMChapters.php.

49 : array
50 {
51 $data = array();
52
53 $parent_type = ilObject::_lookupType($a_parent_ref_id, true);
54
55 foreach ($this->getPossibleItems($a_parent_ref_id) as $item) {
56 $tmp = array();
57 $tmp['id'] = $item['obj_id'];
58 $tmp['ref_id'] = 0;
59 $tmp['title'] = $item['title'];
60 $tmp['type'] = $item['type'];
61 $tmp['status'] = $this->isAssignedEntry($item['obj_id']);
62
63 // #12158
64 $tmp['url'] = ilLink::_getLink(
65 $a_parent_ref_id,
66 $parent_type,
67 [],
68 "_" . $tmp['id']
69 );
70
71 if ($this->mode == ilLPObjSettings::LP_MODE_COLLECTION_TLT) {
72 $tmp['tlt'] = $item['tlt'];
73 }
74
75 $data[] = $tmp;
76 }
77
78 return $data;
79 }
isAssignedEntry(int $a_item_id)
static _lookupType(int $id, bool $reference=false)

References $data, ilLink\_getLink(), ilObject\_lookupType(), getPossibleItems(), ilLPCollection\isAssignedEntry(), and ilLPObjSettings\LP_MODE_COLLECTION_TLT.

+ Here is the call graph for this function:

Field Documentation

◆ $possible_items

array ilLPCollectionOfLMChapters::$possible_items = array()
staticprotected

Definition at line 14 of file class.ilLPCollectionOfLMChapters.php.


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