ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilRepositoryUserResultTableGUI.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 
15 {
16 
20  function __construct($a_parent_obj, $a_parent_cmd)
21  {
22  global $ilCtrl, $lng, $ilAccess, $lng;
23 
24  parent::__construct($a_parent_obj, $a_parent_cmd);
25 
26  $this->addColumn("", "", "1", true);
27  $this->addColumn($this->lng->txt("login"), "login", "33%");
28  $this->addColumn($this->lng->txt("firstname"), "firstname", "33%");
29  $this->addColumn($this->lng->txt("lastname"), "lastname", "33%");
30 
31  $this->setFormAction($ilCtrl->getFormAction($this->parent_obj));
32  $this->setRowTemplate("tpl.rep_search_usr_result_row.html", "Services/Search");
33  $this->setTitle($this->lng->txt('search_results'));
34  $this->setEnableTitle(true);
35  $this->setId("user_table");
36  $this->setDefaultOrderField("login");
37  $this->setDefaultOrderDirection("asc");
38  $this->enable('select_all');
39  $this->setSelectAllCheckbox("user[]");
40  }
41 
46  public function initMultiCommands($a_commands)
47  {
48  if(!count($a_commands))
49  {
50  $this->addMultiCommand('addUser', $this->lng->txt('btn_add'));
51  return true;
52  }
53  $this->addMultiItemSelectionButton('member_type', $a_commands, 'addUser', $this->lng->txt('btn_add'));
54  return true;
55  }
56 
60  protected function fillRow($user)
61  {
62  global $ilCtrl, $lng;
63 
64  $this->tpl->setVariable("VAL_LOGIN", $user["login"]);
65  $this->tpl->setVariable("VAL_FIRSTNAME", $user["firstname"]);
66  $this->tpl->setVariable("VAL_LASTNAME", $user["lastname"]);
67  $this->tpl->setVariable("VAL_ID", $user["id"]);
68  }
69 
75  public function parseUserIds($a_user_ids)
76  {
77  include_once './Services/User/classes/class.ilObjUser.php';
78  foreach($a_user_ids as $usr_id)
79  {
80  $name = ilObjUser::_lookupName($usr_id);
81  $row['login'] = $name['login'];
82  $row['lastname'] = $name['lastname'];
83  $row['firstname'] = $name['firstname'];
84  $row['id'] = $usr_id;
85 
86  $data[] = $row;
87 
88  }
89  $this->setData($data ? $data : array());
90  }
91 
92 }
93 ?>