Commit f9c5d235 authored by platyhouse's avatar platyhouse

.

parent 826a6933
......@@ -6,78 +6,79 @@
/** @var platyFramework\ptyForms $form */
?>
<style>
hr.style3 {
border-top: 1px dashed #8c8b8b;
}
hr.style3 {
border-top: 1px dashed #8c8b8b;
}
</style>
<script src="/platyFramework/apps/admin/views/defaultTheme/resources/plugins/ckeditor/ckeditor.js?1"></script>
<script>
CKEDITOR.config.startupMode = 'wysiwyg';
CKEDITOR.config.height = 400;
CKEDITOR.config.filebrowserUploadUrl = '<?=PLATYFRAMEWORK_APPURL?>/board/api/uploadCKEditor/';
CKEDITOR.config.enterMode = CKEDITOR.ENTER_BR;
CKEDITOR.config.startupMode = 'wysiwyg';
CKEDITOR.config.height = 400;
CKEDITOR.config.filebrowserUploadUrl = '<?=PLATYFRAMEWORK_APPURL?>/board/api/uploadCKEditor/';
CKEDITOR.config.enterMode = CKEDITOR.ENTER_BR;
CKEDITOR.config.allowedContent = true;
// CKEDITOR.config.extraPlugins = 'uploadimage,uploadwidget,filetools,notificationaggregator,notification,toolbar,button';
// CKEDITOR.config.disallowedContent = 'img{width,height}';
// CKEDITOR.config.extraPlugins = 'uploadimage,uploadwidget,filetools,notificationaggregator,notification,toolbar,button';
// CKEDITOR.config.disallowedContent = 'img{width,height}';
</script>
<div class="row">
<div class="col-md-12">
<form class="form-horizontal" method="post" action="<?= $postUrl ?>" enctype="multipart/form-data">
<!-- Horizontal Form -->
<div class="box box-info">
<input type="hidden" name="id" value="<?= $item->id ?>">
<div class="box-body">
<div class='col-md-12'>
<? // = $form->addHidden("userId"); ?>
<? if ($this->request->functionName == "edit") { ?>
<?= $form->getInput("등록일", "regDateTime"); ?>
<? } ?>
<?= $form->getSelect("휴지통여부", "enabled", array("일반" => "1", "휴지통" => "0"), "style='display: none;'"); ?>
<div class="col-md-12">
<form class="form-horizontal" method="post" action="<?= $postUrl ?>" enctype="multipart/form-data">
<!-- Horizontal Form -->
<div class="box box-info">
<input type="hidden" name="id" value="<?= $item->id ?>">
<div class="box-body">
<div class='col-md-12'>
<? // = $form->addHidden("userId"); ?>
<? if ($this->request->functionName == "edit") { ?>
<?= $form->getInput("등록일", "regDateTime"); ?>
<? } ?>
<?= $form->getSelect("휴지통여부", "enabled", array("일반" => "1", "휴지통" => "0"), "style='display: none;'"); ?>
<? if ($this->request->functionName == "edit") { ?>
<?= $form->getInput("노출순서", "descId", "", "노출순서는 -9999 형태로 지정하며, 낮은 음수 일수록 최상위로 노출됩니다"); ?>
<? } ?>
<?= $form->getSelect("게시여부", "published", array("게시" => "1", "비게시" => "0")); ?>
<?= $form->getSelect("게시판명", "board", $boards); ?>
<? if (count($categories)) { ?>
<?= $form->getSelect("주분류", "category", $categories); ?>
<? } ?>
<? if (count($categories2)) { ?>
<?= $form->getSelect("부분류", "category2", $categories2); ?>
<? } ?>
<?= $form->getSelect("게시여부", "published", array("게시" => "1", "비게시" => "0")); ?>
<?= $form->getSelect("게시판명", "board", $boards); ?>
<? if (count($categories)) { ?>
<?= $form->getSelect("주분류", "category", $categories); ?>
<? } ?>
<? if (count($categories2)) { ?>
<?= $form->getSelect("부분류", "category2", $categories2); ?>
<? } ?>
<? if (strstr($this->config->mobileapp->packageName, "atmstockinfo") || strstr($this->config->mobileapp->packageName, "com.platyhouse.storyshare")) { ?>
<?= $form->getSelect("유료글", "paid", array("유료" => "1", "무료" => "0")); ?>
<?= $form->getSelect("유료글", "paid", array("유료" => "1", "무료" => "0")); ?>
<? } ?>
<?= $form->getInput("제목", "title"); ?>
<?= $form->getTextEdit("내용", "content"); ?>
<? // echo $form->getInput("Guest Name", "name"); ?>
<? // echo $form->getInput("isSecret", "isSecret"); ?>
<? // echo $form->getInput("parentId", "parentId"); ?>
<? // echo $form->getInput("commentCount", "commentCount"); ?>
<? // = $form->getInput("시작일", "startDateTime"); ?>
<? // = $form->getInput("종료일", "endDateTime"); ?>
<? // = $form->getInput("발표일", "resultDateTime"); ?>
<? if ($this->request->functionName == "edit") { ?>
<?= $form->getInput("조회수", "readCount"); ?>
<?= $form->getInput("공유수", "shareCount"); ?>
<?= $form->getInput("좋아요수", "likeCount"); ?>
<? } ?>
<?= $form->getFile("첨부1", "file1", 0, " onchange='checkUpload(this, 1);'", "모든 파일 첨부는 최대 ".ini_get("post_max_size") ." 까지 가능합니다"); ?>
<?= $form->getFile("첨부2", "file2", 0, " onchange='checkUpload(this, 2);'"); ?>
<?= $form->getFile("첨부3", "file3", 0, " onchange='checkUpload(this, 3);'"); ?>
<?= $form->getFile("첨부4", "file4", 0, " onchange='checkUpload(this, 4);'"); ?>
<?= $form->getFile("첨부5", "file5", 0, " onchange='checkUpload(this, 5);'"); ?>
<?= $form->getFile("첨부6", "file6", 0, " onchange='checkUpload(this, 6);'"); ?>
<?= $form->getFile("첨부7", "file7", 0, " onchange='checkUpload(this, 7);'"); ?>
<?= $form->getFile("첨부8", "file8", 0, " onchange='checkUpload(this, 8);'"); ?>
<?= $form->getFile("첨부9", "file9", 0, " onchange='checkUpload(this, 9);'"); ?>
<?= $form->getFile("첨부10", "file10", 0, " onchange='checkUpload(this, 10);'"); ?>
<?= $form->getFile("첨부11", "file11", 0, " onchange='checkUpload(this, 11);'"); ?>
<?= $form->getFile("첨부12", "file12", 0, " onchange='checkUpload(this, 12);'"); ?>
<?= $form->getFile("첨부13", "file13", 0, " onchange='checkUpload(this, 13);'"); ?>
<?= $form->getFile("첨부14", "file14", 0, " onchange='checkUpload(this, 14);'"); ?>
<?= $form->getFile("첨부15", "file15", 0, " onchange='checkUpload(this, 15);'"); ?>
<? if ($this->request->functionName == "edit") { ?>
<?= $form->getInput("제목", "title"); ?>
<?= $form->getTextEdit("내용", "content"); ?>
<? // echo $form->getInput("Guest Name", "name"); ?>
<? // echo $form->getInput("isSecret", "isSecret"); ?>
<? // echo $form->getInput("parentId", "parentId"); ?>
<? // echo $form->getInput("commentCount", "commentCount"); ?>
<? // = $form->getInput("시작일", "startDateTime"); ?>
<? // = $form->getInput("종료일", "endDateTime"); ?>
<? // = $form->getInput("발표일", "resultDateTime"); ?>
<? if ($this->request->functionName == "edit") { ?>
<?= $form->getInput("조회수", "readCount"); ?>
<?= $form->getInput("공유수", "shareCount"); ?>
<?= $form->getInput("좋아요수", "likeCount"); ?>
<? } ?>
<?= $form->getFile("첨부1", "file1", 0, " onchange='checkUpload(this, 1);'", "모든 파일 첨부는 최대 " . ini_get("post_max_size") . " 까지 가능합니다"); ?>
<?= $form->getFile("첨부2", "file2", 0, " onchange='checkUpload(this, 2);'"); ?>
<?= $form->getFile("첨부3", "file3", 0, " onchange='checkUpload(this, 3);'"); ?>
<?= $form->getFile("첨부4", "file4", 0, " onchange='checkUpload(this, 4);'"); ?>
<?= $form->getFile("첨부5", "file5", 0, " onchange='checkUpload(this, 5);'"); ?>
<?= $form->getFile("첨부6", "file6", 0, " onchange='checkUpload(this, 6);'"); ?>
<?= $form->getFile("첨부7", "file7", 0, " onchange='checkUpload(this, 7);'"); ?>
<?= $form->getFile("첨부8", "file8", 0, " onchange='checkUpload(this, 8);'"); ?>
<?= $form->getFile("첨부9", "file9", 0, " onchange='checkUpload(this, 9);'"); ?>
<?= $form->getFile("첨부10", "file10", 0, " onchange='checkUpload(this, 10);'"); ?>
<?= $form->getFile("첨부11", "file11", 0, " onchange='checkUpload(this, 11);'"); ?>
<?= $form->getFile("첨부12", "file12", 0, " onchange='checkUpload(this, 12);'"); ?>
<?= $form->getFile("첨부13", "file13", 0, " onchange='checkUpload(this, 13);'"); ?>
<?= $form->getFile("첨부14", "file14", 0, " onchange='checkUpload(this, 14);'"); ?>
<?= $form->getFile("첨부15", "file15", 0, " onchange='checkUpload(this, 15);'"); ?>
<?= $form->getInput("푸시 상단바 선택시 이동 URL", "pushNotificationDirectUrl", "", "푸시 수신후 선택시 앱 실행 직후 URL 로 이동됩니다."); ?>
<? if ($this->request->functionName == "edit") { ?>
<?= $form->getInput("짧은글주소", "shortUrl"); ?>
<? if (false) { ?>
<div class='form-group'>
......@@ -89,223 +90,220 @@
</div>
</div>
<? } ?>
<? } ?>
</div>
<div class='col-md-12'>
<?= $form->getInput("푸쉬 예약 시간", "pushReserveDateTime", ""); ?>
</div>
<? } ?>
</div>
<div class='col-md-12'>
<?= $form->getInput("푸쉬 예약 시간", "pushReserveDateTime", ""); ?>
</div>
<div class='col-md-12'>
<div class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="col-sm-7">
<div class="callout callout-info">
<p>푸쉬 예약 시간을 5분 단위 또는 <?=date("Y-m-d H:i:s") ?> 형식의 초 단위까지 설정 하여 보낼 수 있습니다. 또한 예약된 시간에는 자동으로 게시 상태가 '공개' 로 변경된 후 발송됩니다.<br>
현재보다 이전의 시간을 지정할 경우 즉시 전송되니 유의하세요.</p>
<p>푸쉬 예약 시간을 5분 단위 또는 <?= date("Y-m-d H:i:s") ?> 형식의 초 단위까지 설정 하여 보낼 수 있습니다. 또한 예약된 시간에는 자동으로 게시 상태가 '공개' 로 변경된 후 발송됩니다.<br>
현재보다 이전의 시간을 지정할 경우 즉시 전송되니 유의하세요.</p>
</div>
</div>
</div>
</div>
</div>
<div class="box-footer">
</div>
<div class="box-footer">
<div class="pull-right">
<? if ($this->request->functionName == "edit") { ?>
<button type="button" class="btn btn-danger ptyConfirm2" caption='삭제' title="삭제하시겠습니까?<br><br><font color=red>삭제 이후 해당 글은 복구할 수 없으며, SNS 에 이미 공유된 컨텐츠의 경우에는 다시 한번 고려하시기 바랍니다</font><br><font color=blue>일시적으로 노출을 원하지 않을 경우</font> 취소 버튼을 누른 후 상단의 <b>'게시여부' 를 비게시로 설정</b>하세요." href="javascript:deleteItem(<?=$item->id?>)" yesButtonTitle='삭제'><i class="fa fa-remove"></i> 삭제</button>
<? if ($this->request->functionName == "edit") { ?>
<button type="button" class="btn btn-danger ptyConfirm2" caption='삭제' title="삭제하시겠습니까?<br><br><font color=red>삭제 이후 해당 글은 복구할 수 없으며, SNS 에 이미 공유된 컨텐츠의 경우에는 다시 한번 고려하시기 바랍니다</font><br><font color=blue>일시적으로 노출을 원하지 않을 경우</font> 취소 버튼을 누른 후 상단의 <b>'게시여부' 를 비게시로 설정</b>하세요." href="javascript:deleteItem(<?= $item->id ?>)" yesButtonTitle='삭제'><i class="fa fa-remove"></i> 삭제</button>
<? } ?>
<button type="button" class="btn btn-default ptyGoBack"><i class="fa"></i>취소</button>
</div>
<button type="submit" class="btn btn-primary"><i class="fa fa-plus"></i>저장</button>
</div>
</div>
</div>
</div>
</form>
</div>
</form>
</div>
</div>
<div class="row">
<div class="col-md-12">
<!-- Box Comment -->
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">댓글 목록</h3>
</div>
<div class="box-footer box-comments" style="background-color: white;">
<? foreach ($comments as $commentItem) { ?>
<? // ptyDebug($commentItem); ?>
<div class="col-md-12">
<!-- Box Comment -->
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">댓글 목록</h3>
</div>
<div class="box-footer box-comments" style="background-color: white;">
<? foreach ($comments as $commentItem) { ?>
<? // ptyDebug($commentItem); ?>
<div class="box-comment">
<!-- User image -->
<div class="box-comment">
<!-- User image -->
<? if ($commentItem->user_profileImageUrl) { ?>
<img class="img-circle img-sm" src="<?= $commentItem->user_profileImageUrl ?>" alt="User Image">
<img class="img-circle img-sm" src="<?= $commentItem->user_profileImageUrl ?>" alt="User Image">
<? } ?>
<div class="comment-text">
<div class="comment-text">
<span class="username">
<a href="<?=PLATYFRAMEWORK_APPURL?>/user/list/edit/?id=<?=$commentItem->userId?>"><? if ($commentItem->user_enabled == 0) echo "<del>{$commentItem->user_nickName} (ID : {$commentItem->user_userId}</del>"; else echo "{$commentItem->user_nickName} (ID : {$commentItem->user_userId})"; ?></a>
<a href="<?= PLATYFRAMEWORK_APPURL ?>/user/list/edit/?id=<?= $commentItem->userId ?>"><? if ($commentItem->user_enabled == 0) echo "<del>{$commentItem->user_nickName} (ID : {$commentItem->user_userId}</del>"; else echo "{$commentItem->user_nickName} (ID : {$commentItem->user_userId})"; ?></a>
<span class="text-muted pull-right"><?= $commentItem->regDateTime ?></span>
</span>
<? if ($commentItem->enabled) { ?>
<button type="button" itemId=<?=$commentItem->id?> class="btnRemoveComment pull-right btn btn-default btn-xs"><i class="fa fa-trash"></i> 숨김</button>
<?= nl2br($commentItem->content) ?>
<? } else { ?>
<button type="button" itemId=<?=$commentItem->id?> class="btnEnableComment pull-right btn btn-warning btn-xs"><i class="fa fa-normal"></i> 노출</button>
<del><?= nl2br($commentItem->content) ?></del>
<? } ?>
<? if ($commentItem->enabled) { ?>
<button type="button" itemId=<?= $commentItem->id ?> class="btnRemoveComment pull-right btn btn-default btn-xs"><i class="fa fa-trash"></i> 숨김</button>
<?= nl2br($commentItem->content) ?>
<? } else { ?>
<button type="button" itemId=<?= $commentItem->id ?> class="btnEnableComment pull-right btn btn-warning btn-xs"><i class="fa fa-normal"></i> 노출</button>
<del><?= nl2br($commentItem->content) ?></del>
<? } ?>
<? if ($commentItem->abuseComment == 1) { ?>
<span class="label bg-red pull-left btn-xs"> 신고됨</span>
<? } ?>
<Br>
</div>
<!-- /.comment-text -->
</div>
<!-- /.box-comment -->
<? } ?>
</div>
<!-- /.box-footer -->
<? if (FALSE) { ?>
<div class="box-footer">
<form action="#" method="post">
<img class="img-responsive img-circle img-sm" src="../dist/img/user4-128x128.jpg" alt="Alt Text">
<!-- .img-push is used to add margin to elements next to floating images -->
<div class="img-push">
<input type="text" class="form-control input-sm" placeholder="Press enter to post comment">
</div>
</form>
</div>
<!-- /.box-footer -->
<? } ?>
</div>
<!-- /.box -->
</div>
<Br>
</div>
<!-- /.comment-text -->
</div>
<!-- /.box-comment -->
<? } ?>
</div>
<!-- /.box-footer -->
<? if (FALSE) { ?>
<div class="box-footer">
<form action="#" method="post">
<img class="img-responsive img-circle img-sm" src="../dist/img/user4-128x128.jpg" alt="Alt Text">
<!-- .img-push is used to add margin to elements next to floating images -->
<div class="img-push">
<input type="text" class="form-control input-sm" placeholder="Press enter to post comment">
</div>
</form>
</div>
<!-- /.box-footer -->
<? } ?>
</div>
<!-- /.box -->
</div>
</div>
<script>
function checkUpload(v, i) {
// handleFileSelect(v);
// onChangeFile(v);
var txtId = "{첨부이미지" + i + "}";
function checkUpload(v, i) {
// handleFileSelect(v);
// onChangeFile(v);
var txtId = "{첨부이미지" + i + "}";
// console.log(v);
// console.log(v.files);
// 마지막 위치로 이동
var html = $("#content").val();
$("#content").focus().val("").val(html);
// 마지막 위치로 이동
var html = $("#content").val();
$("#content").focus().val("").val(html);
// 텍스트 검색
// 텍스트 검색
// console.log("'" + html + "'");
// console.log("'" + txtId + "'");
// console.log(html.search(txtId));
if (html.search(txtId) >= 0)
return;
if (html.search(txtId) >= 0)
return;
if (v.files[0]) {
var fileSize = v.files[0].size;
CKEDITOR.instances['content'].insertText(txtId + "\n");
}
}
if (v.files[0]) {
var fileSize = v.files[0].size;
CKEDITOR.instances['content'].insertText(txtId + "\n");
}
}
function onChangeFile(e) {
for (var i = 0; i < e.files.length; i++) {
function onChangeFile(e) {
for (var i = 0; i < e.files.length; i++) {
var file = e.files[i];
var file = e.files[i];
var img = document.createElement("img");
var reader = new FileReader();
reader.onloadend = function () {
img.src = reader.result;
}
reader.readAsDataURL(file);
e.after(img);
}
}
var img = document.createElement("img");
var reader = new FileReader();
reader.onloadend = function () {
img.src = reader.result;
}
reader.readAsDataURL(file);
e.after(img);
}
}
function handleFileSelect(evt) {
// var files = evt.target.files;
var files = evt.files;
function handleFileSelect(evt) {
// var files = evt.target.files;
var files = evt.files;
// Loop through the FileList and render image files as thumbnails.
for (var i = 0, f; f = files[i]; i++) {
// Loop through the FileList and render image files as thumbnails.
for (var i = 0, f; f = files[i]; i++) {
// Only process image files.
if (!f.type.match('image.*')) {
continue;
}
// Only process image files.
if (!f.type.match('image.*')) {
continue;
}
var reader = new FileReader();
var reader = new FileReader();
// Closure to capture the file information.
reader.onload = (function (theFile) {
return function (e) {
// Render thumbnail.
var span = document.createElement('span');
span.innerHTML =
[
'<img style="height: 75px; border: 1px solid #000; margin: 5px" src="',
e.target.result,
'" title="', escape(theFile.name),
'"/>'
].join('');
// Closure to capture the file information.
reader.onload = (function (theFile) {
return function (e) {
// Render thumbnail.
var span = document.createElement('span');
span.innerHTML =
[
'<img style="height: 75px; border: 1px solid #000; margin: 5px" src="',
e.target.result,
'" title="', escape(theFile.name),
'"/>'
].join('');
document.getElementById('list').insertBefore(span, null);
};
})(f);
document.getElementById('list').insertBefore(span, null);
};
})(f);
// Read in the image file as a data URL.
reader.readAsDataURL(f);
}
}
// Read in the image file as a data URL.
reader.readAsDataURL(f);
}
}
function deleteItem(itemId)
{
ptyPost("<?=$this->request->appUrl?>/board/api/delete/", {id:itemId, returnCode:"json"}, function (result) {
function deleteItem(itemId) {
ptyPost("<?=$this->request->appUrl?>/board/api/delete/", {id: itemId, returnCode: "json"}, function (result) {
window.location.href = '<?=$this->request->classUrl?>/<?=ptyRebuildParams("id={NULL}")?>';
});
}
<? // date & time picker 처리. 경로 : resources/plugins/datetimepicker-master/ */ ?>
jQuery(function () {
$.datetimepicker.setLocale('kr');
jQuery('#pushReserveDateTime').datetimepicker({
// value: '2015-04-15 05:06',
lang: 'ko',
format: 'Y-m-d H:i',
<? // date & time picker 처리. 경로 : resources/plugins/datetimepicker-master/ */ ?>
jQuery(function () {
$.datetimepicker.setLocale('kr');
jQuery('#pushReserveDateTime').datetimepicker({
// value: '2015-04-15 05:06',
lang: 'ko',
format: 'Y-m-d H:i',
step: 1,
});
});
/*
$(".content-wrapper").click(function () {
//Enable hide menu when clicking on the content-wrapper on small screens
if ($(window).width() <= (screenSizes.sm - 1) && $("body").hasClass("sidebar-open")) {
$("body").removeClass('sidebar-open');
}
});
*/
/*
$(".content-wrapper").click(function () {
//Enable hide menu when clicking on the content-wrapper on small screens
if ($(window).width() <= (screenSizes.sm - 1) && $("body").hasClass("sidebar-open")) {
$("body").removeClass('sidebar-open');
}
});
*/
$(".btnRemoveComment").click(function () {
itemId = $(this).attr("itemId");
if (confirm("댓글을 삭제하시겠습니까?")) {
ptyPost("<?=$this->request->appUrl?>/board/api/setDisable/", {id:itemId, returnCode:"json"}, function (result) {
if (result == true)
{
window.location.reload();
}
$(".btnRemoveComment").click(function () {
itemId = $(this).attr("itemId");
if (confirm("댓글을 삭제하시겠습니까?")) {
ptyPost("<?=$this->request->appUrl?>/board/api/setDisable/", {id: itemId, returnCode: "json"}, function (result) {
if (result == true) {
window.location.reload();
}
});
}
});
});
}
});
$(".btnEnableComment").click(function () {
itemId = $(this).attr("itemId");
if (confirm("댓글을 노출하시겠습니까?")) {
ptyPost("<?=$this->request->appUrl?>/board/api/setEnable/", {id:itemId, returnCode:"json"}, function (result) {
if (result == true)
{
window.location.reload();
}
$(".btnEnableComment").click(function () {
itemId = $(this).attr("itemId");
if (confirm("댓글을 노출하시겠습니까?")) {
ptyPost("<?=$this->request->appUrl?>/board/api/setEnable/", {id: itemId, returnCode: "json"}, function (result) {
if (result == true) {
window.location.reload();
}
});
});
}
});
});
}
});
});
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment