<%-- - $RCSfile$ - $Revision: 9909 $ - $Date: 2008-02-13 22:32:17 -0500 (Wed, 13 Feb 2008) $ - - Copyright (C) 2004-2008 Jive Software. All rights reserved. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. --%> <%@ page import="org.jivesoftware.util.LocaleUtils, org.jivesoftware.util.ParamUtils" %><%@ page import="org.xmpp.packet.JID"%> <%@ page import="java.net.URLEncoder" %> <%@ page import="org.jivesoftware.openfire.muc.MultiUserChatService" %> <%@ page import="java.util.List" %> <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %> <%! final int DEFAULT_RANGE = 15; final int[] RANGE_PRESETS = {15, 25, 50, 75, 100}; %> <% webManager.init(request, response, session, application, out ); %> <fmt:message key="muc.service.summary.title"/> <% // Get parameters int start = ParamUtils.getIntParameter(request,"start",0); int range = ParamUtils.getIntParameter(request,"range",webManager.getRowsPerPage("muc-service-summary", DEFAULT_RANGE)); if (request.getParameter("range") != null) { webManager.setRowsPerPage("muc-service-summary", range); } // Get the number of registered services int servicesCount = webManager.getMultiUserChatManager().getServicesCount(false); // paginator vars int numPages = (int)Math.ceil((double)servicesCount/(double)range); int curPage = (start/range) + 1; %> <% if (request.getParameter("deletesuccess") != null) { %>

<% } %> <% if (webManager.getMultiUserChatManager().getMultiUserChatServicesCount() < 1) { %>

<% } %>

: <%= LocaleUtils.getLocalizedNumber(servicesCount) %> -- <% if (numPages > 1) { %> <%= LocaleUtils.getLocalizedNumber(start+1) %>-<%= LocaleUtils.getLocalizedNumber(start+range > servicesCount ? servicesCount:start+range) %>, <% } %> -- :

<% if (numPages > 1) { %>

: [ <% int num = 15 + curPage; int s = curPage-1; if (s > 5) { s -= 5; } if (s < 5) { s = 0; } if (s > 2) { %> 1 ... <% } int i; for (i=s; i " ><%= (i+1) %><%= sep %> <% } %> <% if (i < numPages) { %> ... <%= numPages %> <% } %> ]

<% } %>
<% // Print the list of users List services = webManager.getMultiUserChatManager().getMultiUserChatServices(); if (services.isEmpty()) { %> <% } int i = start; for (MultiUserChatService service : services) { if (service.isHidden()) { // Private and hidden, skip it. continue; } i++; %> "> <% } %>
 
<%= i %> "><%= JID.unescapeNode(service.getServiceName()) %> <%= service.getDescription() %>   "><%= service.getNumberChatRooms() %> <%= service.getNumberConnectedUsers(false) %> " title="" ><fmt:message key="> " title="" ><fmt:message key=">
<% if (numPages > 1) { %>

: [ <% int num = 15 + curPage; int s = curPage-1; if (s > 5) { s -= 5; } if (s < 5) { s = 0; } if (s > 2) { %> 1 ... <% } for (i=s; i " ><%= (i+1) %><%= sep %> <% } %> <% if (i < numPages) { %> ... <%= numPages %> <% } %> ]

<% } %>