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.

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