file_public_var_setting.html
2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<include file="theme/functions"/>
<include file="public@header"/>
</head>
<body>
<div class="wrap">
<ul class="nav nav-tabs">
<li>
<a href="{:url('theme/fileSetting',['file_id'=>$file_id,'tab'=>'widget'])}">
组件
</a>
</li>
<notempty name="file.more.vars">
<li>
<a href="{:url('theme/fileSetting',['file_id'=>$file_id,'tab'=>'var'])}">
设置
</a>
</li>
</notempty>
<notempty name="has_public_var">
<li class="active">
<a href="{:url('theme/fileSetting',['file_id'=>$file_id,'tab'=>'public_var'])}">
全局设置
</a>
</li>
</notempty>
</ul>
<form method="post" class="js-ajax-form margin-top-20" action="{:url('theme/settingPost')}">
<foreach name="files" item="file">
<if condition="$file.id neq $file_id">
<notempty name="file['more']['vars']">
{:_parse_vars($file.more.vars,'files['.$file['id'].'][vars]',1,'',$file['id'])}
<else/>
</notempty>
</if>
</foreach>
<div class="form-group text-center" style="display: none;">
<!--<input type="hidden" name="id" value="{$file.id}">-->
<button type="submit" class="btn btn-primary js-ajax-submit" id="submit-btn" data-success="successCallback">
{:lang('SAVE')}
</button>
</div>
</form>
</div>
<include file="theme/scripts"/>
<script>
function successCallback(data, statusText, xhr, $form) {
function _refresh() {
if (data.url) {
//返回带跳转地址
window.location.href = data.url;
} else {
if (data.code == 1) {
//刷新当前页
reloadPage(window);
}
}
}
noty({
text: data.msg,
type: 'success',
layout: 'topCenter',
modal: true,
// animation: {
// open: 'animated bounceInDown', // Animate.css class names
// close: 'animated bounceOutUp', // Animate.css class names
// },
timeout: 800,
callback: {
afterClose: function () {
if (parent.afterSaveSetting) {
parent.afterSaveSetting();
}
_refresh();
}
}
});
}
</script>
</body>
</html>