ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.iliLinkMembersTableGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once 'Services/Table/classes/class.ilTable2GUI.php';
5 
14 {
15  protected $type = 'show';
16 
17  public function __construct($a_parent_obj, $a_data, $a_type, $a_cmd, $a_default_form_action)
18  {
19  global $ilCtrl, $lng, $ilAccess, $lng;
20 
21  parent::__construct($a_parent_obj, $a_cmd);
22 
23  $this->type = $a_type;
24  $this->setData($a_data);
25 
26  if($this->type == 'show')
27  {
28  if($ilAccess->checkAccess('write', '', $a_parent_obj->object->getRefId()))
29  {
30  $this->addColumn('', 'f', '1');
31  if(is_array($a_data) && count($a_data))
32  {
33  $this->addMultiCommand('removeMember', $lng->txt('remove'));
34  $this->addMultiCommand('changeMember', $lng->txt('change'));
35  $this->enable('select_all');
36  $this->setSelectAllCheckbox('user_id[]');
37  }
38  }
39 
40  $this->addColumn($lng->txt('username'), 'login', '20%');
41  $this->addColumn($lng->txt('firstname'), 'firstname', '15%');
42  $this->addColumn($lng->txt('lastname'), 'username', '15%');
43  $this->addColumn($lng->txt('ilinc_coursemember_status'), 'ilinc_coursemember_status', '20%');
44  $this->addColumn($lng->txt('role'), 'role', '20%');
45  $this->addColumn($lng->txt('grp_options'), 'functions', '10%');
46 
47  $this->setRowTemplate('tpl.icrs_members_row.html', 'Modules/ILinc');
48  }
49  else if($this->type == 'change')
50  {
51  $this->addColumn($lng->txt('username'), 'login', '20%');
52  $this->addColumn($lng->txt('firstname'), 'firstname', '15%');
53  $this->addColumn($lng->txt('lastname'), 'username', '15%');
54  $this->addColumn($lng->txt('ilinc_coursemember_status'), 'ilinc_coursemember_status', '20%');
55  $this->addColumn($lng->txt('role'), 'role', '30%');
56 
57  $this->addCommandButton('members', $this->lng->txt('back'));
58  if(is_array($a_data) && count($a_data))
59  {
60  $this->addCommandButton('updateMemberStatus', $this->lng->txt('confirm'));
61  }
62 
63  $this->setRowTemplate('tpl.icrs_members_change_row.html', 'Modules/ILinc');
64  $this->setLimit(32000);
65  }
66 
67  $this->enable('sort');
68  $this->enable('header');
69  $this->enable('numinfo');
70 
71  $this->setPrefix('members');
72  $this->setFormName('members');
73 
74  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_default_form_action));
75  }
76 }
77 ?>