user-tabs.jsp 3.67 KB
Newer Older
1
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
Matt Tucker's avatar
Matt Tucker committed
2 3 4 5 6 7 8
<%--
  -	$RCSfile$
  -	$Revision$
  -	$Date$
--%>

<%@ page import="org.jivesoftware.util.ParamUtils,
9 10
                 org.jivesoftware.openfire.PresenceManager,
                 org.jivesoftware.openfire.user.*"
Matt Tucker's avatar
Matt Tucker committed
11 12
    
%>
13
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
Bill Lynch's avatar
Bill Lynch committed
14
<%-- Define Administration Bean --%>
Matt Tucker's avatar
Matt Tucker committed
15 16 17 18
<jsp:useBean id="ad" class="org.jivesoftware.util.WebManager"  />
<% ad.init(request, response, session, application, out ); %>


19
<c:set var="username" value="${param.username}" />
Matt Tucker's avatar
Matt Tucker committed
20 21 22 23 24
<c:set var="tabName" value="${pageScope.tab}" />
<jsp:useBean id="tabName" type="java.lang.String" />


<%  // Get params
25
    String uname = ParamUtils.getParameter(request,"username");
Matt Tucker's avatar
Matt Tucker committed
26 27

    // Load the user
28
    User foundUser = ad.getUserManager().getUser(uname);
Matt Tucker's avatar
Matt Tucker committed
29 30 31 32 33 34 35 36 37 38

    // Get a presence manager
    PresenceManager presenceManager = ad.getPresenceManager();
%>

<table class="jive-tabs" cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<c:set var="tabCount" value="1" />

    <td class="jive-<%= (("props".equals(tabName)) ? "selected-" : "") %>tab" width="1%" nowrap>
39
        <a href="user-properties.jsp?username=<c:out value="${username}"/>"><fmt:message key="user.tabs.properties" /></a>
Matt Tucker's avatar
Matt Tucker committed
40
    </td>
41
    <td class="jive-tab-spacer" width="1%"><img src="images/blank.gif" width="5" height="1" border="0" alt=""></td>
Matt Tucker's avatar
Matt Tucker committed
42 43 44 45

<c:set var="tabCount" value="${tabCount + 1}" />

    <td class="jive-<%= (("edit".equals(tabName)) ? "selected-" : "") %>tab" width="1%" nowrap>
46
        <a href="user-edit-form.jsp?username=<c:out value="${username}"/>"><fmt:message key="user.tabs.edit" /></a>
Matt Tucker's avatar
Matt Tucker committed
47
    </td>
48
    <td class="jive-tab-spacer" width="1%"><img src="images/blank.gif" width="5" height="1" border="0" alt=""></td>
Matt Tucker's avatar
Matt Tucker committed
49 50 51 52 53 54 55 56

<c:set var="tabCount" value="${tabCount + 1}" />

    <%  // Only show the message tab if the user is online
        if (presenceManager.isAvailable(foundUser)) {
    %>

        <td class="jive-<%= (("message".equals(tabName)) ? "selected-" : "") %>tab" width="1%" nowrap>
57
            <a href="user-message.jsp?username=<c:out value="${username}"/>"><fmt:message key="user.tabs.send" /></a>
Matt Tucker's avatar
Matt Tucker committed
58
        </td>
59
        <td class="jive-tab-spacer" width="1%"><img src="images/blank.gif" width="5" height="1" border="0" alt=""></td>
Matt Tucker's avatar
Matt Tucker committed
60 61 62 63 64 65 66

        <c:set var="tabCount" value="${tabCount + 1}" />


    <%  } %>

    <td class="jive-<%= (("pass".equals(tabName)) ? "selected-" : "") %>tab" width="1%" nowrap>
67
        <a href="user-password.jsp?username=<c:out value="${username}"/>"><fmt:message key="user.tabs.change_pwd" /></a>
Matt Tucker's avatar
Matt Tucker committed
68
    </td>
69
    <td class="jive-tab-spacer" width="1%"><img src="images/blank.gif" width="5" height="1" border="0" alt=""></td>
Matt Tucker's avatar
Matt Tucker committed
70 71 72 73

<c:set var="tabCount" value="${tabCount + 1}" />

    <td class="jive-<%= (("delete".equals(tabName)) ? "selected-" : "") %>tab" width="1%" nowrap>
74
        <a href="user-delete.jsp?username=<c:out value="${username}"/>"><fmt:message key="user.tabs.delete_user" /></a>
Matt Tucker's avatar
Matt Tucker committed
75
    </td>
76
    <td class="jive-tab-spacer" width="1%"><img src="images/blank.gif" width="5" height="1" border="0" alt=""></td>
Matt Tucker's avatar
Matt Tucker committed
77 78 79 80 81 82 83 84 85 86 87 88
<c:set var="width" value="${100-(tabCount*2)}" />
    <td class="jive-tab-spring" width="<c:out value="${width}" />%" align="right" nowrap>
        &nbsp;
    </td>
</tr>
<tr>
    <td class="jive-tab-bar" colspan="99">
        &nbsp;
    </td>
</tr>
</table>
<table bgcolor="#dddddd" cellpadding="0" cellspacing="0" border="0" width="100%">
89
<tr><td width="1%"><img src="images/blank.gif" width="1" height="1" border="0" alt=""></td></tr>
Matt Tucker's avatar
Matt Tucker committed
90 91
</table>
<table bgcolor="#eeeeee" cellpadding="0" cellspacing="0" border="0" width="100%">
92
<tr><td width="1%"><img src="images/blank.gif" width="1" height="1" border="0" alt=""></td></tr>
Matt Tucker's avatar
Matt Tucker committed
93
</table>