first
This commit is contained in:
29
modules/notification/admin/_info.php
Normal file
29
modules/notification/admin/_info.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
$license_local = $g['path_module'].$module.'/LICENSE';
|
||||
$license_global = $g['path_root'].'LICENSE';
|
||||
|
||||
if (file_exists($license_local)) $license = $license_local;
|
||||
else $license = $license_global;
|
||||
?>
|
||||
|
||||
<link href="<?php echo $g['s']?>/_core/css/github-markdown.css" rel="stylesheet">
|
||||
<?php getImport('jquery-markdown','jquery.markdown','0.0.10','js')?>
|
||||
|
||||
<?php @include $g['path_module'].$module.'/var/var.moduleinfo.php' ?>
|
||||
|
||||
<article class="rb-docs markdown-body px-5 pt-3">
|
||||
<h1><?php echo sprintf('%s 모듈정보',ucfirst($MD['name']))?></h1>
|
||||
|
||||
<div class="pb-5 readme">
|
||||
<?php readfile($g['path_module'].$module.'/README.md')?>
|
||||
</div>
|
||||
|
||||
<div class="pb-5">
|
||||
<h2>라이센스</h2>
|
||||
<textarea class="form-control" rows="10"><?php readfile($license)?></textarea>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(".markdown-body .readme").markdown();
|
||||
</script>
|
||||
3
modules/notification/admin/config.css
Normal file
3
modules/notification/admin/config.css
Normal file
@@ -0,0 +1,3 @@
|
||||
.custom-control {
|
||||
min-width: 180px
|
||||
}
|
||||
70
modules/notification/admin/config.php
Normal file
70
modules/notification/admin/config.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
$g['notiVarForSite'] = $g['path_var'].'site/'.$r.'/notification.var.php';
|
||||
include_once file_exists($g['notiVarForSite']) ? $g['notiVarForSite'] : $g['path_module'].$module.'/var/var.php';
|
||||
?>
|
||||
|
||||
<div id="configbox" class="p-4">
|
||||
|
||||
<form name="procForm" action="<?php echo $g['s']?>/" method="post" onsubmit="return saveCheck(this);" class="form-horizontal">
|
||||
<input type="hidden" name="r" value="<?php echo $r ?>">
|
||||
<input type="hidden" name="m" value="<?php echo $module ?>">
|
||||
<input type="hidden" name="a" value="config">
|
||||
|
||||
<h4>알림 설정</h4>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label text-lg-right">알림간격</label>
|
||||
<div class="col-lg-10 col-xl-9">
|
||||
<select name="sec" class="form-control custom-select">
|
||||
<?php for($i = 10; $i < 61; $i=$i+5):?>
|
||||
<option value="<?php echo $i?>"<?php if($d['ntfc']['sec']==$i):?> selected<?php endif?>><?php echo sprintf('%d 초',$i)?></option>
|
||||
<?php endfor?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label text-lg-right">알림갯수처리</label>
|
||||
<div class="col-lg-10 col-xl-9">
|
||||
<select name="num" class="form-control custom-select">
|
||||
<option value="10"<?php if($d['ntfc']['num']==10):?> selected<?php endif?>><?php echo sprintf('%d 개 이상일 경우',10)?> +10</option>
|
||||
<option value="50"<?php if($d['ntfc']['num']==50):?> selected<?php endif?>><?php echo sprintf('%d 개 이상일 경우',50)?> +50</option>
|
||||
<option value="99"<?php if($d['ntfc']['num']==99):?> selected<?php endif?>><?php echo sprintf('%d 개 이상일 경우',99)?> +99</option>
|
||||
<option value="100"<?php if($d['ntfc']['num']==100):?> selected<?php endif?>><?php echo sprintf('%d 개 이상일 경우',100)?> +100</option>
|
||||
<option value="999"<?php if($d['ntfc']['num']==999):?> selected<?php endif?>><?php echo sprintf('%d 개 이상일 경우',999)?> +999</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label text-lg-right">알림차단 모듈</label>
|
||||
<div class="col-lg-10 col-xl-9">
|
||||
|
||||
<?php $_MODULES=getDbArray($table['s_module'],'','*','gid','asc',0,1)?>
|
||||
<?php while($_MD=db_fetch_array($_MODULES)):?>
|
||||
<div class="custom-control custom-checkbox custom-control-inline">
|
||||
<input type="checkbox" class="custom-control-input" id="module_members_<?php echo $_MD['id']?>" name="module_members[]" value="<?php echo $_MD['id']?>"<?php if(strstr($d['ntfc']['cut_modules'],'['.$_MD['id'].']')):?> checked<?php endif?>>
|
||||
<label class="custom-control-label" for="module_members_<?php echo $_MD['id']?>"><?php echo $_MD['name']?> <small class="text-muted">(<?php echo $_MD['id']?>)</small></label>
|
||||
</div>
|
||||
<?php endwhile?>
|
||||
|
||||
<p class="form-text text-muted mt-3">
|
||||
알림을 원천적으로 차단할 모듈을 선택해주세요.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-10 offset-lg-2 col-xl-9 offset-xl-2">
|
||||
<button type="submit" class="btn btn-outline-primary btn-lg my-4<?php if($g['device']):?> btn-block<?php endif?>">저장하기</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function saveCheck(f)
|
||||
{
|
||||
getIframeForAction(f);
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
50
modules/notification/admin/main.css
Normal file
50
modules/notification/admin/main.css
Normal file
@@ -0,0 +1,50 @@
|
||||
#notification .table th,
|
||||
#notification .table td {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#notification .table th.rb-message,
|
||||
#notification .table td.rb-message {
|
||||
text-align: left;
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
#notification .rb-none {
|
||||
text-align: center;
|
||||
color: #999
|
||||
}
|
||||
|
||||
|
||||
#notification .pagination {
|
||||
margin: 0
|
||||
}
|
||||
|
||||
#notification .rb-heading {
|
||||
margin-bottom: 20px
|
||||
}
|
||||
|
||||
#notification .rb-heading > .form-group:last-child {
|
||||
margin-bottom: 0
|
||||
}
|
||||
|
||||
|
||||
#notification .rb-heading .rb-advance.btn.collapsed small:before {
|
||||
content: "▼";
|
||||
}
|
||||
|
||||
#notification .rb-heading .rb-advance.btn small:before {
|
||||
content: "▲";
|
||||
}
|
||||
|
||||
#notification .rb-footer {
|
||||
border-top: 1px solid #eee;
|
||||
margin: 20px 0;
|
||||
padding: 20px 0
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
|
||||
#notification .rb-footer div {
|
||||
float: none !important
|
||||
}
|
||||
}
|
||||
280
modules/notification/admin/main.php
Normal file
280
modules/notification/admin/main.php
Normal file
@@ -0,0 +1,280 @@
|
||||
<?php
|
||||
$sort = $sort ? $sort : 'uid';
|
||||
$orderby= $orderby ? $orderby : 'desc';
|
||||
$recnum = $recnum && $recnum < 301 ? $recnum : 30;
|
||||
$sqlque = 'uid';
|
||||
|
||||
$account = $SD['uid'];
|
||||
$sqlque .= ' and site='.$account;
|
||||
if ($moduleid) $sqlque .= " and frommodule='".$moduleid."'";
|
||||
if ($isread)
|
||||
{
|
||||
if ($isread == 1) $sqlque .= " and d_read<>''";
|
||||
else $sqlque .= " and d_read=''";
|
||||
}
|
||||
if ($where && $keyw)
|
||||
{
|
||||
$sqlque .= getSearchSql($where,$keyw,$ikeyword,'or');
|
||||
}
|
||||
|
||||
$RCD = getDbArray($table['s_notice'],$sqlque,'*',$sort,$orderby,$recnum,$p);
|
||||
$NUM = getDbRows($table['s_notice'],$sqlque);
|
||||
$TPG = getTotalPage($NUM,$recnum);
|
||||
?>
|
||||
|
||||
|
||||
<div id="notification" class="px-4 my-3">
|
||||
|
||||
<form name="procForm" action="<?php echo $g['s']?>/" method="get" class="form-horizontal">
|
||||
<input type="hidden" name="r" value="<?php echo $r?>">
|
||||
<input type="hidden" name="m" value="<?php echo $m?>">
|
||||
<input type="hidden" name="module" value="<?php echo $module?>">
|
||||
<input type="hidden" name="front" value="<?php echo $front?>">
|
||||
|
||||
<div class="form-inline">
|
||||
<select name="moduleid" class="form-control custom-select" onchange="this.form.submit();">
|
||||
<option value="">모듈(전체)</option>
|
||||
<?php $MODULES = getDbArray($table['s_module'],'','*','gid','asc',0,$p)?>
|
||||
<?php while($MD = db_fetch_array($MODULES)):?>
|
||||
<option value="<?php echo $MD['id']?>"<?php if($MD['id']==$moduleid):?> selected<?php endif?>><?php echo $MD['name']?> (<?php echo $MD['id']?>)</option>
|
||||
<?php endwhile?>
|
||||
</select>
|
||||
<select name="isread" class="form-control custom-select" onchange="this.form.submit();">
|
||||
<option value="">상태(전체)</option>
|
||||
<option value="1"<?php if($isread==1):?> selected<?php endif?>>확인</option>
|
||||
<option value="2"<?php if($isread==2):?> selected<?php endif?>>미확인</option>
|
||||
</select>
|
||||
|
||||
<select name="recnum" onchange="this.form.submit();" class="form-control custom-select">
|
||||
<?php for($i=30;$i<=300;$i=$i+30):?>
|
||||
<option value="<?php echo $i?>"<?php if($i==$recnum):?> selected="selected"<?php endif?>><?php echo sprintf('%d 개',$i)?></option>
|
||||
<?php endfor?>
|
||||
</select>
|
||||
|
||||
<div class="btn-toolbar ml-2">
|
||||
<div class="btn-group btn-group-toggle" data-toggle="buttons">
|
||||
<label class="btn btn-light<?php if($sort=='uid'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="uid" name="sort"<?php if($sort=='uid'):?> checked<?php endif?>> 알림일
|
||||
</label>
|
||||
<label class="btn btn-light<?php if($sort=='d_read'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="d_read" name="sort"<?php if($sort=='d_read'):?> checked<?php endif?>> 확인일
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="btn-group btn-group-toggle ml-2" data-toggle="buttons">
|
||||
<label class="btn btn-light<?php if($orderby=='desc'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="desc" name="orderby"<?php if($orderby=='desc'):?> checked<?php endif?>> <i class="fa fa-sort-amount-desc"></i> 역순
|
||||
</label>
|
||||
<label class="btn btn-light<?php if($orderby=='asc'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="asc" name="orderby"<?php if($orderby=='asc'):?> checked<?php endif?>> <i class="fa fa-sort-amount-asc"></i> 정순
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div><!-- /.form-inline -->
|
||||
|
||||
<div class="form-inline mt-2">
|
||||
|
||||
<select name="where" class="form-control custom-select">
|
||||
<option value="message"<?php if($where=='message'):?> selected="selected"<?php endif?>>메시지</option>
|
||||
<option value="referer"<?php if($where=='referer'):?> selected="selected"<?php endif?>>URL</option>
|
||||
</select>
|
||||
<input type="text" name="keyw" value="<?php echo stripslashes($keyw)?>" class="form-control ml-2">
|
||||
<button class="btn btn-light ml-2" type="submit">검색</button>
|
||||
<a href="<?php echo $g['adm_href']?>" class="btn btn-light ml-1">초기화</a>
|
||||
|
||||
<a href="<?php echo $g['s']?>/?r=<?php echo $r?>&m=<?php echo $module?>&a=notice_testonly" onclick="return hrefCheck(this,true,'정말로 테스트 알림을 보내시겠습니까? ');" class="btn btn-light ml-2">테스트 알림</a>
|
||||
<a href="#." class="btn btn-light rb-notifications-modal ml-1" role="button" data-toggle="modal" data-target="#modal_window">내알림 보기</a>
|
||||
|
||||
</div><!-- /.form-inline -->
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<form name="listForm" action="<?php echo $g['s']?>/" method="post">
|
||||
<input type="hidden" name="r" value="<?php echo $r?>">
|
||||
<input type="hidden" name="m" value="<?php echo $module?>">
|
||||
<input type="hidden" name="a" value="">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped f13 text-center">
|
||||
|
||||
<colgroup>
|
||||
<col width="50">
|
||||
<col width="50">
|
||||
<col width="80">
|
||||
<col width="80">
|
||||
<col>
|
||||
<col width="100">
|
||||
<col width="100">
|
||||
<col width="100">
|
||||
</colgroup>
|
||||
<thead class="small text-muted">
|
||||
<tr>
|
||||
<th>
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input checkAll-noti-user" id="checkAll-noti-user">
|
||||
<label class="custom-control-label" for="checkAll-noti-user"></label>
|
||||
</div>
|
||||
</th>
|
||||
<th>번호</th>
|
||||
<th>보낸사람</th>
|
||||
<th>받는사람</th>
|
||||
<th class="text-left">내용</th>
|
||||
<th>연결 URL</th>
|
||||
<th>알림일시</th>
|
||||
<th>확인일시</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php $_i=0;while($R=db_fetch_array($RCD)):?>
|
||||
<?php $SM1=$R['mbruid']?getDbData($table['s_mbrdata'],'memberuid='.$R['mbruid'],'name,nic'):array()?>
|
||||
<?php $SM2=$R['frommbr']?getDbData($table['s_mbrdata'],'memberuid='.$R['frommbr'],'name,nic'):array()?>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input checkAll-noti-user" id="noti_members_<?php echo $R['uid']?>" name="noti_members[]" value="<?php echo $R['uid']?>" onclick="checkboxCheck();">
|
||||
<label class="custom-control-label" for="noti_members_<?php echo $R['uid']?>"></label>
|
||||
</div>
|
||||
</td>
|
||||
<td><?php echo $NUM-((($p-1)*$recnum)+$_rec++)?></td>
|
||||
<td>
|
||||
<?php if($SM2['name']):?>
|
||||
<a href="#" data-toggle="modal" data-target="#modal_window" class="rb-modal-mbrinfo badge badge-pill badge-dark" onmousedown="mbrIdDrop('<?php echo $R['frommbr']?>','notice');">
|
||||
<?php echo $SM2[$_HS['nametype']]?></a>
|
||||
<?php else:?>
|
||||
<span class="badge badge-pill badge-dark">시스템</span>
|
||||
<?php endif?>
|
||||
</td>
|
||||
<td>
|
||||
<a href="#" data-toggle="modal" data-target="#modal_window" class="rb-modal-mbrinfo badge badge-pill badge-dark" onmousedown="mbrIdDrop('<?php echo $R['mbruid']?>','notice');">
|
||||
<?php echo $SM1[$_HS['nametype']]?>
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-left">
|
||||
<a tabindex="0" class="muted-link" role="button" data-toggle="popover" data-trigger="focus" data-html="true" data-content="<?php echo $R['message'] ?>"><?php echo getStrCut($R['message'],'80','..')?></a>
|
||||
</td>
|
||||
<td>
|
||||
<?php if($R['referer']):?>
|
||||
<a class="badge badge-pill badge-dark" href="<?php echo $R['referer']?>" target="<?php echo $R['target']?>">보기</a>
|
||||
<?php else:?>
|
||||
<span class="small text-muted">없음</span>
|
||||
<?php endif?>
|
||||
</td>
|
||||
<td class="rb-update">
|
||||
<time class="timeago small text-muted" data-toggle="tooltip" datetime="<?php echo getDateFormat($R['d_regis'],'c')?>" data-tooltip="tooltip" title="<?php echo getDateFormat($R['d_regis'],'Y.m.d H:i')?>"></time>
|
||||
</td>
|
||||
<td class="rb-update">
|
||||
<?php if($R['d_read']):?>
|
||||
<time class="timeago small text-muted" data-toggle="tooltip" datetime="<?php echo getDateFormat($R['d_read'],'c')?>" data-tooltip="tooltip" title="<?php echo getDateFormat($R['d_read'],'Y.m.d H:i')?>"></time>
|
||||
<?php else:?>
|
||||
<span class="badge badge-pill badge-dark">미확인</span>
|
||||
<?php endif?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $_i++;endwhile?>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<?php if(!$NUM):?>
|
||||
<div class="rb-none">알림이 없습니다.</div>
|
||||
<?php endif?>
|
||||
|
||||
<div class="d-flex justify-content-between px-3 my-4">
|
||||
<div>
|
||||
<button type="button" onclick="chkFlag('noti_members[]');checkboxCheck();" class="btn btn-light">선택/해제</button>
|
||||
<button type="button" onclick="actCheck('multi_delete');" class="btn btn-light" id="rb-action-btn" disabled>삭제</button>
|
||||
</div>
|
||||
<ul class="pagination">
|
||||
<script>getPageLink(5,<?php echo $p?>,<?php echo $TPG?>,'');</script>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
<?php include $g['path_module'].'member/admin/_modal.php';?>
|
||||
|
||||
<!-- timeago -->
|
||||
<?php getImport('jquery-timeago','jquery.timeago',false,'js')?>
|
||||
<?php getImport('jquery-timeago','locales/jquery.timeago.'.$lang['notification']['a2039'],false,'js')?>
|
||||
<script>
|
||||
|
||||
putCookieAlert('result_noti_main') // 실행결과 알림 메시지 출력
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
$(".rb-update time").timeago();
|
||||
});
|
||||
|
||||
// 회원 이름,닉네임 클릭시 uid & mod( 탭 정보 : info, main, post 등) 지정하는 함수
|
||||
var _mbrModalUid;
|
||||
var _mbrModalMod;
|
||||
function mbrIdDrop(uid,mod)
|
||||
{
|
||||
_mbrModalUid = uid;
|
||||
_mbrModalMod = mod;
|
||||
}
|
||||
|
||||
// 회원정보 modal 호출하는 함수 : 위에서 지정한 회원 uid & mod 로 호출한다 .
|
||||
$('.rb-modal-mbrinfo').on('click',function() {
|
||||
modalSetting('modal_window','<?php echo getModalLink('&m=admin&module=member&front=modal.mbrinfo&uid=')?>'+_mbrModalUid+'&tab='+_mbrModalMod);
|
||||
});
|
||||
|
||||
$('[data-toggle="popover"]').popover()
|
||||
|
||||
//사이트 셀렉터 출력
|
||||
$('[data-role="siteSelector"]').removeClass('d-none')
|
||||
|
||||
$(".checkAll-noti-user").click(function(){
|
||||
$(".rb-noti-user").prop("checked",$(".checkAll-noti-user").prop("checked"));
|
||||
checkboxCheck();
|
||||
});
|
||||
function checkboxCheck()
|
||||
{
|
||||
var f = document.listForm;
|
||||
var l = document.getElementsByName('noti_members[]');
|
||||
var n = l.length;
|
||||
var i;
|
||||
var j=0;
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
if (l[i].checked == true) j++;
|
||||
}
|
||||
if (j) getId('rb-action-btn').disabled = false;
|
||||
else getId('rb-action-btn').disabled = true;
|
||||
}
|
||||
function actCheck(act)
|
||||
{
|
||||
var f = document.listForm;
|
||||
var l = document.getElementsByName('noti_members[]');
|
||||
var n = l.length;
|
||||
var j = 0;
|
||||
var i;
|
||||
var s = '';
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
if(l[i].checked == true)
|
||||
{
|
||||
j++;
|
||||
s += '['+l[i].value+']';
|
||||
}
|
||||
}
|
||||
if (!j)
|
||||
{
|
||||
alert('선택된 알림이 없습니다. ');
|
||||
return false;
|
||||
}
|
||||
|
||||
if (act == 'multi_delete')
|
||||
{
|
||||
if(confirm('정말로 삭제하시겠습니까? '))
|
||||
{
|
||||
getIframeForAction(f);
|
||||
f.a.value = act;
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
4
modules/notification/admin/var/var.menu.php
Normal file
4
modules/notification/admin/var/var.menu.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
$d['amenu']['config'] = '환경설정';
|
||||
$d['amenu']['main'] = '알림로그';
|
||||
?>
|
||||
Reference in New Issue
Block a user