skinList.jsp
12.5 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="weaver.hrm.HrmUserVarify"%>
<%@ page import="weaver.hrm.User"%>
<%@ page import="weaver.general.Util" %>
<%@ page import="weaver.systeminfo.setting.*" %>
<%@ page import="weaver.systeminfo.SystemEnv"%>
<%@page import="weaver.general.GCONST"%>
<%@ include file="/wui/common/page/initWui.jsp" %>
<jsp:useBean id="rsExtend" class="weaver.conn.RecordSet" scope="page" />
<%
//Map skinConfig = getProperties(this.getServletConfig().getServletContext().getRealPath("/") + "wui/skins/default/config.properties");
/*用户验证*/
User user = HrmUserVarify.getUser (request , response) ;
if(user==null) {
response.sendRedirect("/login/Login.jsp");
return;
}
//当前主题
String curTheme = "";
//当前皮肤
String cskin = "";
curTheme = getCurrWuiConfig(session, user, "theme");
cskin = getCurrWuiConfig(session, user, "skin");
String ely6flg = "";
if ("ecology6".equals(curTheme.toLowerCase())) {
curTheme = "ecology7";
ely6flg = "ecology6";
}
List syskinsConfig = (List)application.getAttribute("APPLICATION_SYSTEM_SKINS_CONFIG");
if (syskinsConfig == null || syskinsConfig.isEmpty()) {
String projectPath = this.getServletConfig().getServletContext().getRealPath("/");
if (projectPath.lastIndexOf("/") != (projectPath.length() - 1) && projectPath.lastIndexOf("\\") != (projectPath.length() - 1)) {
projectPath += "/";
}
syskinsConfig = getAllSkinInfo(projectPath + "wui/theme/ecology7/skins/");
application.setAttribute("APPLICATION_SYSTEM_SKINS_CONFIG", syskinsConfig);
}
%>
<%=curTheme+cskin %>
<%
String theme = "";
String skin = "";
String logoTop = "";
String logoBottom = "";
int isopen = 0;
int islock = 0;
String lockProj = "";
weaver.systeminfo.template.UserTemplate userTemplate = new weaver.systeminfo.template.UserTemplate();
userTemplate.getTemplateByUID(user.getUID(),user.getUserSubCompany1());
int extendtempletvalueid = userTemplate.getExtendtempletvalueid();
out.println(extendtempletvalueid);
String sqltemplateid1 = "(select id from extandHpTheme where id=" + extendtempletvalueid + ")";
if(userTemplate.getTemplateId()==1&&user.getUserSubCompany1()!=0){
sqltemplateid1 = "(select max(id) from extandHpTheme where templateId=1 and subcompanyid = 1)";
}
out.println("select * from extandHpThemeItem where extandHpThemeId="+sqltemplateid1+" and isopen=1");
rsExtend.executeSql("select * from extandHpThemeItem where extandHpThemeId="+sqltemplateid1+" and isopen=1");
Map tepDbThemekv = new HashMap();
%>
<%!
private List getAllSkinInfo(String path) {
List syskinsConfig = null;
if (path == null || "".equals(path)) {
return null;
}
File parentFile = new File(path);
if (!parentFile.exists() || !parentFile.isDirectory()) {
return null;
}
syskinsConfig = new ArrayList();
File[] files = parentFile.listFiles();
for (int i = 0; i < files.length; i++) {
File item = files[i];
if (item.isDirectory()) {
syskinsConfig.add(getProperties(path + item.getName() + "/config.properties"));
}
}
return syskinsConfig;
}
private Map getProperties(String propertyPath) {
Map skinConfig = new HashMap();
Properties config = new Properties();
try {
config.load(new FileInputStream(propertyPath));
} catch (IOException e) {
e.printStackTrace();
return skinConfig;
}
Enumeration enumeration = config.propertyNames();
while (enumeration.hasMoreElements()) {
String key = (String)enumeration.nextElement();
String value = config.getProperty(key, "");
skinConfig.put(key, value);
}
return skinConfig;
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- jquery1.4 -->
<script type="text/javascript" src="/wui/common/jquery/jquery_wev8.js"></script>
<title></title>
<script type="text/javascript">
$(document).ready(function(){
//皮肤项缩略效果
$(".sltFlgClass").hover(function() {
$(this).removeClass("skinItemThumbnailBg");
$(this).addClass("skinItemThumbnailSltBg");
}, function () {
$(this).removeClass("skinItemThumbnailSltBg");
$(this).addClass("skinItemThumbnailBg");
});
$(".moreFlgClass").hover(function() {
$(this).css("background", "url(/wui/theme/ecology7/page/images/skin/moreSlt_wev8.png) no-repeat");
}, function () {
$(this).css("background", "url(/wui/theme/ecology7/page/images/skin/more_wev8.png) no-repeat");
});
});
function changeSysSkin(clickEle) {
if (clickEle != null && clickEle != undefined) {
var skinFolder = $(clickEle).attr("_skin");
var themeName = $(clickEle).attr("_theme");
alert(skinFolder+"$"+themeName);
if (skinFolder != null && skinFolder != undefined && skinFolder != "") {
if (window.confirm("<%=SystemEnv.getHtmlLabelName(31564,user.getLanguage())%>")) {
parent.window.location.href = "/wui/theme/ecology7/page/skinSetting.jsp?skin=" + skinFolder + "&theme=" + themeName;
parentDialog.close();
return;
}
}
}
}
</script>
<style type="text/css">
/* 皮肤Block */
.skinListBlock {
width:420px;
}
/* 皮肤单项Block */
.skinItemBlock {
width:130px;height:110px;margin-left:5px;margin-right:5px;margin-bottom:10px;float:left;
}
/* 皮肤单项缩略图Block */
.skinItemThumbnailBlock {
height:80px;width:130px;margin-top:5px;margin-bottom:0px;border:none;
}
/* 皮肤单项缩略图 */
.skinItemThumbnail {
height:68px;width:118px;border:none;margin:6px;
}
/* 皮肤单项名称Block */
.skinItemNameBlock {
height:18px;width:100%;text-align:center;overflow:hidden;font-size:12px;margin-top:0px;color:#3399cc;
}
.skinItemThumbnailBg {
background:url(/wui/theme/ecology7/page/images/skin/previewBorder_wev8.png) no-repeat;
}
.skinItemThumbnailSltBg {
background:url(/wui/theme/ecology7/page/images/skin/previewSltBorder_wev8.png) no-repeat;
}
</style>
</head>
<script type="text/javascript">
document.oncontextmenu=function(){return false;}
</script>
<body style="font-family:微软雅黑;font-size:12px;" onclick="">
<table cellpadding="0" cellspacing="0" width="470px">
<tr>
<td align="center" width="100%">
<div class="skinListBlock">
<span style="margin-left:10px;width:100%;display:block;text-align:left;color:#3399cc;font-size:12px;">
<span style="font-size:12px;"><%=SystemEnv.getHtmlLabelName(31565,user.getLanguage())%></span>
</span>
<span style="margin-left:10px;width:420px;;height:3px;overflow:hidden;display:block;margin-bottom:10px;margin-top:5px;border-top:1px dotted #bfbfbf;"></span>
<table cellpadding="0px" cellspacing="0px" width="100%">
<tr align="center">
<td>
<%
int trflag = 0;
for (int i=0; rsExtend.next(); i++) {
//至多显示5个
/*if (i >= 5) {
break;
}*/
//去除大于5的判断
theme = Util.null2String(rsExtend.getString("theme"));
skin = Util.null2String(rsExtend.getString("skin"));
String projectPath = this.getServletConfig().getServletContext().getRealPath("/");
if (projectPath.lastIndexOf("/") != (projectPath.length() - 1) && projectPath.lastIndexOf("\\") != (projectPath.length() - 1)) {
projectPath += "/";
}
Map skinConfig = getProperties(projectPath + "wui/theme/" + theme + "/skins/" + skin + "/config.properties");
String id = (String)skinConfig.get("id");
String name = (String)skinConfig.get("name");
String description = (String)skinConfig.get("description");
String date = (String)skinConfig.get("date");
String author = (String)skinConfig.get("author");
String isBuy = (String)skinConfig.get("isBuy");
String preview = (String)skinConfig.get("preview");
String home = (String)skinConfig.get("home");
%>
<div class="skinItemBlock">
<div class="skinItemThumbnailBlock skinItemThumbnailBg sltFlgClass" _theme="<%=theme %>" _skin="<%=skin %>" <%=(cskin.equals(skin) && curTheme.equals(theme)) ? "" : "onclick=\"javascript:changeSysSkin(this);\" style='cursor:hand;'" %>>
<img src="/wui/theme/<%=theme%>/skins/<%=skin%>/preview_wev8.png" class="skinItemThumbnail" title="<%=theme %>-<%=name %>"/>
</div>
<div class="skinItemNameBlock"><%=theme %>-<%=name %></div>
</div>
<%
}
String isOpenSoftAndSiteTempate=GCONST.getsystemThemeTemplate(); //是否启用软件模板和网站模板 0:不启用 其他:启用
if(!isOpenSoftAndSiteTempate.equals("0")&&false){
%>
<div class="skinItemBlock">
<div class="skinItemThumbnailBlock skinItemThumbnailBg sltFlgClass" _theme="ecology6" _skin="default" <%=(cskin.equals("default") && curTheme.equals("ecology6")) ? "" : "onclick=\"javascript:changeSysSkin(this);\" style='cursor:hand;'" %>>
<img src="/wui/theme/ecology7/page/images/skin/ecology6_wev8.gif" class="skinItemThumbnail" title="ecology6<%=SystemEnv.getHtmlLabelName(27889,user.getLanguage())%>"/>
</div>
<div class="skinItemNameBlock">ecology6<%=SystemEnv.getHtmlLabelName(27889,user.getLanguage())%></div>
</div>
<div class="skinItemBlock">
<div class="skinItemThumbnailBlock skinItemThumbnailBg sltFlgClass" onclick="javascript:parent.location.href='/portal/plugin/homepage/webcustom/index.jsp?templateId=1';parentDialog.close();" style='cursor:hand;'>
<img src="/wui/theme/ecology7/page/images/skin/ecologyInt_wev8.png" class="skinItemThumbnail" title="<%=SystemEnv.getHtmlLabelName(27890,user.getLanguage())%>"/>
</div>
<div class="skinItemNameBlock"><%=SystemEnv.getHtmlLabelName(27890,user.getLanguage())%></div>
</div>
<%} %>
<div class="skinItemBlock">
<div class="skinItemThumbnailBlock skinItemThumbnailBg sltFlgClass" _theme="ecology7" _skin="default" onclick="javascript:changeSysSkin(this)" style='cursor:hand;'>
<img src="/wui/theme/ecology7/skins/default/preview_wev8.png" class="skinItemThumbnail" title="ecology7-<%=SystemEnv.getHtmlLabelName(84261,user.getLanguage())%>"/>
</div>
<div class="skinItemNameBlock">ecology7-<%=SystemEnv.getHtmlLabelName(84261,user.getLanguage())%></div>
</div>
<div class="skinItemBlock">
<div class="skinItemThumbnailBlock skinItemThumbnailBg sltFlgClass" _theme="ecology7" _skin="green" onclick="javascript:changeSysSkin(this)" style='cursor:hand;'>
<img src="/wui/theme/ecology7/skins/green/preview_wev8.png" class="skinItemThumbnail" title="ecology7-<%=SystemEnv.getHtmlLabelName(84263,user.getLanguage())%>"/>
</div>
<div class="skinItemNameBlock">ecology7-<%=SystemEnv.getHtmlLabelName(84263,user.getLanguage())%></div>
</div>
<div class="skinItemBlock">
<div class="skinItemThumbnailBlock skinItemThumbnailBg sltFlgClass" _theme="ecology7" _skin="red" onclick="javascript:changeSysSkin(this)" style='cursor:hand;'>
<img src="/wui/theme/ecology7/skins/red/preview_wev8.png" class="skinItemThumbnail" title="ecology7-<%=SystemEnv.getHtmlLabelName(84265,user.getLanguage())%>"/>
</div>
<div class="skinItemNameBlock">ecology7-<%=SystemEnv.getHtmlLabelName(84265,user.getLanguage())%></div>
</div>
<div class="skinItemBlock">
<div class="skinItemThumbnailBlock skinItemThumbnailBg sltFlgClass" _theme="ecologyBasic" _skin="default" onclick="javascript:changeSysSkin(this)" style='cursor:hand;'>
<img src="/wui/theme/ecologyBasic/skins/default/preview_wev8.png" class="skinItemThumbnail" title="ecologyBasic-<%=SystemEnv.getHtmlLabelName(84261,user.getLanguage())%>"/>
</div>
<div class="skinItemNameBlock">ecologyBasic-<%=SystemEnv.getHtmlLabelName(84261,user.getLanguage())%></div>
</div>
<div class="skinItemBlock">
<div class="skinItemThumbnailBlock moreFlgClass" style="background:url(/wui/theme/ecology7/page/images/skin/more_wev8.png) no-repeat;cursor:hand;" title="<%=SystemEnv.getHtmlLabelName(26277 ,user.getLanguage())%>" onclick="javascript:alert('<%=SystemEnv.getHtmlLabelName(31566 ,user.getLanguage())%>');">
</div>
<div class="skinItemNameBlock" style="margin-top:6px;"><%=SystemEnv.getHtmlLabelName(26277 ,user.getLanguage())%></div>
</div>
</td>
</table>
<span style="margin-left:10px;width:420px;;height:3px;overflow:hidden;display:block;margin-top:20px;margin-bottom:5px;border-top:1px dotted #bfbfbf;"></span>
<!--
<span style="margin-left:10px;width:100%;display:block;text-align:left;color:#3399cc;font-size:12px;">
<span style="font-size:13px;font-weight:bold;"><%=SystemEnv.getHtmlLabelName(26279 ,user.getLanguage())%>:</span>
更多主题请访问
<a href="#" onclick="javascript:alert('对不起,泛微官方社区正在建设中...');">
泛微官方社区
</a>
</span>
-->
</div>
</td>
</tr>
</table>
</body>
</html>