<%@ 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 width="100%" align="left" cellpadding="0" cellspacing="0" border="0">
  <bean:define id="form" name="form" type="vkc.administration.form.SystemDefaultsForm"/>
  
  <html:hidden property="selectedContext"/>
  <html:hidden property="selectedSystemViewId"/>
  <html:hidden property="selectedTabViewId"/>

  <logic:notEmpty name="form" property="tabViews">
  <tr>
    <td width="1" valign="top">
      <table cellspacing="1" cellpadding="0" border="0">
        <logic:iterate id="tab" name="form" property="systemViews" indexId="index" type="vkc.view.bean.TabInfo">
        <bean:define id="sysParams" name="form" property='<%="systemViewParams(" + tab.getTabId() + ")"%>'/>
        
        <tr> 
          <logic:equal name="form" property="selectedSystemViewId" value="<%=tab.getTabId().toString()%>">
          <td nowrap="nowrap"><vkc:img page="/templates/${template.name}/gfx/arrow-right.gif" alt=""/></td>
          <td nowrap="nowrap"><vkc:link page="/systemDefaults.do" name="sysParams" style="font-weight:bold;text-decoration:none;"><vkc:write name="tab" property="tabName"/></vkc:link></td>
          </logic:equal>
          <logic:notEqual name="form" property="selectedSystemViewId" value="<%=tab.getTabId().toString()%>">
          <td nowrap="nowrap"><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" width="1" height="1"/></td>
          <td nowrap="nowrap"><vkc:link page="/systemDefaults.do" name="sysParams" style="font-weight:normal;text-decoration:none;"><vkc:write name="tab" property="tabName"/></vkc:link></td>
          </logic:notEqual>
        </tr> 
        </logic:iterate>
      </table>
    </td>

    <td width="5" valign="top"><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" width="5" height="1"/></td>
    <td width="1" valign="top" class="hline"><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" width="1" height="1"/></td>
    <td width="5" valign="top"><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" width="5" height="1"/></td>

    <td width="1" valign="top">
      <table cellspacing="1" cellpadding="0" border="0">
        <logic:iterate id="tab" name="form" property='<%="tabViewList[" + form.getSelectedSystemViewId() + "]"%>' indexId="index" type="vkc.view.bean.TabInfo">
        <bean:define id="params" name="form" property='<%="tabViewParams(" + tab.getTabId() + ")"%>'/>
        
        <logic:equal name="tab" property="hide" value="false">
        <tr> 
          <logic:equal name="tab" property="enabled" value="true">
            <logic:equal name="form" property="selectedTabViewId" value="<%=tab.getTabId().toString()%>">
            <td nowrap="nowrap"><vkc:img page="/templates/${template.name}/gfx/arrow-right.gif" alt=""/></td>
            <td nowrap="nowrap"><vkc:link page="/systemDefaults.do" name="params" style="font-weight:bold;text-decoration:none;"><vkc:write name="tab" property="tabName"/></vkc:link></td>
            </logic:equal>
            <logic:notEqual name="form" property="selectedTabViewId" value="<%=tab.getTabId().toString()%>">
            <td nowrap="nowrap"><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" width="1" height="1"/></td>
            <td nowrap="nowrap"><vkc:link page="/systemDefaults.do" name="params" style="font-weight:normal;text-decoration:none;"><vkc:write name="tab" property="tabName"/></vkc:link></td>
            </logic:notEqual>
          </logic:equal>

          <logic:equal name="tab" property="enabled" value="false">
            <logic:equal name="form" property="selectedTabViewId" value="<%=tab.getTabId().toString()%>">
            <td nowrap="nowrap"><vkc:img page="/templates/${template.name}/gfx/arrow-right.gif" alt=""/></td>
            <td nowrap="nowrap"><vkc:link page="/systemDefaults.do" name="params" style="font-weight:bold;text-decoration:none;color:#aaaaaa;"><vkc:write name="tab" property="tabName"/></vkc:link></td>
            </logic:equal>
            <logic:notEqual name="form" property="selectedTabViewId" value="<%=tab.getTabId().toString()%>">
            <td nowrap="nowrap"><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" width="1" height="1"/></td>
            <td nowrap="nowrap"><vkc:link page="/systemDefaults.do" name="params" style="font-weight:normal;text-decoration:none;color:#aaaaaa;"><vkc:write name="tab" property="tabName"/></vkc:link></td>
            </logic:notEqual>
          </logic:equal>
        </tr> 
        </logic:equal>
        </logic:iterate>
      </table>
    </td>

    <logic:notEmpty name="form" property='<%="tabViewList[" + form.getSelectedSystemViewId() + "]"%>'>
    <td width="5" valign="top"><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" width="5" height="1"/></td>
    <td width="1" valign="top" class="hline"><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" width="1" height="1"/></td>
    <td width="5" valign="top"><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" width="5" height="1"/></td>

    <bean:define id="selectedTab" name="form" property='<%="tabView(" + form.getSelectedTabViewId() + ")"%>'/>
    <td width="100%" valign="top">
	  <logic:equal name="selectedTab" property="hide" value="false">
      <table width="100%">
	    <tr color="#FFFFFF" bgcolor="#c0c0c0">
	      <td align="center"><b><vkc:message key="vkc.administration.systemdefaults.tabviewsettings.edit"/></b></td>
	    </tr>
        <tr>
          <td>
	        <table cellspacing="1" cellpadding="0" border="0">
	          <tr> 
	            <td nowrap="nowrap"><b><vkc:message key="vkc.administration.systemdefaults.tabviewsettings.enable"/></b>:</td>
	            <td nowrap="nowrap"><html:multibox name="form" property="selectedIds"><vkc:write name="selectedTab" property="tabId"/></html:multibox></td>
	          </tr> 
	          <tr> 
	            <td nowrap="nowrap" valign="top"><b><vkc:message key="vkc.administration.systemdefaults.tabviewsettings.viewtype"/></b>:</td>
	            <td nowrap="nowrap" valign="top">
	              <table>
	                <tr>
	                  <td>
	                    <html:radio name="form" property="selectedId" value='<%=vkc.view.bean.TabInfo.VIEWTYPEID_CLASSIC.toString()%>'/>
	                  </td>
	                  <td>
	                    <vkc:message key="vkc.administration.systemdefaults.tabviewsettings.viewtype.classic"/>
	                  </td>
	                </tr>
	                <tr>
	                  <td>
	                    <html:radio name="form" property="selectedId" value='<%=vkc.view.bean.TabInfo.VIEWTYPEID_ALTERNATE.toString()%>'/>
	                  </td>
	                  <td>
	                    <vkc:message key="vkc.administration.systemdefaults.tabviewsettings.viewtype.alternate"/>
	                  </td>
	                </tr>
	              </table>
	            </td>
	          </tr>
	        </table>
          </td>
        </tr>
		
		<vkc:hline bottomSpace="5" topSpace="0" colspan="1" lineClass="hline" lineHeight="1"/>

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

    <logic:empty name="form" property='<%="tabViewList[" + form.getSelectedSystemViewId() + "]"%>'>
    <td width="100%" valign="top">&nbsp;</td>
    </logic:empty>
  </tr>
  </logic:notEmpty>
</table>