Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
bjrambo committed Jan 31, 2017
0 parents commit 5464651
Showing 184 changed files with 3,573 additions and 0 deletions.
11 changes: 11 additions & 0 deletions conf/info.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="0.2">
<title xml:lang="ko">댓글알림</title>
<description xml:lang="ko">알림톡, 문자메시지, 메일로 댓글을 알려줍니다.</description>
<version>2.4.1</version>
<date>2016-03-29</date>
<category>service</category>
<author email_address="[email protected]" link="http://www.coolsms.co.kr">
<name xml:lang="ko">NURIGO</name>
</author>
</module>
24 changes: 24 additions & 0 deletions conf/module.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<module>
<grants />
<permissions />
<menus>
<menu name="notificationConfig">
<title xml:lang="ko">댓글알림설정</title>
<title xml:lang="en">Notification Configure</title>
</menu>
</menus>
<actions>
<action name="dispNotificationAdminConfig" type="view" menu_name="notificationConfig" />
<action name="dispNotificationAdminList" type="view" admin_index="true" menu_name="notificationConfig" menu_index="true" />
<action name="dispNotificationAdminInsert" type="view" menu_name="notificationConfig" />
<action name="dispNotificationAdminModify" type="view" menu_name="notificationConfig" />

<action name="getNotificationAdminDelete" type="model" />

<action name="procNotificationAdminConfig" type="controller" />

<action name="procNotificationAdminInsert" type="controller" />
<action name="procNotificationAdminDelete" type="controller" />
</actions>
</module>
154 changes: 154 additions & 0 deletions lang/lang.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
<?xml version='1.0' encoding='UTF-8'?>
<lang>
<item name="module_config">
<value xml:lang="ko"><![CDATA[기본 설정]]></value>
<value xml:lang="en"><![CDATA[Basic Setting]]></value>
</item>
<item name="cellphone_fieldname">
<value xml:lang="ko"><![CDATA[휴대전화 필드 선택]]></value>
<value xml:lang="en"><![CDATA[Select cellphone field.]]></value>
</item>
<item name="default_content">
<value xml:lang="ko"><![CDATA[[댓글알림]
%browser_title%
%nick_name%
%content%]]></value>
<value xml:lang="en"><![CDATA[[Notification]\n%browser_title%\n%nick_name\n%content%]]></value>
</item>
<item name="default_mail_content">
<value xml:lang="ko"><![CDATA[<p>브라우저제목 : %browser_title%<br />닉네임 : %nick_name%<br />내용 : %content%<br /></p><p>알림을 받기 원하지 않는다면 %article_url% 에서 알림 체크를 해제하세요.</p>]]></value>
<value xml:lang="en"><![CDATA[<p>브라우저제목 : %browser_title%<br />닉네임 : %nick_name%<br />내용 : %content%<br /></p><p>알림을 받기 원하지 않는다면 %article_url% 에서 알림 체크를 해제하세요.</p>]]></value>
</item>
<item name="target_module">
<value xml:lang="ko"><![CDATA[대상모듈]]></value>
<value xml:lang="en"><![CDATA[Target Module]]></value>
</item>
<item name="general_info">
<value xml:lang="ko"><![CDATA[기본 설정]]></value>
<value xml:lang="en"><![CDATA[General Information]]></value>
</item>
<item name="title_txtmsg">
<value xml:lang="ko"><![CDATA[문자 설정]]></value>
<value xml:lang="en"><![CDATA[SMS Setting]]></value>
</item>
<item name="title_option">
<value xml:lang="ko"><![CDATA[옵션 설정]]></value>
<value xml:lang="en"><![CDATA[Option Setting]]></value>
</item>
<item name="content">
<value xml:lang="ko"><![CDATA[문자메시지]]></value>
<value xml:lang="en"><![CDATA[TextMessage]]></value>
</item>
<item name="mail_content">
<value xml:lang="ko"><![CDATA[이메일]]></value>
<value xml:lang="en"><![CDATA[Email]]></value>
</item>
<item name="sending_method">
<value xml:lang="ko"><![CDATA[전송방식]]></value>
<value xml:lang="en"><![CDATA[Sending Method]]></value>
</item>
<item name="cmd_cellphone">
<value xml:lang="ko"><![CDATA[핸드폰 번호]]></value>
<value xml:lang="en"><![CDATA[Mobile No.]]></value>
</item>
<item name="cmd_admin">
<value xml:lang="ko"><![CDATA[관리자]]></value>
<value xml:lang="en"><![CDATA[Admin]]></value>
</item>
<item name="multiple_phone_no">
<value xml:lang="ko"><![CDATA[콤마(,)로 구분하여 여러개 입력가능]]></value>
<value xml:lang="en"><![CDATA[You can enter many phone numbers by inserting commas(,).]]></value>
</item>
<item name="sender_cellphone">
<value xml:lang="ko"><![CDATA[발신자 번호]]></value>
<value xml:lang="en"><![CDATA[Mobile Number(Sender)]]></value>
</item>
<item name="sender_phone_help">
<value xml:lang="ko"><![CDATA[발신자 번호입니다. 2015년 10월 15일부터는 발신번호사전등록제로 인하여 <br>미리 등록된 발신번호로만 문자 발송이 가능합니다. <a target="_blank" href="http://www.coolsms.co.kr/index.php?mid=service_setup&act=dispSmsconfigSenderNumbers">발신번호등록하러가기</a>]]></value>
<value xml:lang="en"><![CDATA[This will be the sender's phone number. Only pre-registered sender numbers are permitted to send SMS. It is effective from 2015 Oct. 16. ]]></value>
</item>
<item name="textmessage_plus_email">
<value xml:lang="ko"><![CDATA[문자+이메일]]></value>
<value xml:lang="en"><![CDATA[TextMessage + Email]]></value>
</item>
<item name="textmessage">
<value xml:lang="ko"><![CDATA[문자메시지]]></value>
<value xml:lang="en"><![CDATA[TextMessage]]></value>
</item>
<item name="email">
<value xml:lang="ko"><![CDATA[이메일]]></value>
<value xml:lang="en"><![CDATA[Email]]></value>
</item>
<item name="title_email">
<value xml:lang="ko"><![CDATA[E-mail 설정]]></value>
<value xml:lang="en"><![CDATA[E-mail Setting]]></value>
</item>
<item name="comment_content">
<value xml:lang="ko"><![CDATA[댓글내용]]></value>
<value xml:lang="en"><![CDATA[Content]]></value>
</item>
<item name="comment_userid">
<value xml:lang="ko"><![CDATA[댓글자 아이디]]></value>
<value xml:lang="en"><![CDATA[User ID]]></value>
</item>
<item name="comment_username">
<value xml:lang="ko"><![CDATA[댓글자 이름]]></value>
<value xml:lang="en"><![CDATA[User Name]]></value>
</item>
<item name="comment_nickname">
<value xml:lang="ko"><![CDATA[댓글자 닉네임]]></value>
<value xml:lang="en"><![CDATA[Nickname]]></value>
</item>
<item name="browser_title">
<value xml:lang="ko"><![CDATA[브라우저 제목]]></value>
<value xml:lang="en"><![CDATA[Browser Title]]></value>
</item>
<item name="article_url">
<value xml:lang="ko"><![CDATA[문서 URL]]></value>
<value xml:lang="en"><![CDATA[Article URL]]></value>
</item>
<item name="cmd_notification">
<value xml:lang="ko"><![CDATA[댓글알림]]></value>
<value xml:lang="en"><![CDATA[Notification]]></value>
</item>
<item name="cmd_notification_setup">
<value xml:lang="ko"><![CDATA[댓글알림설정]]></value>
<value xml:lang="en"><![CDATA[Notification Setup]]></value>
</item>
<item name="about_cellphone_fieldname">
<value xml:lang="ko"><![CDATA[선택된 필드 값을 문자메시지 수신번호로 사용합니다. <a href="?module=admin&act=dispMemberAdminConfig">회원설정 > 가입폼관리</a> 에서 전화번호 형식으로 추가해주세요.]]></value>
<value xml:lang="en"><![CDATA[You need to add the cellphone input field at <a href="?module=admin&act=dispMemberAdminConfig">Member Setting > Signup Form</a>.]]></value>
</item>
<item name="about_target_module">
<value xml:lang="ko"><![CDATA[적용할 모듈을 선택하세요.]]></value>
<value xml:lang="en"><![CDATA[Select target modules.]]></value>
</item>
<item name="help_mail_content">
<value xml:lang="ko"><![CDATA[%browser_title% : 브라우저제목<br />%mid% : 모듈이름<br />%nick_name% : 닉네임<br />%content% : 내용<br />%article_url% : 댓글 URL<br />%document_srl% : 문서번호]]></value>
<value xml:lang="en"><![CDATA[%browser_title% : 브라우저제목<br />%mid% : 모듈이름<br />%nick_name% : 닉네임<br />%content% : 내용<br />%article_url% : 댓글 URL<br />%document_srl% : 문서번호]]></value>
</item>
<item name="sms_method_help_message">
<value xml:lang="ko"><![CDATA[알림톡 우선: 카카오톡으로 발송을 시도하고 실패시 문자로 대체 발송합니다. (알림톡 설정 요구됨)<br />단문문자만 : 알림 내용이 90바이트 이상시
, 일부는 전송되지 않습니다.<br>장문가능 : 알림내용이 90바이트 이하일경우에는 단문(SMS)발송, 이상일경우에는 장문(LMS)로 발송됩니다.]]></value>
</item>
<item name="enable_alimtalk">
<value xml:lang="ko"><![CDATA[알림톡 우선]]></value>
<value xml:lang="en"><![CDATA[Enable Alimtalk]]></value>
</item>
<item name="alimtalk_setup">
<value xml:lang="ko"><![CDATA[알림톡 설정]]></value>
<value xml:lang="en"><![CDATA[AlimTalk Setup]]></value>
</item>
<item name="help_sender_key">
<value xml:lang="ko"><![CDATA[옐로아이디를 제출하고 발급받은 Sender Key값을 입력합니다. <a href="http://www.coolsms.co.kr/AboutAlimTalk">Sender Key 발급</a>]]></value>
<value xml:lang="en"><![CDATA[Input Sender Key]]></value>
</item>
<item name="help_template_code">
<value xml:lang="ko"><![CDATA[발송하시려는 문구가 포함된 검수받은 템플릿 코드를 입력하세요.]]></value>
<value xml:lang="en"><![CDATA[Input Template Code]]></value>
</item>
<item name="sms_method">
<value xml:lang="ko"><![CDATA[문자방식]]></value>
<value xml:lang="en"><![CDATA[SMS Method]]></value>
</item>
</lang>
102 changes: 102 additions & 0 deletions notification.admin.controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?php
/**
* vi:set sw=4 ts=4 noexpandtab fileencoding=utf8:
* @class notificationAdminController
* @author diver([email protected])
* @brief notificationAdminController
*/
class notificationAdminController extends notification {
function init() {
}

/**
* @brief 모듈 환경설정값 쓰기
**/
function procNotificationAdminConfig() {
$args = Context::gets('cellphone_fieldname', 'use_authdata');

// save module configuration.
$oModuleControll = getController('module');
$output = $oModuleControll->insertModuleConfig('notification', $args);
if (!$output->toBool()) return $output;

$this->setMessage('success_updated');

if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispNotificationAdminConfig');
$this->setRedirectUrl($returnUrl);
return;
}
}

/**
* @brief notification append
**/
function procNotificationAdminInsert() {
$params = Context::gets('content','mail_content','module_srls','msgtype','sending_method','cellphone_fieldname','use_authdata');
$extra_vars = new StdClass();
$extra_vars->sender_phone = Context::get('sender_phone');
$extra_vars->admin_phones = Context::get('admin_phones');
$extra_vars->admin_emails = Context::get('admin_emails');
$extra_vars->cellphone_fieldname = Context::get('cellphone_fieldname');
$extra_vars->use_authdata = Context::get('use_authdata');
$extra_vars->reverse_notify = Context::get('reverse_notify');
$extra_vars->use_extravar = Context::get('use_extravar');
$extra_vars->use_extravar_email = Context::get('use_extravar_email');
$extra_vars->force_notify = Context::get('force_notify');
$extra_vars->email_sender_name = Context::get('email_sender_name');
$extra_vars->email_sender_address = Context::get('email_sender_address');
$extra_vars->sms_method = Context::get('sms_method');
$extra_vars->sender_key = Context::get('sender_key');
$extra_vars->template_code = Context::get('template_code');
$params->notification_srl = Context::get('noti_srl');

if ($params->notification_srl) {
// delete existences
$args->notification_srl = $params->notification_srl;
$output = executeQuery('notification.deleteNotiCom', $args);
if (!$output->toBool()) return $output;
$output = executeQuery('notification.deleteNotificationModuleSrl', $args);
if (!$output->toBool()) return $output;
} else {
// new sequence
$params->notification_srl = getNextSequence();
}

// insert module srls
$module_srls = explode(',', $params->module_srls);
foreach ($module_srls as $srl) {
unset($args);
$args->notification_srl = $params->notification_srl;
$args->module_srl = $srl;
$output = executeQuery('notification.insertNotificationModuleSrl', $args);
if (!$output->toBool()) return $output;
}

$params->extra_vars = serialize($extra_vars);

// insert notification
$output = executeQuery('notification.insertNotiCom', $params);
if (!$output->toBool()) return $output;

$redirectUrl = getNotEncodedUrl('', 'module', 'admin', 'act', 'dispNotificationAdminModify','notification_srl',$params->notification_srl);
$this->setRedirectUrl($redirectUrl);
}

function procNotificationAdminDelete() {
$notification_srl = Context::get('notification_srl');
if (!$notification_srl) return new Object(-1, 'msg_invalid_request');

if ($notification_srl) {
// delete existences
$args->notification_srl = $notification_srl;
$query_id = "notification.deleteNotiCom";
executeQuery($query_id, $args);
$query_id = "notification.deleteNotificationModuleSrl";
executeQuery($query_id, $args);
}
$redirectUrl = getNotEncodedUrl('', 'module', 'admin', 'act', 'dispNotificationAdminList');
$this->setRedirectUrl($redirectUrl);
}
}
?>
34 changes: 34 additions & 0 deletions notification.admin.model.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
/**
* vi:set sw=4 ts=4 noexpandtab fileencoding=utf8:
* @class notificationAdminModel
* @author diver([email protected])
* @brief notificationAdminModel
*/
class notificationAdminModel extends notification {
function getNotificationAdminDelete() {
// load notification info
$args->notification_srl = Context::get('notification_srl');
$output = executeQuery("notification.getNotiComInfo", $args);
$id_list = $output->data->id_list;
$group_srl_list = $output->data->group_srl_list;
$notification_info = $output->data;

$args->notification_srls = Context::get('notification_srl');
$output = executeQueryArray("notification.getModuleInfoByNotificationSrl", $args);
$mid_list = array();
if ($output->data) {
foreach ($output->data as $no => $val) {
$mid_list[] = $val->mid;
}
}
$notification_info->mid_list = join(',', $mid_list);

Context::set('notification_info', $notification_info);

$oTemplate = &TemplateHandler::getInstance();
$tpl = $oTemplate->compile($this->module_path.'tpl', 'delete');
$this->add('tpl', str_replace("\n"," ",$tpl));
}
}
?>
Loading

0 comments on commit 5464651

Please sign in to comment.