Nessuna descrizione
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.

add.htm 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. {include file="public/layout" /}
  2. <body class="bodystyle" style="overflow-y: scroll;min-width:auto;">
  3. <div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
  4. <div id="append_parent"></div>
  5. <div id="ajaxwaitid"></div>
  6. <div class="page min-hg-c-10">
  7. <form class="form-horizontal" id="post_form" action="{:url('Language/add')}" method="post">
  8. <div class="ncap-form-default">
  9. <dl class="row">
  10. <dt class="tit">
  11. <label for="title"><em>*</em>选择语言</label>
  12. </dt>
  13. <dd class="opt" style="width: auto;">
  14. <select name="mark" id="languagemark">
  15. <option value="">请选择语言…</option>
  16. {volist name="$languagemark" id="vo"}
  17. <option value="{$vo.mark}" data-title="{$vo.title}">{$vo.cn_title}</option>
  18. {/volist}
  19. </select>
  20. <span class="err"></span>
  21. <p class="notic"></p>
  22. </dd>
  23. </dl>
  24. <dl class="row">
  25. <dt class="tit">
  26. <label for="title"><em>*</em>语言名称</label>
  27. </dt>
  28. <dd class="opt" style="width: auto;">
  29. <input type="text" name="title" id="title" class="w200" autocomplete="off">
  30. <span class="err"></span>
  31. <p class="notic">在前台显示</p>
  32. </dd>
  33. </dl>
  34. <dl class="row">
  35. <dt class="tit">
  36. <label>语言状态</label>
  37. </dt>
  38. <dd class="opt" style="width: auto;">
  39. <label class="curpoin"><input type="radio" name="status" value="1" checked="checked"/>开启</label>&nbsp;&nbsp;
  40. <label class="curpoin"><input type="radio" name="status" value="0"/>关闭</label>&nbsp;&nbsp;
  41. </dd>
  42. </dl>
  43. <dl class="row">
  44. <dt class="tit">
  45. <label>前台默认语言</label>
  46. </dt>
  47. <dd class="opt" style="width: auto;">
  48. <label class="curpoin"><input type="radio" name="is_home_default" value="1"/>是</label>&nbsp;&nbsp;
  49. <label class="curpoin"><input type="radio" name="is_home_default" value="0" checked="checked"/>否</label>&nbsp;&nbsp;
  50. </dd>
  51. </dl>
  52. <dl class="row">
  53. <dt class="tit">
  54. <label>新窗口打开</label>
  55. </dt>
  56. <dd class="opt" style="width: auto;">
  57. <label class="curpoin"><input type="radio" name="target" value="1"/>是</label>&nbsp;&nbsp;
  58. <label class="curpoin"><input type="radio" name="target" value="0" checked="checked"/>否</label>&nbsp;&nbsp;
  59. </dd>
  60. </dl>
  61. <!-- <dl class="row">
  62. <dt class="tit">
  63. <label for="url">单独域名</label>
  64. </dt>
  65. <dd class="opt" style="width: auto;">
  66. <input type="text" name="url" value="" id="url" class="input-txt">
  67. <span class="err"></span>
  68. <p class=""><font color="red">务必包含http://或https://,访问该域名程序将自动跳转到此语言(需先做好域名解析绑定),或者做外部链接用。</font></p>
  69. </dd>
  70. </dl> -->
  71. <dl class="row">
  72. <dt class="tit">
  73. <label for="sort_order">排序</label>
  74. </dt>
  75. <dd class="opt" style="width: auto;">
  76. <input type="text" name="sort_order" value="100" id="sort_order" class="w200" autocomplete="off">
  77. <span class="err"></span>
  78. <p class="notic">越小越靠前</p>
  79. </dd>
  80. </dl>
  81. <div class="bot mt30">
  82. <input type="hidden" name="copy_lang" value="{$main_lang}" />
  83. <a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
  84. </div>
  85. </div>
  86. </form>
  87. </div>
  88. <script type="text/javascript">
  89. var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  90. $(function(){
  91. /*选择多语言*/
  92. $('#languagemark').change(function(){
  93. var title = $(this).find("option:selected").data('title');
  94. $('input[name=title]').val(title);
  95. });
  96. /*--end*/
  97. });
  98. // 判断输入框是否为空
  99. function checkForm(){
  100. if($('#languagemark').val() == ''){
  101. showErrorMsg('请选择语言!');
  102. $('#languagemark').focus();
  103. return false;
  104. }
  105. if($('input[name=title]').val() == ''){
  106. showErrorMsg('语言名称不能为空!');
  107. $('input[name=title]').focus();
  108. return false;
  109. }
  110. layer_loading('正在处理');
  111. $.ajax({
  112. type : 'post',
  113. url : "{:url('Language/add', ['_ajax'=>1])}",
  114. data : $('#post_form').serialize(),
  115. dataType : 'json',
  116. success : function(res){
  117. layer.closeAll();
  118. if(res.code == 1){
  119. var _parent = parent;
  120. // _parent.layer.close(parentObj);
  121. _parent.window.location.href = res.url;
  122. // _parent.layer.msg(res.msg, {shade: layer_shade, time: 15000000});
  123. // $.ajax({
  124. // type : 'get',
  125. // url : res.url,
  126. // data : {},
  127. // dataType : 'json',
  128. // success : function(res1){
  129. // layer.closeAll();
  130. // if(res1.code == 1){
  131. // _parent.layer.msg(res1.msg, {shade: layer_shade, time: 1500}, function(){
  132. // _parent.window.location.href = res1.url;
  133. // });
  134. // }else{
  135. // showErrorMsg(res1.msg);
  136. // }
  137. // },
  138. // error: function(e){
  139. // layer.closeAll();
  140. // showErrorAlert(e.responseText);
  141. // }
  142. // });
  143. }else{
  144. showErrorMsg(res.msg);
  145. }
  146. },
  147. error: function(e){
  148. layer.closeAll();
  149. showErrorAlert(e.responseText);
  150. }
  151. });
  152. }
  153. </script>
  154. {include file="public/footer" /}