ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilLPCollectionOfLMChapters.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5require_once "Services/Tracking/classes/collection/class.ilLPCollection.php";
6
17{
18 protected static $possible_items = array();
19
20 public function getPossibleItems($a_ref_id)
21 {
22 if(!isset(self::$possible_items[$a_ref_id]))
23 {
25
26 $items = array();
27
28 // only top-level chapters
29
30 include_once "Services/MetaData/classes/class.ilMDEducational.php";
31 $tree = new ilTree($obj_id);
32 $tree->setTableNames('lm_tree','lm_data');
33 $tree->setTreeTablePK("lm_id");
34 foreach ($tree->getChilds($tree->readRootId()) as $child)
35 {
36 if($child["type"] == "st")
37 {
38 $child["tlt"] = ilMDEducational::_getTypicalLearningTimeSeconds($obj_id, $child["obj_id"]);
39 $items[$child["obj_id"]] = $child;
40 }
41 }
42
43 self::$possible_items[$a_ref_id] = $items;
44 }
45
46 return self::$possible_items[$a_ref_id];
47 }
48
49
50 //
51 // TABLE GUI
52 //
53
54 public function getTableGUIData($a_parent_ref_id)
55 {
56 $data = array();
57
58 $parent_type = ilObject::_lookupType($a_parent_ref_id, true);
59 include_once './Services/Link/classes/class.ilLink.php';
60
61 foreach ($this->getPossibleItems($a_parent_ref_id) as $item)
62 {
63 $tmp = array();
64 $tmp['id'] = $item['obj_id'];
65 $tmp['ref_id'] = 0;
66 $tmp['title'] = $item['title'];
67 $tmp['type'] = $item['type'];
68 $tmp['status'] = $this->isAssignedEntry($item['obj_id']);
69
70 // #12158
71 $tmp['url'] = ilLink::_getLink($a_parent_ref_id, $parent_type, null, "_".$tmp['id']);
72
74 {
75 $tmp['tlt'] = $item['tlt'];
76 }
77
78 $data[] = $tmp;
79 }
80
81 return $data;
82 }
83}
84
85?>
LP collection of learning module chapters.
LP collection base class.
isAssignedEntry($a_item_id)
_getTypicalLearningTimeSeconds($a_rbac_id, $a_obj_id=0)
static _lookupObjectId($a_ref_id)
lookup object id
static _lookupType($a_id, $a_reference=false)
lookup object type
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
$data