ILIAS  release_8 Revision v8.25-1-g13de6a5eca6
class.ilChatroomSmiliesTableGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
29{
31 protected \ILIAS\DI\Container $dic;
32
33 public function __construct(ilChatroomObjectGUI $a_ref, string $cmd)
34 {
35 $this->setId('chatroom_smilies_tbl');
36 parent::__construct($a_ref, $cmd);
37
38 global $DIC;
39
40 $this->dic = $DIC;
41 $this->gui = $a_ref;
42
43 $this->setTitle($this->lng->txt('chatroom_available_smilies'));
44
45 $this->addColumn('', 'checkbox', '2%', true);
46 $this->addColumn($this->lng->txt('chatroom_smiley_image'), '', '28%');
47 $this->addColumn($this->lng->txt('chatroom_smiley_keyword'), 'keyword', '55%');
48 $this->addColumn($this->lng->txt('actions'), '', '15%');
49
50 $this->setFormAction($this->ctrl->getFormAction($a_ref));
51 $this->setRowTemplate('tpl.chatroom_smiley_list_row.html', 'Modules/Chatroom');
52 $this->setSelectAllCheckbox('smiley_id');
53
54 if ($this->dic->rbac()->system()->checkAccess('write', $this->gui->getRefId())) {
55 $this->addMultiCommand(
56 'smiley-deleteMultipleObject',
57 $this->lng->txt('chatroom_delete_selected')
58 );
59 }
60 }
61
62 protected function fillRow(array $a_set): void
63 {
64 $this->tpl->setVariable('VAL_SMILEY_ID', $a_set['smiley_id']);
65 $this->tpl->setVariable('VAL_SMILEY_PATH', $a_set['smiley_fullpath']);
66 $this->tpl->setVariable('VAL_SMILEY_KEYWORDS', $a_set['smiley_keywords']);
67 $this->tpl->setVariable(
68 'VAL_SMILEY_KEYWORDS_NONL',
69 str_replace("\n", "", $a_set['smiley_keywords'])
70 );
71
72 if ($this->dic->rbac()->system()->checkAccess('write', $this->gui->getRefId())) {
73 $current_selection_list = new ilAdvancedSelectionListGUI();
74 $current_selection_list->setListTitle($this->lng->txt('actions'));
75 $current_selection_list->setId('act_' . $a_set['smiley_id']);
76
77 $this->ctrl->setParameter($this->gui, 'smiley_id', $a_set['smiley_id']);
78 $current_selection_list->addItem(
79 $this->lng->txt('edit'),
80 '',
81 $this->ctrl->getLinkTarget($this->gui, 'smiley-showEditSmileyEntryFormObject')
82 );
83 $current_selection_list->addItem(
84 $this->lng->txt('delete'),
85 '',
86 $this->ctrl->getLinkTarget($this->gui, 'smiley-showDeleteSmileyFormObject')
87 );
88 $this->ctrl->setParameter($this->gui, 'smiley_id', null);
89
90 $this->tpl->setVariable('VAL_ACTIONS', $current_selection_list->getHTML());
91 }
92 }
93}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilChatroomSmiliesTableGUI Prepares table rows and fills them.
fillRow(array $a_set)
Standard Version of Fill Row.
__construct(ilChatroomObjectGUI $a_ref, string $cmd)
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="")
addMultiCommand(string $a_cmd, string $a_text)
setFormAction(string $a_form_action, bool $a_multipart=false)
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)
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc