<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=<!--{$page_charset}-->" />

    <title>自定义HTML标签</title>
    <!--{include file="<!--{$cptplpath}-->headerjs.tpl"}-->
    <!--{assign var='pluginevent' value=XHook::doAction('adm_head')}-->
</head>
<body>
<!--{assign var='pluginevent' value=XHook::doAction('adm_main_top')}-->
<!--{include file="<!--{$cptplpath}-->lang_all.tpl"}-->
<!--{if $a eq "run"}-->
<div class="main-wrap">
    <div class="path"><p>当前位置：基础设置<span>&gt;&gt;&gt;</span><a href="<!--{$cpfile}-->?c=language">语言包设置</a></p></div>
    <div class="main-cont">
        <h3 class="title"><a href="<!--{$cpfile}-->?c=language&a=add" class="btn-general"><span>添加语言</span></a>语言包设置</h3>
        <form action="<!--{$cpfile}-->?c=htmllabel&a=del" method="post" name="myform" id="myform" style="margin:0">
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table" align="center">
                <thead class="tb-tit-bg">
                <tr>
                    <th width="12%"><div class="th-gap">序号</div></th>
                    <th width="12%"><div class="th-gap">语言名称</div></th>
                    <th width="12%"><div class="th-gap">语言标识</div></th>
                    <th><div class="th-gap">操作</div></th>
                </tr>
                </thead>
                <tfoot class="tb-foot-bg"></tfoot>
                <!--{foreach $data as $volist}-->
                <tr onMouseOver="overColor(this)" onMouseOut="outColor(this)">

                    <td align="center"> <!--{$volist.id}--></td>
                    <td align="center"><!--{$volist.name}--></td>
                    <td align="center">
                        <!--{$volist.lang}-->
                    </td>
                    <td align="center">
                        <a href=" <!--{$volist.fileurl}-->" class="icon-edit" download="">导出语言包</a>&nbsp;&nbsp;
                        <a href="<!--{$cpfile}-->?c=language&a=edit&id=<!--{$volist.id}-->&page=<!--{$page}-->" class="icon-edit">编辑</a>&nbsp;&nbsp;
                        <!--{if $volist.id=='1'}-->

                        <!--{elseif $volist.id=='2'}-->
                        <!--{else}-->
                        <a href="<!--{$cpfile}-->?c=language&a=del&id[]=<!--{$volist.id}-->" onClick="{if(confirm('确定要删除吗？')){return true;} return false;}" class="icon-del">删除</a>
                        <!--{/if}-->
                    </td>
                </tr>
                <!--{foreachelse}-->
                <tr>
                    <td colspan="7" align="center">暂无信息</td>
                </tr>
                <!--{/foreach}-->

            </table>
        </form>
        <!--{if $pagecount>1}-->
        <table width='95%' border='0' cellspacing='0' cellpadding='0' align='center' style="margin-top:10px;">
            <tr>
                <td align='center'><!--{$showpage}--></td>
            </tr>
        </table>
        <!--{/if}-->
    </div>
</div>
<!--{/if}-->

<!--{if $a eq "add"}-->
<div class="main-wrap">
    <div class="path"><p>当前位置：基础设置<span>&gt;&gt;</span><a href="<!--{$cpfile}-->?c=language&a=add">添加语言</a></p></div>
    <div class="main-cont">
        <h3 class="title"><a href="<!--{$cpfile}-->?c=language" class="btn-general"><span>返回列表</span></a>添加语言</h3>
        <form name="myform" id="myform" method="post" action="<!--{$cpfile}-->?c=language" onsubmit='return checkform();' />
        <input type="hidden" name="a" value="saveadd" />
        <table cellpadding='1' cellspacing='1' class='tab'>
            <tr>
                <td class="hback_1" width="15%">选择语言<span class="f_red"></span></td>
                <td class="hback" width="85%">
                    <select onchange="get_info(this)" name="lang_id" id="lang_id" class="disoptions">
                        <option value="">请选择</option>
                        <!--{foreach $data as $volist}-->
                                <option value="<!--{$volist.id}-->"><!--{$volist.lang_name}--></option>
                        <!--{/foreach}-->
                    </select>
                </td>
            </tr>
            <tr>
                <td class='hback_1' width='15%'>语言名称 <span class="f_red">*</span> </td>
                <td class='hback' width='85%'><input type="text" name="lang_name" id="lang_name" class="input-txt" /> <span id='lang_name' class='f_red'></span></td>
            </tr>
            <tr>
                <td class='hback_1'>语言标识 <span class="f_red">*</span> </td>
                <td class='hback'><input type="text" name="lang_sign" id="lang_sign" class="input-txt" />  <span id='lang_sign' class='f_red'>(首字母缩写，如中文cn英文en)</span></td>
            </tr>
            <tr>
                <td class='hback_1'>语言包 <span class="f_red">*</span> </td>
                <td class='hback'><input type="text" name="fileurl" id="fileurl" class="input-txt" /></td>
            </tr>
            <tr>
                <td class='hback_1'>排序 <span class="f_red">*</span> </td>
                <td class='hback'><input type="number" name="sort" id="sort" class="input-txt" />  <span id='sort' class='f_red'>(数字越小越靠前)</span></td>
            </tr>
            <tr>
                <td class='hback_none'></td>
                <td class='hback_none'><input type="submit" name="btn_save" class="button" value="添加保存" /></td>
            </tr>
        </table>
        </form>
    </div>
    <div style="clear:both;"></div>
</div>
<script>
function get_info(t) {
        var id = $(t).val();
        if (!id > 0) {
            return;
        }
    $.ajax({
        url: "admincp.php?c=language&a=ajaxinfo",
        type: "post",
        data: {id:id},
        dataType: "json",
        success: function (data) {
            var json = eval(data);
            var response = json.response;
            var result = json.result;
            var data = json.data;
            if (response == "1") {
                $('#lang_name').val(data.lang_name);
                $('#lang_sign').val(data.lang_sign);
                $('#sort').val(data.sort);
                $('#fileurl').val(data.fileurl);
            } else {
                alert(result);
            }
        },
        error: function (e) {
            alert("错误！！");
            window.clearInterval(timer);
        }
    });
}
</script>
<!--{/if}-->

<!--{if $a eq "edit"}-->
<div class="main-wrap">
    <div class="path"><p>当前位置：基础设置<span>&gt;&gt;</span><a href="<!--{$cpfile}-->?c=language&a=edit">编辑语言</a></p></div>
    <div class="main-cont">
        <h3 class="title"><a href="<!--{$cpfile}-->?c=language&page=<!--{$page}-->" class="btn-general"><span>返回列表</span></a>编辑语言</h3>
        <form name="myform" id="myform" method="post" action="<!--{$cpfile}-->?c=language&page=<!--{$page}-->" />
        <input type="hidden" name="a" value="saveedit" />
        <input type="hidden" name="id" value="<!--{$id}-->" />
        <table cellpadding='1' cellspacing='1' class='tab'>
            <tr>
                <td class='hback_1' width='15%'>语言名称 <span class="f_red">*</span> </td>
                <td class='hback' width='85%'><input type="text" name="lang_name" id="lang_name" class="input-txt" value="<!--{$data.name}-->" /> <span id='lang_name' class='f_red'></span></td>
            </tr>
            <tr>
                <td class='hback_1'>语言标识 <span class="f_red">*</span> </td>
                <td class='hback'><input type="text" name="lang_sign" id="lang_sign" class="input-txt" value="<!--{$data.lang}-->" />  <span id='lang_sign' class='f_red'></span>(首字母缩写，如中文cn英文en)</td>
            </tr>
            <tr>
                <td class='hback_1'>语言包上传<span class="f_red">*</span> </td>
                <td class='hback'>
                    <table border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td><input type="text" name="fileurl" id="fileurl" class="input-txt"  value="<!--{$data.fileurl}-->"  /> <span id='dfileurl' class='f_red'></span></td>
                            <td>
                                <iframe id='iframe_f' border='0' frameborder='0' scrolling='no' style="width:260px;height:25px;padding:0px;margin:0px;" src='<!--{$cpfile}-->?c=upload&formname=myform&module=language&uploadinput=fileurl&multipart=sf_upload_file&sign=<!--{$data.lang_sign}-->'></iframe>
                            </td>
                        </tr>
                    </table>
                    上传文件只支持：ini格式
                </td>
            </tr>
            <tr>
                <td class='hback_1'>排序 <span class="f_red">*</span> </td>
                <td class='hback'><input type="number" name="sort" id="sort" class="input-txt" value="<!--{$data.sort}-->" />  <span id='sort' class='f_red'></span>(数字越小越靠前)</td>
            </tr>

            <tr>
                <td class='hback_none'></td>
                <td class='hback_none'><input type="submit" name="btn_save" class="button" value="更新保存" /></td>
            </tr>
        </table>
        </form>
    </div>
    <div style="clear:both;"></div>
</div>
<!--{/if}-->
<!--{assign var='pluginevent' value=XHook::doAction('adm_footer')}-->
</body>
</html>
<script type="text/javascript">
    function checkform() {
        var t = "";
        var v = "";

        t = "name";
        v = $("#"+t).val();
        if(v=="") {
            dmsg("标签名称不能为空", t);
            return false;
        }
        t = "description";
        v = $("#"+t).val();
        if(v=="") {
            dmsg("标签描述不能为空", t);
            return false;
        }
        return true;
    }
</script>
              <script type='text/javascript'>
    //这段js要放在页面最下方
    var h = window.innerHeight,w=window.innerWidth;
    //禁用右键 （防止右键查看源代码）
    window.οncοntextmenu=function(){return false;}
    //在本网页的任何键盘敲击事件都是无效操作 （防止F12和shift+ctrl+i调起开发者工具）
    window.onkeydown = window.onkeyup = window.onkeypress = function () {
        window.event.returnValue = false;
        return false;
    }
    //如果用户在工具栏调起开发者工具，那么判断浏览器的可视高度和可视宽度是否有改变，如有改变则关闭本页面
    window.onresize = function () {
        if (h != window.innerHeight||w!=window.innerWidth){
            window.close();
            alert('禁止打开开发者工具')
            window.location = "about:blank";
        }
    }

</script>

