ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilChatSmiliesTableGUI.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 
5 include_once('Services/Table/classes/class.ilTable2GUI.php');
6 include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
7 
9  public function __construct($a_ref, $title) {
10  global $lng, $ilCtrl;
11 
12  parent::__construct($a_ref, $title);
13  $this->setTitle($lng->txt('chat_available_smilies'));
14 
15  $this->setId('chat_smilies_tbl');
16 
17  $this->addColumn('', 'checkbox', '2%', true);
18  $this->addColumn($lng->txt('chat_smiley_image'), '' , '28%');
19  $this->addColumn($lng->txt('chat_smiley_keyword'), 'keyword' , '55%');
20  $this->addColumn($lng->txt('actions'), '', '15%');
21 
22  $this->setFormAction($ilCtrl->getFormAction($a_ref));
23  $this->setRowTemplate('tpl.chat_smiley_list_row.html', 'Modules/Chat');
24  $this->setSelectAllCheckbox('smiley_id');
25 
26  $this->addMultiCommand("deleteMultiple", $lng->txt("chat_delete_selected"));
27  }
28 
29  public function fillRow($a_set)
30  {
31  global $ilCtrl;
32  $this->tpl->setVariable('VAL_SMILEY_ID', $a_set['smiley_id']);
33  $this->tpl->setVariable('VAL_SMILEY_PATH', $a_set['smiley_fullpath']);
34  $this->tpl->setVariable('VAL_SMILEY_KEYWORDS', $a_set['smiley_keywords']);
35  $this->tpl->setVariable('VAL_SMILEY_KEYWORDS_NONL', str_replace("\n", "", $a_set['smiley_keywords']));
36  $this->tpl->setVariable('VAL_SORTING_TEXTINPUT', ilUtil::formInput('sorting['.$a_set['id'].']', $a_set['sorting']));
37 
38  $ilCtrl->setParameter($this->parent_obj, 'topic_id', $a_set['id']);
39 
40  $current_selection_list = new ilAdvancedSelectionListGUI();
41  $current_selection_list->setListTitle($this->lng->txt("actions"));
42  $current_selection_list->setId("act_".$a_set['smiley_id']);
43 
44  $current_selection_list->addItem($this->lng->txt("edit"), '', $ilCtrl->getLinkTarget($this->parent_obj, 'showEditSmileyEntryForm')."&smiley_id=".$a_set['smiley_id']);
45  $current_selection_list->addItem($this->lng->txt("delete"), '', $ilCtrl->getLinkTarget($this->parent_obj, 'showDeleteSmileyForm')."&smiley_id=".$a_set['smiley_id']);
46 
47  $this->tpl->setVariable('VAL_ACTIONS', $current_selection_list->getHTML());
48 
49  }
50 
51 }