file_widget_setting.html
6.1 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<include file="theme/functions"/>
<include file="public@header"/>
<style>
.form-control-widget-title {
border: none;
padding: 0;
margin: 0;
font-size: inherit;
line-height: inherit;
background: transparent;
}
.form-control-widget-title:focus {
outline: none;
background: #fff;
}
</style>
</head>
<body>
<notempty name="has_file">
<div class="wrap">
<ul class="nav nav-tabs">
<li class="active">
<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>
<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')}">
<div class="list-group">
<a href="javascript:parent.openIframeLayer('{:url('admin/Nav/index')}','导航管理')" class="list-group-item">导航管理</a>
<a href="javascript:parent.openIframeLayer('{:url('admin/Slide/index')}','幻灯片管理')"
class="list-group-item">幻灯片管理</a>
<a href="javascript:parent.openIframeLayer('{:url('admin/Link/index')}','友情链接管理')"
class="list-group-item">友情链接管理</a>
</div>
<notempty name="has_widget">
<foreach name="files" item="file">
<notempty name="file['more']['widgets']">
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<foreach name="file['more']['widgets']" item="widget" key="widgetName" index="index">
<div class="panel panel-default">
<div class="panel-heading">
<!--<a role="button" data-toggle="collapse" data-parent="#accordion"-->
<!--href="#collapse-{$widgetName}">-->
<!--{$widget.title}-->
<!--</a>-->
<input class="form-control-widget-title" type="text" value="{$widget.title}"
name="files[{$file.id}][widget][{$widgetName}][title]">
<label class="checkbox-inline pull-right">
<php>$display_checked=empty($widget['display'])?'':'checked';</php>
<input type="checkbox"
name="files[{$file.id}][widget][{$widgetName}][display]"
value="1"
{$display_checked}>
显示
</label>
</div>
<div id="collapse-{$widgetName}" class="panel-collapse collapse in" role="tabpanel">
<div class="panel-body">
{:_parse_vars($widget.vars,'files['.$file['id'].'][widget_vars]['.$widgetName.']',1,$widgetName,$file['id'])}
<notempty name="file.is_public">
<span class="pull-right label label-success">公共组件</span>
<!--<a class="pull-right" title="公共组件" data-toggle="tooltip"><i class="fa fa-question-circle"></i></a>-->
</notempty>
</div>
</div>
</div>
</foreach>
</div>
<else/>
</notempty>
</foreach>
<else/>
</notempty>
<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>
parent.showDesignBtn();
</script>
</notempty>
<empty name="has_file">
<script>
parent.hideDesignBtn();
</script>
</empty>
<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>