You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

139 lines
6.4 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. <div class="container">
  2. <div class="page-header">
  3. <h1 class="page-title"><?=$board['brd_title']?> <?=($post_idx?'글 수정': (defined('IS_REPLY_WRITE_FORM')?'답글 달기':'글쓰기'))?></h1>
  4. </div>
  5. <?=$form_open?>
  6. <div class="form-horizontal">
  7. <?php if(! defined('IS_REPLY_WRITE_FORM') && $use_category) :?>
  8. <!-- START :: 카테고리를 사용한다면 -->
  9. <div class="form-group">
  10. <label class="control-label col-sm-3 col-md-2">카테고리</label>
  11. <div class="col-sm-9 col-md-10">
  12. <select class="form-control" name="post_category">
  13. <?php foreach($board['category'] as $cate):?>
  14. <option value="<?=$cate?>" <?=$cate==element('post_category', $view)?'selected':''?>><?=$cate?></option>
  15. <?php endforeach;?>
  16. </select>
  17. </div>
  18. </div>
  19. <!-- END :: 카테고리를 사용한다면 -->
  20. <?php endif;?>
  21. <!-- START :: 제목 -->
  22. <div class="form-group">
  23. <label class="control-label col-sm-3 col-md-2">제목</label>
  24. <div class="col-sm-9 col-md-10">
  25. <input class="form-control" name="post_title" value="<?=element('post_title', $view)?>" required>
  26. </div>
  27. </div>
  28. <!-- END :: 제목 -->
  29. <?php if(! defined('IS_REPLY_WRITE_FORM') && $use_notice) :?>
  30. <!-- START:: 공지사항 권한이 있다면-->
  31. <div class="form-group">
  32. <label class="control-label col-sm-3 col-md-2">공지사항</label>
  33. <div class="col-sm-9 col-md-10">
  34. <div class="checkbox">
  35. <label><input type="checkbox" value="Y" name="post_notice" <?=element('post_notice',$view,'N')=='Y'?'checked':''?>> 공지사항</label>
  36. </div>
  37. </div>
  38. </div>
  39. <!-- END:: 공지사항 권한이 있다면 -->
  40. <?php endif;?>
  41. <?php if(! defined('IS_REPLY_WRITE_FORM') && $use_secret) : ?>
  42. <!-- START:: 비밀글 기능을 사용한다면 -->
  43. <div class="form-group">
  44. <label class="control-label col-sm-3 col-md-2">비밀글</label>
  45. <div class="col-sm-9 col-md-10">
  46. <div class="checkbox">
  47. <label><input type="checkbox" value="Y" name="post_secret" <?=element('post_secret',$view,'N')=='Y'?'checked':''?>> 비밀글</label>
  48. </div>
  49. </div>
  50. </div>
  51. <!-- END:: 비밀글 기능을 사용한다면 -->
  52. <?php endif;?>
  53. <?php if( ! $this->member->is_login() ) : ?>
  54. <!--START :: 비회원일 경우 입력폼 추가 -->
  55. <div class="form-group">
  56. <label class="control-label col-sm-3 col-md-2">작성자</label>
  57. <div class="col-sm-9 col-md-10">
  58. <input class="form-control" name="post_nickname" value="<?=element('post_nickname', $view)?>" required>
  59. </div>
  60. </div>
  61. <div class="form-group">
  62. <label class="control-label col-sm-3 col-md-2">비밀번호</label>
  63. <div class="col-sm-9 col-md-10">
  64. <input type="password" class="form-control" name="post_password" value="" required>
  65. </div>
  66. </div>
  67. <!--END :: 비회원일 경우 입력폼 추가 -->
  68. <?php endif;?>
  69. <div class="form-group">
  70. <label class="control-label col-sm-3 col-md-2"> 내용</label>
  71. <div class="col-sm-9 col-md-10">
  72. <?=get_editor('post_content', element('post_content', $view), '');?>
  73. </div>
  74. </div>
  75. <div class="form-group">
  76. <label class="control-label col-sm-3 col-md-2">태그</label>
  77. <div class="col-sm-9 col-md-10">
  78. <input class="form-control" name="post_keywords" value="<?=element('post_keywords', $view)?>">
  79. </div>
  80. </div>
  81. <!-- START :: 파일 첨부 기능을 사용하고, 권한이 있을경우 -->
  82. <div class="form-group">
  83. <label class="control-label col-sm-3 col-md-2">파일 첨부</label>
  84. <div class="col-sm-9 col-md-10">
  85. [widget name="board_file_upload"]
  86. </div>
  87. </div>
  88. <!-- END :: 파일 첨부 기능을 사용하고, 권한이 있을경우 -->
  89. <?php if( $post_idx && count(element('file', $view)) > 0) :?>
  90. <!-- START :: 현재 첨부되어 있는 이미지 -->
  91. <div class="form-group">
  92. <label class="control-label col-sm-3 col-md-2">첨부된 파일</label>
  93. <div class="col-sm-9 col-md-10">
  94. <?php foreach($view['file'] as $attach) : ?>
  95. <div class="col-sm-3">
  96. <?php $img_url = ($attach['att_is_image'] == 'Y') ? base_url($attach['att_filepath']) : base_url('assets/images/common/attach.png'); ?>
  97. <figure>
  98. <img class="img-responsive" src="<?=$img_url?>" <?=($attach['att_is_image'] != 'Y')?'style="max-width:64px;margin:auto"':''?>>
  99. <figcaption><?=$attach['att_origin']?></figcaption>
  100. </figure>
  101. <div class="checkbox">
  102. <label><input type="checkbox" name="del_file[]" value="<?=$attach['att_idx']?>"> 파일 삭제</label>
  103. </div>
  104. </div>
  105. <?php endforeach;?>
  106. <div class="clearfix"></div>
  107. </div>
  108. </div>
  109. <!-- END :: 현재 첨부되어 있는 이미지-->
  110. <?php endif;?>
  111. <?php if( ! $this->member->is_login() && $this->site->config('google_recaptcha_site_key') && $this->site->config('google_recaptcha_secret_key') ) :?>
  112. <!-- START :: 비회원일경우 구글 reCaptcha 사용 -->
  113. <script src="https://www.google.com/recaptcha/api.js" async defer></script>
  114. <div class="form-group">
  115. <label class="control-label col-sm-3 col-md-2">자동 등록방지</label>
  116. <div class="col-sm-9 col-md-10">
  117. <div class="g-recaptcha" data-sitekey="<?=$this->site->config('google_recaptcha_site_key')?>"></div>
  118. </div>
  119. </div>
  120. <!-- END :: 비회원일경우 구글 reCaptcha 사용 -->
  121. <?php endif;?>
  122. </div>
  123. <div class="text-center">
  124. <button type="submit" class="btn btn-primary"> 작성하기</button>
  125. </div>
  126. <?=$form_close?>
  127. </div>