ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilChatMessageNotifyGUI Class Reference

User Interface Class for Chat Message Notification in Main Menu. More...

+ Collaboration diagram for ilChatMessageNotifyGUI:

Public Member Functions

 __construct ()
 getHTML ()

Private Attributes

 $tpl
 $lng

Detailed Description

User Interface Class for Chat Message Notification in Main Menu.

Author
Jan Posselt jposs.nosp@m.elt@.nosp@m.datab.nosp@m.ay.d.nosp@m.e
Version
$Id$

Definition at line 31 of file class.ilChatMessageNotifyGUI.php.

Constructor & Destructor Documentation

ilChatMessageNotifyGUI::__construct ( )

Definition at line 36 of file class.ilChatMessageNotifyGUI.php.

References $lng, and $tpl.

{
global $tpl, $lng;
$this->tpl = $tpl;
$this->lng = $lng;
$this->lng->loadLanguageModule('chat');
}

Member Function Documentation

ilChatMessageNotifyGUI::getHTML ( )

Definition at line 46 of file class.ilChatMessageNotifyGUI.php.

References $_SESSION, $ilSetting, $tpl, ilChatServerCommunicator\_getTailMessages(), and ilChatServerCommunicator\_lookupUser().

{
global $ilUser, $ilObjDataCache, $ilAccess, $ilSetting, $rbacsystem;
include_once 'Modules/Chat/classes/class.ilChatServerCommunicator.php';
$chatinfo = ilChatServerCommunicator::_lookupUser($ilUser->getId());
$last_message_info = false;
if ($chatinfo !== false)
{
$last_msg_info = ilChatServerCommunicator::_getTailMessages($chatinfo->chatId, $chatinfo->roomId, time() - 60 * 60);
if ($last_msg_info == false)
{
return "";
}
else if ($_SESSION["il_notify_last_msg_checksum"] == $last_msg_info->entryId )
{
return "";
}
}
else
{
return "";
}
$last_msg = $last_msg_info->message;
$_SESSION["il_notify_last_msg_checksum"] = $last_msg_info->entryId;
$this->tpl->addJavascript('./Modules/Chat/js/ChatMessagesMainMenu.js');
$tpl = new ilTemplate('tpl.chat_messages_navigation.html', true, true,'Modules/Chat');
if((int)$ilSetting->get('chat_sound_status') && (int)$ilUser->getPref('chat_new_message_sound_status'))
{
$tpl->setCurrentBlock('beep');
$tpl->setVariable('BEEP_SRC', './Modules/Chat/sounds/receive.mp3');
$tpl->parseCurrentBlock();
}
include_once 'Modules/Chat/classes/class.ilChatServerCommunicator.php';
$tpl->setVariable("CHAT_RECENT_POSTINGS", $this->lng->txt("chat_recent_postings"));
$tpl->setCurrentBlock('msg_item');
$tpl->setVariable("TXT_MSG", $last_msg);
$tpl->setVariable("TXT_ROOM", $chatinfo->chatTitle);
$tpl->parseCurrentBlock();
return $tpl->get();
}

+ Here is the call graph for this function:

Field Documentation

ilChatMessageNotifyGUI::$lng
private

Definition at line 34 of file class.ilChatMessageNotifyGUI.php.

Referenced by __construct().

ilChatMessageNotifyGUI::$tpl
private

Definition at line 33 of file class.ilChatMessageNotifyGUI.php.

Referenced by __construct(), and getHTML().


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