<% 
  import  org.exoplatform.webui.core.UIBreadcumbs; 
  import  org.exoplatform.webui.core.UITree; 
%>
<div class="UIGroupMembershipSelector" id="$uicomponent.id">
  <div class="Container">
		<div class="SelectedGroupPath"><% uicomponent.renderChild(UIBreadcumbs.class); %></div>
		<div class="GroupSelector">
		  <div class="ContentContainer">
			  <div class="MembershipTitle"><%=_ctx.appRes(uicomponent.id+".label.selectGroup")%></div>
			  <%uicomponent.renderChild(UITree.class);%>
			</div>
		</div>
	  <div class="MembershipSelector">
	    <div class="ContentContainer">
		    <div class="MembershipTitle">
		    	<%if(uicomponent.isSelectUser()){%>
		    		<%=_ctx.appRes(uicomponent.id+".label.selectUser")%>
		    	<%}%>
		    	<%if(uicomponent.isSelectMemberShip()){%>
		    	 	<%=_ctx.appRes(uicomponent.id+".label.selectMemberShip")%>
				  <%}%>
				  <%if(uicomponent.isSelectGroup()){%>
				  	<%=_ctx.appRes(uicomponent.id+".label.selectGroup")%>
				  <%}%>
		    </div>
	      <div class="OverflowContainer">
		      <%                
		      boolean even = true ;
		     if(uicomponent.getCurrentGroup() != null) {
			      for(user in uicomponent.getList()){
			        String rowCssClass = "OddRow" ;
			        if(even) rowCssClass = "EvenRow" ;  
			        even = !even ;
							even = !even ;
			        	key = "" ;
				        if(uicomponent.isSelectMemberShip()){ 
				        		 key = user + ":" +  uicomponent.getCurrentGroup().getId() ;
				        } else if(uicomponent.isSelectUser()){ 
				        	key = user ;
				        } else if(uicomponent.isSelectGroup()){ 
				        	key = uicomponent.getCurrentGroup().getId()+"/"+user ;
				        }    
		      %>
				     <div class="$rowCssClass">
				        	<a class="ItemIcon" href="<%=uicomponent.event('SelectMembership',key)%>">$user</a>	
				      </div>
		      <%}
		      } else if (uicomponent.isSelectGroup()){
		      	for(user in uicomponent.getList()){
			        String rowCssClass = "OddRow" ;
			        if(even) rowCssClass = "EvenRow" ;  
			        even = !even ;
				      key = "/" + user ;    
		      %>
				      <div class="$rowCssClass">
				        	<a class="ItemIcon" href="<%=uicomponent.event('SelectMembership',key)%>">$user</a>	
				      </div>
		      <%}		
		      
		      }
		      %>
	      </div>
	    </div>
	  </div>
		<div style="clear:left"><span></span></div>
	</div>
</div> 		
