Merge pull request #555 from kijin/pr/ncenterlite-custom-content

다른 모듈에서 알림 내용을 쉽게 커스터마이징할 수 있도록 지원
This commit is contained in:
Kijin Sung 2016-07-26 22:07:51 +09:00 committed by GitHub
commit d8ea756244
2 changed files with 31 additions and 1 deletions

View file

@ -993,7 +993,17 @@ class ncenterliteController extends ncenterlite
return new Object();
}
// 노티 ID가 없는 경우 자동 생성
if (!$args->notify)
{
$args->notify = $this->_getNotifyId($args);
}
// 날짜가 없는 경우 자동 생성
if (!$args->regdate)
{
$args->regdate = date('YmdHis');
}
if($anonymous == TRUE)
{

View file

@ -328,6 +328,26 @@ class ncenterliteModel extends ncenterlite
$type = $lang->ncenterlite_type_test;
break;
// Custom string.
case 'X':
return $notification->target_body;
// Custom language.
case 'Y':
return $lang->{$notification->target_body};
// Custom language with string interpolation.
case 'Z':
return vsprintf($lang->{$notification->target_body}, array(
$notification->target_member_srl, // %1$d
$notification->target_nick_name, // %2$s
$notification->target_user_id, // %3$s
$notification->target_email_address, // %4$s
$notification->target_browser, // %5$s
$notification->target_summary, // %6$s
$notification->target_url, // %7$s
));
// Other.
case 'U':
default: