<%@  page pageEncoding="utf-8" contentType="text/html;charset=utf-8" import="com.novell.webaccess.common.JSPConduit, com.novell.emframe.dev.eMFrameUtils" %>
<%   JSPConduit c = JSPConduit.getJSPConduit(request);
   c.stringTable("DevResources");
   c.stringTable("FwResources"); %>

<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>

<HTML>
<HEAD>
   <TITLE><%= c.string("ProductName") %></TITLE>
   <LINK rel='stylesheet' href='<%= c.getModulesUrl() + "/dev/css/hf_style.css" %>'>
   <jsp:include page='<%= c.getPath("dev/eMFrameScripts_inc.jsp") %>' flush="true" />

   <SCRIPT LANGUAGE="JavaScript">
      function isPageValid()
      {
         document.form.attributes.value = packSelect(document.form._attributes);
         return true;
      }

      function swapOptions(sel, i1, i2)
      {
         var o = sel.options;
         if(i1>=0 && i2>=0 && i1<o.length && i2<o.length)
         {
            var tmpVal = o[i1].value;
            var tmpText = o[i1].text;
            o[i1].value = o[i2].value;
            o[i1].text = o[i2].text;
            o[i2].value = tmpVal;
            o[i2].text = tmpText;
            o.selectedIndex = i1;
         }
      }

      function moveUp(sel)
      {
         swapOptions(sel, sel.selectedIndex-1, sel.selectedIndex);
      }

      function moveDown(sel)
      {
         swapOptions(sel, sel.selectedIndex+1, sel.selectedIndex);
      }
      function init()
      {
         parent.setFooterButtons(parent.nextButton | parent.backButton | parent.cancelButton);
         parent.setHeader("<% if (c.var("mode").equals("developer")) { %><%= c.string("TemplateBuilder.title") %><% } else { %><%= c.string("TaskBuilder.title") %><% } %>", "<%= c.string("TaskBuilder.FormatOptions") %>");
      }
   </SCRIPT>

   <STYLE>
      select {width:200px; font-size:10px; font-face:Helvetica,Arial};
   </STYLE>
</HEAD>

<body text="#000000" bgcolor="#ffffff" onLoad="init();">
<FORM name="form" method=post action="webacc" onsubmit="isPageValid();" >

<!-- WEBACC VARIABLES -->
<INPUT type=hidden name="taskId" value="<%= c.var("taskId") %>">
<INPUT type=hidden name="nextState" value="WriteTemplateOrParams">
<INPUT type=hidden name="objectTypeName" value="<%= c.toHTML(c.var("objectTypeName")) %>">

<% if (c.var("mode").equals("developer")) {
      c.set("nextMerge", "fw.TemplateBuilder_created");
   } else {
      c.set("nextMerge", "fw.TemplateBuilder_preview");
   } %>

<INPUT type=hidden name="merge" value="<%= c.var("nextMerge") %>">
<INPUT type=hidden name="error" value="dev.GenErr">
<INPUT type=hidden name="pluginType" value="<%= c.var("pluginType") %>">
<INPUT type=hidden name="client" value="<%= c.var("client") %>">
<INPUT type=hidden name="mode" value="<%= c.var("mode") %>">


<DIV class=instructions><%= c.string("TaskBuilder.FormatInstructions") %></DIV><BR>

<TABLE>
   <TR>
      <TD><%= c.string("TaskBuilder.AttributeOrder") %></TD>
   </TR>
   <TR>
      <TD>
         <INPUT type=hidden name=attributes value="">
         <SELECT size="10" name="_attributes">
            <% c.set("i", "0");
               while (c.lt(c.var("i"), c.var("attributes.count"))) { %>
            <OPTION value="<%= c.toHTML(c.var("attributes."+c.var("i"))) %>"><%= c.toHTML(c.var("attributes."+c.var("i"))) %>
            <% c.inc("i");
               } %>
         </SELECT>
      </TD>
      <TD>
         <A href="#" onClick="moveUp(document.form._attributes);"><IMG src="<%= c.getModulesUrl() + "/dev/images/up24.gif" %>" border="0" alt="<%= c.string("TaskBuilder.MoveUp") %>" title="<%= c.string("TaskBuilder.MoveUp") %>"></A><BR>
         <A href="#" onClick="moveDown(document.form._attributes);"><IMG src="<%= c.getModulesUrl() + "/dev/images/down24.gif" %>" border="0" alt="<%= c.string("TaskBuilder.MoveDown") %>" title="<%= c.string("TaskBuilder.MoveDown") %>"></A>
      </TD>
   </TR>
</TABLE>
<BR>
<TABLE>
   <TR>
      <TD><%= c.string("TaskBuilder.Layout") %></TD>
   </TR>
   <TR><TD>
   <SELECT size="1" name="layout">
   <% if(c.var("pluginType").equals("create")){ %>
      <OPTION value="left"><%= c.string("TaskBuilder.LabelsLeftOfControls") %>
      <OPTION value="above"><%= c.string("TaskBuilder.LabelsAboveControls") %>
   <% } else { %>
      <OPTION value="above"><%= c.string("TaskBuilder.LabelsAboveControls") %>
      <OPTION value="left"><%= c.string("TaskBuilder.LabelsLeftOfControls") %>
   <% } %>
   </SELECT>
   </TD>
   </TR>
   <TR><TD>&nbsp;</TD></TR>


   <c:if test="${pluginType=='create'}">
      <TR>
         <TD><%= c.string("TaskBuilder.ContainerControl") %></TD>
      </TR>
      <TR>
         <TD>
            <SELECT name="contextControlType">
               <OPTION value="0"><%= c.string("TextfieldUiHandlerName") %>
               <OPTION value="1"><%= c.string("MVSelectDisplayName") %>
               <OPTION value="2"><%= c.string("MVRadioDisplayName") %>
            </SELECT>
         </TD>
      </TR>
      <TR><TD>&nbsp;</TD></TR>

      <c:if test="${showPasswordCheckbox}">
         <TR>
            <TD>
               <INPUT type="checkbox" name="showPassword" value="true">&nbsp;<%= c.string("TaskBuilder.AddSetPasswordField") %>
            </TD>
         </TR>
      </c:if>

      <c:if test="${showCloneCheckbox}">
         <TR>
            <TD>
               <INPUT type="checkbox" name="showClone" value="true">&nbsp;<%= c.string("TaskBuilder.AddCloneObjectField") %>
            </TD>
         </TR>
      </c:if>
   </c:if>


   <c:if test="${pluginType=='page'}">
      <TR>
         <TD>
            <INPUT type="checkbox" name="showOthername" value="true">&nbsp;<%= c.string("TaskBuilder.ShowOthername") %>
         </TD>
      </TR>
   </c:if>


</TABLE>

<BR><BR>
</FORM>
</BODY>
</HTML>
