<% 
	/**
	 * Created by The eXo Platform SARL
	 * Author : Le bien thuy  
	 *          lebienthuy@gmail.com
	 * Oct 9, 2006
	 * version: $Id$	 
	 */
  
  import org.exoplatform.webui.core.UIComponent ;  
  String[] beanFields =  uicomponent.getBeanFields() ;
  String[] beanActions =  uicomponent.getBeanActions() ;
  String path = uicomponent.getParent().getName() ;
  String name = uicomponent.getId() ;
  String key ;
  int totalPages = uicomponent.getUIPageIterator().getAvailablePage() ;
%>
<div class="UIReferencesList">  
	<table class="UIGrid">
	  <thead>
	    <tr>
	      <%if(name != null) key = name; 
	        else key = parth ; 
          for(field in beanFields) { %>
      	    <th><%=_ctx.appRes(key + ".header." + field)%></th>
          <%}%>
	    </tr>
	  </thead>
	  <tbody>
	    <%
	    def rowClass = "EvenRow" ;
	    boolean even = true ;
	    if(uicomponent.getBeans().size() > 0) {
		    for (bean in uicomponent.getBeans())  {
		      if(even) rowClass = "EvenRow" ;  
		      else rowClass =  "OddRow" ; 
		      even = !even ;
		    %>
		      <tr class="$rowClass">
		        <td><%=bean.getWorkspace();%></td>
		        <td><%=bean.getPath();%></td>
		      </tr>
		<%
		    }
	    } else {
    %>
	      <tr class="$rowClass">
	        <td colspan="2" align="center"><%=_ctx.appRes("UIReferencesList.msg.no-references")%></td>
	      </tr>	    
	  <%}%>
	  </tbody>
	</table> <!--End UIGrid-->
  <% if(totalPages>1){ %>
	<%_ctx.renderUIComponent(uicomponent.getUIPageIterator())%>
	<% } %>
	<div class="UIAction">
		  <a onclick="<%=uicomponent.event("Close")%>" class="ActionButton LightBlueStyle" href="javascript:void(0);"><%=_ctx.appRes("UIReferencesList.action.Close")%></a>
	 </div>
</div>