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.

119 lines
5.0 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. <?=form_open(NULL, array('class'=>'form-flex'))?>
  2. <input type="hidden" name="mnu_idx" value="<?=$mnu_idx?>">
  3. <input type="hidden" name="mnu_parent" value="<?=$mnu_parent?>">
  4. <div data-ax-tbl>
  5. <div data-ax-tr>
  6. <div data-ax-td class="width-100">
  7. <div data-ax-td-label>메뉴 이름</div>
  8. <div data-ax-td-wrap>
  9. <input class="form-control" name="mnu_name" value="<?=element('mnu_name', $view)?>" required maxlength="30">
  10. </div>
  11. </div>
  12. </div>
  13. <div data-ax-tr>
  14. <div data-ax-td>
  15. <div data-ax-td-label>링크 구분</div>
  16. <div data-ax-td-wrap>
  17. <select class="form-control" id="menu-helper">
  18. <option value="">직접입력</option>
  19. <option value="#" <?=element('mnu_link',$view)=='#'?'selected':''?>>링크 없음</option>
  20. <option value="board">게시판</option>
  21. <option value="pages">일반페이지</option>
  22. </select>
  23. </div>
  24. </div>
  25. <div data-ax-td>
  26. <div data-ax-td-wrap id="menu-helper-input">
  27. <select class="form-control">
  28. <option value="">직접입력</option>
  29. <option value="#" <?=element('mnu_link',$view)=='#'?'selected':''?>>링크 없음</option>
  30. <option value="board">게시판</option>
  31. <option value="pages">일반페이지</option>
  32. </select>
  33. </div>
  34. </div>
  35. </div>
  36. <div data-ax-tr>
  37. <div data-ax-td class="width-100">
  38. <div data-ax-td-label>표시 설정</div>
  39. <div data-ax-td-wrap>
  40. <label class="w-check">
  41. <input type="checkbox" name="mnu_desktop" value="Y" <?=element('mnu_desktop',$view,'Y')=='Y'?'checked':''?>>
  42. <span>PC버젼 표시</span>
  43. </label>
  44. <label class="w-check">
  45. <input type="checkbox" name="mnu_mobile" value="Y" <?=element('mnu_mobile',$view,'Y')=='Y'?'checked':''?>>
  46. <span>모바일버젼 표시</span>
  47. </label>
  48. </div>
  49. </div>
  50. </div>
  51. <div data-ax-tr>
  52. <div data-ax-td class="width-100">
  53. <div data-ax-td-label>기타 옵션</div>
  54. <div data-ax-td-wrap>
  55. <label class="w-check">
  56. <input type="checkbox" name="mnu_newtab" value="Y" <?=element('mnu_newtab',$view,'Y')=='N'?'checked':''?>>
  57. <span>새탭으로 열기</span>
  58. </label>
  59. </div>
  60. </div>
  61. </div>
  62. <div data-ax-tr>
  63. <div data-ax-td class="width-100">
  64. <div data-ax-td-label>Active KEY</div>
  65. <div data-ax-td-wrap>
  66. <input class="form-control" name="mnu_active_key" value="<?=element('mnu_active_key',$view)?>">
  67. <p class="form-control-static">개발자가 설정하는 값입니다.</p>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. <div class="text-center MT15">
  73. <button class="btn btn-primary"><i class="fal fa-save"></i> 저장하기</button>
  74. </div>
  75. <?=form_close()?>
  76. <script>
  77. var mnu_link = "<?=element('mnu_link', $view)?>";
  78. var board_link = <?=json_encode($board_list)?>;
  79. var pages_link = [
  80. { url : '/customer/faq', name : 'FAQ'},
  81. { url : '/customer/qna', name : 'Q&A'},
  82. { url : '/contact', name : 'Contact'},
  83. { url : '/agreement/site', name:'이용약관'},
  84. { url : '/agreement/privacy', name:'개인정보취급방침'}
  85. ];
  86. $(function(){
  87. $("#menu-helper").change(function(){
  88. var $this = $(this);
  89. $("#menu-helper-input").empty();
  90. if( $this.val() == '' )
  91. {
  92. var input = $("<input>").addClass('form-control').attr('name', "mnu_link").attr('required','required').val( mnu_link );
  93. $("#menu-helper-input").append( input);
  94. }
  95. else if ( $this.val() == '#' )
  96. {
  97. var input = $("<input>").addClass('form-control').attr('name', "mnu_link").val( '#' ).attr('readonly','readonly');
  98. $("#menu-helper-input").append( input);
  99. }
  100. else if ( $this.val() == 'board' || $this.val() == 'pages' ) {
  101. var data_list = [];
  102. if( $this.val() == 'board' ) {
  103. data_list = board_link;
  104. }
  105. else if ($this.val() == 'pages') {
  106. data_list = pages_link;
  107. }
  108. var select = $("<select>").addClass('form-control').attr('name', 'mnu_link');
  109. for(var i=0; i<data_list.length; i++ )
  110. {
  111. var option = $("<option>").attr('value', data_list[i].url ).text( data_list[i].name );
  112. select.append(option);
  113. }
  114. $("#menu-helper-input").append( select );
  115. }
  116. }).change();
  117. });
  118. </script>