ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilChatroomSmiliesTableGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5include_once('Services/Table/classes/class.ilTable2GUI.php');
6include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
7
16{
17 private $gui = null;
21 protected $dic;
22
29 public function __construct($a_ref, $cmd)
30 {
31 parent::__construct($a_ref, $cmd);
32
33 global $DIC;
34
35 $this->dic = $DIC;
36 $this->gui = $a_ref;
37
38 $this->setTitle($this->lng->txt('chatroom_available_smilies'));
39 $this->setId('chatroom_smilies_tbl');
40
41 $this->addColumn('', 'checkbox', '2%', true);
42 $this->addColumn($this->lng->txt('chatroom_smiley_image'), '', '28%');
43 $this->addColumn($this->lng->txt('chatroom_smiley_keyword'), 'keyword', '55%');
44 $this->addColumn($this->lng->txt('actions'), '', '15%');
45
46 $this->setFormAction($this->ctrl->getFormAction($a_ref));
47 $this->setRowTemplate('tpl.chatroom_smiley_list_row.html', 'Modules/Chatroom');
48 $this->setSelectAllCheckbox('smiley_id');
49
50 if ($this->dic->rbac()->system()->checkAccess('write', $this->gui->ref_id)) {
51 $this->addMultiCommand(
52 "smiley-deleteMultipleObject",
53 $this->lng->txt("chatroom_delete_selected")
54 );
55 }
56 }
57
62 public function fillRow($a_set)
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 $this->tpl->setVariable(
72 'VAL_SORTING_TEXTINPUT',
74 'sorting[' . $a_set['id'] . ']',
75 $a_set['sorting']
76 )
77 );
78
79 $this->ctrl->setParameter($this->gui, 'topic_id', $a_set['id']);
80
81 if ($this->dic->rbac()->system()->checkAccess('write', $this->gui->ref_id)) {
82 $current_selection_list = new ilAdvancedSelectionListGUI();
83 $current_selection_list->setListTitle($this->lng->txt("actions"));
84 $current_selection_list->setId("act_" . $a_set['smiley_id']);
85
86 $current_selection_list->addItem($this->lng->txt("edit"), '', $this->ctrl->getLinkTarget($this->gui, 'smiley-showEditSmileyEntryFormObject')
87 . "&smiley_id=" . $a_set['smiley_id']);
88 $current_selection_list->addItem($this->lng->txt("delete"), '', $this->ctrl->getLinkTarget($this->gui, 'smiley-showDeleteSmileyFormObject')
89 . "&smiley_id=" . $a_set['smiley_id']);
90
91 $this->tpl->setVariable('VAL_ACTIONS', $current_selection_list->getHTML());
92 }
93 }
94}
An exception for terminatinating execution or to throw for unit testing.
User interface class for advanced drop-down selection lists.
Class ilChatroomSmiliesTableGUI Prepares table rows and fills them.
__construct($a_ref, $cmd)
Constructor Prepares smilies table.
fillRow($a_set)
Fills table rows with content from $a_set.
Class ilTable2GUI.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
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.
setId($a_val)
Set id.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
static formInput($varname, $value, $disabled=false)
create html input area
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46