ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilRepositoryObjectResultTableGUI.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
16{
23 public function __construct($a_parent_obj,$a_parent_cmd,$a_allow_object_selection = false)
24 {
25 global $ilCtrl, $lng, $ilAccess, $lng;
26
27 parent::__construct($a_parent_obj, $a_parent_cmd);
28
29 $this->addColumn("", "", "1", true);
30 $this->addColumn($this->lng->txt("title"), "title", "80%");
31 $this->addColumn($this->lng->txt("members"), "member", "20%");
32
33 $this->setFormAction($ilCtrl->getFormAction($this->parent_obj));
34 $this->setRowTemplate("tpl.rep_search_obj_result_row.html", "Services/Search");
35 $this->setTitle($this->lng->txt('search_results'));
36 $this->setEnableTitle(true);
37 $this->setId("group_table");
38 $this->setDefaultOrderField("title");
39 $this->setDefaultOrderDirection("asc");
40 $this->enable('select_all');
41 $this->setSelectAllCheckbox("obj[]");
42
43 $this->addMultiCommand('listUsers', $this->lng->txt('grp_list_users'));
44 if((bool)$a_allow_object_selection)
45 {
46 $this->addMultiCommand('selectObject', $this->lng->txt('grp_select_object'));
47 }
48 }
49
55 public function fillRow($row)
56 {
57 if($row['member'])
58 {
59 $this->tpl->setVariable('VAL_ID',$row['id']);
60 }
61 $this->tpl->setVariable('VAL_TITLE',$row['title']);
62 if(strlen($row['desc']))
63 {
64 $this->tpl->setVariable('VAL_DESC',$row['desc']);
65 }
66 $this->tpl->setVariable('VAL_MEMBER',$row['member']);
67 return true;
68 }
69
70
76 public function parseObjectIds($a_ids)
77 {
78 foreach($a_ids as $object_id)
79 {
80 $row = array();
81 $type = ilObject::_lookupType($object_id);
82
83 if($type == 'role')
84 {
85 if($GLOBALS['rbacreview']->isRoleDeleted($object_id))
86 {
87 continue;
88 }
89 }
90
91
92 $row['title'] = ilObject::_lookupTitle($object_id);
93 $row['desc'] = ilObject::_lookupDescription($object_id);
94 $row['id'] = $object_id;
95
96 switch($type)
97 {
98
99 case 'crs':
100 case 'grp':
101
102 include_once './Services/Membership/classes/class.ilParticipants.php';
104 {
105 $row['member'] = count(ilParticipants::getInstanceByObjId($object_id)->getParticipants());
106 }
107 else
108 {
109 $row['member'] = 0;
110 }
111 break;
112
113 case 'role':
114 global $rbacreview;
115 include_once './Services/User/classes/class.ilUserFilter.php';
116 $row['member'] = count(ilUserFilter::getInstance()->filter($rbacreview->assignedUsers($object_id)));
117 break;
118 }
119
120 $data[] = $row;
121 }
122 $this->setData($data ? $data : array());
123 }
124
129 function numericOrdering($a_field)
130 {
131 if($a_field == "member")
132 {
133 return true;
134 }
135 return false;
136 }
137}
138?>
static _lookupTitle($a_id)
lookup object title
static _lookupDescription($a_id)
lookup object description
static _lookupType($a_id, $a_reference=false)
lookup object type
static hasParticipantListAccess($a_obj_id, $a_usr_id=null)
Check if (current) user has access to the participant list.
static getInstanceByObjId($a_obj_id)
Get instance by obj type.
TableGUI class object (course,group and role) search results Used in member search.
__construct($a_parent_obj, $a_parent_cmd, $a_allow_object_selection=false)
Constructor.
Class ilTable2GUI.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setEnableTitle($a_enabletitle)
Set Enable Title.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
setId($a_val)
Set id.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
enable($a_module_name)
enables particular modules of table
static getInstance()
Singelton get instance.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40