mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 19:21:40 +09:00
Merge pull request #1092 from bjrambo/pr/ncenterlite-cleanup
알림센터의 코드를 정리합니다.
This commit is contained in:
commit
30f224ece2
12 changed files with 128 additions and 99 deletions
|
|
@ -50,6 +50,7 @@ $lang->ncenterlite_date['5'] = 'second';
|
||||||
$lang->ncenterlite_sir = ' ';
|
$lang->ncenterlite_sir = ' ';
|
||||||
$lang->ncenterlite_message = 'You have <strong class="num">%s</strong> new notification.';
|
$lang->ncenterlite_message = 'You have <strong class="num">%s</strong> new notification.';
|
||||||
$lang->ncenterlite_messages = 'You have <strong class="num">%s</strong> new notifications.';
|
$lang->ncenterlite_messages = 'You have <strong class="num">%s</strong> new notifications.';
|
||||||
|
$lang->ncenterlite_not_have_message = 'You have read all the notifications.';
|
||||||
$lang->ncenterlite_thisistest = '[*] This is a test notice.';
|
$lang->ncenterlite_thisistest = '[*] This is a test notice.';
|
||||||
$lang->ncenterlite_delete_all = 'delete all';
|
$lang->ncenterlite_delete_all = 'delete all';
|
||||||
$lang->ncenterlite_more = 'More';
|
$lang->ncenterlite_more = 'More';
|
||||||
|
|
@ -72,6 +73,8 @@ $lang->ncenterlite_display_pc = 'Only PC';
|
||||||
$lang->ncenterlite_display_mobile = 'Only Mobile';
|
$lang->ncenterlite_display_mobile = 'Only Mobile';
|
||||||
$lang->ncenterlite_display_none = 'Not display.';
|
$lang->ncenterlite_display_none = 'Not display.';
|
||||||
$lang->ncenterlite_display_about = 'You can hide notifications from Notification Center Lite if you are using a layout or widget that handles notifications for you.';
|
$lang->ncenterlite_display_about = 'You can hide notifications from Notification Center Lite if you are using a layout or widget that handles notifications for you.';
|
||||||
|
$lang->ncenterlite_always_display = 'Always ncenterlite display';
|
||||||
|
$lang->ncenterlite_always_display_about = 'This feature allows there to display the Notification Center even if there is no notification of the user.';
|
||||||
$lang->ncenterlite_mention_target = 'Mention target';
|
$lang->ncenterlite_mention_target = 'Mention target';
|
||||||
$lang->ncenterlite_mention_target_about = 'Mention target can be nicknames or IDs (@Nickname or @ID).';
|
$lang->ncenterlite_mention_target_about = 'Mention target can be nicknames or IDs (@Nickname or @ID).';
|
||||||
$lang->ncenterlite_skin_settings = 'Skin settings';
|
$lang->ncenterlite_skin_settings = 'Skin settings';
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ $lang->ncenterlite_date['5'] = '초';
|
||||||
$lang->ncenterlite_sir = '님';
|
$lang->ncenterlite_sir = '님';
|
||||||
$lang->ncenterlite_message = '<strong class="num">%s</strong>개의 알림이 있습니다.';
|
$lang->ncenterlite_message = '<strong class="num">%s</strong>개의 알림이 있습니다.';
|
||||||
$lang->ncenterlite_messages = '<strong class="num">%s</strong>개의 알림이 있습니다.';
|
$lang->ncenterlite_messages = '<strong class="num">%s</strong>개의 알림이 있습니다.';
|
||||||
|
$lang->ncenterlite_not_have_message = '알림을 모두 읽으셨습니다.';
|
||||||
$lang->ncenterlite_thisistest = '[*] 시험용 알림입니다';
|
$lang->ncenterlite_thisistest = '[*] 시험용 알림입니다';
|
||||||
$lang->ncenterlite_delete_all = '모두 삭제';
|
$lang->ncenterlite_delete_all = '모두 삭제';
|
||||||
$lang->ncenterlite_more = '더보기';
|
$lang->ncenterlite_more = '더보기';
|
||||||
|
|
@ -82,6 +83,8 @@ $lang->ncenterlite_display_pc = 'PC만 표시';
|
||||||
$lang->ncenterlite_display_mobile = '모바일만 표시';
|
$lang->ncenterlite_display_mobile = '모바일만 표시';
|
||||||
$lang->ncenterlite_display_none = '표시하지 않음';
|
$lang->ncenterlite_display_none = '표시하지 않음';
|
||||||
$lang->ncenterlite_display_about = '사용하는 레이아웃이나 위젯에 알림을 표시하는 기능이 있는 경우 중복을 막기 위해 알림센터의 알림을 숨길 수 있습니다.';
|
$lang->ncenterlite_display_about = '사용하는 레이아웃이나 위젯에 알림을 표시하는 기능이 있는 경우 중복을 막기 위해 알림센터의 알림을 숨길 수 있습니다.';
|
||||||
|
$lang->ncenterlite_always_display = '알림센터 항상 표기';
|
||||||
|
$lang->ncenterlite_always_display_about = '이 기능을 사용할 경우 유저들의 알림이 없을 경우에도 알림센터를 출력합니다.';
|
||||||
$lang->ncenterlite_mention_target = '멘션 타겟';
|
$lang->ncenterlite_mention_target = '멘션 타겟';
|
||||||
$lang->ncenterlite_mention_target_about = '멘션 알림을 @아이디 소유자에게 보낼지 @닉네임 소유자에게 보낼지 선택할 수 있습니다.';
|
$lang->ncenterlite_mention_target_about = '멘션 알림을 @아이디 소유자에게 보낼지 @닉네임 소유자에게 보낼지 선택할 수 있습니다.';
|
||||||
$lang->ncenterlite_skin_settings = '스킨 설정';
|
$lang->ncenterlite_skin_settings = '스킨 설정';
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@
|
||||||
<a class="notify" href="#">
|
<a class="notify" href="#">
|
||||||
<!--@if($_ncenterlite_num > 1)-->
|
<!--@if($_ncenterlite_num > 1)-->
|
||||||
{sprintf($lang->ncenterlite_messages, $ncenterlite_page_navigation->total_count)}
|
{sprintf($lang->ncenterlite_messages, $ncenterlite_page_navigation->total_count)}
|
||||||
|
<!--@else if($_ncenterlite_num < 1)-->
|
||||||
|
{$lang->ncenterlite_not_have_message}
|
||||||
<!--@else-->
|
<!--@else-->
|
||||||
{sprintf($lang->ncenterlite_message, $ncenterlite_page_navigation->total_count)}
|
{sprintf($lang->ncenterlite_message, $ncenterlite_page_navigation->total_count)}
|
||||||
<!--@endif-->
|
<!--@endif-->
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ class ncenterliteAdminController extends ncenterlite
|
||||||
$config_vars = array(
|
$config_vars = array(
|
||||||
'use',
|
'use',
|
||||||
'display_use',
|
'display_use',
|
||||||
|
'always_display',
|
||||||
'user_config_list',
|
'user_config_list',
|
||||||
'mention_names',
|
'mention_names',
|
||||||
'mention_suffixes',
|
'mention_suffixes',
|
||||||
|
|
|
||||||
|
|
@ -53,11 +53,13 @@ class ncenterliteController extends ncenterlite
|
||||||
|
|
||||||
$this->setMessage('success_updated');
|
$this->setMessage('success_updated');
|
||||||
|
|
||||||
if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
|
if (Context::get('success_return_url'))
|
||||||
{
|
{
|
||||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('act', 'dispNcenterliteUserConfig', 'member_srl', $member_srl);
|
$this->setRedirectUrl(Context::get('success_return_url'));
|
||||||
header('location: ' . $returnUrl);
|
}
|
||||||
return;
|
else
|
||||||
|
{
|
||||||
|
$this->setRedirectUrl(getNotEncodedUrl('act', 'dispNcenterliteUserConfig', 'member_srl', $member_srl));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -80,6 +82,13 @@ class ncenterliteController extends ncenterlite
|
||||||
{
|
{
|
||||||
$this->removeFlagFile($args->member_srl);
|
$this->removeFlagFile($args->member_srl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete to user setting.
|
||||||
|
$userSetOutput = executeQuery('ncenterlite.deleteNcenterliteUserSettingData', $args);
|
||||||
|
if(!$userSetOutput->toBool())
|
||||||
|
{
|
||||||
|
return $userSetOutput;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function triggerAfterInsertDocument(&$obj)
|
function triggerAfterInsertDocument(&$obj)
|
||||||
|
|
@ -194,6 +203,10 @@ class ncenterliteController extends ncenterlite
|
||||||
{
|
{
|
||||||
$obj->admin_comment_notify = true;
|
$obj->admin_comment_notify = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -253,7 +266,11 @@ class ncenterliteController extends ncenterlite
|
||||||
$args->regdate = $regdate;
|
$args->regdate = $regdate;
|
||||||
$args->target_browser = $module_info->browser_title;
|
$args->target_browser = $module_info->browser_title;
|
||||||
$args->notify = $this->_getNotifyId($args);
|
$args->notify = $this->_getNotifyId($args);
|
||||||
$this->_insertNotify($args, $is_anonymous);
|
$output = $this->_insertNotify($args, $is_anonymous);
|
||||||
|
if(!$output->toBool())
|
||||||
|
{
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
$notify_member_srls[] = abs($member_srl);
|
$notify_member_srls[] = abs($member_srl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -297,7 +314,11 @@ class ncenterliteController extends ncenterlite
|
||||||
$args->regdate = $regdate;
|
$args->regdate = $regdate;
|
||||||
$args->target_browser = $module_info->browser_title;
|
$args->target_browser = $module_info->browser_title;
|
||||||
$args->notify = $this->_getNotifyId($args);
|
$args->notify = $this->_getNotifyId($args);
|
||||||
$this->_insertNotify($args, $is_anonymous);
|
$output = $this->_insertNotify($args, $is_anonymous);
|
||||||
|
if(!$output->toBool())
|
||||||
|
{
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -341,7 +362,11 @@ class ncenterliteController extends ncenterlite
|
||||||
$args->regdate = date('YmdHis');
|
$args->regdate = date('YmdHis');
|
||||||
$args->notify = $this->_getNotifyId($args);
|
$args->notify = $this->_getNotifyId($args);
|
||||||
$args->target_url = getNotEncodedFullUrl('', 'act', 'dispCommunicationMessages', 'message_srl', $obj->related_srl);
|
$args->target_url = getNotEncodedFullUrl('', 'act', 'dispCommunicationMessages', 'message_srl', $obj->related_srl);
|
||||||
$this->_insertNotify($args);
|
$output = $this->_insertNotify($args);
|
||||||
|
if(!$output->toBool())
|
||||||
|
{
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function triggerAfterVotedupdate(&$obj)
|
function triggerAfterVotedupdate(&$obj)
|
||||||
|
|
@ -373,6 +398,10 @@ class ncenterliteController extends ncenterlite
|
||||||
$args->notify = $this->_getNotifyId($args);
|
$args->notify = $this->_getNotifyId($args);
|
||||||
$args->target_url = getNotEncodedFullUrl('', 'document_srl', $obj->document_srl);
|
$args->target_url = getNotEncodedFullUrl('', 'document_srl', $obj->document_srl);
|
||||||
$output = $this->_insertNotify($args);
|
$output = $this->_insertNotify($args);
|
||||||
|
if(!$output->toBool())
|
||||||
|
{
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function triggerAfterCommentVotedCount($obj)
|
function triggerAfterCommentVotedCount($obj)
|
||||||
|
|
@ -539,19 +568,6 @@ class ncenterliteController extends ncenterlite
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this->_hide_ncenterlite = false;
|
|
||||||
if($oModule->module == 'beluxe' && Context::get('is_modal'))
|
|
||||||
{
|
|
||||||
$this->_hide_ncenterlite = true;
|
|
||||||
}
|
|
||||||
if($oModule->module == 'bodex' && Context::get('is_iframe'))
|
|
||||||
{
|
|
||||||
$this->_hide_ncenterlite = true;
|
|
||||||
}
|
|
||||||
if($oModule->getLayoutFile() == 'popup_layout.html')
|
|
||||||
{
|
|
||||||
$this->_hide_ncenterlite = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($oModule->act == 'dispBoardReplyComment')
|
if($oModule->act == 'dispBoardReplyComment')
|
||||||
{
|
{
|
||||||
|
|
@ -635,7 +651,7 @@ class ncenterliteController extends ncenterlite
|
||||||
}
|
}
|
||||||
|
|
||||||
// 지식인 모듈의 의견
|
// 지식인 모듈의 의견
|
||||||
// TODO: 코드 분리
|
// TODO: 지식인 모듈을 사용하는지 안하는지 현재로써는 모르기 때문에 일단은 이 코드를 유지 하였다가 나중에 라이믹스용 지식인이 나온다면 변경하기
|
||||||
if($oModule->act == 'procKinInsertComment')
|
if($oModule->act == 'procKinInsertComment')
|
||||||
{
|
{
|
||||||
// 글, 댓글 구분
|
// 글, 댓글 구분
|
||||||
|
|
@ -671,6 +687,10 @@ class ncenterliteController extends ncenterlite
|
||||||
$args->regdate = date('YmdHis');
|
$args->regdate = date('YmdHis');
|
||||||
$args->notify = $this->_getNotifyId($args);
|
$args->notify = $this->_getNotifyId($args);
|
||||||
$output = $this->_insertNotify($args);
|
$output = $this->_insertNotify($args);
|
||||||
|
if(!$output->toBool())
|
||||||
|
{
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if($oModule->act == 'dispKinView' || $oModule->act == 'dispKinIndex')
|
else if($oModule->act == 'dispKinView' || $oModule->act == 'dispKinIndex')
|
||||||
|
|
@ -711,7 +731,6 @@ class ncenterliteController extends ncenterlite
|
||||||
|
|
||||||
function triggerBeforeDisplay(&$output_display)
|
function triggerBeforeDisplay(&$output_display)
|
||||||
{
|
{
|
||||||
$act = Context::get('act');
|
|
||||||
// 팝업창이면 중지
|
// 팝업창이면 중지
|
||||||
if(Context::get('ncenterlite_is_popup'))
|
if(Context::get('ncenterlite_is_popup'))
|
||||||
{
|
{
|
||||||
|
|
@ -719,7 +738,7 @@ class ncenterliteController extends ncenterlite
|
||||||
}
|
}
|
||||||
|
|
||||||
// 자신의 알림목록을 보고 있을 경우엔 알림센터창을 띄우지 않는다.
|
// 자신의 알림목록을 보고 있을 경우엔 알림센터창을 띄우지 않는다.
|
||||||
if($act == 'dispNcenterliteNotifyList')
|
if(Context::get('act') == 'dispNcenterliteNotifyList')
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -743,7 +762,6 @@ class ncenterliteController extends ncenterlite
|
||||||
|
|
||||||
$module_info = Context::get('module_info');
|
$module_info = Context::get('module_info');
|
||||||
|
|
||||||
|
|
||||||
// admin 모듈이면 중지
|
// admin 모듈이면 중지
|
||||||
if($module_info->module == 'admin')
|
if($module_info->module == 'admin')
|
||||||
{
|
{
|
||||||
|
|
@ -765,23 +783,24 @@ class ncenterliteController extends ncenterlite
|
||||||
}
|
}
|
||||||
|
|
||||||
// 노티바 제외 페이지이면 중지
|
// 노티바 제외 페이지이면 중지
|
||||||
if(in_array($module_info->module_srl, $config->hide_module_srls))
|
if(is_array($config->hide_module_srls) && in_array($module_info->module_srl, $config->hide_module_srls))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Context::set('ncenterlite_config', $config);
|
Context::set('ncenterlite_config', $config);
|
||||||
|
|
||||||
|
Context::loadFile(array('./modules/ncenterlite/tpl/js/ncenterlite.js', 'body', '', 100000));
|
||||||
|
|
||||||
$js_args = array('./modules/ncenterlite/tpl/js/ncenterlite.js', 'body', '', 100000);
|
|
||||||
Context::loadFile($js_args);
|
|
||||||
|
|
||||||
// 알림 목록 가져오기
|
|
||||||
$logged_info = Context::get('logged_info');
|
$logged_info = Context::get('logged_info');
|
||||||
$_output = $oNcenterliteModel->getMyNotifyList($logged_info->member_srl);
|
$_output = $oNcenterliteModel->getMyNotifyList($logged_info->member_srl);
|
||||||
// 알림 메시지가 없어도 항상 표시하게 하려면 이 줄을 제거 또는 주석 처리하세요.
|
|
||||||
if(!$_output->data)
|
if($config->always_display !== 'Y')
|
||||||
{
|
{
|
||||||
return;
|
if(!$_output->data)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$_latest_notify_id = array_slice($_output->data, 0, 1);
|
$_latest_notify_id = array_slice($_output->data, 0, 1);
|
||||||
|
|
@ -848,6 +867,11 @@ class ncenterliteController extends ncenterlite
|
||||||
$target_srl = Context::get('target_srl');
|
$target_srl = Context::get('target_srl');
|
||||||
|
|
||||||
$oMemberController->addMemberMenu('dispNcenterliteNotifyList', 'ncenterlite_my_list');
|
$oMemberController->addMemberMenu('dispNcenterliteNotifyList', 'ncenterlite_my_list');
|
||||||
|
}
|
||||||
|
|
||||||
|
if($config->user_notify_setting == 'Y')
|
||||||
|
{
|
||||||
|
$oMemberController->addMemberMenu('dispNcenterliteUserConfig', 'ncenterlite_my_settings');
|
||||||
|
|
||||||
if($logged_info->is_admin == 'Y')
|
if($logged_info->is_admin == 'Y')
|
||||||
{
|
{
|
||||||
|
|
@ -856,11 +880,6 @@ class ncenterliteController extends ncenterlite
|
||||||
$oMemberController->addMemberPopupMenu($url, $str, '');
|
$oMemberController->addMemberPopupMenu($url, $str, '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($config->user_notify_setting == 'Y')
|
|
||||||
{
|
|
||||||
$oMemberController->addMemberMenu('dispNcenterliteUserConfig', 'ncenterlite_my_settings');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function _addFile()
|
function _addFile()
|
||||||
|
|
@ -922,7 +941,6 @@ class ncenterliteController extends ncenterlite
|
||||||
$args->member_srl = $member_srl;
|
$args->member_srl = $member_srl;
|
||||||
$args->notify = $notify;
|
$args->notify = $notify;
|
||||||
$output = executeQuery('ncenterlite.updateNotifyReaded', $args);
|
$output = executeQuery('ncenterlite.updateNotifyReaded', $args);
|
||||||
//$output = executeQuery('ncenterlite.deleteNotify', $args);
|
|
||||||
|
|
||||||
//Remove flag files
|
//Remove flag files
|
||||||
$this->removeFlagFile($args->member_srl);
|
$this->removeFlagFile($args->member_srl);
|
||||||
|
|
@ -935,7 +953,6 @@ class ncenterliteController extends ncenterlite
|
||||||
$args->member_srl = $member_srl;
|
$args->member_srl = $member_srl;
|
||||||
$args->target_srl = $target_srl;
|
$args->target_srl = $target_srl;
|
||||||
$output = executeQuery('ncenterlite.updateNotifyReadedByTargetSrl', $args);
|
$output = executeQuery('ncenterlite.updateNotifyReadedByTargetSrl', $args);
|
||||||
//$output = executeQuery('ncenterlite.deleteNotifyByTargetSrl', $args);
|
|
||||||
|
|
||||||
//Remove flag files
|
//Remove flag files
|
||||||
$this->removeFlagFile($args->member_srl);
|
$this->removeFlagFile($args->member_srl);
|
||||||
|
|
@ -947,7 +964,6 @@ class ncenterliteController extends ncenterlite
|
||||||
$args = new stdClass();
|
$args = new stdClass();
|
||||||
$args->member_srl = $member_srl;
|
$args->member_srl = $member_srl;
|
||||||
$output = executeQuery('ncenterlite.updateNotifyReadedAll', $args);
|
$output = executeQuery('ncenterlite.updateNotifyReadedAll', $args);
|
||||||
//$output = executeQuery('ncenterlite.deleteNotifyByMemberSrl', $args);
|
|
||||||
|
|
||||||
//Remove flag files
|
//Remove flag files
|
||||||
$this->removeFlagFile($args->member_srl);
|
$this->removeFlagFile($args->member_srl);
|
||||||
|
|
@ -1085,23 +1101,18 @@ class ncenterliteController extends ncenterlite
|
||||||
}
|
}
|
||||||
|
|
||||||
$output = executeQuery('ncenterlite.insertNotify', $args);
|
$output = executeQuery('ncenterlite.insertNotify', $args);
|
||||||
if(!$output->toBool())
|
if($output->toBool())
|
||||||
{
|
|
||||||
return $output;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
ModuleHandler::triggerCall('ncenterlite._insertNotify', 'after', $args);
|
ModuleHandler::triggerCall('ncenterlite._insertNotify', 'after', $args);
|
||||||
|
$this->sendSmsMessage($args);
|
||||||
|
$this->sendMailMessage($args);
|
||||||
|
$this->removeFlagFile($args->member_srl);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->sendSmsMessage($args);
|
|
||||||
$this->sendMailMessage($args);
|
|
||||||
$this->removeFlagFile($args->member_srl);
|
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function updateFlagFile($member_srl = null, $output)
|
public static function updateFlagFile($member_srl = null, $output = null)
|
||||||
{
|
{
|
||||||
if(!$member_srl)
|
if(!$member_srl)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ class ncenterliteModel extends ncenterlite
|
||||||
return self::$config;
|
return self::$config;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNotifyTypebySrl($notify_srl='')
|
function getNotifyTypebySrl($notify_srl)
|
||||||
{
|
{
|
||||||
$args = new stdClass();
|
$args = new stdClass();
|
||||||
$args->notify_type_srl = $notify_srl;
|
$args->notify_type_srl = $notify_srl;
|
||||||
|
|
@ -86,7 +86,7 @@ class ncenterliteModel extends ncenterlite
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNotifyTypeString($notify_srl='',$notify_args)
|
function getNotifyTypeString($notify_srl, $notify_args)
|
||||||
{
|
{
|
||||||
$this->notify_args = $notify_args;
|
$this->notify_args = $notify_args;
|
||||||
|
|
||||||
|
|
@ -113,7 +113,7 @@ class ncenterliteModel extends ncenterlite
|
||||||
return $this->notify_args->{$match[1]};
|
return $this->notify_args->{$match[1]};
|
||||||
}
|
}
|
||||||
|
|
||||||
function isNotifyTypeExistsbySrl($notify_srl='')
|
function isNotifyTypeExistsbySrl($notify_srl)
|
||||||
{
|
{
|
||||||
$args = new stdClass();
|
$args = new stdClass();
|
||||||
$args->notify_type_srl = $notify_srl;
|
$args->notify_type_srl = $notify_srl;
|
||||||
|
|
@ -229,6 +229,8 @@ class ncenterliteModel extends ncenterlite
|
||||||
|
|
||||||
function _getMyNotifyList($member_srl=null, $page=1, $readed='N')
|
function _getMyNotifyList($member_srl=null, $page=1, $readed='N')
|
||||||
{
|
{
|
||||||
|
$oNcenterliteController = getController('ncenterlite');
|
||||||
|
|
||||||
if(!$member_srl)
|
if(!$member_srl)
|
||||||
{
|
{
|
||||||
if (!Context::get('is_logged'))
|
if (!Context::get('is_logged'))
|
||||||
|
|
@ -262,7 +264,6 @@ class ncenterliteModel extends ncenterlite
|
||||||
|
|
||||||
if($create_time <= $deleteOutput->regdate)
|
if($create_time <= $deleteOutput->regdate)
|
||||||
{
|
{
|
||||||
$oNcenterliteController = getController('ncenterlite');
|
|
||||||
$oNcenterliteController->removeFlagFile($member_srl);
|
$oNcenterliteController->removeFlagFile($member_srl);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -292,12 +293,17 @@ class ncenterliteModel extends ncenterlite
|
||||||
|
|
||||||
if (Rhymix\Framework\Cache::getDriverName() !== 'dummy')
|
if (Rhymix\Framework\Cache::getDriverName() !== 'dummy')
|
||||||
{
|
{
|
||||||
Rhymix\Framework\Cache::set($cache_key, $output);
|
if($page <= 1)
|
||||||
|
{
|
||||||
|
Rhymix\Framework\Cache::set($cache_key, $output);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
elseif($page <= 1)
|
else
|
||||||
{
|
{
|
||||||
$oNcenterliteController = getController('ncenterlite');
|
if($page <= 1)
|
||||||
$oNcenterliteController->updateFlagFile($member_srl, $output);
|
{
|
||||||
|
$oNcenterliteController->updateFlagFile($member_srl, $output);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
|
|
@ -407,29 +413,27 @@ class ncenterliteModel extends ncenterlite
|
||||||
*/
|
*/
|
||||||
public function getNotificationText($notification)
|
public function getNotificationText($notification)
|
||||||
{
|
{
|
||||||
global $lang;
|
|
||||||
|
|
||||||
// Get the type of notification.
|
// Get the type of notification.
|
||||||
switch ($notification->type)
|
switch ($notification->type)
|
||||||
{
|
{
|
||||||
// Document.
|
// Document.
|
||||||
case 'D':
|
case 'D':
|
||||||
$type = $lang->ncenterlite_document;
|
$type = lang('ncenterlite_document');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Comment.
|
// Comment.
|
||||||
case 'C':
|
case 'C':
|
||||||
$type = $lang->ncenterlite_comment;
|
$type = lang('ncenterlite_comment');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Message.
|
// Message.
|
||||||
case 'E':
|
case 'E':
|
||||||
$type = $lang->ncenterlite_type_message;
|
$type = lang('ncenterlite_type_message');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Test.
|
// Test.
|
||||||
case 'T':
|
case 'T':
|
||||||
$type = $lang->ncenterlite_type_test;
|
$type = lang('ncenterlite_type_test');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Custom string.
|
// Custom string.
|
||||||
|
|
@ -438,16 +442,16 @@ class ncenterliteModel extends ncenterlite
|
||||||
|
|
||||||
// Insert member
|
// Insert member
|
||||||
case 'I':
|
case 'I':
|
||||||
$type = $lang->cmd_signup;
|
$type = lang('cmd_signup');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Custom language.
|
// Custom language.
|
||||||
case 'Y':
|
case 'Y':
|
||||||
return $lang->{$notification->target_body};
|
return lang($notification->target_body);
|
||||||
|
|
||||||
// Custom language with string interpolation.
|
// Custom language with string interpolation.
|
||||||
case 'Z':
|
case 'Z':
|
||||||
return vsprintf($lang->{$notification->target_body}, array(
|
return vsprintf(lang($notification->target_body), array(
|
||||||
$notification->target_member_srl, // %1$d
|
$notification->target_member_srl, // %1$d
|
||||||
$notification->target_nick_name, // %2$s
|
$notification->target_nick_name, // %2$s
|
||||||
$notification->target_user_id, // %3$s
|
$notification->target_user_id, // %3$s
|
||||||
|
|
@ -468,63 +472,63 @@ class ncenterliteModel extends ncenterlite
|
||||||
{
|
{
|
||||||
// Comment on your document.
|
// Comment on your document.
|
||||||
case 'C':
|
case 'C':
|
||||||
$str = sprintf($lang->ncenterlite_commented, $notification->target_nick_name, $type, $notification->target_summary);
|
$str = sprintf(lang('ncenterlite_commented'), $notification->target_nick_name, $type, $notification->target_summary);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Comment on a board.
|
// Comment on a board.
|
||||||
case 'A':
|
case 'A':
|
||||||
$str = sprintf($lang->ncenterlite_commented_board, $notification->target_nick_name, $notification->target_browser, $notification->target_summary);
|
$str = sprintf(lang('ncenterlite_commented_board'), $notification->target_nick_name, $notification->target_browser, $notification->target_summary);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Mentioned.
|
// Mentioned.
|
||||||
case 'M':
|
case 'M':
|
||||||
$str = sprintf($lang->ncenterlite_mentioned, $notification->target_nick_name, $notification->target_browser, $notification->target_summary, $type);
|
$str = sprintf(lang('ncenterlite_mentioned'), $notification->target_nick_name, $notification->target_browser, $notification->target_summary, $type);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Message arrived.
|
// Message arrived.
|
||||||
case 'E':
|
case 'E':
|
||||||
$str = sprintf($lang->ncenterlite_message_mention, $notification->target_nick_name, $notification->target_summary);
|
$str = sprintf(lang('ncenterlite_message_mention'), $notification->target_nick_name, $notification->target_summary);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Test notification.
|
// Test notification.
|
||||||
case 'T':
|
case 'T':
|
||||||
$str = sprintf($lang->ncenterlite_test_noti, $notification->target_nick_name);
|
$str = sprintf(lang('ncenterlite_test_noti'), $notification->target_nick_name);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// New document on a board.
|
// New document on a board.
|
||||||
case 'P':
|
case 'P':
|
||||||
$str = sprintf($lang->ncenterlite_board, $notification->target_nick_name, $notification->target_browser, $notification->target_summary);
|
$str = sprintf(lang('ncenterlite_board'), $notification->target_nick_name, $notification->target_browser, $notification->target_summary);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// New document.
|
// New document.
|
||||||
case 'S':
|
case 'S':
|
||||||
if($notification->target_browser)
|
if($notification->target_browser)
|
||||||
{
|
{
|
||||||
$str = sprintf($lang->ncenterlite_board, $notification->target_nick_name, $notification->target_browser, $notification->target_summary);
|
$str = sprintf(lang('ncenterlite_board'), $notification->target_nick_name, $notification->target_browser, $notification->target_summary);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$str = sprintf($lang->ncenterlite_article, $notification->target_nick_name, $notification->target_summary);
|
$str = sprintf(lang('ncenterlite_article'), $notification->target_nick_name, $notification->target_summary);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Voted.
|
// Voted.
|
||||||
case 'V':
|
case 'V':
|
||||||
$str = sprintf($lang->ncenterlite_vote, $notification->target_nick_name, $notification->target_summary, $type);
|
$str = sprintf(lang('ncenterlite_vote'), $notification->target_nick_name, $notification->target_summary, $type);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Admin notification.
|
// Admin notification.
|
||||||
case 'B':
|
case 'B':
|
||||||
$str = sprintf($lang->ncenterlite_admin_content_message, $notification->target_nick_name, $notification->target_browser, $notification->target_summary);
|
$str = sprintf(lang('ncenterlite_admin_content_message'), $notification->target_nick_name, $notification->target_browser, $notification->target_summary);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'I':
|
case 'I':
|
||||||
$str = sprintf($lang->ncenterlite_insert_member_message, $notification->target_nick_name);
|
$str = sprintf(lang('ncenterlite_insert_member_message'), $notification->target_nick_name);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Other.
|
// Other.
|
||||||
default:
|
default:
|
||||||
$str = $lang->ncenterlite;
|
$str = lang('ncenterlite');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $str;
|
return $str;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
<query id="deleteNcenterliteUserSettingData" action="delete">
|
||||||
|
<tables>
|
||||||
|
<table name="ncenterlite_user_set" />
|
||||||
|
</tables>
|
||||||
|
|
||||||
|
<conditions>
|
||||||
|
<condition operation="equal" column="member_srl" var="member_srl" notnull="notnull" filter="number" />
|
||||||
|
</conditions>
|
||||||
|
</query>
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
<query id="deleteNotify" action="delete">
|
|
||||||
<tables>
|
|
||||||
<table name="ncenterlite_notify" />
|
|
||||||
</tables>
|
|
||||||
|
|
||||||
<conditions>
|
|
||||||
<condition operation="equal" column="notify" var="notify" notnull="notnull" />
|
|
||||||
<condition operation="equal" column="member_srl" var="member_srl" filter="number" notnull="notnull" pipe="and" />
|
|
||||||
</conditions>
|
|
||||||
</query>
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
<query id="deleteNotifyByTargetSrl" action="delete">
|
|
||||||
<tables>
|
|
||||||
<table name="ncenterlite_notify" />
|
|
||||||
</tables>
|
|
||||||
|
|
||||||
<conditions>
|
|
||||||
<condition operation="equal" column="member_srl" var="member_srl" filter="number" notnull="notnull" />
|
|
||||||
<condition operation="equal" column="target_srl" var="srl" filter="number" notnull="notnull" pipe="and" />
|
|
||||||
</conditions>
|
|
||||||
</query>
|
|
||||||
|
|
@ -12,6 +12,8 @@
|
||||||
<a class="notify" href="#">
|
<a class="notify" href="#">
|
||||||
<!--@if($_ncenterlite_num > 1)-->
|
<!--@if($_ncenterlite_num > 1)-->
|
||||||
{sprintf($lang->ncenterlite_messages, $ncenterlite_page_navigation->total_count)}
|
{sprintf($lang->ncenterlite_messages, $ncenterlite_page_navigation->total_count)}
|
||||||
|
<!--@else if($_ncenterlite_num < 1)-->
|
||||||
|
{$lang->ncenterlite_not_have_message}
|
||||||
<!--@else-->
|
<!--@else-->
|
||||||
{sprintf($lang->ncenterlite_message, $ncenterlite_page_navigation->total_count)}
|
{sprintf($lang->ncenterlite_message, $ncenterlite_page_navigation->total_count)}
|
||||||
<!--@endif-->
|
<!--@endif-->
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@
|
||||||
<a class="notify" href="#">
|
<a class="notify" href="#">
|
||||||
<!--@if($_ncenterlite_num > 1)-->
|
<!--@if($_ncenterlite_num > 1)-->
|
||||||
{sprintf($lang->ncenterlite_messages, $ncenterlite_page_navigation->total_count)}
|
{sprintf($lang->ncenterlite_messages, $ncenterlite_page_navigation->total_count)}
|
||||||
|
<!--@else if($_ncenterlite_num < 1)-->
|
||||||
|
{$lang->ncenterlite_not_have_message}
|
||||||
<!--@else-->
|
<!--@else-->
|
||||||
{sprintf($lang->ncenterlite_message, $ncenterlite_page_navigation->total_count)}
|
{sprintf($lang->ncenterlite_message, $ncenterlite_page_navigation->total_count)}
|
||||||
<!--@endif-->
|
<!--@endif-->
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,18 @@
|
||||||
<p class="x_help-block">{$lang->ncenterlite_display_about}</p>
|
<p class="x_help-block">{$lang->ncenterlite_display_about}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="x_control-group">
|
||||||
|
<label class="x_control-label">{$lang->ncenterlite_always_display}</label>
|
||||||
|
<div class="x_controls">
|
||||||
|
<label class="x_inline">
|
||||||
|
<input type="radio" id="always_display_y" name="always_display" value="Y" checked="checked"|cond="$config->always_display == 'Y'" /> {$lang->use}
|
||||||
|
</label>
|
||||||
|
<label class="x_inline">
|
||||||
|
<input type="radio" id="always_display_n" name="always_display" value="N" checked="checked"|cond="$config->always_display != 'Y'" /> {$lang->notuse}
|
||||||
|
</label>
|
||||||
|
<p class="x_help-block">{$lang->ncenterlite_always_display_about}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="x_control-group">
|
<div class="x_control-group">
|
||||||
<label class="x_control-label">{$lang->member_menu_view}</label>
|
<label class="x_control-label">{$lang->member_menu_view}</label>
|
||||||
<div class="x_controls">
|
<div class="x_controls">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue