<%@ page language="java" buffer="64kb" %>

<%@ 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" %>
<vkc:init/>

<table align='left' width='100%' cellpadding='2' cellspacing='0' border='0'>

  <bean:define id="form" name="form" type="vkc.administration.form.SystemDefaultsForm"/>

  
  <html:hidden property="selectedContext"/>
  <html:hidden property="uniqueId"/>
  <logic:iterate id="did" name="form" property="deleteIds" type="java.lang.Integer">
    <html:hidden property="deleteIds" name="form" value='<%=String.valueOf(did.toString())%>'/>
  </logic:iterate>

  <tr bgcolor='#c0c0c0' color='#FFFFFF'>
    <td align='center'>&nbsp;<b><vkc:message key="vkc.administration.systemdefaults.adddocattributes.manage"/>:</b>&nbsp;</td>
  </tr>

  <tr>
    <td width="100%">
	  <logic:notEmpty name="form" property="addDocAttributes">
      <table cellspacing="1" cellpadding="3" width="100%" border="0" class="tableLineColor">
        <tr>  
          <td class="headerUnselected" nowrap="nowrap" align="center">&nbsp;</td>
          <td class="headerUnselected" nowrap="nowrap" align="center"><b><vkc:message key="vkc.string.number"/></b></td>
          <td class="headerUnselected" nowrap="nowrap" align="left" width="33%"><b><vkc:message key="vkc.administration.systemdefaults.adddocattributes.name"/>&nbsp;<vkc:img page="/templates/${template.name}/gfx/mandatoryField.gif" alt="*" border="0"/></b></td>
          <td class="headerUnselected" nowrap="nowrap" align="left" width="33%"><b><vkc:message key="vkc.administration.systemdefaults.adddocattributes.description"/></b></td>
          <td class="headerUnselected" nowrap="nowrap" align="left" width="33%"><b><vkc:message key="vkc.administration.systemdefaults.adddocattributes.defaultvalue"/></b></td>
          <td class="headerUnselected" nowrap="nowrap" align="left"><b><vkc:message key="vkc.administration.systemdefaults.adddocattributes.allownull"/></b></td>
        </tr>
        <logic:iterate id="addDocAttribute" name="form" property="addDocAttributes" indexId="index" type="vkc.db.entities.VKCAddAttribute">
        <html:hidden name="addDocAttribute" property="attrId" indexed="true"/>
        <tr> 
          <td class="columnSelected" align="center"><vkc:link linkName='<%= "attribute" + addDocAttribute.getAttrId() %>'/><html:multibox property="selectedIds"><vkc:write name="addDocAttribute" property="attrId"/></html:multibox></td>
          <td class="columnSelected" align="center">&nbsp;<%=index.intValue()+1%>&nbsp;</td>
          <td class="columnSelected" align="left" width="33%"><vkc:text name="addDocAttribute" property="name" indexed="true" style="width:100%;"/></td>
          <td class="columnSelected" align="left" width="33%"><vkc:text name="addDocAttribute" property="description" indexed="true" style="width:100%;"/></td>
          <td class="columnSelected" align="left" width="33%"><vkc:text name="addDocAttribute" property="defaultValue" indexed="true" style="width:100%;"/></td>
          <td class="columnSelected" align="center"><html:multibox property="nullIds"><vkc:write name="addDocAttribute" property="attrId"/></html:multibox></td>
        </tr> 
        </logic:iterate>
      </table>
	  </logic:notEmpty>
	
	  <logic:empty name="form" property="addDocAttributes">
      <table cellspacing="1" cellpadding="3" width="100%" border="0">
	    <tr><td colspan="2"><vkc:message key="vkc.administration.systemdefaults.adddocattributes.noattributes"/></td></tr>
      </table>
	  </logic:empty>
	
      <table cellspacing="1" cellpadding="3" width="100%" border="0">
	    <tr>
	      <td colspan="2">
	        <vkc:button property="action.new.adddocattribute" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="vkc.administration.button.new.attribute"/></vkc:button>
	        <logic:notEmpty name="form" property="addDocAttributes">
	        <vkc:button property="action.delete.adddocattribute" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="vkc.administration.button.delete.attribute"/></vkc:button>
	        </logic:notEmpty>
	      </td>
	    </tr>  
      </table>
    </td>
  </tr>

  <vkc:hline bottomSpace="5" topSpace="0" colspan="2" lineClass="hline" lineHeight="1"/>

  <tr>
    <td align="center" nowrap>
      <vkc:button property="action.save.adddocattributes" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="button.save"/></vkc:button>
    </td>
  </tr>

</table>
