123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- {include file="public/layout" /}
- <body class="bodystyle" style="overflow-y: scroll;min-width:auto;">
- <div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
- <div id="append_parent"></div>
- <div id="ajaxwaitid"></div>
- <div class="page min-hg-c-10">
- <form class="form-horizontal" id="post_form" action="{:url('Language/add')}" method="post">
- <div class="ncap-form-default">
- <dl class="row">
- <dt class="tit">
- <label for="title"><em>*</em>选择语言</label>
- </dt>
- <dd class="opt" style="width: auto;">
- <select name="mark" id="languagemark">
- <option value="">请选择语言…</option>
- {volist name="$languagemark" id="vo"}
- <option value="{$vo.mark}" data-title="{$vo.title}">{$vo.cn_title}</option>
- {/volist}
- </select>
- <span class="err"></span>
- <p class="notic"></p>
- </dd>
- </dl>
- <dl class="row">
- <dt class="tit">
- <label for="title"><em>*</em>语言名称</label>
- </dt>
- <dd class="opt" style="width: auto;">
- <input type="text" name="title" id="title" class="w200" autocomplete="off">
- <span class="err"></span>
- <p class="notic">在前台显示</p>
- </dd>
- </dl>
- <dl class="row">
- <dt class="tit">
- <label>语言状态</label>
- </dt>
- <dd class="opt" style="width: auto;">
- <label class="curpoin"><input type="radio" name="status" value="1" checked="checked"/>开启</label>
- <label class="curpoin"><input type="radio" name="status" value="0"/>关闭</label>
- </dd>
- </dl>
- <dl class="row">
- <dt class="tit">
- <label>前台默认语言</label>
- </dt>
- <dd class="opt" style="width: auto;">
- <label class="curpoin"><input type="radio" name="is_home_default" value="1"/>是</label>
- <label class="curpoin"><input type="radio" name="is_home_default" value="0" checked="checked"/>否</label>
- </dd>
- </dl>
- <dl class="row">
- <dt class="tit">
- <label>新窗口打开</label>
- </dt>
- <dd class="opt" style="width: auto;">
- <label class="curpoin"><input type="radio" name="target" value="1"/>是</label>
- <label class="curpoin"><input type="radio" name="target" value="0" checked="checked"/>否</label>
- </dd>
- </dl>
- <!-- <dl class="row">
- <dt class="tit">
- <label for="url">单独域名</label>
- </dt>
- <dd class="opt" style="width: auto;">
- <input type="text" name="url" value="" id="url" class="input-txt">
- <span class="err"></span>
- <p class=""><font color="red">务必包含http://或https://,访问该域名程序将自动跳转到此语言(需先做好域名解析绑定),或者做外部链接用。</font></p>
- </dd>
- </dl> -->
- <dl class="row">
- <dt class="tit">
- <label for="sort_order">排序</label>
- </dt>
- <dd class="opt" style="width: auto;">
- <input type="text" name="sort_order" value="100" id="sort_order" class="w200" autocomplete="off">
- <span class="err"></span>
- <p class="notic">越小越靠前</p>
- </dd>
- </dl>
- <div class="bot mt30">
- <input type="hidden" name="copy_lang" value="{$main_lang}" />
- <a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
- </div>
- </div>
- </form>
- </div>
- <script type="text/javascript">
-
- var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- $(function(){
- /*选择多语言*/
- $('#languagemark').change(function(){
- var title = $(this).find("option:selected").data('title');
- $('input[name=title]').val(title);
- });
- /*--end*/
- });
-
- // 判断输入框是否为空
- function checkForm(){
- if($('#languagemark').val() == ''){
- showErrorMsg('请选择语言!');
- $('#languagemark').focus();
- return false;
- }
- if($('input[name=title]').val() == ''){
- showErrorMsg('语言名称不能为空!');
- $('input[name=title]').focus();
- return false;
- }
- layer_loading('正在处理');
- $.ajax({
- type : 'post',
- url : "{:url('Language/add', ['_ajax'=>1])}",
- data : $('#post_form').serialize(),
- dataType : 'json',
- success : function(res){
- layer.closeAll();
- if(res.code == 1){
- var _parent = parent;
- // _parent.layer.close(parentObj);
- _parent.window.location.href = res.url;
- // _parent.layer.msg(res.msg, {shade: layer_shade, time: 15000000});
- // $.ajax({
- // type : 'get',
- // url : res.url,
- // data : {},
- // dataType : 'json',
- // success : function(res1){
- // layer.closeAll();
- // if(res1.code == 1){
- // _parent.layer.msg(res1.msg, {shade: layer_shade, time: 1500}, function(){
- // _parent.window.location.href = res1.url;
- // });
- // }else{
- // showErrorMsg(res1.msg);
- // }
- // },
- // error: function(e){
- // layer.closeAll();
- // showErrorAlert(e.responseText);
- // }
- // });
- }else{
- showErrorMsg(res.msg);
- }
- },
- error: function(e){
- layer.closeAll();
- showErrorAlert(e.responseText);
- }
- });
- }
- </script>
- {include file="public/footer" /}
|