skin.jsp

来自「Jive是基于JSP/JAVA技术构架的一个大型BBS论坛系统,这是Jive论坛」· JSP 代码 · 共 1,026 行 · 第 1/3 页

JSP
1,026
字号
<%/** *	$RCSfile: skin.jsp,v $ *	$Revision: 1.8 $ *	$Date: 2002/08/09 22:44:09 $ */%><%@ page import="java.util.*,                 com.jivesoftware.forum.*,                 com.jivesoftware.util.*,				 com.jivesoftware.forum.util.*" %><%! // global methods, vars, etc        // Default properties values. (Maintenance note: this list is duplicated in upgrade.jsp)    static Map properties = new HashMap();    static {        properties.put("fontFace", "arial,sans-serif");        properties.put("buttonFontFace", "verdana,arial,sans-serif");        properties.put("headerFontFace", "verdana,arial,sans-serif");        properties.put("categoryFontFace", "arial,sans-serif");        properties.put("fontSize", "-1");        properties.put("buttonFontSize", "-2");        properties.put("headerFontSize", "-2");        properties.put("categoryFontSize", "-1");        properties.put("homeURL", "index.jsp");        properties.put("bgColor", "#ffffff");        properties.put("textColor", "#000000");        properties.put("linkColor", "#003399");        properties.put("vLinkColor", "#003399");        properties.put("aLinkColor", "#99ccff");                properties.put("tableBorderColor", "#cccccc");        properties.put("tableHeaderBgColor", "#336699");        properties.put("tableHeaderTextColor", "#ffffff");        properties.put("tableRowColor1", "#eeeeee");        properties.put("tableRowColor2", "#d9e4f9");        properties.put("paginatorTextColor", "#333333");        properties.put("paginatorTableBgColor", "#eeeeee");        properties.put("categoryTextColor", "#000000");        properties.put("categoryCellBgColor", "#dddddd");        properties.put("sidebarHeaderBgColor", "#eeeeee");        properties.put("sidebarHeaderTextColor", "#000000");        properties.put("sidebarBgColor", "#ffffff");        properties.put("prefsHeaderBgColor", "#eeeeee");        properties.put("prefsHeaderTextColor", "#000000");        properties.put("prefsBgColor", "#ffffff");                properties.put("communityDescription", "Welcome to our online community. Please choose from one of the forums below or log-in to your user account to start using this service.");        properties.put("headerLogo", "<img src=\"images/logo.gif\" width=\"242\" height=\"38\" alt=\"Community Forums\" border=\"0\">");        properties.put("headerBorderColor", "#003366");        properties.put("headerBgColor", "#336699");                properties.put("threadMode", "flat"); // other value is "threaded"        properties.put("debug", "false");        properties.put("trackIP", "true");        properties.put("newAccountCreationEnabled", "true");        properties.put("showLastPostLink", "true");        properties.put("usersChooseLocale", "false");        properties.put("useDefaultWelcomeText", "true");        properties.put("useDefaultHeaderImage", "true");    }%><%@ include file="global.jsp" %><%	// Get parameters    boolean save = "save".equals(request.getParameter("formAction"));    boolean cancel = "cancel".equals(request.getParameter("formAction"));    boolean restoreDefaults = "defaults".equals(request.getParameter("formAction"));    String mode = ParamUtils.getParameter(request,"mode");        // Cancel if requested    if (cancel) {        response.sendRedirect("skin.jsp");        return;    }        // Get the current theme. The current theme will be "default" if no    // current theme is detected.    String theme = "default";    // Save properties to current theme    if (save) {        // Loop through the list of properties, save whatever is not null        for (Iterator iter=properties.keySet().iterator(); iter.hasNext();) {            String propName = (String)iter.next();            String propValue = ParamUtils.getParameter(request, propName, true);            if (propValue != null) {                JiveGlobals.setJiveProperty("skin." + theme + "." + propName, propValue);            }        }    }    // Restore the current theme to use the default    if (restoreDefaults) {        /*        JiveGlobals.setJiveProperty("skin.currentTheme", "default");        */        // Loop through the defaults, set jive properties accordingly        for (Iterator iter=properties.keySet().iterator(); iter.hasNext();) {            String key = (String)iter.next();            String value = (String)properties.get(key);            JiveGlobals.setJiveProperty("skin.default."+key, value);        }    }    // redirect    if (save || restoreDefaults) {        //response.sendRedirect("skin.jsp");        //return;    }    // List o' properties    String skinTheme = "skin." + theme + ".";    String fontFace = JiveGlobals.getJiveProperty(skinTheme + "fontFace");    String buttonFontFace = JiveGlobals.getJiveProperty(skinTheme + "buttonFontFace");    String headerFontFace = JiveGlobals.getJiveProperty(skinTheme + "headerFontFace");    String categoryFontFace = JiveGlobals.getJiveProperty(skinTheme + "categoryFontFace");    String fontSize = JiveGlobals.getJiveProperty(skinTheme + "fontSize");    String buttonFontSize = JiveGlobals.getJiveProperty(skinTheme + "buttonFontSize");    String headerFontSize = JiveGlobals.getJiveProperty(skinTheme + "headerFontSize");    String categoryFontSize = JiveGlobals.getJiveProperty(skinTheme + "categoryFontSize");    String homeURL = JiveGlobals.getJiveProperty(skinTheme + "homeURL");    String bgColor = JiveGlobals.getJiveProperty(skinTheme + "bgColor");    String textColor = JiveGlobals.getJiveProperty(skinTheme + "textColor");    String linkColor = JiveGlobals.getJiveProperty(skinTheme + "linkColor");    String vLinkColor = JiveGlobals.getJiveProperty(skinTheme + "vLinkColor");    String aLinkColor = JiveGlobals.getJiveProperty(skinTheme + "aLinkColor");    String tableBorderColor = JiveGlobals.getJiveProperty(skinTheme + "tableBorderColor");    String tableHeaderBgColor = JiveGlobals.getJiveProperty(skinTheme + "tableHeaderBgColor");    String tableHeaderTextColor = JiveGlobals.getJiveProperty(skinTheme + "tableHeaderTextColor");    String tableRowColor1 = JiveGlobals.getJiveProperty(skinTheme + "tableRowColor1");    String tableRowColor2 = JiveGlobals.getJiveProperty(skinTheme + "tableRowColor2");    String paginatorTextColor = JiveGlobals.getJiveProperty(skinTheme + "paginatorTextColor");    String paginatorTableBgColor = JiveGlobals.getJiveProperty(skinTheme + "paginatorTableBgColor");    String categoryTextColor = JiveGlobals.getJiveProperty(skinTheme + "categoryTextColor");    String categoryCellBgColor = JiveGlobals.getJiveProperty(skinTheme + "categoryCellBgColor");    String sidebarHeaderBgColor = JiveGlobals.getJiveProperty(skinTheme + "sidebarHeaderBgColor");    String sidebarHeaderTextColor = JiveGlobals.getJiveProperty(skinTheme + "sidebarHeaderTextColor");    String sidebarBgColor = JiveGlobals.getJiveProperty(skinTheme + "sidebarBgColor");    String prefsHeaderBgColor = JiveGlobals.getJiveProperty(skinTheme + "prefsHeaderBgColor");    String prefsHeaderTextColor = JiveGlobals.getJiveProperty(skinTheme + "prefsHeaderTextColor");    String prefsBgColor = JiveGlobals.getJiveProperty(skinTheme + "prefsBgColor");    String communityDescription = JiveGlobals.getJiveProperty(skinTheme + "communityDescription");    String headerLogo = JiveGlobals.getJiveProperty(skinTheme + "headerLogo");    String headerBorderColor = JiveGlobals.getJiveProperty(skinTheme + "headerBorderColor");    String headerBgColor = JiveGlobals.getJiveProperty(skinTheme + "headerBgColor");    String threadMode = JiveGlobals.getJiveProperty(skinTheme + "threadMode");    if (threadMode == null || "".equals(threadMode)) {        // set "flat" mode as the default thread view        threadMode = "flat";    }    String debug = JiveGlobals.getJiveProperty(skinTheme + "debug");    if (debug == null || "".equals(debug)) {        // set "false" as the default value for debug        debug = "false";    }    String trackIP = JiveGlobals.getJiveProperty(skinTheme + "trackIP");    if (trackIP == null) {        // on by default        trackIP = "true";    }    else if (!"true".equals(trackIP)) {        trackIP = "false";    }    String newAccountCreationEnabled = JiveGlobals.getJiveProperty("skin.default.newAccountCreationEnabled");    if (newAccountCreationEnabled == null) {        // enable by default        newAccountCreationEnabled = "true";    }    String showLastPostLink = JiveGlobals.getJiveProperty("skin.default.showLastPostLink");    if (showLastPostLink == null) {        // enable by default        showLastPostLink = "true";    }    String usersChooseLocale = JiveGlobals.getJiveProperty("skin.default.usersChooseLocale");    if (usersChooseLocale == null) {        // not enabled by default        usersChooseLocale = "false";    }    String useDefaultWelcomeText = JiveGlobals.getJiveProperty("skin.default.useDefaultWelcomeText");    if (useDefaultWelcomeText == null) {        // enable by default        useDefaultWelcomeText = "true";    }    String useDefaultHeaderImage = JiveGlobals.getJiveProperty("skin.default.useDefaultHeaderImage");    if (useDefaultHeaderImage == null) {        // enable by default        useDefaultHeaderImage = "true";    }    if (categoryFontFace == null) {        categoryFontFace = (String)properties.get("categoryFontFace");        JiveGlobals.setJiveProperty("skin.default.categoryFontFace", categoryFontFace);    }    if (categoryFontSize == null) {        categoryFontSize = (String)properties.get("categoryFontSize");        JiveGlobals.setJiveProperty("skin.default.categoryFontSize", categoryFontSize);    }    if (categoryCellBgColor == null) {        categoryCellBgColor = (String)properties.get("categoryCellBgColor");        JiveGlobals.setJiveProperty("skin.default.categoryCellBgColor", categoryCellBgColor);    }    if (categoryTextColor == null) {        categoryTextColor = (String)properties.get("categoryTextColor");        JiveGlobals.setJiveProperty("skin.default.categoryTextColor", categoryTextColor);    }    // escape the < and > and quotes from necessary fields    communityDescription = StringUtils.escapeHTMLTags(communityDescription);    communityDescription = StringUtils.replace(communityDescription, "\"", "&quot;");    headerLogo = StringUtils.escapeHTMLTags(headerLogo);    headerLogo = StringUtils.replace(headerLogo, "\"", "&quot;");%><%@ include file="header.jsp" %><%  // Title of this page and breadcrumbs    String title = "Skin Settings";    String[][] breadcrumbs = null;    if ("fonts".equals(mode)) {        breadcrumbs = new String[][] {            {"Main", "main.jsp"},            {title, "skin.jsp"},            {"Fonts", "skin.jsp?mode=fonts"}        };    }    else if ("colors".equals(mode)) {        breadcrumbs = new String[][] {            {"Main", "main.jsp"},            {title, "skin.jsp"},            {"Colors", "skin.jsp?mode=colors"}        };    }    else if ("forumtext".equals(mode)) {        breadcrumbs = new String[][] {            {"Main", "main.jsp"},            {title, "skin.jsp"},            {"Forum Text", "skin.jsp?mode=forumtext"}        };    }    else if ("headerandfooter".equals(mode)) {        breadcrumbs = new String[][] {            {"Main", "main.jsp"},            {title, "skin.jsp"},            {"Header &amp; Footer", "skin.jsp?mode=headerandfooter"}        };    }    else if ("features".equals(mode)) {        breadcrumbs = new String[][] {            {"Main", "main.jsp"},            {title, "skin.jsp"},            {"Features", "skin.jsp?mode=features"}        };    }    else if ("threadmode".equals(mode)) {        breadcrumbs = new String[][] {            {"Main", "main.jsp"},            {title, "skin.jsp"},            {"Thread Mode", "skin.jsp?mode=threadmode"}        };    }    else {        breadcrumbs = new String[][] {            {"Main", "main.jsp"},            {title, "skin.jsp"}        };    }%><%@ include file="title.jsp" %><script language="JavaScript" type="text/javascript"><!--var theEl;function colorPicker(el) {    var val = el.value.substr(1,6);    var win = window.open("colorPicker.jsp?element="+el.name+"&defaultColor="+val,"","menubar=yes,location=no,personalbar=no,scrollbar=yes,width=580,height=300,resizable");}//--></script><style type="text/css">.demo {    text-decoration : underline;    color : <%= linkColor %>;}.demo:hover {    text-decoration : underline;    color : <%= linkColor %>;}</style><form action="skin.jsp" name="skinForm" method="post"><input type="hidden" name="formAction" value=""><%  if (mode != null) { %><input type="hidden" name="mode" value="<%= mode %>"><%  } %><%  // Depending on the "mode", we'll print out a different page. The default    // mode (when mode == null) is to print out the list of editable skin    // categories.    if (mode == null) {%>    <font size="-1">    You can edit the attributes of the default Jive Forums skin by choosing one    of the options below:    </font>    <ul><li><font size="-1"><a href="skin.jsp?mode=fonts">Fonts</a>            - Adjust the list of fonts and their sizes.            </font>        <li><font size="-1"><a href="skin.jsp?mode=colors">Colors</a>            - Adjust colors of backgrounds, fonts, links, and borders.            </font>        <li><font size="-1"><a href="skin.jsp?mode=forumtext">Forum Text</a>            - Edit the welcome text for your community.            </font>        <li><font size="-1"><a href="skin.jsp?mode=headerandfooter">Header &amp; Footer</a>            - Edit the image and colors of the header and footer as well as              the text and links for the breadcrumbs.            </font>        <li><font size="-1"><a href="skin.jsp?mode=features">Features</a>            - Turn on or off various features in the default skin.            </font>    </ul><%  } else if ("fonts".equals(mode)) { %>        <font size="-1">    <b>Font Settings</b>    </font>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?