skinList.jsp
17.7 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
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
<%@ 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="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="rsExtend" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="PortalDataSource" class="weaver.admincenter.homepage.PortalDataSource" 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 theme = "";
String skin = "";
String logoTop = "";
String logoBottom = "";
int isopen = 0;
int islock = 0;
String lockProj = "";
%>
<%!
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(){
//皮肤项缩略效果
$(".skinItemThumbnailBlock").find("span:first").css("width","121px")
$(".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/ecology8/page/images/skin/moreSlt_wev8.png) no-repeat");
}, function () {
$(this).css("background", "url(/wui/theme/ecology8/page/images/skin/more_wev8.png) no-repeat");
});
$(".tabitem").bind("click",function(){
$(".over").removeClass("over");
$(this).addClass("over")
var theme = $(this).attr("theme");
if(theme=="ecology7"){
$("#ecology9").hide();
$("#ecology8").hide();
$("#ecology7").show();
}else if(theme=="ecology8"){
$("#ecology9").hide();
$("#ecology8").show();
$("#ecology7").hide();
}else if(theme=="ecology9"){
$("#ecology9").show();
$("#ecology8").hide();
$("#ecology7").hide();
}
})
$(".tabitem[theme='<%= "ecology81".equals(curTheme) ? "ecology9" : curTheme%>']").trigger("click");
if ('<%=curTheme%>' == 'ecology9') {
selectSysSkin90();
}
});
function changeSysSkin(clickEle) {
if (clickEle != null && clickEle != undefined) {
var skinFolder = $(clickEle).attr("_skin");
var themeName = $(clickEle).attr("_theme");
var cssid = $(clickEle).attr("_css");
var templateId = $(clickEle).attr("_templateId");
if (skinFolder != null && skinFolder != undefined && skinFolder != "") {
if (window.confirm("<%=SystemEnv.getHtmlLabelName(31564,user.getLanguage()) %>")) {
var css="left";
if(themeName=="ecology8" || themeName=="ecology81"){
if(parseInt(cssid)-1>0){
css=css+(parseInt(cssid)-1);
}
//alert("/wui/theme/ecology8/page/skinColorDo.jsp?from=theme&css="+css+"&cssid="+cssid)
jQuery.post("/wui/theme/ecology8/page/skinColorDo.jsp?from=theme&css="+css+"&cssid="+cssid,null,function(){});
}
parent.parent.window.location.href = "/wui/theme/ecology8/page/skinSetting.jsp?skin=" + skinFolder + "&theme=" + themeName+ "&templateId=" + templateId+ "&cssid=" + cssid;
parentDialog.close();
return;
}
}
}
}
function changeSysSkin80(clickEle) {
var skinFolder = $(clickEle).attr("_skin");
if(skinFolder=="default"){
jQuery.post("/wui/theme/ecology8/page/skinColorDo.jsp?css=left",null,function(){
$("#portalCss",top.document).attr("href","/wui/theme/ecology8/skins/default/page/left_wev8.css")
});
}
}
function changeSysSkin90(clickEle) {
var type = $(clickEle).attr("_type");
var templateid = $(clickEle).attr("_templateId");
var templatetype = $(clickEle).attr("_theme");
var skin = $(clickEle).attr("_skin");
var id = $(clickEle).attr("_id");
if (window.confirm("<%=SystemEnv.getHtmlLabelName(31564,user.getLanguage()) %>")) {
jQuery.post("/api/portal/themeCenter/setMyTheme",{
type:type,
templateid:templateid,
templatetype:templatetype,
skin:skin,
id:id
},function(){
parent.parent.window.location.href = "/wui/main.jsp";
});
}
}
function selectSysSkin90() {
var colorType = localStorage.getItem('theme-colorType') || '1';
$(".skinItemBlock .skinItemThumbnailBlock[_colorType='"+colorType+"']").append('<img src="/wui/theme/ecology9/image/colors/selected.png" class="skinItemSelected" />');
}
</script>
<style type="text/css">
/* 皮肤Block */
.skinListBlock {
width:560px;
margin-left: 15px;
}
/* 皮肤单项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/ecology8/page/images/skin/previewBorder_wev8.png) no-repeat;
}
.skinItemThumbnailSltBg {
background:url(/wui/theme/ecology8/page/images/skin/previewSltBorder_wev8.png) no-repeat;
}
.tab2{
height: 35px;
width: 100%;
border-bottom: 1px solid #dedede;
}
.tabitem{
font-size:12px;
width: 100px;
float: left;
height: 33px;
line-height: 33px;
cursor: pointer;
padding-left:5px;
padding-right:5px;
}
.tab2 .over{
border-bottom: 2px solid #02c63a;
color:008ff3;
}
.skinItemSelected {
position: absolute;
width: 21px;
height: 21px;
top: 0;
right: 0;
margin: 6px;
}
</style>
</head>
<script type="text/javascript">
document.oncontextmenu=function(){return false;}
</script>
<body style="font-family:微软雅黑;font-size:12px;" onclick="">
<table id="topTitle" cellpadding="0" cellspacing="0" width="100%">
</table>
<table cellpadding="0" cellspacing="0" width="470px">
<tr>
<td align="center" width="100%">
<div class="skinListBlock">
<span style="display:none; margin-left:10px;width:100%;text-align:left;color:#3399cc;font-size:12px;">
<span style="font-size:12px;"><%=SystemEnv.getHtmlLabelName(84134,user.getLanguage()) %></span>
</span>
<div class="tab2">
<div class="tabitem over" theme="ecology7">
ecology7 <%=SystemEnv.getHtmlLabelName(25025,user.getLanguage()) %>
</div>
<div class="tabitem" theme="ecology8">
ecology8 <%=SystemEnv.getHtmlLabelName(25025,user.getLanguage()) %>
</div>
<div class="tabitem" theme="ecology9">
ecology9 <%=SystemEnv.getHtmlLabelName(25025,user.getLanguage()) %>
</div>
</div>
<span style="margin-left:10px;width:450px;;height:3px;overflow:hidden;display:none;margin-bottom:10px;margin-top:5px;border-top:1px dotted #bfbfbf;"></span>
<table cellpadding="0px" cellspacing="0px" width="100%">
<tr align="center">
<td>
<div id="ecology7">
<%
String srtSql="";
srtSql = "select * from SystemTemplate WHERE companyId = "+user.getUserSubCompany1()+" AND isOpen =1 and templatetype<>'ecology8' and templatetype<>'ecology81' and templatetype<>'ecology9' and templatetype<>'custom' order by templatetype asc, skin asc";
rsExtend.execute(srtSql);
if(rsExtend.getCounts()==0){
srtSql = "select * from SystemTemplate WHERE companyId = 0 AND isOpen =1 and templatetype<>'ecology8' and templatetype<>'ecology81' and templatetype<>'ecology9' and templatetype<>'custom' order by templatetype asc, skin asc";
rsExtend.execute(srtSql);
}
int trflag = 0;
String temp="";
String templatetype="";
String templateId ="";
for (int i=0; rsExtend.next(); i++) {
String type = Util.null2String(rsExtend.getString("templatetype"));
skin = Util.null2String(rsExtend.getString("skin"));
templateId = Util.null2String(rsExtend.getString("id"));
if(type.equals("")){
templatetype = "ecologyBasic";
skin = "default";
}else{
templatetype = type;
}
String projectPath = this.getServletConfig().getServletContext().getRealPath("/");
if (projectPath.lastIndexOf("/") != (projectPath.length() - 1) && projectPath.lastIndexOf("\\") != (projectPath.length() - 1)) {
projectPath += "/";
}
theme = templatetype;
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 %>" _templateId="<%=templateId %>" <%=(cskin.equals(skin) && curTheme.equals(theme)) ? "" : "onclick=\"javascript:changeSysSkin(this);\" style='cursor:pointer;'" %>>
<img src="/wui/theme/<%=theme%>/skins/<%=skin%>/preview_wev8.png" class="skinItemThumbnail" title="<%=theme %>-<%=name %>"/>
</div>
<div class="skinItemNameBlock"><%=theme %>-<%=name %></div>
</div>
<%
}
%>
</div>
<%
srtSql = "select * from SystemTemplate WHERE companyId = "+user.getUserSubCompany1()+" AND isOpen =1 and templatetype='ecology8' order by templatetype asc, skin asc";
rsExtend.execute(srtSql);
if(rsExtend.getCounts()==0){
srtSql = "select * from SystemTemplate WHERE companyId = 0 AND isOpen =1 and templatetype='ecology8' order by templatetype asc, skin asc";
rsExtend.execute(srtSql);
}
%>
<div id="ecology8">
<% for (int i=0; rsExtend.next(); i++) {
skin = Util.null2String(rsExtend.getString("skin"));
templateId = Util.null2String(rsExtend.getString("id"));
rs.execute("select * from ecology8theme where id="+skin);
if(rs.next()){
%>
<div class="skinItemBlock">
<div class="skinItemThumbnailBlock skinItemThumbnailBg sltFlgClass" _theme="ecology8" _css="<%=rs.getString("id") %>" _skin="default" _templateId="<%=templateId %>" onclick="javascript:changeSysSkin(this)" style='cursor:pointer;position: relative;' title="ecology8-<%=rs.getString("name") %>">
<%
out.println(PortalDataSource.getDiv(rs));
%>
</div>
<div class="skinItemNameBlock">ecology8-<%=rs.getString("name") %></div>
</div>
<%
}
}
%>
</div>
<div id="ecology9">
<div class="skinItemBlock">
<div class="skinItemThumbnailBlock skinItemThumbnailBg sltFlgClass" _type="color" _theme="ecology9" _skin="1" _id="1" _templateId="1"
onclick="javascript:changeSysSkin90(this)" style='cursor:pointer;position: relative;' title="东方夜韵">
<img src="/wui/theme/ecology9/image/colors/1.png" class="skinItemThumbnail" />
</div>
<div class="skinItemNameBlock">东方夜韵</div>
</div>
<div class="skinItemBlock">
<div class="skinItemThumbnailBlock skinItemThumbnailBg sltFlgClass" _type="color" _theme="ecology9" _skin="2" _id="2" _templateId="1"
onclick="javascript:changeSysSkin90(this)" style='cursor:pointer;position: relative;' title="蓝色光年">
<img src="/wui/theme/ecology9/image/colors/2.png" class="skinItemThumbnail" />
</div>
<div class="skinItemNameBlock">蓝色光年</div>
</div>
<div class="skinItemBlock">
<div class="skinItemThumbnailBlock skinItemThumbnailBg sltFlgClass" _type="color" _theme="ecology9" _skin="3" _id="3" _templateId="1"
onclick="javascript:changeSysSkin90(this)" style='cursor:pointer;position: relative;' title="松林密境">
<img src="/wui/theme/ecology9/image/colors/3.png" class="skinItemThumbnail" />
</div>
<div class="skinItemNameBlock">松林密境</div>
</div>
<div class="skinItemBlock">
<div class="skinItemThumbnailBlock skinItemThumbnailBg sltFlgClass" _type="color" _theme="ecology9" _skin="4" _id="4" _templateId="1"
onclick="javascript:changeSysSkin90(this)" style='cursor:pointer;position: relative;' title="激情岁月">
<img src="/wui/theme/ecology9/image/colors/4.png" class="skinItemThumbnail" />
</div>
<div class="skinItemNameBlock">激情岁月</div>
</div>
<div class="skinItemBlock">
<div class="skinItemThumbnailBlock skinItemThumbnailBg sltFlgClass" _type="color" _theme="ecology9" _skin="5" _id="5" _templateId="1"
onclick="javascript:changeSysSkin90(this)" style='cursor:pointer;position: relative;' title="梦幻丁香">
<img src="/wui/theme/ecology9/image/colors/5.png" class="skinItemThumbnail" />
</div>
<div class="skinItemNameBlock">梦幻丁香</div>
</div>
<div class="skinItemBlock">
<div class="skinItemThumbnailBlock skinItemThumbnailBg sltFlgClass" _type="color" _theme="ecology9" _skin="6" _id="6" _templateId="1"
onclick="javascript:changeSysSkin90(this)" style='cursor:pointer;position: relative;' title="寂寞清秋">
<img src="/wui/theme/ecology9/image/colors/6.png" class="skinItemThumbnail" />
</div>
<div class="skinItemNameBlock">寂寞清秋</div>
</div>
<div class="skinItemBlock">
<div class="skinItemThumbnailBlock skinItemThumbnailBg sltFlgClass" _type="color" _theme="ecology9" _skin="7" _id="7" _templateId="1"
onclick="javascript:changeSysSkin90(this)" style='cursor:pointer;position: relative;' title="苍茫穹顶">
<img src="/wui/theme/ecology9/image/colors/7.png" class="skinItemThumbnail" />
</div>
<div class="skinItemNameBlock">苍茫穹顶</div>
</div>
<div class="skinItemBlock">
<div class="skinItemThumbnailBlock skinItemThumbnailBg sltFlgClass" _type="color" _theme="ecology9" _skin="8" _id="8" _templateId="1"
onclick="javascript:changeSysSkin90(this)" style='cursor:pointer;position: relative;' title="鲜橙飘香">
<img src="/wui/theme/ecology9/image/colors/8.png" class="skinItemThumbnail" />
</div>
<div class="skinItemNameBlock">鲜橙飘香</div>
</div>
<div class="skinItemBlock">
<div class="skinItemThumbnailBlock skinItemThumbnailBg sltFlgClass" _type="color" _theme="ecology9" _skin="9" _id="9" _templateId="1"
onclick="javascript:changeSysSkin90(this)" style='cursor:pointer;position: relative;' title="枯木逢春">
<img src="/wui/theme/ecology9/image/colors/9.png" class="skinItemThumbnail" />
</div>
<div class="skinItemNameBlock">枯木逢春</div>
</div>
<div class="skinItemBlock">
<div class="skinItemThumbnailBlock skinItemThumbnailBg sltFlgClass" _type="color" _theme="ecology9" _skin="10" _id="10" _templateId="1"
onclick="javascript:changeSysSkin90(this)" style='cursor:pointer;position: relative;' title="十里桃花">
<img src="/wui/theme/ecology9/image/colors/10.png" class="skinItemThumbnail" />
</div>
<div class="skinItemNameBlock">十里桃花</div>
</div>
<div class="skinItemBlock">
<div class="skinItemThumbnailBlock skinItemThumbnailBg sltFlgClass" _type="color" _theme="ecology9" _skin="11" _id="11" _templateId="1"
onclick="javascript:changeSysSkin90(this)" style='cursor:pointer;position: relative;' title="深谷清泉">
<img src="/wui/theme/ecology9/image/colors/11.png" class="skinItemThumbnail" />
</div>
<div class="skinItemNameBlock">深谷清泉</div>
</div>
<div class="skinItemBlock">
<div class="skinItemThumbnailBlock skinItemThumbnailBg sltFlgClass" _type="color" _theme="ecology9" _skin="12" _id="12" _templateId="1"
onclick="javascript:changeSysSkin90(this)" style='cursor:pointer;position: relative;' title="红色恋人">
<img src="/wui/theme/ecology9/image/colors/12.png" class="skinItemThumbnail" />
</div>
<div class="skinItemNameBlock">红色恋人</div>
</div>
</div>
</td>
</tr>
</table>
<span style="margin-left:10px;width:420px;;height:3px;overflow:hidden;display:none;margin-top:20px;margin-bottom:5px;border-top:1px dotted #bfbfbf;"></span>
</div>
</td>
</tr>
</table>
</body>
</html>