%@page language="java" contentType="text/html; charset=UTF-8"%>
<%@ include file="./config.jsp" %>
<%@page import="com.hanweb.common.util.Convert"%>
<%@page import="jcms.extramodule.comment.VotingFun"%>
<%@page import="java.io.File"%>
<%@page import="jcms.blf.module.voting.Jcms_Voting_KindBLF"%>
<%@page import="jcms.entity.module.Jcms_Voting_KindEntity"%>
<%@page import="java.util.Vector"%>
<%@page import="java.util.ArrayList"%>
<%
String strPath = VotingFun.getPath(application.getRealPath(""), strAppID,strWebID);
int kindid = Convert.getParameterInt(request, "classid", 0);
String strUnitPath = "";
if (kindid > 0) {
strUnitPath = strPath + "config/init"+kindid+".xml";
} else {
strUnitPath = strPath + "config/init0.xml";
}
File init = new File(strUnitPath);
if (!init.exists()) {
Convert ct = new Convert();
ct.copyFile(strPath + "config/init.xml",strUnitPath);
}
// 列表页显示记录数
String strListCount = xmlFile.getContent("listcount", strUnitPath);
strListCount = Convert.getValue(strListCount);
strListCount = strListCount.trim().length()==0?"5":strListCount;
String strScript = xmlFile.getContent("columlist", strUnitPath);
String strqyHeight = xmlFile.getContent("qyheight", strUnitPath);
String strqyWidth = xmlFile.getContent("qywidth", strUnitPath);
strScript = Convert.getValue(strScript);
Jcms_Voting_KindBLF kBLF = new Jcms_Voting_KindBLF(strAppID,strWebID);
int iType = Convert.getParameterInt(request,"type",1);
int scope = Convert.getParameterInt(request,"scope",-1);
int limit = Convert.getParameterInt(request,"limit");
ArrayList list = kBLF.getEntities("0",iType,scope); // 获取多个类别
int nLen = 0;
int nStart = strScript.indexOf("");
int nEnd = strScript.indexOf("");
String strHead = "";
String strForTr = "";
String strEnd = "";
String strContent = "";
String strDisplay = "";
if (nStart != -1 && nEnd != -1 && nEnd > nStart) {
strHead = strScript.substring(0,nStart);
strForTr = strScript.substring(nStart+10,nEnd);
strEnd = strScript.substring(nEnd+11);
}
String strConfigPath = strPath + "config"+File.separator+"config.xml";
String strWebServerName = xmlFile.getContent("web_in_servername", strConfigPath);
strWebServerName = Convert.getValue(strWebServerName);
String strwebtype = xmlFile.getContent("webtype", strConfigPath); // 1 制作端; 2 web服务器端
// 系统路径
String strSysPath = "/";
if (strwebtype.equals("1")) {
strSysPath = "/" + strWebServerName + "/jcms_files/jcms"+strAppID+"/web"+strWebID+"/site/";
}
if (strwebtype.equals("2")) {
strSysPath = "/";
}
String strMoreUrl = strSysPath + "module/voting/que_questionairelist.jsp?type="+iType+"&scope="+scope;//更多的链接
String strUrl = "";
Vector v_label = new Vector(5);
v_label.add("");
v_label.add("");
v_label.add("");
v_label.add("");
v_label.add("");
Vector v_value = new Vector(5);
String strLabel = "";
StringBuffer sbContent = new StringBuffer();
if (list != null && list.size() > 0) {
nLen = list.size();
int nDefault = Convert.getStringValueInt(strListCount);
nLen = (nDefault>nLen) ? nLen:nDefault;
strDisplay = (nDefault>nLen) ? "none":"";
int nScope = 0;
String strKindName = "";
String strEndtime = "";
for (int i=0; ilimit) {
strKindName = strKindName.substring(0,limit) + "...";
}
//if(nScope==0){
strLabel = "截至: "+strEndtime;
strKindName = ""+strKindName+"";
//}
// else if(nScope==1){
//strLabel = "截至: "+strEndtime;
//strKindName = ""+strKindName+"";
//}
strContent = strForTr;
strUrl = strSysPath + "module/voting/index.jsp?kindid="+en.getI_id()+"&type=1&inlay=yes&height="+strqyHeight+"&width="+strqyWidth;
v_value.add(String.valueOf(i+1));
v_value.add(strUrl);
v_value.add(strKindName);
v_value.add(strLabel);
v_value.add(Convert.getValue(en.getVc_sparefield()));
for (int j=0; j",strDisplay);
strContent = Convert.replaceString(strContent,"",strMoreUrl);
strContent = Convert.replaceString(strContent,"\n","");
strContent = Convert.replaceString(strContent,"\r","");
strContent = Convert.replaceString(strContent,"\"","\\\\\"");
if (sbContent.length() > 0) {
sbContent.delete(0,sbContent.length());
}
sbContent = VotingFun.organiseContent(strContent,"yes");
out.println(sbContent.toString());
%>