ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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;
18
27 public function __construct($a_ref, $cmd)
28 {
29 global $lng, $ilCtrl;
30
31 parent::__construct($a_ref, $cmd);
32
33 $this->gui = $a_ref;
34
35 $this->setTitle($lng->txt('chatroom_available_smilies'));
36 $this->setId('chatroom_smilies_tbl');
37
38 $this->addColumn('', 'checkbox', '2%', true);
39 $this->addColumn($lng->txt('chatroom_smiley_image'), '', '28%');
40 $this->addColumn($lng->txt('chatroom_smiley_keyword'), 'keyword', '55%');
41 $this->addColumn($lng->txt('actions'), '', '15%');
42
43 $this->setFormAction($ilCtrl->getFormAction($a_ref));
44 $this->setRowTemplate('tpl.chatroom_smiley_list_row.html', 'Modules/Chatroom');
45 $this->setSelectAllCheckbox('smiley_id');
46
47 $this->addMultiCommand(
48 "smiley-deleteMultipleObject", $lng->txt("chatroom_delete_selected")
49 );
50 }
51
57 public function fillRow($a_set)
58 {
59 global $ilCtrl;
60
61 $this->tpl->setVariable('VAL_SMILEY_ID', $a_set['smiley_id']);
62 $this->tpl->setVariable('VAL_SMILEY_PATH', $a_set['smiley_fullpath']);
63 $this->tpl->setVariable('VAL_SMILEY_KEYWORDS', $a_set['smiley_keywords']);
64 $this->tpl->setVariable(
65 'VAL_SMILEY_KEYWORDS_NONL',
66 str_replace("\n", "", $a_set['smiley_keywords'])
67 );
68 $this->tpl->setVariable(
69 'VAL_SORTING_TEXTINPUT',
70 ilUtil::formInput('sorting[' . $a_set['id'] . ']',
71 $a_set['sorting'])
72 );
73
74 $ilCtrl->setParameter($this->gui, 'topic_id', $a_set['id']);
75
76 $current_selection_list = new ilAdvancedSelectionListGUI();
77 $current_selection_list->setListTitle($this->lng->txt("actions"));
78 $current_selection_list->setId("act_" . $a_set['smiley_id']);
79
80 $current_selection_list->addItem(
81 $this->lng->txt("edit"),
82 '',
83 $ilCtrl->getLinkTarget($this->gui, 'smiley-showEditSmileyEntryFormObject') .
84 "&smiley_id=" . $a_set['smiley_id']
85 );
86 $current_selection_list->addItem(
87 $this->lng->txt("delete"),
88 '',
89 $ilCtrl->getLinkTarget($this->gui, 'smiley-showDeleteSmileyFormObject') .
90 "&smiley_id=" . $a_set['smiley_id']
91 );
92
93 $this->tpl->setVariable('VAL_ACTIONS', $current_selection_list->getHTML());
94 }
95
96}
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.
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.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
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
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:17
$cmd
Definition: sahs_server.php:35