ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilUserClipboardTableGUI.php
Go to the documentation of this file.
1<?php
2
24{
26
27 public function __construct(
28 object $a_parent_obj,
29 string $a_parent_cmd,
30 int $a_id
31 ) {
32 $this->setId('obj_table_' . $a_id);
33 parent::__construct($a_parent_obj, $a_parent_cmd, '');
34
35 $this->clipboard = ilUserClipboard::getInstance($a_id);
36 $this->lng->loadLanguageModule('user');
37 }
38
39 public function init(): void
40 {
41 $this->setTitle($this->lng->txt('clipboard_table_title'));
42
43 $this->addColumn('', 'id', '5px');
44 $this->addColumn($this->lng->txt('name'), 'name', '70%');
45 $this->addColumn($this->lng->txt('login'), 'login', '30%');
46
47 $this->setOrderColumn('name');
48 $this->setRowTemplate('tpl.usr_clipboard_table_row.html', 'components/ILIAS/User');
49
50 $this->setSelectAllCheckbox('uids');
51
52 $this->addMultiCommand(
53 'addFromClipboard',
54 $this->lng->txt('add')
55 );
56
57 $this->addMultiCommand(
58 'removeFromClipboard',
59 $this->lng->txt('clipboard_remove_btn')
60 );
61
62 $this->addCommandButton('emptyClipboard', $this->lng->txt('clipboard_empty_btn'));
63 $this->addCommandButton('cancel', $this->lng->txt('cancel'));
64 }
65
69 protected function fillRow(array $a_set): void
70 {
71 $this->tpl->setVariable('VAL_POSTNAME', 'uids');
72 $this->tpl->setVariable('VAL_ID', $a_set['usr_id']);
73 $this->tpl->setVariable('VAL_NAME', $a_set['name']);
74 $this->tpl->setVariable('VAL_LOGIN', $a_set['login']);
75 }
76
77 public function parse(): void
78 {
79 $content = [];
80 foreach ($this->clipboard->getValidatedContent() as $user_id) {
81 $row['usr_id'] = $user_id;
83
84 $row['name'] = ($name_arr['lastname'] . ', ' . $name_arr['firstname']);
85 $row['login'] = ilObjUser::_lookupLogin($user_id);
86
87 $content[] = $row;
88 }
89 $this->setMaxCount(count($this->clipboard->getValidatedContent()));
90 $this->setData($content);
91 }
92}
static _lookupName(int $a_user_id)
static _lookupLogin(int $a_user_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
addMultiCommand(string $a_cmd, string $a_text)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
setData(array $a_data)
Set table data.
setOrderColumn(string $a_order_column="", string $a_default_column="")
setMaxCount(int $a_max_count)
set max.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(object $a_parent_obj, string $a_parent_cmd, int $a_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance(int $a_usr_id)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc