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