<%
	/**
	 * Created by The eXo Platform SAS
	 * Author : eXoPlatform
	 *          chuong.phan@exoplatform.com, phan.le.thanh.chuong@gmail.com
	 * Jun 30, 2009  
	 */
	 
	 import org.exoplatform.webui.core.UIPageIterator;
%>
<div class=" ClearFix">
<div id="UIPageSelectorPanel" class="UIPageSelectorPanel">
	<table class="UIGrid">
		<thead>
			<tr>
	      		<th><%=_ctx.appRes("UIPageSelectorPanel.header.path")%></th>
		    	<th style="width: 35px;"><%=_ctx.appRes("UIPageSelectorPanel.header.action")%></th>
	    	</tr>
	  	</thead>
	  	<tbody>
      		<%
        		def pages = uicomponent.getSelectablePages() ;
        		def rowClass = "OddRow" ;
		    	boolean even = true ;
		    	if(pages.isEmpty()) {
		    		%>
		  				<tr class="EvenRow">
		  					<td style="font-style:italic; color: #FF5604; text-align: center;" colspan="2">
		  						<%=_ctx.appRes("UIPageSelectorPanel.msg.child-not-found")%>
		  					</td>
		  				</tr>
		  			<%  	
		    	} else {
		  			for(page in pages) {
				      	if(even) rowClass = "EvenRow" ;
						else rowClass =  "OddRow" ;
				      	even = !even ;
	      				%>
				      		<tr class="$rowClass">
				        		<td>
				          			<div class=""><%= page.getURI() %></div>
				        		</td>
				        		<td>
			              			<a href="<%=uicomponent.event("Select", page.getURI())%>" title="<%=_ctx.appRes("UIPageSelectorPanel.title.select")%>">
			                			<div class="Select16x16Icon" style="margin: auto;"></div>
			              			</a>
				        		</td>
				      		</tr>
						<%
					}
		    	}
			%>
    	</tbody>
  	</table>
  	<% 
  		UIPageIterator pageIterator = uicomponent.getPageIterator();
  		if (pageIterator.getAvailablePage() > 1) { 
  			%>
  				<div style="margin:1px 0px 5px 0px;">
    				<%_ctx.renderUIComponent(pageIterator)%>
  				</div>
  			<% 
  		} 
  	%>
</div>
</div>