Ei kuvausta
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.

index.htm 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. {include file="public/layout" /}
  2. <body class="bodystyle" style="cursor: default; -moz-user-select: inherit;">
  3. <div id="append_parent"></div>
  4. <div id="ajaxwaitid"></div>
  5. <div class="page min-hg-c-10">
  6. {include file="language/bar" /}
  7. <div class="flexigrid">
  8. <div class="mDiv pt0">
  9. <div class="ftitle">
  10. {eq name='$main_lang' value='$admin_lang'}
  11. {eq name="'Language@add'|is_check_access" value="1"}
  12. <div class="fbutton">
  13. <a href="javascript:void(0);" data-href="{:url('Language/add')}" onclick="openFullframe(this, '新增语言', '600px', '570px');">
  14. <div class="add">
  15. <span><i class="layui-icon layui-icon-addition"></i>新增语言</span>
  16. </div>
  17. </a>
  18. </div>
  19. {/eq}
  20. {/eq}
  21. </div>
  22. <form class="navbar-form form-inline" action="{:url('Language/index')}" method="get" onsubmit="layer_loading('正在处理');">
  23. {$searchform.hidden|default=''}
  24. <div class="sDiv">
  25. <div class="sDiv2">
  26. <input type="text" size="30" name="keywords" value="{$Request.param.keywords}" class="qsbox" placeholder="中文名称搜索...">
  27. <input type="submit" class="btn" value="搜索">
  28. <i class="iconfont e-sousuo"></i>
  29. </div>
  30. </div>
  31. </form>
  32. </div>
  33. <div class="hDiv">
  34. <div class="hDivBox">
  35. <table cellspacing="0" cellpadding="0" style="width: 100%">
  36. <thead>
  37. <tr>
  38. {eq name='$main_lang' value='$admin_lang'}
  39. <th class="sign w40" axis="col0">
  40. <div class="tc"><input type="checkbox" class="checkAll"></div>
  41. </th>
  42. {/eq}
  43. <th abbr="article_show" axis="col5" class="w40">
  44. <div class="tc">ID</div>
  45. </th>
  46. <th abbr="ac_id" axis="col4">
  47. <div class="text-l10">语言名称</div>
  48. </th>
  49. <th abbr="article_time" axis="col6" class="w80">
  50. <div class="tc">语言标识</div>
  51. </th>
  52. <th abbr="article_title" axis="col3" class="w180">
  53. <div class="text-l10">中文名称</div>
  54. </th>
  55. <th abbr="article_time" axis="col6" class="w60">
  56. <div class="tc">国旗</div>
  57. </th>
  58. <th abbr="article_time" axis="col6" class="w100">
  59. <div class="tc">前台默认语言</div>
  60. </th>
  61. <th abbr="article_time" axis="col6" class="w50">
  62. <div class="tc">开启</div>
  63. </th>
  64. <!-- <th abbr="article_time" axis="col6" class="w200">
  65. <div class="tc">单独域名</div>
  66. </th> -->
  67. <th axis="col1" class="w150">
  68. <div class="tc">操作</div>
  69. </th>
  70. <th abbr="article_show" axis="col5" class="w60">
  71. <div class="tc">排序</div>
  72. </th>
  73. </tr>
  74. </thead>
  75. </table>
  76. </div>
  77. </div>
  78. <div class="bDiv" style="height: auto;">
  79. <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
  80. <table style="width: 100%">
  81. <tbody>
  82. {empty name="list"}
  83. <tr>
  84. <td class="no-data" align="center" axis="col0" colspan="50">
  85. <div class="no_row">
  86. <div class="no_pic"><img src="__SKIN__/images/null-data.png"></div>
  87. </div>
  88. </td>
  89. </tr>
  90. {else/}
  91. {foreach name="list" item="vo" key="k" }
  92. <tr>
  93. {eq name='$main_lang' value='$admin_lang'}
  94. <td class="sign">
  95. <div class="w40 tc">
  96. {if condition="1 != $vo.is_home_default AND 0 < $k"}
  97. <input type="checkbox" autocomplete="off" name="ids[]" value="{$vo.id}">
  98. {else/}
  99. <input disabled type="checkbox" name="ids[]" value="{$vo.id}">
  100. {/if}
  101. </div>
  102. </td>
  103. {/eq}
  104. <td class="sort">
  105. <div class="w40 tc">
  106. {$vo.id}
  107. </div>
  108. </td>
  109. <td style="width: 100%">
  110. <div class="text-l10" style="">
  111. <a href="javascript:void(0);" data-href="{:url('Language/edit',array('id'=>$vo['id']))}" onclick="openFullframe(this, '编辑语言', '600px', '530px');">
  112. {$vo.title}</a>
  113. </div>
  114. </td>
  115. <td class="tc">
  116. <div class="w80 tc">
  117. {$vo.mark}
  118. </div>
  119. </td>
  120. <td class="">
  121. <div class="w180 text-l10">
  122. {$languagemarkList[$vo['mark']]['cn_title']}
  123. </div>
  124. </td>
  125. <td class="tc">
  126. <div class="w60 tc">
  127. <img src="__STATIC__/common/images/language/{$vo.mark}.gif" alt="{$vo.cn_title}" style="float: unset;"/>
  128. </div>
  129. </td>
  130. <td class="">
  131. <div class="w100 tc">
  132. {eq name="$vo['is_home_default']" value='1'}
  133. <span class="yes">是</span>
  134. {else /}
  135. <span class="no">否</span>
  136. {/eq}
  137. </div>
  138. </td>
  139. <td class="">
  140. <div class="w50 tc">
  141. {eq name="$vo['status']" value='1'}
  142. <span class="yes" {eq name="'Language@edit'|is_check_access" value="1"}onClick="changeTableVal('language','id','{$vo.id}','status',this);"{/eq}><i class="fa fa-check-circle"></i>是</span>
  143. {else /}
  144. <span class="no" {eq name="'Language@edit'|is_check_access" value="1"}onClick="changeTableVal('language','id','{$vo.id}','status',this);"{/eq}><i class="fa fa-ban"></i>否</span>
  145. {/eq}
  146. </div>
  147. </td>
  148. <!-- <td class="">
  149. <div class="w200 tc">
  150. {$vo.url}
  151. </div>
  152. </td> -->
  153. <td class="operation">
  154. <div class="w150 tc">
  155. {eq name="'Language@edit'|is_check_access" value="1"}
  156. <a href="javascript:void(0);" data-href="{:url('Language/edit',array('id'=>$vo['id']))}" onclick="openFullframe(this, '编辑语言', '600px', '570px');" class="btn blue">编辑</a>
  157. {/eq}
  158. {if condition="$vo['is_home_default'] == 1 || $vo['mark'] == $main_lang"}
  159. <i></i>
  160. <a class="btn grey" href="javascript:void(0);">同步</a>
  161. <i></i>
  162. <a class="btn grey" href="javascript:void(0);" data-id="{$vo.admin_id}">删除</a>
  163. {else /}
  164. <i></i>
  165. <a class="btn blue" href="javascript:void(0);" data-id="{$vo.id}" onClick="sync_arc(this);">同步</a>
  166. {eq name="'Language@del'|is_check_access" value="1"}
  167. <i></i>
  168. <a class="btn red" href="javascript:void(0)" data-url="{:url('Language/del')}" data-id="{$vo.id}" onClick="delfun(this);">删除</a>
  169. {/eq}
  170. {/if}
  171. </div>
  172. </td>
  173. <td class="sort">
  174. <div class="w60 tc">
  175. {eq name="'Language@edit'|is_check_access" value="1"}
  176. <input style="text-align: left;" type="text" onchange="changeTableVal('language','id','{$vo.id}','sort_order',this);" size="4" value="{$vo.sort_order}" />
  177. {else /}
  178. {$vo.sort_order}
  179. {/eq}
  180. </div>
  181. </td>
  182. </tr>
  183. {/foreach}
  184. {/empty}
  185. </tbody>
  186. </table>
  187. </div>
  188. <div class="iDiv" style="display: none;"></div>
  189. </div>
  190. <div class="tDiv">
  191. <div class="tDiv2">
  192. {eq name='$main_lang' value='$admin_lang'}
  193. <div class="fbutton checkboxall">
  194. <input type="checkbox" class="checkAll">
  195. </div>
  196. {eq name="'Language@del'|is_check_access" value="1"}
  197. <div class="fbutton">
  198. <a onclick="batch_del(this, 'ids');" data-url="{:url('Language/del')}">
  199. <div class="add">
  200. <span>批量删除</span>
  201. </div>
  202. </a>
  203. </div>
  204. {/eq}
  205. <div class="fbutton">
  206. <a href="javascript:void(0);" onclick="tag_call('web_language_switch');">
  207. <div class="add">
  208. <span>标签调用</span>
  209. </div>
  210. </a>
  211. </div>
  212. {/eq}
  213. </div>
  214. <div style="clear:both"></div>
  215. </div>
  216. <!--分页位置-->
  217. {$page}
  218. </div>
  219. </div>
  220. <script>
  221. $(function(){
  222. $('input[name*=ids]').click(function(){
  223. if ($('input[name*=ids]').length == $('input[name*=ids]:checked').length) {
  224. $('.checkAll').prop('checked','checked');
  225. } else {
  226. $('.checkAll').prop('checked', false);
  227. }
  228. });
  229. $('input[type=checkbox].checkAll').click(function(){
  230. $('input[type=checkbox]:not(:disabled)').prop('checked',this.checked);
  231. });
  232. });
  233. $(document).ready(function(){
  234. // 表格行点击选中切换
  235. $('#flexigrid > table>tbody >tr').click(function(){
  236. $(this).toggleClass('trSelected');
  237. });
  238. // 点击刷新数据
  239. $('.fa-refresh').click(function(){
  240. location.href = location.href;
  241. });
  242. // 显示顶部菜单语言列表
  243. append_lang();
  244. function append_lang(){
  245. $(".em_lang ul li.lang", window.parent.document).remove();
  246. var htmlstr = '';
  247. {volist name='$list' id='vo'}
  248. htmlstr += '<li class="ey-tool-list text-center lang"><a class="liaojie" href="?lang={$vo.mark}">{$vo.title}</a></li>';
  249. {/volist}
  250. $('#addlang', window.parent.document).before(htmlstr);
  251. }
  252. });
  253. function pack_iframe(obj)
  254. {
  255. var url = $(obj).data('url');
  256. //iframe窗
  257. layer.open({
  258. type: 2,
  259. title: '模板语言变量',
  260. fixed: true, //不固定
  261. shadeClose: false,
  262. shade: layer_shade,
  263. maxmin: false, //开启最大化最小化按钮
  264. area: ['90%', '90%'],
  265. content: url,
  266. end: function(){ //结束弹窗之后的处理
  267. }
  268. });
  269. }
  270. function delfun(obj){
  271. var title = $(obj).attr('data-typename');
  272. layer.confirm('<font color="#ff0000">将同步清空该语言的全部数据</font>,确认删除?', {
  273. shade: layer_shade,
  274. area: ['480px', '190px'],
  275. move: false,
  276. title: '提示',
  277. btnAlign:'r',
  278. closeBtn: 3,
  279. btn: ['确定', '取消'] ,//按钮
  280. success: function () {
  281. $(".layui-layer-content").css('text-align', 'left');
  282. }
  283. }, function(){
  284. layer_loading('正在处理');
  285. // 确定
  286. $.ajax({
  287. type : 'post',
  288. url : $(obj).attr('data-url'),
  289. data : {del_id:$(obj).attr('data-id'), _ajax:1},
  290. dataType : 'json',
  291. success : function(data){
  292. layer.closeAll();
  293. if(data.code == 1){
  294. layer.msg(data.msg, {icon: 1});
  295. window.location.reload();
  296. // $('tr[data-id="'+$(obj).attr('data-id')+'"]').remove();
  297. }else{
  298. layer.alert(data.msg, {icon: 2, title:false});
  299. }
  300. }
  301. })
  302. }, function(index){
  303. layer.close(index);
  304. }
  305. );
  306. return false;
  307. }
  308. function tag_call(name)
  309. {
  310. $.ajax({
  311. type: "POST",
  312. url: "{:url('System/ajax_tag_call', ['_ajax'=>1])}",
  313. data: {name:name},
  314. dataType: 'json',
  315. success: function (res) {
  316. if(res.code == 1){
  317. //询问框
  318. var confirm = layer.confirm(res.data.msg, {
  319. area: ['780px','350px'],
  320. move: false,
  321. title: '提示',
  322. shade: layer_shade,
  323. btnAlign:'r',
  324. closeBtn: 3,
  325. btn: ['关闭'] ,//按钮
  326. success: function () {
  327. $(".layui-layer-content").css('text-align', 'left');
  328. }
  329. }, function(){
  330. layer.close(confirm);
  331. }
  332. );
  333. }else{
  334. layer.alert(res.msg, {icon: 2, title:false});
  335. }
  336. },
  337. error:function(e){
  338. layer.alert(e.responseText, {icon: 2, title:false});
  339. }
  340. });
  341. }
  342. function sync_arc(obj) {
  343. var sync_arc_tip = layer.confirm('一键同步和中文主站有关联的栏目文档,将清空该语言下的所有原文档', {
  344. area: ['480px', '190px'],
  345. move: false,
  346. title: '提示',
  347. shade: layer_shade,
  348. btnAlign: 'r',
  349. closeBtn: 3,
  350. btn: ['确定', '取消'],//按钮
  351. success: function () {
  352. $(".layui-layer-content").css('text-align', 'left');
  353. }
  354. }, function () {
  355. layer.close(sync_arc_tip);
  356. layer_loading('正在处理');
  357. var is_jump = 0;
  358. var id = $(obj).data('id');
  359. // var is_jump_val = $("#is_jump:checked").val();
  360. // if ('on' == is_jump_val){
  361. // is_jump = 1;
  362. // }
  363. $.ajax({
  364. type: "POST",
  365. url: "{:url('Language/sync', ['_ajax'=>1])}",
  366. data: {id: id,is_jump:is_jump},
  367. dataType: 'json',
  368. success: function (res) {
  369. layer.closeAll();
  370. if (res.code == 1) {
  371. layer.msg(res.msg, {icon: 1});
  372. } else {
  373. layer.alert(res.msg, {icon: 2, title: false});
  374. }
  375. },
  376. error: function (e) {
  377. layer.closeAll();
  378. layer.alert(e.responseText, {icon: 2, title: false});
  379. }
  380. });
  381. }
  382. , function () {
  383. layer.close(sync_arc_tip);
  384. }
  385. )
  386. // $(".layui-layer-content").append('<p><input type="checkbox" id="is_jump" checked>跳过已存在文档</p>');
  387. }
  388. </script>
  389. {include file="public/footer" /}