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.

133 lines
5.5 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
7 years ago
7 years ago
  1. <div class="page-header">
  2. <h1 class="page-title">다국어 설정</h1>
  3. </div>
  4. <?=form_open_multipart("admin/setting/update", array("class"=>"form-flex"))?>
  5. <input type="hidden" name="reurl" value="<?=base_url('admin/setting/localize')?>">
  6. <div data-ax-tbl>
  7. <div class="caption">다국어 기본 설정</div>
  8. <div data-ax-tr>
  9. <div data-ax-td>
  10. <div data-ax-td-label>사용여부</div>
  11. <div data-ax-td-wrap>
  12. <select class="form-control form-control-inline" name="setting[use_localize]">
  13. <option value="Y" <?=$this->site->config('use_localize')=='Y'?'selected':''?>>사용</option>
  14. <option value="N" <?=$this->site->config('use_localize')=='N'?'selected':''?>>미사용</option>
  15. </select>
  16. </div>
  17. </div>
  18. <div data-ax-td>
  19. <div data-ax-td-label>기본 언어</div>
  20. <div data-ax-td-wrap>
  21. <select class="form-control form-control-inline" name="setting[default_language]">
  22. <option value="ko" <?=$this->site->config('default_language')=='ko'?'selected':''?>>한국어</option>
  23. <option value="en" <?=$this->site->config('default_language')=='en'?'selected':''?>>English</option>
  24. <option value="ja" <?=$this->site->config('default_language')=='ja'?'selected':''?>>일본어</option>
  25. <option value="zh-hans" <?=$this->site->config('default_language')=='zh-hans'?'selected':''?>>중국어(간체)</option>
  26. <option value="zh-hant" <?=$this->site->config('default_language')=='zh-hant'?'selected':''?>>중국어(번체)</option>
  27. </select>
  28. </div>
  29. </div>
  30. </div>
  31. <div data-ax-tr>
  32. <div data-ax-td class="width-100">
  33. <div data-ax-td-label>사용할 언어</div>
  34. <div data-ax-td-wrap>
  35. <?php
  36. $accept_lang = $this->site->config('accept_languages');
  37. $accept_lang = explode(',', $accept_lang);
  38. ?>
  39. <div class="controls">
  40. <label class="w-check"><input type="checkbox" value="ko" name="accept_language[]" <?=in_array('ko', $accept_lang)?'checked':''?>><span>한글</span></label>
  41. <label class="w-check"><input type="checkbox" value="en" name="accept_language[]" <?=in_array('en', $accept_lang)?'checked':''?>><span>English</span></label>
  42. <label class="w-check"><input type="checkbox" value="ja" name="accept_language[]" <?=in_array('ja', $accept_lang)?'checked':''?>><span>일본어</span></label>
  43. <label class="w-check"><input type="checkbox" value="zh-hans" name="accept_language[]" <?=in_array('zh-hans', $accept_lang)?'checked':''?>><span>중국어(간체)</span></label>
  44. <label class="w-check"><input type="checkbox" value="zh-hant" name="accept_language[]" <?=in_array('zh-hant', $accept_lang)?'checked':''?>><span>중국어(번체)</span></label>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. <div class="text-center MT10">
  51. <button class="btn btn-primary">저장하기</button>
  52. </div>
  53. <?=form_close()?>
  54. <script>
  55. $(function(){
  56. $('[name="accept_language[]"]').change(function(e){
  57. if( $(this).val() == $('[name="setting[default_language]"] option:selected').val() ) {
  58. $(this).prop('checked', true);
  59. }
  60. });
  61. });
  62. </script>
  63. <div class="H20"></div>
  64. <?=form_open(NULL, array('autocomplete'=>'off'))?>
  65. <input type="hidden" name="mode" value="u">
  66. <div class="ax-button-group">
  67. <div class="left">
  68. <button class="btn btn-default" type="button" data-button="btn-add-localize">언어 스트링 추가</button>
  69. </div>
  70. <div class="right">
  71. <button class="btn btn-primary">저장하기</button>
  72. </div>
  73. </div>
  74. <ul class="tab-list">
  75. <?php foreach($tab_list as $row) :?>
  76. <li class="<?=urldecode($active)==$row['keys']?' active':''?>"><a href="<?=base_url('admin/setting/localize/'.$row['keys'])?>"><?=$row['keys']?></a></li>
  77. <?php endforeach;;?>
  78. </ul>
  79. <div class="grid">
  80. <table>
  81. <thead>
  82. <tr>
  83. <th class="W200">KEY</th>
  84. <?php foreach($accept_langs as $langs):?>
  85. <th><?=$lang_name[$langs]?></th>
  86. <?php endforeach;?>
  87. </tr>
  88. </thead>
  89. <tbody>
  90. <?php foreach($list as $row) :?>
  91. <tr>
  92. <td>
  93. <input type="hidden" name="loc_key[]" value="<?=$row['loc_key']?>">
  94. <span><?=$row['loc_key']?></span>
  95. </td>
  96. <?php foreach($accept_langs as $langs):?>
  97. <td>
  98. <textarea class="form-control" name="loc_value_<?=$langs?>[]" data-autosize><?=$row['loc_value_'.$langs]?></textarea>
  99. </td>
  100. <?php endforeach;?>
  101. </tr>
  102. <?php endforeach;?>
  103. </tbody>
  104. </table>
  105. </div>
  106. <?=form_close()?>
  107. <div class="H30"></div>
  108. <script>
  109. $(function(){
  110. $('[data-button="btn-add-localize"]').click(function(){
  111. APP.MODAL.callback = function(){
  112. location.reload();
  113. };
  114. APP.MODAL.open({
  115. iframe : {
  116. url : '/admin/setting/localize_form'
  117. },
  118. header : {
  119. title : '언어 스트링 추가'
  120. },
  121. width:800,
  122. height:600
  123. })
  124. });
  125. });
  126. </script>