<%
	/**
	 * Created by The eXo Platform SAS
	 * Author : Nguyen Duc Khoi
	 *          khoi.nguyen@exoplatform.com
	 * Apr 22, 2010  
	 */
%>
<%
  import org.exoplatform.commons.utils.HTMLEntityEncoder;
	
	String popupId = uicomponent.getId();
	def rcontext = _ctx.getRequestContext();
	
	def message = uicomponent.getMessage();
	def actions = uicomponent.getActions();

	void printAction(List actions)
	{
		for(act in actions)
		{
			println "	<a href=\"javascript:void(0);\" onclick="+uicomponent.event("Click", act.getEventId())+" class=\"btn\"> ${act.getActionKey()} </a>";
		}
	}
%>
	<div class="UIPopupWindow UIDragObject uiPopup" id="$popupId" style="width: 550px; display: none;">
	<%
    def module = rcontext.getJavascriptManager().require("SHARED/uiPopupWindow", "uiPopupWindow");
	  if(uicomponent.hasMessage()){
		  module.addScripts("uiPopupWindow.show('$popupId', $uicomponent.showMask);");	  
	%>
		<div class="popupHeader clearfix">
			<a class="uiIconClose pull-right" title="<%=_ctx.appRes("UIConfirmation.Close")%>" onclick="<%=uicomponent.event("Close")%>"></a>
			<span class="PopupTitle popupTitle"><%= _ctx.appRes("UIConfirmation.title.exoMessages") %></span>
		</div>
		
		<div class="PopupContent popupContent">
			<ul class="singleMessage popupMessage resizable">
				<li>
					<span class="confirmationIcon">
					<%=HTMLEntityEncoder.getInstance().encode(message);%>
					</span>
				</li>
			</ul>
			<div class="uiAction uiActionBorder">
				<%
					printAction(actions);
				%>
			</div>
		</div>			
	<%
	  } else if (rcontext.useAjax()) {
      module.addScripts("uiPopupWindow.hide('$popupId', $uicomponent.showMask);");
		}
	%>
  </div>