150 lines
		
	
	
		
			6.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			150 lines
		
	
	
		
			6.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
<%--
 | 
						|
  The contents of this file are subject to the Mozilla Public License Version 1.1
 | 
						|
  (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.mozilla.org/MPL/>.
 | 
						|
 | 
						|
  Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
 | 
						|
  WARRANTY OF ANY KIND, either express or implied. See the License for the specific
 | 
						|
  language governing rights and limitations under the License.
 | 
						|
  
 | 
						|
  The Original Code is the Venice Web Communities System.
 | 
						|
  
 | 
						|
  The Initial Developer of the Original Code is Eric J. Bowersox <erbo@ricochet.com>,
 | 
						|
  for Silverwrist Design Studios.  Portions created by Eric J. Bowersox are
 | 
						|
  Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios.  All Rights Reserved.
 | 
						|
 | 
						|
  Contributor(s): 
 | 
						|
--%>
 | 
						|
<%@ page import = "java.util.Iterator" %>
 | 
						|
<%@ page import = "java.util.List" %>
 | 
						|
<%@ page import = "com.silverwrist.venice.core.*" %>
 | 
						|
<%@ page import = "com.silverwrist.venice.ui.view.MembersView" %>
 | 
						|
<%@ taglib uri="/tlds/util" prefix="util" %>
 | 
						|
<%@ taglib uri="/tlds/community" prefix="comm" %>
 | 
						|
<%
 | 
						|
  MembersView view = MembersView.get(request);
 | 
						|
%>
 | 
						|
<util:comment>Members view for community <comm:name/></util:comment>
 | 
						|
<util:header title="Members of Community:">
 | 
						|
  <util:subtitle><util:escape><comm:name/></util:escape></util:subtitle>
 | 
						|
</util:header>
 | 
						|
<% if (view.canExportMembers()) { %>
 | 
						|
  <util:font color="content.fg" size="content">[
 | 
						|
    <util:xlink>
 | 
						|
      <util:href type="servlet">comm/member_export.js.vs?cc=<comm:ID/></util:href>
 | 
						|
      <util:text>Export Member List</util:text>
 | 
						|
    </util:xlink>
 | 
						|
  ]</util:font><p>
 | 
						|
<% } // end if %>
 | 
						|
<util:font color="content.fg" size="subhead"><B>Find members of community "<comm:name/>":</B></util:font><P>
 | 
						|
<util:form action="comm/members.js.vs" type="servlet"><DIV CLASS="content">
 | 
						|
  <INPUT TYPE="HIDDEN" NAME="cc" VALUE="<comm:ID/>">
 | 
						|
  <INPUT TYPE="HIDDEN" NAME="sl" VALUE="0">
 | 
						|
  <INPUT TYPE="HIDDEN" NAME="ofs" VALUE="0">
 | 
						|
  <util:font color="content.fg" size="content">
 | 
						|
    Display all community members whose  
 | 
						|
    <SELECT NAME="field" SIZE=1>
 | 
						|
      <OPTION VALUE="<%= SearchMode.FIELD_USER_NAME %>"
 | 
						|
      <% if (view.testField(SearchMode.FIELD_USER_NAME)) { %>SELECTED<% } %> >user name</OPTION>
 | 
						|
      <OPTION VALUE="<%= SearchMode.FIELD_USER_DESCRIPTION %>"
 | 
						|
      <% if (view.testField(SearchMode.FIELD_USER_DESCRIPTION)) { %>SELECTED<% } %> >description</OPTION>
 | 
						|
      <OPTION VALUE="<%= SearchMode.FIELD_USER_GIVEN_NAME %>"
 | 
						|
      <% if (view.testField(SearchMode.FIELD_USER_GIVEN_NAME)) { %>SELECTED<% } %> >first name</OPTION>
 | 
						|
      <OPTION VALUE="<%= SearchMode.FIELD_USER_FAMILY_NAME %>"
 | 
						|
      <% if (view.testField(SearchMode.FIELD_USER_FAMILY_NAME)) { %>SELECTED<% } %> >last name</OPTION>
 | 
						|
    </SELECT><BR>
 | 
						|
 | 
						|
    <SELECT NAME="mode" SIZE=1>
 | 
						|
      <OPTION VALUE="<%= SearchMode.SEARCH_PREFIX %>"
 | 
						|
      <% if (view.testMode(SearchMode.SEARCH_PREFIX)) { %>SELECTED<% } %> >starts with the string</OPTION>
 | 
						|
      <OPTION VALUE="<%= SearchMode.SEARCH_SUBSTRING %>"
 | 
						|
      <% if (view.testMode(SearchMode.SEARCH_SUBSTRING)) { %>SELECTED<% } %> >contains the string</OPTION>
 | 
						|
      <OPTION VALUE="<%= SearchMode.SEARCH_REGEXP %>"
 | 
						|
      <% if (view.testMode(SearchMode.SEARCH_REGEXP)) { %>SELECTED<% } %> >matches the regular
 | 
						|
      expression</OPTION>
 | 
						|
    </SELECT>
 | 
						|
 | 
						|
    <SPAN CLASS="cinput"><INPUT TYPE=TEXT CLASS="cinput" NAME="term" SIZE=32 MAXLENGTH=255
 | 
						|
                                VALUE="<%= view.getTerm() %>"></SPAN><BR>
 | 
						|
    <util:button id="search" type="input"/>
 | 
						|
  </util:font>
 | 
						|
</DIV></util:form>
 | 
						|
 | 
						|
<% List results = view.getResults(); %>
 | 
						|
<% if (results!=null) { %>
 | 
						|
  <HR>
 | 
						|
  <%
 | 
						|
    int dcount = results.size();
 | 
						|
    // Determine the number of results to display and whether to display a "next" button
 | 
						|
    boolean go_next = false;
 | 
						|
    if (dcount>view.getMaxResults())
 | 
						|
    { // there's a "next"
 | 
						|
      dcount = view.getMaxResults();
 | 
						|
      go_next = true;
 | 
						|
 | 
						|
    } // end if
 | 
						|
  %>
 | 
						|
  <TABLE WIDTH="100%" BORDER=0 ALIGN=CENTER><TR VALIGN=MIDDLE>
 | 
						|
    <TD WIDTH="50%" ALIGN=LEFT CLASS="content"><util:font color="content.fg" size="content">
 | 
						|
      <%-- The community members/search results header --%>
 | 
						|
      <FONT SIZE=+1><B>
 | 
						|
        <% if (view.getSimple()) { %>Community Members:<% } else { %>Search Results:<% } %>
 | 
						|
      </B></FONT>
 | 
						|
      (Displaying <%= view.getOffset() + 1 %>-<%= view.getOffset() + dcount %> of
 | 
						|
      <%= view.getFindCount() %>)
 | 
						|
    </util:font></TD>
 | 
						|
 | 
						|
    <TD WIDTH="50%" ALIGN=RIGHT CLASS="content">
 | 
						|
      <% if (go_next || (view.getOffset()>0)) { %>
 | 
						|
        <%-- The navigational form that allows us to page through the results --%>
 | 
						|
        <util:comment>Navigational Form</util:comment>
 | 
						|
        <util:form action="comm/members.js.vs" type="servlet"><DIV CLASS="content">
 | 
						|
          <INPUT TYPE="HIDDEN" NAME="cc" VALUE="<comm:ID/>">
 | 
						|
          <INPUT TYPE="HIDDEN" NAME="sl" VALUE="<%= view.getSimple() ? 1 : 0 %>">
 | 
						|
          <INPUT TYPE=HIDDEN NAME="ofs" VALUE="<%= view.getOffset() %>">
 | 
						|
          <INPUT TYPE=HIDDEN NAME="field" VALUE="<%= view.getField() %>">
 | 
						|
          <INPUT TYPE=HIDDEN NAME="mode" VALUE="<%= view.getMode() %>">
 | 
						|
          <INPUT TYPE=HIDDEN NAME="term" VALUE="<%= view.getTerm() %>">
 | 
						|
          <INPUT TYPE=HIDDEN NAME="fcount" VALUE="<%= view.getFindCount() %>">
 | 
						|
          <% if (view.getOffset()>0) { %>
 | 
						|
            <util:button id="previous" type="input"/>
 | 
						|
          <% } else { %>
 | 
						|
            <util:button id="_null_"/>
 | 
						|
          <% } // end if %>
 | 
						|
           
 | 
						|
          <% if (go_next) { %>
 | 
						|
            <util:button id="next" type="input"/>
 | 
						|
          <% } else { %>
 | 
						|
            <util:button id="_null_"/>
 | 
						|
          <% } // end if %>
 | 
						|
        </DIV></util:form>
 | 
						|
      <% } else { %> <% } %>
 | 
						|
    </TD>
 | 
						|
  </TR></TABLE><BR>
 | 
						|
 | 
						|
  <%-- Display the results of the search --%>
 | 
						|
  <TABLE BORDER=0 ALIGN=LEFT CELLPADDING=0 CELLSPACING=4>
 | 
						|
    <% for (int i=0; i<dcount; i++) { %>
 | 
						|
      <TR VALIGN=TOP>
 | 
						|
        <TD ALIGN=CENTER WIDTH=14><util:stdbullet/></TD>
 | 
						|
        <TD ALIGN=LEFT CLASS="content"><util:font color="content.fg" size="content">
 | 
						|
          <% UserFound uf = (UserFound)(results.get(i)); %>
 | 
						|
          <util:xlink>
 | 
						|
            <util:href type="servlet">user/<%= uf.getName() %></util:href>
 | 
						|
            <util:text><%= uf.getName() %></util:text>
 | 
						|
          </util:xlink><BR>
 | 
						|
          <util:escape><%= uf.getGivenName() %> <%= uf.getFamilyName() %></util:escape>,
 | 
						|
          from <util:escape><%= uf.getLocality() %>, <%= uf.getRegion() %></util:escape>
 | 
						|
          <%= uf.getCountry() %>
 | 
						|
          <% if (view.isCommunityAdmin(uf)) { %>
 | 
						|
             <util:image src="tag_host.gif" fixup="true" alt="Host!" width="40" height="20"/>
 | 
						|
          <% } // end if %>
 | 
						|
          <% if (uf.getDescription()!=null) { %>
 | 
						|
            <BR><EM><util:escape><%= uf.getDescription() %></util:escape></EM>
 | 
						|
          <% } // end if %>
 | 
						|
        </util:font></TD>
 | 
						|
      </TR>
 | 
						|
    <% } // end for %>
 | 
						|
  </TABLE><BR CLEAR=LEFT>
 | 
						|
<% } // end if %>
 |