group-delete.jsp 2.65 KB
Newer Older
Matt Tucker's avatar
Matt Tucker committed
1 2 3 4 5 6 7 8 9 10 11 12 13
<%--
  -	$RCSfile$
  -	$Revision$
  -	$Date$
  -
  - Copyright (C) 2004 Jive Software. All rights reserved.
  -
  - This software is published under the terms of the GNU Public License (GPL),
  - a copy of which is included in this distribution.
--%>

<%@ page import="org.jivesoftware.util.*,
                 org.jivesoftware.admin.*,
Matt Tucker's avatar
Matt Tucker committed
14 15
                 org.jivesoftware.messenger.group.Group,
                 java.net.URLEncoder"
Matt Tucker's avatar
Matt Tucker committed
16 17 18
    errorPage="error.jsp"
%>

19
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
20
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
Matt Tucker's avatar
Matt Tucker committed
21 22 23 24 25 26 27 28 29 30 31

<jsp:useBean id="webManager" class="org.jivesoftware.util.WebManager" />
<% webManager.init(request, response, session, application, out ); %>

<%  // Get parameters //
    boolean cancel = request.getParameter("cancel") != null;
    boolean delete = request.getParameter("delete") != null;
    String groupName = ParamUtils.getParameter(request,"group");

    // Handle a cancel
    if (cancel) {
Matt Tucker's avatar
Matt Tucker committed
32
        response.sendRedirect("group-edit.jsp?group=" + URLEncoder.encode(groupName, "UTF-8"));
Matt Tucker's avatar
Matt Tucker committed
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
        return;
    }

    // Load the group object
    Group group = webManager.getGroupManager().getGroup(groupName);

    // Handle a group delete:
    if (delete) {
        // Delete the group
        webManager.getGroupManager().deleteGroup(group);
        // Done, so redirect
        response.sendRedirect("group-summary.jsp?deletesuccess=true");
        return;
    }
%>

<jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" />
<%  // Title of this page and breadcrumbs
51
    String title = LocaleUtils.getLocalizedString("group.delete.title");
Matt Tucker's avatar
Matt Tucker committed
52
    pageinfo.setTitle(title);
53
    pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(LocaleUtils.getLocalizedString("global.main"), "index.jsp"));
Matt Tucker's avatar
Matt Tucker committed
54
    pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "group-delete.jsp?group="+URLEncoder.encode(groupName, "UTF-8")));
Matt Tucker's avatar
Matt Tucker committed
55
    pageinfo.setSubPageID("group-delete");
Matt Tucker's avatar
Matt Tucker committed
56
    pageinfo.setExtraParams("group="+URLEncoder.encode(groupName, "UTF-8"));
Matt Tucker's avatar
Matt Tucker committed
57 58 59 60 61
%>
<jsp:include page="top.jsp" flush="true" />
<jsp:include page="title.jsp" flush="true" />

<p>
62
<fmt:message key="group.delete.hint_info" />
Matt Tucker's avatar
Matt Tucker committed
63
<b><a href="group-edit.jsp?group=<%= URLEncoder.encode(group.getName(), "UTF-8")%>"><%= group.getName() %></a></b>
64
<fmt:message key="group.delete.hint_info1" />
Matt Tucker's avatar
Matt Tucker committed
65 66 67 68
</p>

<form action="group-delete.jsp">
<input type="hidden" name="group" value="<%= groupName %>">
69 70
<input type="submit" name="delete" value="<fmt:message key="group.delete.delete" />">
<input type="submit" name="cancel" value="<fmt:message key="global.cancel" />">
Matt Tucker's avatar
Matt Tucker committed
71 72 73
</form>

<jsp:include page="bottom.jsp" flush="true" />