mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
As now, private messages use an in-page notifying message instead of a popup window.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9312 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
8e0eb4b98e
commit
5dbb64c26b
2 changed files with 36 additions and 9 deletions
|
|
@ -26,21 +26,20 @@
|
|||
$oMemberController->addMemberMenu('dispCommunicationMessages', 'cmd_view_message_box');
|
||||
// Pop-up to display messages if a flag on new message is set
|
||||
$flag_path = './files/member_extra_info/new_message_flags/'.getNumberingPath($logged_info->member_srl);
|
||||
$flag_file = sprintf('%s%s', $flag_path, $logged_info->member_srl);
|
||||
$flag_file = $flag_path.$logged_info->member_srl;
|
||||
|
||||
if(file_exists($flag_file)) {
|
||||
$new_message_count = FileHandler::readFile($flag_file);
|
||||
$new_message_count = trim(FileHandler::readFile($flag_file));
|
||||
FileHandler::removeFile($flag_file);
|
||||
Context::loadLang('./addons/member_communication/lang');
|
||||
Context::loadFile(array('./addons/member_communication/tpl/member_communication.js'));
|
||||
|
||||
$script = sprintf('<script type="text/javascript"> jQuery(function() { if(confirm("%s")) { popopen("%s"); } }); </script>', sprintf(Context::getLang('alert_new_message_arrived'), $new_message_count), Context::getRequestUri().'?module=communication&act=dispCommunicationNewMessage');
|
||||
$text = preg_replace('@\r?\n@', '\\n', addslashes(Context::getLang('alert_new_message_arrived')));
|
||||
$link = Context::getRequestUri().'?module=communication&act=dispCommunicationNewMessage';
|
||||
$script = "<script type=\"text/javascript\">jQuery(function(){ xeNotifyMessage('{$text}','{$new_message_count}'); });</script>";
|
||||
|
||||
Context::addHtmlHeader( $script );
|
||||
}
|
||||
|
||||
/**
|
||||
* Links are added on the pop-up menu which appears when clicking user name
|
||||
**/
|
||||
Context::addHtmlFooter($script);
|
||||
}
|
||||
} elseif($called_position == 'before_module_proc' && $this->act == 'getMemberMenu') {
|
||||
|
||||
$oMemberController = &getController('member');
|
||||
|
|
|
|||
28
addons/member_communication/tpl/member_communication.js
Normal file
28
addons/member_communication/tpl/member_communication.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
(function($){
|
||||
|
||||
window.xeNotifyMessage = function(text, count){
|
||||
var $bar;
|
||||
|
||||
$bar = $('div.notifyMessage');
|
||||
if(!$bar.length) {
|
||||
$bar = $('<div class="notifyMessage" />')
|
||||
.hide()
|
||||
.css({
|
||||
position : 'absolute',
|
||||
background : '#ff0',
|
||||
border : '1px solid #990',
|
||||
textAlign : 'center'
|
||||
})
|
||||
.appendTo(document.body);
|
||||
}
|
||||
|
||||
h = $bar.html('<a href="'+current_url.setQuery('act','dispCommunicationMessages')+'">'+text+'</a>').height();
|
||||
$bar.css('top', -h-4).show().animate({top:0});
|
||||
|
||||
// hide after 10 seconds
|
||||
setTimeout(function(){
|
||||
$bar.animate({top:-h-4}, function(){ $bar.hide() });
|
||||
}, 10000);
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
Loading…
Add table
Add a link
Reference in a new issue