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.

153 lines
7.3 KiB

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