<%@  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");
   c.stringTable("BaseResources"); %>
<HTML>
<HEAD>
<TITLE><%= c.toDisplay(c.string("DevelopersForm.Task.DisplayName")) %></TITLE>
<LINK   href="<%= c.getModulesUrl() + "/dev/css/hf_style.css" %>"
        rel="styleSheet"
        type="text/css">

<jsp:include page='<%= c.getPath("dev/MoveListItems_inc.jsp") %>' flush="true" />
<jsp:include page='<%= c.getPath("dev/eMFrameScripts_inc.jsp") %>' flush="true" />

<script language="JavaScript">

    //Global variables
    var myWindow = null;


    /*******************
     * FUNCTION HEADER *
     *******************/
    function addSelected()
    {
        if ((myWindow == null) || myWindow.closed)
        {
            var strUrl = "webacc?taskId=<%= c.var("taskId") %>&merge=fw.DeveloperPage&User.context=<%= c.toDisplay(c.var("User.context")) %>&nextState=DeveloperPagePage&Task.SelectedButton=AddPageListButton";
            var winOptions = "toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,width=575,height=410";
            myWindow = window.open(strUrl, "", winOptions);
        }
        else
        {
            myWindow.focus();
        }
    }

    /*******************
     * FUNCTION HEADER *
     *******************/
    function deleteSelected()
    {
        var form = document.DeveloperPageListForm;

        if((form.List.selectedIndex == -1) || (form.List.length == 0))
        {
            return;
        }

        if(confirm("<%= c.toScript(c.string("DevelopersForm.DeleteObject")) %>")== false)
        {
            return;
        }

        form.elements["merge"].value="fw.DeveloperPageList";
        form.elements["nextState"].value="DeveloperPageListPage";
        form.elements["Task.SelectedButton"].value="DeletePageListButton";
        form.elements["Selected_Item"].value=form.List.options[form.List.selectedIndex].value;
        form.submit();
   }


    /*******************
     * FUNCTION HEADER *
     *******************/
    function modifySelected()
    {
        var form = document.DeveloperPageListForm;

        if((form.List.selectedIndex == -1) || (form.List.length == 0))
        {
            return;
        }

        if ((myWindow == null) || myWindow.closed)
        {
            var selectedItem = form.List.options[form.List.selectedIndex].value;
            var strUrl = "webacc?taskId=<%= c.var("taskId") %>&merge=fw.DeveloperPage&User.context=<%= c.toDisplay(c.var("User.context")) %>&nextState=DeveloperPagePage&Task.SelectedButton=ModifyPageListButton&Selected_Item="+urlEncode(selectedItem);
            var winOptions = "toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,width=575,height=410";
            myWindow = window.open(strUrl, "", winOptions);
        }
        else
        {
            myWindow.focus();
        }
    }


    /*******************
     * FUNCTION HEADER *
     *******************/
    function nextSelected()
    {
        var form = document.DeveloperPageListForm;

        form.elements["merge"].value="fw.DeveloperBookList";
        form.elements["nextState"].value="DeveloperBookListPage";
        form.elements["Task.SelectedButton"].value="NextPageListButton";
        form.submit();
    }


    /*******************
     * FUNCTION HEADER *
     *******************/
    function backSelected()
    {
        var form = document.DeveloperPageListForm;

        form.elements["merge"].value="fw.DeveloperTaskList";
        form.elements["nextState"].value="DeveloperTaskListPage";
        form.elements["Task.SelectedButton"].value="BackPageListButton";
        form.submit();
    }


    /*******************
     * FUNCTION HEADER *
     *******************/
    function onPageLoad()
    {
        var form = document.DeveloperPageListForm;

        sortLists(form.List);

        if( form.List.length > 0 )
        {
            form.List.options[0].selected=true;
        }
    }


    /*******************
     * FUNCTION HEADER *
     *******************/
    function setPageInfo(pageName, addMod)
    {
        var form = document.DeveloperPageListForm;

        form.elements["DP_TaskName_Name"].value = pageName;

        form.elements["merge"].value="fw.DeveloperPageList";
        form.elements["nextState"].value="DeveloperPageListPage";
        form.elements["Task.SelectedButton"].value="OkPageButton";
        form.elements["AddOrModify"].value=addMod;
        form.submit();
    }


    /*******************
     * FUNCTION HEADER *
     *******************/
	function checkDefaultKey(evt)
   {
      var keyCode = evt.which ? evt.which : evt.keyCode;
      // 13 is the Enter key code
      if (keyCode == 13)
      {
         return(nextSelected());
      }
      return true;
   }

</SCRIPT>
</HEAD>

<BODY   TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#000000" bgcolor="#FFFFFF"
        onLoad="onPageLoad()">
<form   name="DeveloperPageListForm"
        method="post"
        onSubmit="return(nextSelected())"
        action="webacc">

        <input  type=hidden
                name="taskId"
                value="fw.Developer">

        <input  type=hidden
                name="merge"
                value="">

        <input  type=hidden
                name="error"
                value="dev.GenErr">

        <input  type=hidden
                name="User.context"
                value="<%= c.var("User.context") %>">

        <input  type=hidden
                name="nextState"
                value="">

        <input  type=hidden
                name="Selected_Item"
                value="">

        <input  type=hidden
                name="Task.SelectedButton"
                value="">

        <input  type=hidden
                name="DP_TaskName_Name"
                value="">

        <input   type=hidden
                name="AddOrModify"
                value="<%= c.toDisplay(c.var("AddOrModify_Value")) %>">

	<!-- ************ -->
	<!-- HEADER TABLE -->
	<!-- ************ -->
    <% c.set("WizardHeader.title", c.toDisplay(c.string("DevelopersForm.Wizard.Header")));
       c.set("WizardHeader.subtitle", c.toDisplay(c.string("Schema.Step5")));
       c.set("WizardHeader.instruction", c.toDisplay(c.string("DevelopersForm.PageList.Step")));
       c.set("WizardHeader.helpFile", "base/xmlinstallfile_definepages.html"); %>
    <jsp:include page='<%= c.getPath("dev/WizardHeader_inc.jsp") %>' flush="true" />

	<!-- ************************* -->
	<!-- STEPS & INSTRUCTION TABLE -->
	<!-- ************************* -->
    <table border="0" cellspacing="0" cellpadding="2" width="90%">
        <tr valign="baseline">
            <td height="16" colspan="7" align="center" valign="middle" class="instructions">
                <div align="left"><%= c.toDisplay(c.string("DevelopersForm.PageList.Instruction")) %></div>
            </td>
        </tr>
        <tr valign="baseline">
            <td height="16" colspan="5" align="center" valign="middle" class="mediumtext">
                &nbsp;
            </td>
        </tr>
    </table>

    <!-- ************* -->
    <!-- CONTENT TABLE -->
    <!-- ************* -->
    <table border="0" cellspacing="4" cellpadding="0">
        <tr>
            <td class="mediumtext">
                <b><%= c.toDisplay(c.string("DevelopersForm.PageList.Pages")) %>
            </td>
        </tr>
        <tr>
            <td>
                <select size="10" name="List" style="WIDTH: 250px" onkeypress="return checkDefaultKey(event)">
                    <% c.set("i", "0");
                       while (c.lt(c.var("i"), c.var("List.Count"))) { %>
                        <OPTION value="<%= c.toDisplay(c.var("List.Element."+c.var("i"))) %>"><%= c.toDisplay(c.var("List.Element."+c.var("i"))) %>
                    <% c.inc("i");
                       } %>
                </select>
            </td>
            <td valign="top" align="center">
                <table border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td>
                            <a href="#" onClick="javascript:addSelected();return false"><IMG src="<%= c.getModulesUrl() + "/dev/images/iconadd.gif" %>" alt="<%= c.string("Button.Add.alt") %>" title="<%= c.string("Button.Add.alt") %>" border=0></a>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <a href="#" onClick="javascript:deleteSelected();return false"><IMG src="<%= c.getModulesUrl() + "/dev/images/iconremove.gif" %>" alt="<%= c.string("Button.Delete.alt") %>" title="<%= c.string("Button.Delete.alt") %>" border=0></a>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <a href="#" onClick="javascript:modifySelected();return false"><IMG src="<%= c.getModulesUrl() + "/dev/images/iconedit.gif" %>" alt="<%= c.string("Button.Modify.alt") %>" title="<%= c.string("Button.Modify.alt") %>" border=0></a>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>

	<!-- ************ -->
	<!-- BUTTON TABLE -->
	<!-- ************ -->
    <table width="85%" border="0" cellspacing="0" cellpadding="0" height="25">
        <tr valign="baseline" bgcolor="#FFFFFF">
            <td height="16" colspan="5" align="center" valign="middle" class="mediumtext">
                &nbsp;
            </td>
            <td height="16" align="left" valign="middle" colspan="2" class="mediumtext">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td colspan="2" height="23" class="ruleabove">
                <a href="#" onClick="javascript:backSelected();return false">
                    <IMG src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.Back.image") %>"
                    alt="<%= c.string("Button.Back.alt") %>"
                    title="<%= c.string("Button.Back.alt") %>"
                    border=0></a>
                <a href="#" onClick="javascript:nextSelected();return false">
                    <IMG src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.Next.image") %>"
                    alt="<%= c.string("Button.Next.alt") %>"
                    title="<%= c.string("Button.Next.alt") %>"
                    border=0></a><jsp:include page='<%= c.getPath("dev/Cancel_inc.jsp") %>' flush="true" />
            </td>
        </tr>
    </table>
</form>
</BODY></HTML>

