muc-room-delete.jsp 3.86 KB
Newer Older
Gaston Dombiak's avatar
Gaston Dombiak 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 the proprietary information of Jive Software.
  - Use is subject to license terms.
--%>

<%@ page import="org.jivesoftware.util.*,
                 org.jivesoftware.admin.*,
Gaston Dombiak's avatar
Gaston Dombiak committed
14 15
                 org.jivesoftware.messenger.muc.MUCRoom,
                 java.net.URLEncoder"
Gaston Dombiak's avatar
Gaston Dombiak committed
16 17 18 19
    errorPage="error.jsp"
%>

<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
20
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
Gaston Dombiak's avatar
Gaston Dombiak committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
<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 roomName = ParamUtils.getParameter(request,"roomName");
    String alternateJID = ParamUtils.getParameter(request,"alternateJID");
    String reason = ParamUtils.getParameter(request,"reason");

    // Handle a cancel
    if (cancel) {
        response.sendRedirect("muc-room-summary.jsp");
        return;
    }

    // Load the room object
    MUCRoom room = webManager.getMultiUserChatServer().getChatRoom(roomName);

    // Handle a room delete:
    if (delete) {
        // Delete the room
        if (room !=  null) {
            // If the room still exists then destroy it
            room.destroyRoom(alternateJID, reason);
        }
        // Done, so redirect
        response.sendRedirect("muc-room-summary.jsp?deletesuccess=true");
        return;
    }
%>

<jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" />
<%  // Title of this page and breadcrumbs
55
    String title = LocaleUtils.getLocalizedString("muc.room.delete.title");
Gaston Dombiak's avatar
Gaston Dombiak committed
56
    pageinfo.setTitle(title);
57
    pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(LocaleUtils.getLocalizedString("global.main"), "index.jsp"));
Gaston Dombiak's avatar
Gaston Dombiak committed
58
    pageinfo.getBreadcrumbs().add(new AdminPageBean.Breadcrumb(title, "muc-room-delete.jsp?roomName="+URLEncoder.encode(roomName, "UTF-8")));
Gaston Dombiak's avatar
Gaston Dombiak committed
59
    pageinfo.setSubPageID("muc-room-delete");
Gaston Dombiak's avatar
Gaston Dombiak committed
60
    pageinfo.setExtraParams("roomName="+URLEncoder.encode(roomName, "UTF-8"));
Gaston Dombiak's avatar
Gaston Dombiak committed
61
%>
Matt Tucker's avatar
Matt Tucker committed
62 63 64
<jsp:include page="top.jsp" flush="true">
    <jsp:param name="helpPage" value="delete_a_group_chat_room.html" />
</jsp:include>
Gaston Dombiak's avatar
Gaston Dombiak committed
65 66 67
<jsp:include page="title.jsp" flush="true" />

<p>
68
<fmt:message key="muc.room.delete.info" />
Gaston Dombiak's avatar
Gaston Dombiak committed
69
<b><a href="muc-room-edit-form.jsp?roomName=<%= URLEncoder.encode(room.getName(), "UTF-8") %>"><%= room.getName() %></a></b>
70
<fmt:message key="muc.room.delete.detail" />
Gaston Dombiak's avatar
Gaston Dombiak committed
71 72 73 74 75 76
</p>

<form action="muc-room-delete.jsp">
<input type="hidden" name="roomName" value="<%= roomName %>">

<fieldset>
77
    <legend><fmt:message key="muc.room.delete.destructon_title" /></legend>
Gaston Dombiak's avatar
Gaston Dombiak committed
78 79 80 81 82
    <div>
    <table cellpadding="3" cellspacing="0" border="0" width="100%">
    <tbody>
        <tr>
            <td class="c1">
83
                <fmt:message key="muc.room.delete.room_id" />
Gaston Dombiak's avatar
Gaston Dombiak committed
84 85 86 87 88 89 90
            </td>
            <td>
                <%= room.getName() %>
            </td>
        </tr>
        <tr>
            <td class="c1">
91
                <fmt:message key="muc.room.delete.reason" />
Gaston Dombiak's avatar
Gaston Dombiak committed
92 93 94 95 96 97 98
            </td>
            <td>
                <input type="text" size="50" maxlength="150" name="reason">
            </td>
        </tr>
        <tr>
            <td class="c1">
99
                <fmt:message key="muc.room.delete.alternate_address" />
Gaston Dombiak's avatar
Gaston Dombiak committed
100 101 102 103 104 105 106 107 108 109 110 111
            </td>
            <td>
                <input type="text" size="30" maxlength="150" name="alternateJID">
            </td>
        </tr>
    </tbody>
    </table>
    </div>
</fieldset>

<br><br>

112 113
<input type="submit" name="delete" value="<fmt:message key="muc.room.delete.destroy_room" />">
<input type="submit" name="cancel" value="<fmt:message key="global.cancel" />">
Gaston Dombiak's avatar
Gaston Dombiak committed
114 115 116
</form>

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