ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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
4include_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}
Settings for LO courses.
__construct($a_parent_obj, $a_parent_cmd, $a_id)
Constructor.
fillRow($set)
Standard Version of Fill Row.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _lookupType($a_id, $a_reference=false)
lookup object type
Class ilTable2GUI.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setId($a_val)
Set id.
setOrderColumn($a_order_column=0, $a_default_column=0)
set order column @access public
static getTypeIconPath($a_type, $a_obj_id, $a_size='small')
Get type icon path path Return image path for icon_xxx.pngs Or (if enabled) path to custom icon Depre...
$ref_id
Definition: sahs_server.php:39