ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilChatroomAdminSmileyGUI Class Reference

Class ilChatroomSmileyGUI Provides methods to show, add, edit and delete smilies consisting of icon and keywords. More...

+ Inheritance diagram for ilChatroomAdminSmileyGUI:
+ Collaboration diagram for ilChatroomAdminSmileyGUI:

Public Member Functions

 executeDefault ($requestedMethod)
 {} More...
 
 view ()
 Switches GUI to visible mode and calls editSmiliesObject method which prepares and displays the table of existing smilies. More...
 
 editSmiliesObject ()
 Shows existing smilies table Prepares existing smilies table and displays it. More...
 
 initSmiliesForm ()
 Initializes smilies form and returns it. More...
 
 showEditSmileyEntryFormObject ()
 Shows EditSmileyEntryForm Prepares EditSmileyEntryForm and displays it. More...
 
 initSmiliesEditForm ($form_data)
 Initializes SmiliesEditForm and returns it. More...
 
 deleteSmileyObject ()
 Deletes a smiley by $_REQUEST["chatroom_smiley_id"] ilRbacSystem $rbacsystem ilCtrl $ilCtrl. More...
 
 updateSmiliesObject ()
 Updates a smiley and/or its keywords Updates a smiley icon and/or its keywords by $_REQUEST["chatroom_smiley_id"] and gets keywords from $_REQUEST["chatroom_smiley_keywords"]. More...
 
 uploadSmileyObject ()
 Uploads and stores a new smiley with keywords from $_REQUEST["chatroom_smiley_keywords"] ilRbacSystem $rbacsystem ilCtrl2 $ilCtrl. More...
 
- Public Member Functions inherited from ilChatroomGUIHandler
 __construct (ilChatroomObjectGUI $gui)
 
 sendResponse ($response)
 Sends a json encoded response and exits the php process. More...
 
 hasPermission ($permission)
 Checks for access with ilRbacSystem. More...
 
 execute ($method)
 Executes given $method if existing, otherwise executes executeDefault() method. More...
 
 executeDefault ($requestedMethod)
 
 redirectIfNoPermission ($permission)
 Checks for requested permissions and redirects if the permission check failed. More...
 
 isSuccessful ($response)
 Checks for success param in an json decoded response. More...
 

Static Public Member Functions

static _checkSetup ()
 
static _getSmileyDir ()
 

Static Private Member Functions

static _setupFolder ()
 setup directory More...
 
static _insertDefaultValues ()
 

Additional Inherited Members

- Protected Member Functions inherited from ilChatroomGUIHandler
 getRoomByObjectId ($objectId)
 
 exitIfNoRoomExists ($room)
 Checks if a ilChatroom exists. More...
 
 exitIfNoRoomPermission ($room, $subRoom, $chat_user)
 Check if user can moderate a chatroom. More...
 
 canModerate ($room, $subRoom, $user_id)
 Checks if the user has permission to moderate a ilChatroom. More...
 
 isMainRoom ($subRoomId)
 
- Protected Attributes inherited from ilChatroomGUIHandler
 $gui
 
 $ilUser
 
 $ilCtrl
 
 $ilLng
 
 $rbacsystem
 

Detailed Description

Class ilChatroomSmileyGUI Provides methods to show, add, edit and delete smilies consisting of icon and keywords.

Author
Andreas Kordosz akord.nosp@m.osz@.nosp@m.datab.nosp@m.ay.d.nosp@m.e
Version
$Id$

Definition at line 12 of file class.ilChatroomAdminSmileyGUI.php.

Member Function Documentation

◆ _checkSetup()

static ilChatroomAdminSmileyGUI::_checkSetup ( )
static

Definition at line 52 of file class.ilChatroomAdminSmileyGUI.php.

References $lng, $path, array, ilUtil\makeDirParents(), ilUtil\sendFailure(), ilUtil\sendInfo(), and ilUtil\sendSuccess().

53  {
54  global $lng;
55 
56  $path = self::_getSmileyDir();
57 
58  if(!is_dir($path))
59  {
60  ilUtil::sendInfo($lng->txt('chat_smilies_dir_not_exists'));
62 
63  if(!is_dir($path))
64  {
65  ilUtil::sendFailure($lng->txt('chat_smilies_dir_not_available'));
66  return false;
67  }
68  else
69  {
70  $smilies = array
71  (
72  "icon_smile.gif",
73  "icon_wink.gif",
74  "icon_laugh.gif",
75  "icon_sad.gif",
76  "icon_shocked.gif",
77  "icon_tongue.gif",
78  "icon_cool.gif",
79  "icon_eek.gif",
80  "icon_angry.gif",
81  "icon_flush.gif",
82  "icon_idea.gif",
83  "icon_thumbup.gif",
84  "icon_thumbdown.gif",
85  );
86 
87  foreach($smilies as $smiley)
88  {
89  copy("templates/default/images/emoticons/$smiley", $path . "/$smiley");
90  }
91 
92  self::_insertDefaultValues();
93 
94  ilUtil::sendSuccess($lng->txt('chat_smilies_initialized'));
95  }
96 
97  }
98 
99  if(!is_writable($path))
100  {
101  ilUtil::sendInfo($lng->txt('chat_smilies_dir_not_writable'));
102  }
103 
104  return true;
105  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static makeDirParents($a_dir)
Create a new directory and all parent directories.
$path
Definition: aliased.php:25
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ _getSmileyDir()

static ilChatroomAdminSmileyGUI::_getSmileyDir ( )
static
Returns
string path to smilies

Definition at line 110 of file class.ilChatroomAdminSmileyGUI.php.

References ilUtil\getWebspaceDir().

111  {
112  return ilUtil::getWebspaceDir() . '/chatroom/smilies';
113  }
static getWebspaceDir($mode="filesystem")
get webspace directory
+ Here is the call graph for this function:

◆ _insertDefaultValues()

static ilChatroomAdminSmileyGUI::_insertDefaultValues ( )
staticprivate

Definition at line 115 of file class.ilChatroomAdminSmileyGUI.php.

References array.

116  {
117  $values = array(
118  array("icon_smile.gif", ":)\n:-)\n:smile:"),
119  array("icon_wink.gif", ";)\n;-)\n:wink:"),
120  array("icon_laugh.gif", ":D\n:-D\n:laugh:\n:grin:\n:biggrin:"),
121  array("icon_sad.gif", ":(\n:-(\n:sad:"),
122  array("icon_shocked.gif", ":o\n:-o\n:shocked:"),
123  array("icon_tongue.gif", ":p\n:-p\n:tongue:"),
124  array("icon_cool.gif", ":cool:"),
125  array("icon_eek.gif", ":eek:"),
126  array("icon_angry.gif", ":||\n:-||\n:angry:"),
127  array("icon_flush.gif", ":flush:"),
128  array("icon_idea.gif", ":idea:"),
129  array("icon_thumbup.gif", ":thumbup:"),
130  array("icon_thumbdown.gif", ":thumbdown:"),
131  );
132 
133  require_once 'Modules/Chatroom/classes/class.ilChatroomSmilies.php';
134  foreach($values as $val)
135  {
136  ilChatroomSmilies::_storeSmiley($val[1], $val[0]);
137  }
138  }
Create styles array
The data for the language used.

◆ _setupFolder()

static ilChatroomAdminSmileyGUI::_setupFolder ( )
staticprivate

setup directory

Definition at line 17 of file class.ilChatroomAdminSmileyGUI.php.

References $path.

18  {
19  $path = self::_getSmileyDir();
20 
21  if(!is_dir($path))
22  {
23  mkdir($path, 0755, true);
24  }
25  }
$path
Definition: aliased.php:25

◆ deleteSmileyObject()

ilChatroomAdminSmileyGUI::deleteSmileyObject ( )

Deletes a smiley by $_REQUEST["chatroom_smiley_id"] ilRbacSystem $rbacsystem ilCtrl $ilCtrl.

Definition at line 382 of file class.ilChatroomAdminSmileyGUI.php.

References ilChatroomGUIHandler\$ilCtrl, $lng, and ilChatroomGUIHandler\$rbacsystem.

383  {
384  global $rbacsystem, $ilCtrl, $lng;
385 
386  if(!$rbacsystem->checkAccess('write', $this->gui->ref_id))
387  {
388  $this->ilias->raiseError(
389  $lng->txt('msg_no_perm_write'), $this->ilias->error_obj->MESSAGE
390  );
391  }
392 
393  include_once 'Modules/Chatroom/classes/class.ilChatroomSmilies.php';
394 
395  ilChatroomSmilies::_deleteSmiley($_REQUEST["chatroom_smiley_id"]);
396 
397  $ilCtrl->redirect($this->gui, "smiley");
398  }
redirection script todo: (a better solution should control the processing via a xml file) ...
global $lng
Definition: privfeed.php:17

◆ editSmiliesObject()

ilChatroomAdminSmileyGUI::editSmiliesObject ( )

Shows existing smilies table Prepares existing smilies table and displays it.

ilRbacSystem $rbacsystem ilLanguage $lng ilTemplate $tpl

Definition at line 147 of file class.ilChatroomAdminSmileyGUI.php.

References $lng, ilChatroomGUIHandler\$rbacsystem, $tpl, ilChatroomSmilies\_checkSetup(), ilChatroomSmiliesGUI\_getExistingSmiliesTable(), and initSmiliesForm().

Referenced by view().

148  {
149  global $rbacsystem, $lng, $tpl;
150 
151  if(!$rbacsystem->checkAccess('read', $this->gui->ref_id))
152  {
153  $this->ilias->raiseError(
154  $lng->txt('msg_no_perm_read'), $this->gui->ilias->error_obj->MESSAGE
155  );
156  }
157 
158  include_once 'Modules/Chatroom/classes/class.ilChatroomSmilies.php';
159 
161 
162  if(!$this->form_gui)
163  {
164  $form = $this->initSmiliesForm();
165  }
166  else
167  {
168  $form = $this->form_gui;
169  }
170 
171  include_once "Modules/Chatroom/classes/class.ilChatroomSmiliesGUI.php";
172 
174 
175  $tpl_smilies = new ilTemplate(
176  "tpl.chatroom_edit_smilies.html", true, true, "Modules/Chatroom"
177  );
178  $tpl_smilies->setVariable("SMILEY_TABLE", $table);
179  $tpl_smilies->setVariable("SMILEY_FORM", $form->getHtml());
180 
181  $tpl->setContent($tpl_smilies->get());
182  }
static _getExistingSmiliesTable($a_ref)
Constructor public.
initSmiliesForm()
Initializes smilies form and returns it.
global $tpl
Definition: ilias.php:8
special template class to simplify handling of ITX/PEAR
redirection script todo: (a better solution should control the processing via a xml file) ...
static _checkSetup()
Checks if smiley folder is available; if not it will try to create folder and performs actions for an...
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeDefault()

ilChatroomAdminSmileyGUI::executeDefault (   $requestedMethod)

{}

Definition at line 30 of file class.ilChatroomAdminSmileyGUI.php.

References view().

31  {
32  $this->view();
33  }
view()
Switches GUI to visible mode and calls editSmiliesObject method which prepares and displays the table...
+ Here is the call graph for this function:

◆ initSmiliesEditForm()

ilChatroomAdminSmileyGUI::initSmiliesEditForm (   $form_data)

Initializes SmiliesEditForm and returns it.

ilCtrl2 $ilCtrl ilLanguage $lng

Returns
ilPropertyFormGUI

Definition at line 278 of file class.ilChatroomAdminSmileyGUI.php.

References ilChatroomGUIHandler\$ilCtrl, $lng, ilChatroomGUIHandler\$rbacsystem, $tpl, array, ilUtil\img(), ilFileInputGUI\setSuffixes(), ilChatroomSmiliesCurrentSmileyFormElement\setValue(), and ilTextAreaInputGUI\setValue().

Referenced by showEditSmileyEntryFormObject().

279  {
280  global $ilCtrl, $lng;
281 
282  include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
283 
284  $this->form_gui = new ilPropertyFormGUI();
285 
286  $this->form_gui->setValuesByArray($form_data);
287 
288  $table_nav = $_REQUEST["_table_nav"] ? "&_table_nav=" . $_REQUEST["_table_nav"] : "";
289 
290  $ilCtrl->saveParameter($this->gui, 'smiley_id');
291 
292  $this->form_gui->setFormAction(
293  $ilCtrl->getFormAction($this->gui, 'smiley-updateSmiliesObject') . $table_nav
294  );
295 
296  $sec_l = new ilFormSectionHeaderGUI();
297 
298  $sec_l->setTitle($lng->txt('chatroom_edit_smiley'));
299  $this->form_gui->addItem($sec_l);
300 
301  include_once "Modules/Chatroom/classes/class.ilChatroomSmiliesCurrentSmileyFormElement.php";
302 
304  $lng->txt('chatroom_current_smiley_image_path'),
305  'chatroom_current_smiley_image_path'
306  );
307 
308  $inp->setValue($form_data['chatroom_current_smiley_image_path']);
309  $this->form_gui->addItem($inp);
310 
311  $inp = new ilImageFileInputGUI(
312  $lng->txt('chatroom_image_path'), 'chatroom_image_path'
313  );
314  $inp->setSuffixes(array("jpg", "jpeg", "png", "gif", "svg"));
315 
316  $inp->setRequired(false);
317  $inp->setInfo($lng->txt('chatroom_smiley_image_only_if_changed'));
318  $this->form_gui->addItem($inp);
319 
320  $inp = new ilTextAreaInputGUI(
321  $lng->txt('chatroom_smiley_keywords'), 'chatroom_smiley_keywords'
322  );
323 
324  $inp->setValue($form_data['chatroom_smiley_keywords']);
325  $inp->setUseRte(false);
326  $inp->setRequired(true);
327  $inp->setInfo($lng->txt('chatroom_smiley_keywords_one_per_line_note'));
328  $this->form_gui->addItem($inp);
329 
330  $inp = new ilHiddenInputGUI('chatroom_smiley_id');
331 
332  $this->form_gui->addItem($inp);
333  $this->form_gui->addCommandButton(
334  'smiley-updateSmiliesObject', $lng->txt('submit')
335  );
336  $this->form_gui->addCommandButton('smiley', $lng->txt('cancel'));
337  return $this->form_gui;
338  }
This class represents a property form user interface.
This class represents a section header in a property form.
setValue($a_value)
Set Value.
setValue($a_value)
Sets given value as $this->value in ilChatroomSmiliesCurrentSmileyFormElement.
This class represents a hidden form property in a property form.
Class ilChatroomSmiliesCurrentSmileyFormElement Class ilchatroomSmiliesCurrentSmileyFormElement simpl...
Create styles array
The data for the language used.
This class represents an image file property in a property form.
global $lng
Definition: privfeed.php:17
This class represents a text area property in a property form.
setSuffixes($a_suffixes)
Set Accepted Suffixes.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSmiliesForm()

ilChatroomAdminSmileyGUI::initSmiliesForm ( )

Initializes smilies form and returns it.

ilCtrl2 $ilCtrl ilLanguage $lng

Returns
ilPropertyFormGUI

Definition at line 190 of file class.ilChatroomAdminSmileyGUI.php.

References ilChatroomGUIHandler\$ilCtrl, $lng, array, ilFormPropertyGUI\setRequired(), and ilFileInputGUI\setSuffixes().

Referenced by editSmiliesObject(), and uploadSmileyObject().

191  {
192  global $ilCtrl, $lng;
193 
194  include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
195 
196  $this->form_gui = new ilPropertyFormGUI();
197 
198  $table_nav = $_REQUEST["_table_nav"] ? "&_table_nav=" . $_REQUEST["_table_nav"] : "";
199  $this->form_gui->setFormAction(
200  $ilCtrl->getFormAction($this->gui, 'smiley-uploadSmileyObject') . $table_nav
201  );
202 
203  // chat server settings
204  $sec_l = new ilFormSectionHeaderGUI();
205 
206  $sec_l->setTitle($lng->txt('chatroom_add_smiley'));
207  $this->form_gui->addItem($sec_l);
208 
209  $inp = new ilImageFileInputGUI(
210  $lng->txt('chatroom_image_path'), 'chatroom_image_path'
211  );
212  $inp->setSuffixes(array("jpg", "jpeg", "png", "gif", "svg"));
213 
214  $inp->setRequired(true);
215  $this->form_gui->addItem($inp);
216 
217  $inp = new ilTextAreaInputGUI(
218  $lng->txt('chatroom_smiley_keywords'), 'chatroom_smiley_keywords'
219  );
220 
221  $inp->setRequired(true);
222  $inp->setUseRte(false);
223  $inp->setInfo($lng->txt('chatroom_smiley_keywords_one_per_line_note'));
224  $this->form_gui->addItem($inp);
225  $this->form_gui->addCommandButton(
226  'smiley-uploadSmileyObject', $lng->txt('chatroom_upload_smiley')
227  );
228 
229  return $this->form_gui;
230  }
This class represents a property form user interface.
This class represents a section header in a property form.
Create styles array
The data for the language used.
This class represents an image file property in a property form.
global $lng
Definition: privfeed.php:17
This class represents a text area property in a property form.
setSuffixes($a_suffixes)
Set Accepted Suffixes.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showEditSmileyEntryFormObject()

ilChatroomAdminSmileyGUI::showEditSmileyEntryFormObject ( )

Shows EditSmileyEntryForm Prepares EditSmileyEntryForm and displays it.

ilRbacSystem $rbacsystem ilTemplate $tpl

Definition at line 238 of file class.ilChatroomAdminSmileyGUI.php.

References $lng, ilChatroomGUIHandler\$rbacsystem, $tpl, array, and initSmiliesEditForm().

239  {
240  global $rbacsystem, $tpl, $lng;
241 
242  $this->gui->switchToVisibleMode();
243 
244  if(!$rbacsystem->checkAccess('read', $this->gui->ref_id))
245  {
246  $this->ilias->raiseError(
247  $lng->txt('msg_no_perm_read'), $this->ilias->error_obj->MESSAGE
248  );
249  }
250 
251  include_once "Modules/Chatroom/classes/class.ilChatroomSmilies.php";
252 
253  $smiley = ilChatroomSmilies::_getSmiley($_REQUEST["smiley_id"]);
254 
255  $form_data = array(
256  "chatroom_smiley_id" => $smiley["smiley_id"],
257  "chatroom_smiley_keywords" => $smiley["smiley_keywords"],
258  "chatroom_current_smiley_image_path" => $smiley["smiley_fullpath"],
259  );
260 
261  $form = $this->initSmiliesEditForm($form_data);
262 
263  $tpl_form = new ilTemplate(
264  "tpl.chatroom_edit_smilies.html", true, true, "Modules/Chatroom"
265  );
266 
267  $tpl_form->setVariable("SMILEY_FORM", $form->getHTML());
268 
269  $tpl->setContent($tpl_form->get());
270  }
global $tpl
Definition: ilias.php:8
initSmiliesEditForm($form_data)
Initializes SmiliesEditForm and returns it.
special template class to simplify handling of ITX/PEAR
redirection script todo: (a better solution should control the processing via a xml file) ...
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ updateSmiliesObject()

ilChatroomAdminSmileyGUI::updateSmiliesObject ( )

Updates a smiley and/or its keywords Updates a smiley icon and/or its keywords by $_REQUEST["chatroom_smiley_id"] and gets keywords from $_REQUEST["chatroom_smiley_keywords"].

ilRbacSystem $rbacsystem ilCtrl2 $ilCtrl

Definition at line 407 of file class.ilChatroomAdminSmileyGUI.php.

References $_POST, $data, ilChatroomGUIHandler\$ilCtrl, $lng, ilChatroomGUIHandler\$rbacsystem, $tpl, ilChatroomSmilies\_deleteMultipleSmilies(), ilChatroomSmilies\_getSmiliesBasePath(), ilChatroomSmilies\_prepareKeywords(), array, ilUtil\img(), ilUtil\moveUploadedFile(), ilUtil\sendFailure(), ilUtil\sendInfo(), ilUtil\stripSlashes(), and view().

408  {
409  global $rbacsystem, $ilCtrl, $tpl, $lng;
410 
411  if(!$rbacsystem->checkAccess('write', $this->gui->ref_id))
412  {
413  $this->ilias->raiseError(
414  $lng->txt('msg_no_perm_write'), $this->ilias->error_obj->MESSAGE
415  );
416  }
417 
418  include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
419  $this->form_gui = new ilPropertyFormGUI();
420 
421  // $this->initSmiliesEditForm();
422 
423  include_once "Modules/Chatroom/classes/class.ilChatroomSmilies.php";
424 
426  ilUtil::stripSlashes($_REQUEST["chatroom_smiley_keywords"])
427  );
428 
429  $keywordscheck = count($keywords) > 0;
430 
431  if(!$this->form_gui->checkInput() || !$keywordscheck)
432  {
433  $tpl->setContent($this->form_gui->getHtml());
434  ilUtil::sendFailure('test', true);
435  return $this->view();
436  }
437  else
438  {
439  $data = array();
440  $data["smiley_keywords"] = join("\n", $keywords);
441  $data["smiley_id"] = $_REQUEST["smiley_id"];
442 
443  if($_FILES["chatroom_image_path"])
444  {
446  $_FILES["chatroom_image_path"]["tmp_name"],
447  $_FILES["chatroom_image_path"]["name"],
448  ilChatroomSmilies::_getSmiliesBasePath() . $_FILES["chatroom_image_path"]["name"]
449  );
450 
451  $data["smiley_path"] = $_FILES["chatroom_image_path"]["name"];
452  }
453 
454  ilChatroomSmilies::_updateSmiley($data);
455  }
456 
457  $ilCtrl->redirect($this->gui, "smiley");
458  }
This class represents a property form user interface.
view()
Switches GUI to visible mode and calls editSmiliesObject method which prepares and displays the table...
global $tpl
Definition: ilias.php:8
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
redirection script todo: (a better solution should control the processing via a xml file) ...
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static _getSmiliesBasePath()
Returns smilies basepath.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $lng
Definition: privfeed.php:17
static _prepareKeywords($words)
Trims given keywords and returns them in one array.
+ Here is the call graph for this function:

◆ uploadSmileyObject()

ilChatroomAdminSmileyGUI::uploadSmileyObject ( )

Uploads and stores a new smiley with keywords from $_REQUEST["chatroom_smiley_keywords"] ilRbacSystem $rbacsystem ilCtrl2 $ilCtrl.

Definition at line 549 of file class.ilChatroomAdminSmileyGUI.php.

References ilChatroomGUIHandler\$ilCtrl, $lng, ilChatroomGUIHandler\$rbacsystem, $tpl, ilChatroomSmilies\_getSmiliesBasePath(), ilChatroomSmilies\_prepareKeywords(), initSmiliesForm(), ilUtil\moveUploadedFile(), ilUtil\stripSlashes(), time, and view().

550  {
551  global $rbacsystem, $ilCtrl, $tpl, $lng;
552 
553  if(!$rbacsystem->checkAccess('write', $this->gui->ref_id))
554  {
555  $this->ilias->raiseError(
556  $lng->txt('msg_no_perm_write'), $this->ilias->error_obj->MESSAGE
557  );
558  }
559 
560  $this->initSmiliesForm();
561 
562  include_once "Modules/Chatroom/classes/class.ilChatroomSmilies.php";
563  include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
564 
565  //$this->form_gui = new ilPropertyFormGUI();
566 
567  $this->form_gui->setValuesByPost();
568 
570  ilUtil::stripSlashes($_REQUEST["chatroom_smiley_keywords"])
571  );
572 
573  $keywordscheck = count($keywords) > 0;
574 
575  if(!$this->form_gui->checkInput())
576  {
577  $tpl->setContent($this->form_gui->getHtml());
578  return $this->view();
579  }
580 
581  $pathinfo = pathinfo($_FILES["chatroom_image_path"]["name"]);
582  $target_file = md5(time() + $pathinfo['basename']) . "." . $pathinfo['extension'];
583 
585  $_FILES["chatroom_image_path"]["tmp_name"],
586  $target_file,
588  );
589 
590  ilChatroomSmilies::_storeSmiley(join("\n", $keywords), $target_file);
591 
592  $ilCtrl->redirect($this->gui, "smiley");
593  }
view()
Switches GUI to visible mode and calls editSmiliesObject method which prepares and displays the table...
initSmiliesForm()
Initializes smilies form and returns it.
global $tpl
Definition: ilias.php:8
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
redirection script todo: (a better solution should control the processing via a xml file) ...
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static _getSmiliesBasePath()
Returns smilies basepath.
global $lng
Definition: privfeed.php:17
static _prepareKeywords($words)
Trims given keywords and returns them in one array.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
+ Here is the call graph for this function:

◆ view()

ilChatroomAdminSmileyGUI::view ( )

Switches GUI to visible mode and calls editSmiliesObject method which prepares and displays the table of existing smilies.

Definition at line 39 of file class.ilChatroomAdminSmileyGUI.php.

References ilChatroom\checkUserPermissions(), and editSmiliesObject().

Referenced by executeDefault(), updateSmiliesObject(), and uploadSmileyObject().

40  {
41  include_once 'Modules/Chatroom/classes/class.ilChatroom.php';
42 
43  ilChatroom::checkUserPermissions('read', $this->gui->ref_id);
44 
45  $this->gui->switchToVisibleMode();
46 
47  self::_checkSetup();
48 
49  $this->editSmiliesObject();
50  }
static checkUserPermissions($permissions, $ref_id, $send_info=true)
Checks user permissions by given array and ref_id.
editSmiliesObject()
Shows existing smilies table Prepares existing smilies table and displays it.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: