ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilLPCollectionOfLMChapters Class Reference
+ 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
array $items
 
int $obj_id
 
int $mode
 
ilDBInterface $db
 
ilLogger $logger
 
TrackingDBFactoryInterface $tracking_db_factory
 

Detailed Description

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

Member Function Documentation

◆ getPossibleItems()

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

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

29 {
30 if (!isset(self::$possible_items[$a_ref_id])) {
32
33 $items = array();
34
35 // only top-level chapters
36 $tree = new ilTree($obj_id);
37 $tree->setTableNames('lm_tree', 'lm_data');
38 $tree->setTreeTablePK("lm_id");
39 foreach ($tree->getChilds($tree->readRootId()) as $child) {
40 if ($child["type"] == "st") {
42 $child["type"],
43 $obj_id,
44 $child["obj_id"]
45 );
46 $items[$child["obj_id"]] = $child;
47 }
48 }
49
50 self::$possible_items[$a_ref_id] = $items;
51 }
52
53 return self::$possible_items[$a_ref_id];
54 }
static _getTypicalLearningTime(string $type, int $obj_id, int $sub_id=0)
static _lookupObjectId(int $ref_id)
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...

References ilLPCollection\$items, ilLPCollection\$obj_id, ilLPStatus\_getTypicalLearningTime(), 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 59 of file class.ilLPCollectionOfLMChapters.php.

59 : array
60 {
61 $data = array();
62
63 foreach ($this->getPossibleItems($a_parent_ref_id) as $item) {
64 $tmp = array();
65 $tmp['id'] = $item['obj_id'];
66 $tmp['ref_id'] = 0;
67 $tmp['title'] = $item['title'];
68 $tmp['type'] = $item['type'];
69 $tmp['status'] = $this->isAssignedEntry($item['obj_id']);
70
71 // #12158
72 $tmp['url'] = ilLink::_getLink(
73 null,
74 'st',
75 [],
76 $tmp['id'] . '_' . $a_parent_ref_id
77 );
78
79 if ($this->mode == ilLPObjSettings::LP_MODE_COLLECTION_TLT) {
80 $tmp['tlt'] = $item['tlt'];
81 }
82
83 $data[] = $tmp;
84 }
85
86 return $data;
87 }
isAssignedEntry(int $a_item_id)
const int LP_MODE_COLLECTION_TLT
$data
Definition: storeScorm.php:45

References $data, 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 23 of file class.ilLPCollectionOfLMChapters.php.


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