<%@ page contentType="text/html;charset=GBK" %>
<%
/**
 *	$RCSfile: sidebar.jsp,v $
 *	$Revision: 1.1.1.1 $
 *	$Date: 2002/09/09 13:50:18 $
 */
%>

<%@ page import="com.jivesoftware.forum.*,
                 com.jivesoftware.forum.util.*" %>

<%@ include file="global.jsp" %>

<%	// Get parameters

	// "sidebar" (tells which sidebar to display)
	String sidebar = ParamUtils.getParameter(request,"sidebar");
    if (sidebar == null) {
        String sessionSidebar = (String)session.getAttribute("jive.admin.sidebarTab");
        if (sessionSidebar == null) {
            sidebar = "system";
        }
        else {
            sidebar = sessionSidebar;
        }
    }
    else {
        session.setAttribute("jive.admin.sidebarTab",sidebar);
    }
%>

<html>
<head>
<title>Jive论坛管理工具</title>
<%@ include file="global.css" %>
</head>

<body background="images/sidebar_back.gif" text="#000000" link="#0000ff" vlink="#0000ff" alink="#6699cc"
 onload="parent.frames['header'].location.href='tabs.jsp?tab=<%= sidebar %>';">

<img src="images/blank.gif" width="50" height="5" border="0"><br>

<%  if ("system".equals(sidebar)) { %>

    <table cellpadding="2" cellspacing="0" border="0" width="100%">
    <tr><td rowspan="99" width="1%">&nbsp;</td>
        <td colspan="3" width="99%"><font size="-1" color="#333333"><b>系统设置</b></font></td>
    </tr>
    <tr><td>&nbsp;</td>
        <td>&#149;</td>
        <td><font size="-1"><a href="forumPerms.jsp" target="main">全局权限</a></font></td>
    </tr>
    <tr><td>&nbsp;</td>
        <td>&#149;</td>
        <td><font size="-1"><a href="filters.jsp" target="main">全局过虑</a></font></td>
    </tr>
    <tr><td>&nbsp;</td>
        <td>&#149;</td>
        <td><font size="-1"><a href="searchSettings.jsp" target="main">搜索设置</a></font></td>
    </tr>
    <tr><td width="1%">&nbsp;</td>
        <td width="1%">&#149;</td>
        <td width="97%"><font size="-1"><a href="cache.jsp" target="main">缓存设置</a></font></td>
    </tr>
    <tr><td>&nbsp;</td>
        <td>&#149;</td>
        <td><font size="-1"><a href="database.jsp" target="main">数据库设置</a></font></td>
    </tr>
    <tr><td>&nbsp;</td>
        <td>&#149;</td>
        <td><font size="-1"><a href="locale.jsp" target="main">区域设置</a></font></td>
    </tr>
    <tr><td>&nbsp;</td>
        <td>&#149;</td>
        <td><font size="-1"><a href="data.jsp" target="main">数据导入/导出</a></font></td>
    </tr>
    <tr><td>&nbsp;</td>
        <td>&#149;</td>
        <td><font size="-1"><a href="stats.jsp" target="main">基本统计</a></font></td>
    </tr>
    <tr><td>&nbsp;</td>
        <td>&#149;</td>
        <td><font size="-1"><a href="skin.jsp" target="main">外观设置</a></font></td>
    </tr>
    <tr><td colspan="3">&nbsp;</td>
    </tr>
    <tr><td colspan="3"><font size="-1" color="#333333"><b>监控</b></font></td>
    </tr>
    <tr><td>&nbsp;</td>
        <td>&#149;</td>
        <td><font size="-1"><a href="editWatches.jsp" target="main">监控设置</a></font></td>
    </tr>
    <tr><td colspan="3">&nbsp;</td>
    </tr>
    <tr><td colspan="3"><font size="-1" color="#333333"><b>奖赏</b></font></td>
    </tr>
    <tr><td>&nbsp;</td>
        <td>&#149;</td>
        <td><font size="-1"><a href="manageRewards.jsp" target="main">点数管理</a></font></td>
    </tr>
    <tr><td>&nbsp;</td>
        <td>&#149;</td>
        <td><font size="-1"><a href="editRewards.jsp" target="main">点数设置</a></font></td>
    </tr>
    <tr><td>&nbsp;</td>
        <td>&#149;</td>
        <td><font size="-1"><a href="rewardReports.jsp" target="main">报告</a></font></td>
    </tr>
    </table>

<%  } else if ("users".equals(sidebar)) {
        // Get a user object out of the session. The existence of this object
        // means we need to display more links specific to the user
        User user = null;
        try {
            long userID = Long.parseLong((String)session.getAttribute("admin.sidebar.users.currentUserID"));
            user = forumFactory.getUserManager().getUser(userID);
        }
        catch (Exception e) {}
        boolean showUserLinks = (user != null);

        // Get a group object out of the session. The existence of this object
        // means we need to display more links specific to the group
        Group group = null;
        try {
            long groupID = Long.parseLong((String)session.getAttribute("admin.sidebar.groups.currentGroupID"));
            group = forumFactory.getGroupManager().getGroup(groupID);
        }
        catch (Exception e) {}
        boolean showGroupLinks = (group != null);
%>
    <table cellpadding="2" cellspacing="0" border="0" width="100%">
    <tr><td rowspan="99" width="1%">&nbsp;</td>
        <td colspan="3" width="99%"><font size="-1"><b>用户</b></font></td>
    </tr>
    <tr><td width="1%">&nbsp;</td>
        <td width="1%">&#149;</td>
        <td width="97%"><font size="-1"><a href="users.jsp" target="main">用户概览</a></font></td>
    </tr>
    <tr><td>&nbsp;</td>
        <td>&#149;</td>
        <td><font size="-1"><a href="createUser.jsp" target="main">创建用户</a></font></td>
    </tr>
    </table>

    <%  if (showUserLinks) {
            long userID = user.getID();
            String userName = user.getUsername();
            if (userName.length() > 20) {
            	userName = userName.substring(0, 20);
            	userName += "...";
            }
    %>
    <p>
    <table cellpadding="2" cellspacing="0" border="0" width="100%">
    <tr><td rowspan="99" width="1%">&nbsp;</td>
        <td colspan="3" width="99%">

        <table bgcolor="#a5abc0" cellpadding="1" cellspacing="0" border="0" width="100%">
        <tr><td>
        <table bgcolor="#d1d9e2" cellpadding="2" cellspacing="0" border="0" width="100%">
        <tr>
            <td colspan="3"><font size="-1"><b>用户: <%= userName %></b></font></td>
        </tr>
        <tr bgcolor="#eeeeee">
            <td>&nbsp;</td>
            <td>&#149;</td>
            <td><font size="-1"><a href="editUser.jsp?user=<%= userID %>" target="main">用户属性</a></font></td>
        </tr>
        <tr bgcolor="#eeeeee">
            <td>&nbsp;</td>
            <td>&#149;</td>
            <td><font size="-1"><a href="removeUser.jsp?user=<%= userID %>" target="main">删除用户</a></font></td>
        </tr>
        </table>
        </td></tr>
        </table>

        </td>
    </tr>
    </table>
    <%  } %>

    <p>

    <table cellpadding="2" cellspacing="0" border="0" width="100%">
    <tr><td rowspan="99" width="1%">&nbsp;</td>
        <td colspan="3"><font size="-1"><b>用户组</b></font></td>
    </tr>
    <tr><td>&nbsp;</td>
        <td>&#149;</td>
        <td><font size="-1"><a href="groups.jsp" target="main">用户组概览</a></font></td>
    </tr>
    <tr><td>&nbsp;</td>
        <td>&#149;</td>
        <td><font size="-1"><a href="createGroup.jsp" target="main">创建用户组</a></font></td>
    </tr>
    </table>

    <%  if (showGroupLinks) {
            long groupID = group.getID();
    %>
    <p>
    <table cellpadding="2" cellspacing="0" border="0" width="100%">
    <tr><td rowspan="99" width="1%">&nbsp;</td>
        <td colspan="3" width="99%">

        <table bgcolor="#a5abc0" cellpadding="1" cellspacing="0" border="0" width="100%">
        <tr><td>
        <table bgcolor="#d1d9e2" cellpadding="2" cellspacing="0" border="0" width="100%">
        <tr>
            <td colspan="3"><font size="-1"><b>用户组: <%= group.getName() %></b></font></td>
        </tr>
        <tr bgcolor="#eeeeee">
            <td>&nbsp;</td>
            <td>&#149;</td>
            <td><font size="-1"><a href="editGroup.jsp?group=<%= groupID %>" target="main">用户组属性</a></font></td>
        </tr>
        <tr bgcolor="#eeeeee">
            <td>&nbsp;</td>
            <td>&#149;</td>
            <td><font size="-1"><a href="groupMembers.jsp?group=<%= groupID %>" target="main">用户组成员</a></font></td>
        </tr>
        <tr bgcolor="#eeeeee">
            <td>&nbsp;</td>
            <td>&#149;</td>
            <td><font size="-1"><a href="removeGroup.jsp?group=<%= groupID %>" target="main">删除用户组</a></font></td>
        </tr>
        </table>
        </td></tr>
        </table>

        </td>
    </tr>
    </table>
    <%  } %>

<%  } else if ("forum".equals(sidebar)) {
        // Get a forum object out of the session. The existence of this object
        // means we need to display more links specific to the forum
        Forum forum = null;
        String forumName = null;
        try {
            long forumID = Long.parseLong((String)session.getAttribute("admin.sidebar.forums.currentForumID"));
            forum = forumFactory.getForum(forumID);
            forumName = forum.getName();
            if (forumName.length() > 20) {
            	forumName = forumName.substring(0, 20);
            	forumName += "...";
            }
        }
        catch (Exception e) {}
        boolean showForumLinks = (forum != null);
%>

    <table cellpadding="2" cellspacing="0" border="0" width="100%">
    <tr><td rowspan="99" width="1%">&nbsp;</td>
        <td colspan="3" width="99%"><font size="-1"><b>论坛</b></font></td>
    </tr>
    <tr><td width="1%">&nbsp;</td>
        <td width="1%">&#149;</td>
        <td width="97%"><font size="-1"><a href="forums.jsp" target="main">论坛概览</a></font></td>
    </tr>
    <tr><td>&nbsp;</td>
        <td>&#149;</td>
        <td><font size="-1"><a href="createForum.jsp" target="main">创建新论坛</a></font></td>
    </tr>
    <tr><td colspan="3">&nbsp;</td>
    </tr>
    </table>

    <%  if (showForumLinks) {
            long forumID = forum.getID();
    %>
    <table cellpadding="2" cellspacing="0" border="0" width="100%">
    <tr><td rowspan="99" width="1%">&nbsp;</td>
        <td colspan="3" width="99%">

        <table bgcolor="#a5abc0" cellpadding="1" cellspacing="0" border="0" width="100%">
        <tr><td>
        <table bgcolor="#d1d9e2" cellpadding="2" cellspacing="0" border="0" width="100%">
        <tr>
            <td colspan="3"><font size="-1"><b><%= forumName %></b></font></td>
        </tr>
        <tr bgcolor="#eeeeee">
            <td>&nbsp;</td>
            <td>&#149;</td>
            <td><font size="-1"><a href="editForum.jsp?forum=<%= forumID %>" target="main">论坛属性</a></font></td>
        </tr>
        <tr bgcolor="#eeeeee">
            <td>&nbsp;</td>
            <td>&#149;</td>
            <td><font size="-1"><a href="forumPerms.jsp?forum=<%= forumID %>" target="main">权限</a></font></td>
        </tr>
        <tr bgcolor="#eeeeee">
            <td>&nbsp;</td>
            <td>&#149;</td>
            <td><font size="-1"><a href="filters.jsp?forum=<%= forumID %>" target="main">消息过虑</a></font></td>
        </tr>
        <tr bgcolor="#eeeeee">
            <td>&nbsp;</td>
            <td>&#149;</td>
            <td><font size="-1"><a href="moderation.jsp?forum=<%= forumID %>" target="main">节制</a></font></td>
        </tr>
        <tr bgcolor="#eeeeee">
            <td>&nbsp;</td>
            <td>&#149;</td>
            <td><font size="-1"><a href="forumContent.jsp?forum=<%= forumID %>" target="main">内容管理</a></font></td>
        </tr>
        <tr bgcolor="#eeeeee">
            <td>&nbsp;</td>
            <td>&#149;</td>
            <td><font size="-1"><a href="gateways.jsp?forum=<%= forumID %>" target="main">网关</a></font></td>
        </tr>
        <tr bgcolor="#eeeeee">
            <td>&nbsp;</td>
            <td>&#149;</td>
            <td><font size="-1"><a href="removeForum.jsp?forum=<%= forumID %>" target="main">删除论坛</a></font></td>
        </tr>
        </table>
        </td></tr>
        </table>

        </td>
    </tr>
    </table>
    <%  } %>

<% } else if ("moderation".equals(sidebar)) { %>

    <table cellpadding="2" cellspacing="0" border="0" width="100%">
    <tr><td rowspan="99" width="1%">&nbsp;</td>
        <td colspan="3" width="99%"><font size="-1"><b>节制</b></font></td>
    </tr>
    <tr><td width="1%">&nbsp;</td>
        <td width="1%">&#149;</td>
        <td width="97%"><font size="-1"><a href="moderation.jsp" target="main">节制</a></font></td>
    </tr>
    </table>

<%  } %>

<br><br>

</body>
</html>

