ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilLPCollectionOfLMChapters Class Reference

LP collection of learning module chapters. More...

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

Public Member Functions

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

Static Protected Attributes

static $possible_items = array()
 

Additional Inherited Members

- Static Public Member Functions inherited from ilLPCollection
static getInstanceByMode ($a_obj_id, $a_mode)
 
static getCollectionModes ()
 
- Protected Member Functions inherited from ilLPCollection
 read ($a_obj_id)
 
 validateEntry ($a_item_id)
 
 addEntry ($a_item_id)
 
 deleteEntry ($a_item_id)
 
- Protected Attributes inherited from ilLPCollection
 $obj_id
 
 $mode
 
 $items
 

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
Version
Id
class.ilLPCollections.php 40326 2013-03-05 11:39:24Z jluetzen

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

Member Function Documentation

◆ getPossibleItems()

ilLPCollectionOfLMChapters::getPossibleItems (   $a_ref_id)

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

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

Referenced by getTableGUIData().

21  {
22  if (!isset(self::$possible_items[$a_ref_id])) {
24 
25  $items = array();
26 
27  // only top-level chapters
28 
29  include_once "Services/MetaData/classes/class.ilMDEducational.php";
30  $tree = new ilTree($obj_id);
31  $tree->setTableNames('lm_tree', 'lm_data');
32  $tree->setTreeTablePK("lm_id");
33  foreach ($tree->getChilds($tree->readRootId()) as $child) {
34  if ($child["type"] == "st") {
35  $child["tlt"] = ilMDEducational::_getTypicalLearningTimeSeconds($obj_id, $child["obj_id"]);
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($a_rbac_id, $a_obj_id=0)
static _lookupObjectId($a_ref_id)
lookup object id
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTableGUIData()

ilLPCollectionOfLMChapters::getTableGUIData (   $a_parent_ref_id)

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

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

52  {
53  $data = array();
54 
55  $parent_type = ilObject::_lookupType($a_parent_ref_id, true);
56  include_once './Services/Link/classes/class.ilLink.php';
57 
58  foreach ($this->getPossibleItems($a_parent_ref_id) as $item) {
59  $tmp = array();
60  $tmp['id'] = $item['obj_id'];
61  $tmp['ref_id'] = 0;
62  $tmp['title'] = $item['title'];
63  $tmp['type'] = $item['type'];
64  $tmp['status'] = $this->isAssignedEntry($item['obj_id']);
65 
66  // #12158
67  $tmp['url'] = ilLink::_getLink($a_parent_ref_id, $parent_type, null, "_" . $tmp['id']);
68 
69  if ($this->mode == ilLPObjSettings::LP_MODE_COLLECTION_TLT) {
70  $tmp['tlt'] = $item['tlt'];
71  }
72 
73  $data[] = $tmp;
74  }
75 
76  return $data;
77  }
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
isAssignedEntry($a_item_id)
+ Here is the call graph for this function:

Field Documentation

◆ $possible_items

ilLPCollectionOfLMChapters::$possible_items = array()
staticprotected

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


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