ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjectTableGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once './Services/Table/classes/class.ilTable2GUI.php';
5 
13 {
14  protected $objects = array();
15 
22  public function __construct($a_parent_obj, $a_parent_cmd, $a_id)
23  {
24  $this->setId('obj_table_'.$a_id);
25  parent::__construct($a_parent_obj, $a_parent_cmd, '');
26 
27  $this->setOrderColumn('title');
28 
29  $this->setRowTemplate('tpl.object_table_row.html', 'Services/Object');
30  }
31 
32 
33  public function setObjects($a_ref_ids)
34  {
35  $this->objects = $a_ref_ids;
36  }
37 
38  public function getObjects()
39  {
40  return $this->objects;
41  }
42 
43  public function init()
44  {
45  $this->addColumn($this->lng->txt('type'), 'type','30px');
46  $this->addColumn($this->lng->txt('title'),'title');
47  }
48 
49  public function fillRow($set)
50  {
51  include_once './Services/Link/classes/class.ilLink.php';
52  $this->tpl->setVariable('OBJ_LINK',ilLink::_getLink($set['ref_id'], $set['type']));
53  $this->tpl->setVariable('OBJ_LINKED_TITLE',$set['title']);
54  $this->tpl->setVariable('TYPE_IMG',ilUtil::getTypeIconPath($set['type'], $set['obj_id']));
55  $this->tpl->setVariable('TYPE_STR',$this->lng->txt('obj_'.$set['type']));
56  }
57 
61  public function parse()
62  {
63  $counter = 0;
64  $set = array();
65  foreach($this->getObjects() as $ref_id)
66  {
68  if($type == 'rolf')
69  {
70  continue;
71  }
72 
73  $set[$counter]['ref_id'] = $ref_id;
74  $set[$counter]['obj_id'] = ilObject::_lookupObjId($ref_id);
75  $set[$counter]['type'] = ilObject::_lookupType(ilObject::_lookupObjId($ref_id));
76  $set[$counter]['title'] = ilObject::_lookupTitle(ilObject::_lookupObjId($ref_id));
77  $counter++;
78  }
79 
80  $this->setData($set);
81  }
82 }