<%@ page language="java" %>
<%@ taglib uri="struts-html"     prefix="html"  %>
<%@ taglib uri="struts-bean"     prefix="bean"  %>
<%@ taglib uri="struts-logic"    prefix="logic" %>
<%@ taglib uri="vkc-taglib"      prefix="vkc"   %>
<%@ page import="org.apache.struts.Globals" %>
<%@ page import="vkc.administration.form.SystemMaintenanceForm" %>
<%@ page import="vkc.db.entities.VKCCategory" %>

<vkc:init/>

<html:form action="/export" method="post">
<input type="hidden" name="selectedContext" value="<%=request.getParameter("selectedContext")%>" />
<table align='left' width='100%' cellpadding='2' cellspacing='0' border='0'>

  <bean:define id="form" name="exportMaintenanceForm" type="vkc.administration.form.ExportMaintenanceForm"/>  
  <vkc:hidden name="form" property="exportFilePath" />
   <html:hidden property="categoryId"/> 
   <logic:present name="succeeded">               
    <tr>
      <td colspan="2" bgcolor="#77D369" align="center">
        <font color="white"><b><vkc:write name="succeeded"/></b></font>
      </td>      
    </tr>
    <tr>
       <td><b><vkc:message key="vkc.administration.systemmaintenance.export.exportfile"/>:</b></td>
       <td nowrap="nowrap"><vkc:link page="/downloadFile" paramId="file" paramName="form" paramProperty="encodedExportFilename" titleKey="vkc.string.download" target="_blank"><vkc:write name="form" property="exportFilename"/></vkc:link></td>
    </tr>    
    <tr>
     <td align="left" nowrap="nowrap" colspan="2">&nbsp;</td>
    </tr>
  </logic:present>  
  <logic:notPresent name="succeeded">
  <table width="100%" border="0" class="color_tab">
    <tr align="center">
      <td>
	    <table width="100%">          
		  <bean:define id="categories" name="form" property="categories"></bean:define>	
		   
		  <tr>
      		<td align="left" valign="top" nowrap="nowrap"><b><vkc:message key="vkc.administration.systemmaintenance.export.selectedcategory" />:</b></td>
      		<td width="100%" align="left" valign="top" colspan="4">
        	<table cellpadding="0" cellspacing="0" border="0">
          		<tr>
           			 <td><vkc:image page="/templates/${template.name}/gfx/navigator.gif" property="btn_explorer" onclick="this.blur();return showExplorer();" titleKey="vkc.string.show.explorer"/></td>
           			 <td>&nbsp;</td>
           			 <td><vkc:link page="/showCategory.do" name="form" property="exportCategoryParams"><vkc:write name="form" property="categoryPath"/></vkc:link></td>
         		 </tr>
      		  </table>
     		 </td>
   		 </tr>
         <tr><td nowrap="nowrap">&nbsp;&nbsp;&nbsp;</td></tr>
		
          <tr>
            <td nowrap="nowrap"><b><vkc:message key="vkc.administration.systemmaintenance.export.directory"/>:</b></td>
            <td nowrap="nowrap"><vkc:write name="form" property="archiveDirectoryPath"/></td>
          </tr>
 		  <tr><td nowrap="nowrap">&nbsp;&nbsp;&nbsp;</td></tr>
         
		  
    	  <tr>
            <td nowrap="nowrap" align="left" colspan="2">
    	      <vkc:button property="action.export" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="vkc.administration.button.export"/></vkc:button>
	  	    </td>
          </tr>
  	    </table>
      </td>
    </tr>
  </table> 
  </logic:notPresent>

</table>
</html:form>