<%@ page contentType="text/html;charset=GBK" %>

<%
/**
 *	$RCSfile: removeForum.jsp,v $
 *	$Revision: 1.1.1.1 $
 *	$Date: 2002/09/09 13:50:17 $
 */
%>

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

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

<%	// cancel if requested
    if ("取消".equals(ParamUtils.getParameter(request,"submitButton"))) {
        response.sendRedirect("forums.jsp");
        return;
    }

    // get parameters
	long forumID = ParamUtils.getIntParameter(request,"forum",-1);
	boolean delete = ParamUtils.getBooleanParameter(request,"delete");

    // Load up the forum specified
    Forum forum = forumFactory.getForum(forumID);

    // Put the forum in the session (is needed by the sidebar)
    session.setAttribute("admin.sidebar.forums.currentForumID", ""+forumID);

	if (delete) {
        forumFactory.deleteForum(forum);
		response.sendRedirect("forums.jsp");
		return;
	}
%>

<%  // special onload command to load the sidebar
    onload = " onload=\"parent.frames['sidebar'].location.href='sidebar.jsp?sidebar=forum';\"";
%>
<%@ include file="header.jsp" %>

<p>

<%  // Title of this page and breadcrumbs
    String title = "删除论坛";
    String[][] breadcrumbs = {
        {"主页面", "main.jsp"},
        {"论坛", "forums.jsp"},
        {title, "removeForum.jsp?forum="+forumID}
    };
%>
<%@ include file="title.jsp" %>

<form action="removeForum.jsp" name="deleteForm">
<input type="hidden" name="delete" value="true">
<input type="hidden" name="forum" value="<%= forumID %>">

<font size="-1"><b>论坛删除确认</b></font><p>
<ul>
    <font size="-1">
	严重警告: 这将永久的删除论坛：<b><%= forum.getName() %></b>。你确认要这样做？
    <p>
    </font>
	<input type="submit" name="submitButton" value="删除论坛">
	&nbsp;
	<input type="submit" name="submitButton" value="取消">
</ul>
</form>

<script language="JavaScript" type="text/javascript">
<!--
// focus the "cancel" button -- if the user accidentally hits enter or
// space on this page, the default action would be to cancel, not delete
// the forum ;)
document.deleteForm.cancelButton.focus();
//-->
</script>

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