Esempio n. 1
0
        /// <summary> This is an opportunity to write HTML directly into the main form, without
        /// using the pop-up html form architecture </summary>
        /// <param name="Output"> Textwriter to write the pop-up form HTML for this viewer </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <remarks> This text will appear within the ItemNavForm form tags </remarks>
        public override void Write_ItemNavForm_Closing(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Default_Metadata_AdminViewer.Write_ItemNavForm_Closing", "Add any popup divisions for form elements");

            Output.WriteLine("<!-- Default_Metadata_AdminViewer.Write_ItemNavForm_Closing -->");

            // Add the scripts needed
            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/jquery/jquery-ui-1.10.3.custom.min.js\"></script>");

            // Add the hidden field
            Output.WriteLine("<!-- Hidden field is used for postbacks to indicate what to save -->");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_project_tosave\" name=\"admin_project_tosave\" value=\"\" />");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_project_delete\" name=\"admin_project_delete\" value=\"\" />");
            Output.WriteLine();

            Output.WriteLine("<!-- Default_Metadata Rename Form -->");
            Output.WriteLine("<div class=\"sbkPav_PopupDiv\" id=\"form_project\" style=\"display:none;\">");
            Output.WriteLine("  <div class=\"sbkAdm_PopupTitle\"><table style=\"width:100%\"><tr><td style=\"text-align:left;\">RENAME DEFAULT METADATA</td><td style=\"text-align:right;\"> <a href=\"#template\" alt=\"CLOSE\" onclick=\"project_form_close()\">X</a> &nbsp; </td></tr></table></div>");
            Output.WriteLine("  <br />");
            Output.WriteLine("  <table class=\"sbkAdm_PopupTable\">");

            // Add line for code
            Output.WriteLine("    <tr>");
            Output.WriteLine("      <td style=\"width:120px;\"><label for=\"form_project_code\">Metadata Code:</label></td>");
            Output.WriteLine("      <td><span class=\"form_linkline admin_existing_code_line\" id=\"form_project_code\"></span></td>");
            Output.WriteLine("    </tr>");

            // Add line for name
            Output.WriteLine("    <tr>");
            Output.WriteLine("      <td><label for=\"form_project_name\">Metadata Name:</label></td>");
            Output.WriteLine("      <td><input class=\"sbkPav_large_input sbkAdmin_Focusable\" name=\"form_project_name\" id=\"form_project_name\" type=\"text\" value=\"\" /></td>");
            Output.WriteLine("    </tr>");

            // Add the buttons and close the table
            Output.WriteLine("    <tr style=\"height:35px; text-align: center; vertical-align: bottom;\">");
            Output.WriteLine("      <td colspan=\"2\"> &nbsp; &nbsp; ");
            Output.WriteLine("        <button title=\"Do not apply changes\" class=\"sbkAdm_RoundButton\" onclick=\"return project_form_close();\"><img src=\"" + currentMode.Base_URL + "default/images/button_previous_arrow.png\" class=\"sbkAdm_RoundButton_LeftImg\" alt=\"\" /> CANCEL</button> &nbsp; &nbsp; ");
            Output.WriteLine("        <button title=\"Save changes to this default metadata\" class=\"sbkAdm_RoundButton\" type=\"submit\">SAVE <img src=\"" + currentMode.Base_URL + "default/images/button_next_arrow.png\" class=\"sbkAdm_RoundButton_RightImg\" alt=\"\" /></button>");
            Output.WriteLine("      </td>");
            Output.WriteLine("    </tr>");
            Output.WriteLine("  </table>");
            Output.WriteLine("</div>");
            Output.WriteLine();

            Tracer.Add_Trace("Default_Metadata_AdminViewer.Write_ItemNavForm_Closing", "Write the rest of the form html");

            // Get the list of all projects
            DataSet projectsSet = SobekCM_Database.Get_All_Template_DefaultMetadatas(Tracer);

            Output.WriteLine("<script src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_admin.js\" type=\"text/javascript\"></script>");
            Output.WriteLine("<div class=\"sbkAdm_HomeText\">");

            if (actionMessage.Length > 0)
            {
                Output.WriteLine("  <br />");
                Output.WriteLine("  <div id=\"sbkAdm_ActionMessage\">" + actionMessage + "</div>");
            }

            Output.WriteLine("  <p>For clarification of any terms on this form, <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "adminhelp/projects\" target=\"PROJECTS_INTERFACE_HELP\" >click here to view the help page</a>.</p>");

            Output.WriteLine("  <h2>New Default Metadata</h2>");
            Output.WriteLine("  <div class=\"sbkPav_NewDiv\">");
            Output.WriteLine("    <table class=\"sbkAdm_PopupTable\">");

            // Add line for code and base code
            Output.WriteLine("      <tr>");
            Output.WriteLine("        <td style=\"width:120px;\"><label for=\"admin_project_code\">Metadata Code:</label></td>");
            Output.WriteLine("        <td><input class=\"sbkPav_small_input sbkAdmin_Focusable\" name=\"admin_project_code\" id=\"admin_project_code\" type=\"text\" value=\"\" /></td>");
            Output.WriteLine("        <td style=\"width:285px;\">");
            Output.WriteLine("          <label for=\"admin_project_base\">Base Metadata Code:</label> &nbsp; ");
            Output.WriteLine("          <select class=\"sbkPav_select\" name=\"admin_project_base\" id=\"admin_project_base\">");
            Output.WriteLine("            <option value=\"(none)\" selected=\"selected\">(none)</option>");
            foreach (DataRow thisRow in projectsSet.Tables[0].Rows)
            {
                Output.Write("            <option value=\"" + thisRow["MetadataCode"] + "\" >" + thisRow["MetadataCode"] + "</option>");
            }
            Output.WriteLine("          </select>");
            Output.WriteLine("        </td>");
            Output.WriteLine("      </tr>");

            // Add line for name
            Output.WriteLine("      <tr>");
            Output.WriteLine("        <td><label for=\"admin_project_name\">Metadata Name:</label></td>");
            Output.WriteLine("        <td colspan=\"2\"><input class=\"sbkPav_large_input sbkAdmin_Focusable\" name=\"admin_project_name\" id=\"admin_project_name\" type=\"text\" value=\"\" /></td>");
            Output.WriteLine("      <tr>");

            // Add the SAVE button
            Output.WriteLine("      <tr style=\"height:30px; text-align: center;\"><td colspan=\"3\"><button title=\"Save new default metadata\" class=\"sbkAdm_RoundButton\" onclick=\"return save_new_project();\">SAVE <img src=\"" + currentMode.Base_URL + "default/images/button_next_arrow.png\" class=\"sbkAdm_RoundButton_RightImg\" alt=\"\" /></button></td></tr>");
            Output.WriteLine("    </table>");
            Output.WriteLine("  </div>");
            Output.WriteLine("  <br />");
            Output.WriteLine();

            // Add all the existing proejcts
            Output.WriteLine("  <h2>Existing Default Metadata</h2>");
            Output.WriteLine("  <table class=\"sbkPav_Table sbkAdm_Table\">");
            Output.WriteLine("    <tr>");
            Output.WriteLine("      <th class=\"sbkPav_TableHeader1\">ACTIONS</th>");
            Output.WriteLine("      <th class=\"sbkPav_TableHeader2\">CODE</th>");
            Output.WriteLine("      <th class=\"sbkPav_TableHeader3\">NAME</th>");
            Output.WriteLine("    </tr>");
            Output.WriteLine("    <tr><td class=\"sbkAdm_TableRule\" colspan=\"3\"></td></tr>");

            currentMode.My_Sobek_SubMode = "XXXXXXX";
            string redirect = currentMode.Redirect_URL();

            // Write the data for each interface
            foreach (DataRow thisRow in projectsSet.Tables[0].Rows)
            {
                // Pull all these values
                string code = thisRow["MetadataCode"].ToString();
                string name = thisRow["MetadataName"].ToString();

                // Build the action links
                Output.WriteLine("    <tr>");
                Output.Write("      <td class=\"sbkAdm_ActionLink\" >( ");
                Output.Write("<a title=\"Click to edit this default metadata\" href=\"" + redirect.Replace("XXXXXXX", "1" + code) + "\" >edit</a> | ");
                Output.Write("<a title=\"Click to change the name of this default metadata\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return project_form_popup('" + code + "','" + name + "');\">rename</a> ");
                if (String.Compare(code, "none", StringComparison.OrdinalIgnoreCase) != 0)
                {
                    if (user.Is_System_Admin)
                    {
                        Output.WriteLine("| <a title=\"Click to delete this default metadata\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\"  onclick=\"return delete_project('" + code + "');\">delete</a> )</td>");
                    }
                    else
                    {
                        Output.WriteLine("| <a title=\"Only SYSTEM administrators can delete default metadata\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\"  onclick=\"alert('Only SYSTEM administrators can delete default metadata'); return false;\">delete</a> )</td>");
                    }
                }
                else
                {
                    Output.WriteLine(")</td>");
                }


                // Add the rest of the row with data
                Output.WriteLine("      <td>" + code + "</td>");
                Output.WriteLine("      <td>" + name + "</td>");
                Output.WriteLine("    </tr>");
                Output.WriteLine("    <tr><td class=\"sbkAdm_TableRule\" colspan=\"3\"></td></tr>");
            }

            Output.WriteLine("  </table>");
            Output.WriteLine("  <br />");
            Output.WriteLine("</div>");
            Output.WriteLine();
        }
        /// <summary> This is an opportunity to write HTML directly into the main form, without
        /// using the pop-up html form architecture </summary>
        /// <param name="Output"> Textwriter to write the pop-up form HTML for this viewer </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <remarks> This text will appear within the ItemNavForm form tags </remarks>
        public override void Add_HTML_In_Main_Form(TextWriter Output, Custom_Tracer Tracer)
        {
            // Set the help for these subelements
            const string PORTAL_NAME_HELP  = "Name for the system when accessed through this url portal.  This additionally identifies this url portal to administrators.\n\nFor example, Digital Library of the Caribbean, or University of Florida Digital Collections.";
            const string ABBREVIATION_HELP = "Abbreviation for the system, when accessed through this url portal.\n\nFor example, 'dLOC', or UFDC.";
            const string WEB_SKIN_HELP     = "Default web skin under which this url portal should be displayed.  If none is probided, it will default to the system web skin.";
            const string AGGREGATION_HELP  = "Default aggregation which should be displayed under this url portal.  If none is provided, this url portal will display the main system home page.";
            const string URL_SEGMENT_HELP  = "URL segment used for matching purposes to determine which url portal a user is accessing this system from.\n\nA blank URL portal will make this the default portal.";
            const string BASE_PURL_HELP    = "Base permanent link URL to be used when constructing permanent URLs for items which do not have itt explicitly entered.\n\nA blank value here will result in the current URL being used as the base for the purl.";

            Tracer.Add_Trace("Portals_AdminViewer.Add_HTML_In_Main_Form", "Adds the portal information to the main form");

            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/jquery/jquery-1.6.2.min.js\"></script>");
            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/jquery/jquery-ui-1.8.16.custom.min.js\"></script>");
            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_form.js\" ></script>");

            // Add the hidden field
            Output.WriteLine("<!-- Hidden field is used for postbacks to indicate what to save and reset -->");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_portal_action\" name=\"admin_portal_action\" value=\"\" />");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_portal_tosave\" name=\"admin_portal_tosave\" value=\"\" />");
            Output.WriteLine();

            Output.WriteLine("<!-- URL Portal Edit Form -->");
            Output.WriteLine("<div class=\"admin_portal_popup_div\" id=\"form_portal\" style=\"display:none;\">");
            Output.WriteLine("  <div class=\"popup_title\"><table width=\"100%\"><tr><td align=\"left\">EDIT URL PORTAL</td><td align=\"right\"> <a href=\"#template\" alt=\"CLOSE\" onclick=\"portal_form_close()\">X</a> &nbsp; </td></tr></table></div>");
            Output.WriteLine("  <br />");
            Output.WriteLine("  <table class=\"popup_table\">");

            // Add the line for the url portal name
            Output.WriteLine("    <tr height=\"30px\">");
            Output.WriteLine("          <td width=\"145px\"><label for=\"form_portal_name\">Portal Name:</label></td>");
            Output.WriteLine("          <td><input class=\"admin_portal_input\" name=\"form_portal_name\" id=\"form_portal_name\" type=\"text\" value=\"\"  onfocus=\"javascript:textbox_enter('form_portal_name', 'admin_portal_input_focused')\" onblur=\"javascript:textbox_leave('form_portal_name', 'admin_portal_input')\" /></td>");
            Output.WriteLine("          <td><img border=\"0px\" style=\"padding-left:5px; margin-top:3px; cursor:pointer; cursor:hand;\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + PORTAL_NAME_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" /></td>");
            Output.WriteLine("    </tr>");

            // Add the line for the url portal abbreviation
            Output.WriteLine("    <tr height=\"30px\">");
            Output.WriteLine("          <td><label for=\"form_portal_abbr\">System Abbreviation:</label></td>");
            Output.WriteLine("          <td><input class=\"admin_portal_input\" name=\"form_portal_abbr\" id=\"form_portal_abbr\" type=\"text\" value=\"\"  onfocus=\"javascript:textbox_enter('form_portal_abbr', 'admin_portal_input_focused')\" onblur=\"javascript:textbox_leave('form_portal_abbr', 'admin_portal_input')\" /></td>");
            Output.WriteLine("          <td><img border=\"0px\" style=\"padding-left:5px; margin-top:3px; cursor:pointer; cursor:hand;\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + ABBREVIATION_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" /></td>");
            Output.WriteLine("    </tr>");

            // Add the line for the default web skin
            Output.WriteLine("    <tr height=\"30px\">");
            Output.WriteLine("          <td><label for=\"form_portal_skin\">Default Web Skin:</label></td>");
            Output.WriteLine("          <td><input class=\"admin_portal_input\" name=\"form_portal_skin\" id=\"form_portal_skin\" type=\"text\" value=\"\"  onfocus=\"javascript:textbox_enter('form_portal_skin', 'admin_portal_input_focused')\" onblur=\"javascript:textbox_leave('form_portal_skin', 'admin_portal_input')\" /></td>");
            Output.WriteLine("          <td><img border=\"0px\" style=\"padding-left:5px; margin-top:3px; cursor:pointer; cursor:hand;\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + WEB_SKIN_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" /></td>");
            Output.WriteLine("    </tr>");

            // Add the line for the default aggregation
            Output.WriteLine("    <tr height=\"30px\">");
            Output.WriteLine("          <td><label for=\"form_portal_aggregation\">Default Aggregation:</label></td>");
            Output.WriteLine("          <td><input class=\"admin_portal_input\" name=\"form_portal_aggregation\" id=\"form_portal_aggregation\" type=\"text\" value=\"\"  onfocus=\"javascript:textbox_enter('form_portal_aggregation', 'admin_portal_input_focused')\" onblur=\"javascript:textbox_leave('form_portal_aggregation', 'admin_portal_input')\" /></td>");
            Output.WriteLine("          <td><img border=\"0px\" style=\"padding-left:5px; margin-top:3px; cursor:pointer; cursor:hand;\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + AGGREGATION_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" /></td>");
            Output.WriteLine("    </tr>");

            // Add the line for the base url segment
            Output.WriteLine("    <tr height=\"30px\">");
            Output.WriteLine("          <td><label for=\"form_portal_url\">URL Segment:</label></td>");
            Output.WriteLine("          <td><input class=\"admin_portal_input\" name=\"form_portal_url\" id=\"form_portal_url\" type=\"text\" value=\"\"  onfocus=\"javascript:textbox_enter('form_portal_url', 'admin_portal_input_focused')\" onblur=\"javascript:textbox_leave('form_portal_url', 'admin_portal_input')\" /></td>");
            Output.WriteLine("          <td><img border=\"0px\" style=\"padding-left:5px; margin-top:3px; cursor:pointer; cursor:hand;\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + URL_SEGMENT_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" /></td>");
            Output.WriteLine("    </tr>");

            // Add the line for the base purl
            Output.WriteLine("    <tr height=\"30px\">");
            Output.WriteLine("          <td><label for=\"form_portal_purl\">Base PURL:</label></td>");
            Output.WriteLine("          <td><input class=\"admin_portal_input\" name=\"form_portal_purl\" id=\"form_portal_purl\" type=\"text\" value=\"\"  onfocus=\"javascript:textbox_enter('form_portal_purl', 'admin_portal_input_focused')\" onblur=\"javascript:textbox_leave('form_portal_purl', 'admin_portal_input')\" /></td>");
            Output.WriteLine("          <td><img border=\"0px\" style=\"padding-left:5px; margin-top:3px; cursor:pointer; cursor:hand;\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + BASE_PURL_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" /></td>");
            Output.WriteLine("    </tr>");
            Output.WriteLine("  </table>");
            Output.WriteLine("  <br />");
            Output.WriteLine("  <center><a href=\"\" onclick=\"return portal_form_close();\"><img border=\"0\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/cancel_button_g.gif\" alt=\"CLOSE\" /></a> &nbsp; &nbsp; <input type=\"image\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button_g.gif\" value=\"Submit\" alt=\"Submit\"></center>");
            Output.WriteLine("</div>");

            Output.WriteLine("<!-- Portals_AdminViewer.Add_HTML_In_Main_Form -->");
            Output.WriteLine("<script src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_admin.js\" type=\"text/javascript\"></script>");
            Output.WriteLine("<div class=\"SobekHomeText\">");

            if (!String.IsNullOrEmpty(actionMessage))
            {
                Output.WriteLine("  <strong>" + actionMessage + "</strong>");
            }

            Output.WriteLine("  <blockquote>");
            Output.WriteLine("    URL portals allow the same SobekCM library to have a very different look and feel and encompass different item aggregations.  Each portal is defined by the incoming URL and the URL for each incoming request is analyzed to ensure it is handled correctly.<br /><br />");
            Output.WriteLine("    For more information about URL portals, <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "admin/portals\" target=\"ADMIN_USER_HELP\" >click here to view the help page</a>.");
            Output.WriteLine("  </blockquote>");

            Output.WriteLine("  <span class=\"SobekAdminTitle\">New URL Portal</span>");
            Output.WriteLine("  <blockquote>");
            Output.WriteLine("  To add a new URL portal to this system, enter the information below and press SAVE.<br /><br />");
            Output.WriteLine("    <div class=\"admin_portal_new_div\">");
            Output.WriteLine("      <table class=\"popup_table\">");

            Portal newPortal = new Portal(-1, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty);



            // Add the line for the url portal name
            Output.WriteLine("        <tr height=\"30px\">");
            Output.WriteLine("          <td width=\"145px\"><label for=\"admin_portal_name\">Portal Name:</label></td>");
            Output.WriteLine("          <td><input class=\"admin_portal_input\" name=\"admin_portal_name\" id=\"admin_portal_name\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(newPortal.Name) + "\"  onfocus=\"javascript:textbox_enter('admin_portal_name', 'admin_portal_input_focused')\" onblur=\"javascript:textbox_leave('admin_portal_name', 'admin_portal_input')\" /></td>");
            Output.WriteLine("          <td><img border=\"0px\" style=\"padding-left:5px; margin-top:3px; cursor:pointer; cursor:hand;\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + PORTAL_NAME_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" /></td>");
            Output.WriteLine("        </tr>");

            // Add the line for the url portal abbreviation
            Output.WriteLine("        <tr height=\"30px\">");
            Output.WriteLine("          <td><label for=\"admin_portal_abbr\">System Abbreviation:</label></td>");
            Output.WriteLine("          <td><input class=\"admin_portal_input\" name=\"admin_portal_abbr\" id=\"admin_portal_abbr\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(newPortal.Abbreviation) + "\"  onfocus=\"javascript:textbox_enter('admin_portal_abbr', 'admin_portal_input_focused')\" onblur=\"javascript:textbox_leave('admin_portal_abbr', 'admin_portal_input')\" /></td>");
            Output.WriteLine("          <td><img border=\"0px\" style=\"padding-left:5px; margin-top:3px; cursor:pointer; cursor:hand;\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + ABBREVIATION_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" /></td>");
            Output.WriteLine("        </tr>");

            // Add the line for the default web skin
            Output.WriteLine("        <tr height=\"30px\">");
            Output.WriteLine("          <td><label for=\"admin_portal_skin\">Default Web Skin:</label></td>");
            Output.WriteLine("          <td><input class=\"admin_portal_input\" name=\"admin_portal_skin\" id=\"admin_portal_skin\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(newPortal.Default_Web_Skin) + "\"  onfocus=\"javascript:textbox_enter('admin_portal_skin', 'admin_portal_input_focused')\" onblur=\"javascript:textbox_leave('admin_portal_skin', 'admin_portal_input')\" /></td>");
            Output.WriteLine("          <td><img border=\"0px\" style=\"padding-left:5px; margin-top:3px; cursor:pointer; cursor:hand;\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + WEB_SKIN_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" /></td>");
            Output.WriteLine("        </tr>");

            // Add the line for the default aggregation
            Output.WriteLine("        <tr height=\"30px\">");
            Output.WriteLine("          <td><label for=\"admin_portal_aggregation\">Default Aggregation:</label></td>");
            Output.WriteLine("          <td><input class=\"admin_portal_input\" name=\"admin_portal_aggregation\" id=\"admin_portal_aggregation\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(newPortal.Default_Aggregation) + "\"  onfocus=\"javascript:textbox_enter('admin_portal_aggregation', 'admin_portal_input_focused')\" onblur=\"javascript:textbox_leave('admin_portal_aggregation', 'admin_portal_input')\" /></td>");
            Output.WriteLine("          <td><img border=\"0px\" style=\"padding-left:5px; margin-top:3px; cursor:pointer; cursor:hand;\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + AGGREGATION_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" /></td>");
            Output.WriteLine("        </tr>");

            // Add the line for the base url segment
            Output.WriteLine("        <tr height=\"30px\">");
            Output.WriteLine("          <td><label for=\"admin_portal_url\">URL Segment:</label></td>");
            Output.WriteLine("          <td><input class=\"admin_portal_input\" name=\"admin_portal_url\" id=\"admin_portal_url\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(newPortal.URL_Segment) + "\"  onfocus=\"javascript:textbox_enter('admin_portal_url', 'admin_portal_input_focused')\" onblur=\"javascript:textbox_leave('admin_portal_url', 'admin_portal_input')\" /></td>");
            Output.WriteLine("          <td><img border=\"0px\" style=\"padding-left:5px; margin-top:3px; cursor:pointer; cursor:hand;\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + URL_SEGMENT_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" /></td>");
            Output.WriteLine("        </tr>");

            // Add the line for the base purl
            Output.WriteLine("        <tr height=\"30px\">");
            Output.WriteLine("          <td><label for=\"admin_portal_purl\">Base PURL:</label></td>");
            Output.WriteLine("          <td><input class=\"admin_portal_input\" name=\"admin_portal_purl\" id=\"admin_portal_purl\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(newPortal.Base_PURL) + "\"  onfocus=\"javascript:textbox_enter('admin_portal_purl', 'admin_portal_input_focused')\" onblur=\"javascript:textbox_leave('admin_portal_purl', 'admin_portal_input')\" /></td>");
            Output.WriteLine("          <td><img border=\"0px\" style=\"padding-left:5px; margin-top:3px; cursor:pointer; cursor:hand;\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + BASE_PURL_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" /></td>");
            Output.WriteLine("        </tr>");

            Output.WriteLine("        </table>");

            Output.WriteLine("        <center><input type=\"image\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button.gif\" value=\"Submit\" alt=\"Submit\" onclick=\"return save_new_portal();\"/></center>");

            Output.WriteLine("      </div>");
            Output.WriteLine("    </blockquote>");


            Output.WriteLine("  <span class=\"SobekAdminTitle\">Existing URL Portals</span>");
            Output.WriteLine("  <blockquote>");
            Output.WriteLine("    The following URL portals are currently cached in this web application.<br /><br />");
            Output.WriteLine("  </blockquote>");

            Output.WriteLine("<table border=\"0px\" cellspacing=\"0px\" class=\"statsTable\">");
            Output.WriteLine("  <tr align=\"left\" bgcolor=\"#0022a7\" >");
            Output.WriteLine("    <th width=\"85px\" align=\"left\"><span style=\"color: White\"> &nbsp; ACTIONS</span></th>");
            Output.WriteLine("    <th width=\"130px\" align=\"left\"><span style=\"color: White\">URL<br />SEGMENT</span></th>");
            Output.WriteLine("    <th width=\"110px\" align=\"left\"><span style=\"color: White\">SYSTEM<br />ABBREVIATION</span></th>");
            Output.WriteLine("    <th width=\"85px\" align=\"left\"><span style=\"color: White\">DEFAULT<br />WEB SKIN</span></th>");
            Output.WriteLine("    <th width=\"105px\" align=\"left\"><span style=\"color: White\">DEFAULT<br />AGGREGATION</span></th>");
            Output.WriteLine("    <th width=\"180px\" align=\"left\"><span style=\"color: White\">BASE<br />PURL</span></th>");
            Output.WriteLine("   </tr>");
            Output.WriteLine("  <tr><td bgcolor=\"#e7e7e7\" colspan=\"6\"></td></tr>");

            // Write the default portal first
            Output.WriteLine("  <tr align=\"left\" >");
            if (portals.Default_Portal.ID > 0)
            {
                Output.Write("    <td class=\"SobekAdminActionLink\" >( ");
                Portal thisPortal = portals.Default_Portal;
                Output.WriteLine("      <a title=\"Edit this portal\" id=\"VIEW_0\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return portal_form_popup('VIEW_0','" + thisPortal.ID + "','" + HttpUtility.HtmlEncode(thisPortal.Name.Replace("'", "")) + "','" + thisPortal.Abbreviation + "','" + thisPortal.Default_Web_Skin + "','" + thisPortal.Default_Aggregation + "','" + thisPortal.URL_Segment + "','" + thisPortal.Base_PURL + "');\">edit</a> ) </td>");
            }
            else
            {
                Output.WriteLine("    <td>&nbsp;</td>");
            }
            Output.WriteLine("    <td><i><b>default</b></i></span></td>");
            Output.WriteLine("    <td>" + portals.Default_Portal.Abbreviation + "</span></td>");
            Output.WriteLine("    <td>" + portals.Default_Portal.Default_Web_Skin + "</span></td>");
            Output.WriteLine("    <td>" + portals.Default_Portal.Default_Aggregation + "</span></td>");
            Output.WriteLine("    <td>" + portals.Default_Portal.Base_PURL + "</span></td>");
            Output.WriteLine("   </tr>");
            Output.WriteLine("  <tr><td bgcolor=\"#e7e7e7\" colspan=\"6\"></td></tr>");

            // Write the data for each portal
            foreach (Portal thisPortal in portals.All_Portals)
            {
                if (thisPortal != portals.Default_Portal)
                {
                    Output.WriteLine("  <tr align=\"left\" >");
                    Output.Write("    <td class=\"SobekAdminActionLink\" >( ");
                    Output.Write("<a title=\"Edit this portal\" id=\"VIEW_" + thisPortal.ID + "\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return portal_form_popup('VIEW_" + thisPortal.ID + "','" + thisPortal.ID + "','" + HttpUtility.HtmlEncode(thisPortal.Name.Replace("'", "")) + "','" + thisPortal.Abbreviation + "','" + thisPortal.Default_Web_Skin + "','" + thisPortal.Default_Aggregation + "','" + thisPortal.URL_Segment + "','" + thisPortal.Base_PURL + "');\">edit</a> | ");
                    Output.WriteLine("<a title=\"Delete this portal\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return delete_portal('" + thisPortal.ID + "','" + HttpUtility.HtmlEncode(thisPortal.Name.Replace("'", "")) + "');\">delete</a> )</td>");
                    Output.WriteLine("    <td>" + thisPortal.URL_Segment + "</span></td>");
                    Output.WriteLine("    <td>" + thisPortal.Abbreviation + "</span></td>");
                    Output.WriteLine("    <td>" + thisPortal.Default_Web_Skin + "</span></td>");
                    Output.WriteLine("    <td>" + thisPortal.Default_Aggregation + "</span></td>");
                    Output.WriteLine("    <td>" + thisPortal.Base_PURL + "</span></td>");
                    Output.WriteLine("   </tr>");
                    Output.WriteLine("  <tr><td bgcolor=\"#e7e7e7\" colspan=\"6\"></td></tr>");
                }
            }
            Output.WriteLine("  </table>");
            Output.WriteLine("  <br /><br />");
            Output.WriteLine("</div>");
        }
Esempio n. 3
0
        /// <summary> This is an opportunity to write HTML directly into the main form, without
        /// using the pop-up html form architecture </summary>
        /// <param name="Output"> Textwriter to write the pop-up form HTML for this viewer </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <remarks> This text will appear within the ItemNavForm form tags </remarks>
        public override void Add_HTML_In_Main_Form(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Thematic_Headings_AdminViewer.Add_HTML_In_Main_Form", "Add any popup divisions for form elements");

            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/jquery/jquery-1.6.2.min.js\"></script>");
            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/jquery/jquery-ui-1.8.16.custom.min.js\"></script>");
            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_form.js\" ></script>");

            // Add the hidden field
            Output.WriteLine("<!-- Hidden field is used for postbacks to indicate what to save and reset -->");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_heading_action\" name=\"admin_heading_action\" value=\"\" />");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_heading_tosave\" name=\"admin_heading_tosave\" value=\"\" />");
            Output.WriteLine();

            Output.WriteLine("<!-- Thematic Heading Edit Form -->");
            Output.WriteLine("<div class=\"admin_heading_popup_div\" id=\"form_heading\" style=\"display:none;\">");
            Output.WriteLine("  <div class=\"popup_title\"><table width=\"100%\"><tr><td align=\"left\">EDIT THEMATIC HEADING</td><td align=\"right\"> <a href=\"#template\" alt=\"CLOSE\" onclick=\"heading_form_close()\">X</a> &nbsp; </td></tr></table></div>");
            Output.WriteLine("  <br />");
            Output.WriteLine("  <table class=\"popup_table\">");

            // Add line for heading
            Output.WriteLine("    <tr><td width=\"80px\"><label for=\"form_heading_name\">Heading:</label></td><td colspan=\"2\"><input class=\"admin_heading_input\" name=\"form_heading_name\" id=\"form_heading_name\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('form_heading_name', 'admin_heading_input_focused')\" onblur=\"javascript:textbox_leave('form_heading_name', 'admin_heading_input')\" /></td></tr>");

            Output.WriteLine("  </table>");
            Output.WriteLine("  <br />");
            Output.WriteLine("  <center><a href=\"\" onclick=\"return heading_form_close();\"><img border=\"0\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/cancel_button_g.gif\" alt=\"CLOSE\" /></a> &nbsp; &nbsp; <input type=\"image\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button_g.gif\" value=\"Submit\" alt=\"Submit\"></center>");
            Output.WriteLine("</div>");

            Tracer.Add_Trace("Thematic_Headings_AdminViewer.Add_HTML_In_Main_Form", "Write the rest of the form ");

            Output.WriteLine("<!-- Thematic_Headings_AdminViewer.Add_HTML_In_Main_Form -->");
            Output.WriteLine("<script src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_admin.js\" type=\"text/javascript\"></script>");
            Output.WriteLine("<div class=\"SobekHomeText\">");

            if (actionMessage.Length > 0)
            {
                Output.WriteLine("  <br />");
                Output.WriteLine("  <center><b>" + actionMessage + "</b></center>");
            }

            Output.WriteLine("  <blockquote>");
            Output.WriteLine("    Thematic headings are the headings on the main library home page, under which all the item ");
            Output.WriteLine("    aggregation icons appear.<br /><br />");
            Output.WriteLine("    For more information about thematic headings, <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "admin/headings\" target=\"ADMIN_USER_HELP\" >click here to view the help page</a>.");
            Output.WriteLine("  </blockquote>");

            Output.WriteLine("  <span class=\"SobekAdminTitle\">New Thematic Heading</span>");
            Output.WriteLine("    <blockquote>");
            Output.WriteLine("      <div class=\"admin_heading_new_div\">");
            Output.WriteLine("        <table class=\"popup_table\">");
            Output.WriteLine("          <tr><td><label for=\"admin_heading_name\">Heading:</label></td><td><input class=\"admin_heading_input\" name=\"admin_heading_name\" id=\"admin_heading_name\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('admin_heading_name', 'admin_heading_input_focused')\" onblur=\"javascript:textbox_leave('admin_heading_name', 'admin_heading_input')\" /></td>");
            Output.WriteLine("          <td><input type=\"image\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button.gif\" value=\"Submit\" alt=\"Submit\" onclick=\"return save_new_heading();\"/></td></tr>");
            Output.WriteLine("        </table>");
            Output.WriteLine("      </div>");
            Output.WriteLine("    </blockquote>");
            Output.WriteLine("    <br />");

            Output.WriteLine("  <span class=\"SobekAdminTitle\">Existing Thematic Headings</span>");
            Output.WriteLine("    <blockquote>");
            Output.WriteLine("<table border=\"0px\" cellspacing=\"0px\" class=\"statsTable\">");
            Output.WriteLine("  <tr align=\"left\" bgcolor=\"#0022a7\" >");
            Output.WriteLine("    <th width=\"90px\" align=\"left\"><span style=\"color: White\"> &nbsp; ACTIONS</span></th>");
            Output.WriteLine("    <th width=\"120px\" align=\"center\"><span style=\"color: White\">REORDER</span></th>");
            Output.WriteLine("    <th width=\"350px\" align=\"left\"><span style=\"color: White\">THEMATIC HEADING</span></th>");
            Output.WriteLine("   </tr>");
            Output.WriteLine("  <tr><td bgcolor=\"#e7e7e7\" colspan=\"3\"></td></tr>");

            // Write the data for each interface
            int current_order = 1;

            foreach (Thematic_Heading thisTheme in thematicHeadings)
            {
                // Build the action links
                Output.WriteLine("  <tr align=\"left\" >");
                Output.Write("    <td class=\"SobekAdminActionLink\" >( ");
                Output.Write("<a title=\"Click to edit\" id=\"VIEW_" + thisTheme.ThematicHeadingID + "\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return heading_form_popup('VIEW_" + thisTheme.ThematicHeadingID + "', '" + thisTheme.ThemeName + "','" + thisTheme.ThematicHeadingID + "');\">edit</a> | ");
                Output.Write("<a title=\"Delete this thematic heading\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return delete_heading('" + thisTheme.ThematicHeadingID + "', '" + thisTheme.ThemeName.Replace("\'", "") + "');\">delete</a> )</td>");

                Output.Write("    <td class=\"SobekAdminActionLink\" align=\"center\" >( ");
                Output.Write("<a title=\"Move this heading up in the order\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return move_heading_up('" + thisTheme.ThematicHeadingID + "', '" + current_order + "');\">up</a> | ");
                Output.Write("<a title=\"Move this heading down in the order\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return move_heading_down('" + thisTheme.ThematicHeadingID + "', '" + current_order + "');\">down</a> )</td>");

                // Add the rest of the row with data
                Output.WriteLine("    <td>" + thisTheme.ThemeName + "</td>");
                Output.WriteLine("   </tr>");
                Output.WriteLine("  <tr><td bgcolor=\"#e7e7e7\" colspan=\"3\"></td></tr>");

                current_order++;
            }

            Output.WriteLine("</table>");
            Output.WriteLine("    </blockquote>");
            Output.WriteLine("    <br />");
            Output.WriteLine("</div>");
            Output.WriteLine();
        }
        /// <summary> This is an opportunity to write HTML directly into the main form, without
        /// using the pop-up html form architecture </summary>
        /// <param name="Output"> Textwriter to write the pop-up form HTML for this viewer </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <remarks> This text will appear within the ItemNavForm form tags </remarks>
        public override void Add_HTML_In_Main_Form(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Builder_AdminViewer.Add_HTML_In_Main_Form", "Add the current status and add html controls to change status");

            Output.WriteLine("<!-- Builder_AdminViewer.Add_HTML_In_Main_Form -->");

            // Pull the builder settings
            Dictionary <string, string> builderSettings = SobekCM_Database.Get_Settings(Tracer);

            Output.WriteLine("<!-- Hidden field to keep the newly requested status -->");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_builder_tosave\" name=\"admin_builder_tosave\" value=\"\" />");
            Output.WriteLine("<script src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_admin.js\" type=\"text/javascript\"></script>");

            // Start to show the text
            Output.WriteLine("<div class=\"SobekHomeText\">");

            Output.WriteLine("  <blockquote>");
            Output.WriteLine("    The SobekCM builder is constantly loading new items and updates and building the full text indexes.  This page can be used to view and updated the current status as well as view the most recent log files.<br /><br />");
            Output.WriteLine("    For more information about the builder and possible actions from this screen, <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "admin/builder\" target=\"ADMIN_USER_HELP\" >click here to view the help page</a>.");
            Output.WriteLine("  </blockquote>");

            // If missing values, display an error
            if ((!builderSettings.ContainsKey("Builder Operation Flag")) || (!builderSettings.ContainsKey("Log Files URL")) || (!builderSettings.ContainsKey("Log Files Directory")))
            {
                Output.WriteLine("<br /><br />ERROR PULLING BUILDER SETTINGS... MISSING VALUES<br /><br />");
            }
            else
            {
                // Get the current pertinent values
                string operationFlag = builderSettings["Builder Operation Flag"];
                string logURL        = builderSettings["Log Files URL"];


                Output.WriteLine("  <span class=\"SobekAdminTitle\">SobekCM Builder Status</span>");
                Output.WriteLine("  <blockquote>");
                Output.WriteLine("    <table cellspacing=\"5\" cellpadding=\"5\">");
                Output.WriteLine("      <tr><td>Current Status: </td><td><strong>" + operationFlag + "</strong></td><td>&nbsp;</td></tr>");
                Output.Write("      <tr valign=\"center\"><td>Next Status: </td><td>");
                Output.Write("<select class=\"admin_builder_select\" name=\"admin_builder_status\" id=\"admin_builder_status\">");

                if ((operationFlag != "ABORT REQUESTED") && (operationFlag != "NO BUILDING REQUESTED"))
                {
                    Output.Write("<option value=\"STANDARD OPERATION\" selected=\"selected\">STANDARD OPERATION</option>");
                }
                else
                {
                    Output.Write("<option value=\"STANDARD OPERATION\">STANDARD OPERATION</option>");
                }

                Output.Write(operationFlag == "PAUSE REQUESTED"
                 ? "<option value=\"PAUSE REQUESTED\" selected=\"selected\">PAUSE REQUESTED</option>"
                 : "<option value=\"PAUSE REQUESTED\">PAUSE REQUESTED</option>");

                Output.Write(operationFlag == "ABORT REQUESTED"
                                 ? "<option value=\"ABORT REQUESTED\" selected=\"selected\">ABORT REQUESTED</option>"
                                 : "<option value=\"ABORT REQUESTED\">ABORT REQUESTED</option>");

                Output.Write(operationFlag == "NO BUILDING REQUESTED"
                                 ? "<option value=\"NO BUILDING REQUESTED\" selected=\"selected\" >NO BUILDING REQUESTED</option>"
                                 : "<option value=\"NO BUILDING REQUESTED\" >NO BUILDING REQUESTED</option>");


                Output.Write("</select> </td><td> <input type=\"image\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button.gif\" value=\"Submit\" alt=\"Submit\" onclick=\"return save_new_builder_status();\"/></td></tr>");
                Output.WriteLine("    </table>");
                Output.WriteLine("  </blockquote>");
                Output.WriteLine("  <br />");

                Output.WriteLine("  <span class=\"SobekAdminTitle\">Recent Incoming Logs</span>");
                Output.WriteLine("  <blockquote>");
                Output.WriteLine("    Select a date below to view the recent incoming resources log file:");
                Output.WriteLine("    <blockquote>");

                string   logDirectory = SobekCM_Library_Settings.Base_Design_Location + "extra\\logs";
                string[] logFiles     = Directory.GetFiles(logDirectory, "incoming*.html");
                Output.WriteLine("    <table cellspacing=\"2\" cellpadding=\"2\">");
                foreach (string logFile in logFiles)
                {
                    string logName     = (new FileInfo(logFile)).Name;
                    string date_string = logName.ToLower().Replace("incoming_", "").Replace(".html", "");
                    if (date_string.Length == 10)
                    {
                        DateTime date = new DateTime(Convert.ToInt32(date_string.Substring(0, 4)), Convert.ToInt32(date_string.Substring(5, 2)), Convert.ToInt32(date_string.Substring(8)));
                        Output.WriteLine("      <tr><td><a href=\"" + logURL + logName + "\">" + date.ToLongDateString() + "</a></td></tr>");
                    }
                }
                Output.WriteLine("    </table>");
                Output.WriteLine("    </blockquote>");
                Output.WriteLine("  </blockquote>");
                Output.WriteLine("  <br />");
            }

            Output.WriteLine("  <span class=\"SobekAdminTitle\">Related Links</span>");
            Output.WriteLine("  <blockquote>");
            Output.WriteLine("    <table cellspacing=\"2\" cellpadding=\"2\">");
            Output.WriteLine("      <tr><td><a href=\"" + currentMode.Base_URL + "l/internal/new\">Newly added or updated items</a></td></tr>");
            Output.WriteLine("      <tr><td><a href=\"" + currentMode.Base_URL + "l/internal/failures\">Failed packages or builder errors</a></td></tr>");
            Output.WriteLine("    </table>");
            Output.WriteLine("  </blockquote>");
            Output.WriteLine("  <br />");

            Output.WriteLine("</div>");
        }
        /// <summary> Add the HTML to be displayed in the main SobekCM viewer area </summary>
        /// <param name="Output"> Textwriter to write the HTML for this viewer</param>
        /// <param name="Tracer">Trace object keeps a list of each method executed and important milestones in rendering</param>
        public override void Add_HTML_In_Main_Form(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Group_Add_Volume_MySobekViewer.Add_HTML_In_Main_Form", "");

            Output.WriteLine("<!-- Hidden field is used for postbacks to add new form elements (i.e., new name, new other titles, etc..) -->");
            Output.WriteLine("<input type=\"hidden\" id=\"action\" name=\"action\" value=\"\" />");


            Output.WriteLine("<!-- Group_Add_Volume_MySobekViewer.Add_HTML_In_Main_Form -->");
            Output.WriteLine("<div class=\"SobekText\">");
            Output.WriteLine("  <br />");
            Output.WriteLine("  <b>Add a new volume to this existing title/item group.</b>");
            Output.WriteLine("    <ul>");
            Output.WriteLine("      <li>Only enter data that you wish to override the data in the existing base volume.</li>");
            //Output.WriteLine("      <li>Clicking on the green plus button ( <img class=\"repeat_button\" src=\"" + currentMode.Base_URL + "default/images/new_element_demo.jpg\" /> ) will add another instance of the element, if the element is repeatable.</li>");
            Output.WriteLine("      <li>Click <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "help/addvolume\" target=\"_EDIT_INSTRUCTIONS\">here for detailed instructions</a> on adding new volumes online.</li>");
            Output.WriteLine("     </ul>");
            Output.WriteLine("</div>");
            Output.WriteLine();

            if (message.Length > 0)
            {
                Output.WriteLine("" + message + "<br />");
            }

            Output.WriteLine("<a name=\"template\"> </a>");
            Output.WriteLine("<div class=\"ViewsBrowsesRow\">");
            Output.WriteLine(Selected_Tab_Start + "NEW VOLUME" + Selected_Tab_End + " ");
            Output.WriteLine("</div>");
            Output.WriteLine("<div class=\"SobekEditPanel\">");
            Output.WriteLine("<!-- Add SAVE and CANCEL buttons to top of form -->");
            Output.WriteLine("<script src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_metadata.js\" type=\"text/javascript\"></script>");
            Output.WriteLine("<table width=\"100%\">");
            Output.WriteLine("  <tr>");
            Output.WriteLine("    <td width=\"20px\">&nbsp;</td>");

            // Output.WriteLine("    <td width=\"460px\"> Import metadata and behaviors from existing volume: &nbsp; ");
            Output.WriteLine("    <td width=\"300px\"> Import from existing volume: &nbsp; ");
            Output.WriteLine("      <select id=\"base_volume\" name=\"base_volume\" class=\"addvolume_base_volume\">");

            DataColumn vidColumn  = itemsInTitle.Item_Table.Columns["VID"];
            bool       first      = true;
            DataView   sortedView = new DataView(itemsInTitle.Item_Table)
            {
                Sort = "VID DESC"
            };

            foreach (DataRowView itemRowView in sortedView)
            {
                if (first)
                {
                    Output.WriteLine("        <option value=\"" + itemRowView.Row[vidColumn] + "\" selected=\"selected\">" + itemRowView.Row[vidColumn] + "</option>");
                    first = false;
                }
                else
                {
                    Output.WriteLine("        <option value=\"" + itemRowView.Row[vidColumn] + "\">" + itemRowView.Row[vidColumn] + "</option>");
                }
            }


            Output.WriteLine("      </select>");
            Output.WriteLine("    </td>");
            Output.WriteLine("    <td align=\"right\">");
            Output.WriteLine("      <a onmousedown=\"addvolume_cancel_form(); return false;\"><img style=\"cursor: pointer;\" border=\"0px\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/cancel_button_g.gif\" alt=\"CANCEL\" /></a> &nbsp; &nbsp; ");
            Output.WriteLine("      <a onmousedown=\"addvolume_save_form(''); return false;\"><img style=\"cursor: pointer;\" border=\"0px\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button_g.gif\" alt=\"SAVE\" /></a> &nbsp; &nbsp; ");
            Output.WriteLine("      <a onmousedown=\"addvolume_save_form('_again'); return false;\"><img style=\"cursor: pointer;\" border=\"0px\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_add_another.gif\" alt=\"SAVE AND ADD ANOTHER\" /></a>");
            Output.WriteLine("    </td>");
            Output.WriteLine("    <td width=\"20px\">&nbsp;</td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine("</table>");

            bool isMozilla = false;

            if (currentMode.Browser_Type.ToUpper().IndexOf("FIREFOX") >= 0)
            {
                isMozilla = true;
            }

            // Create a new blank item for display purposes
            SobekCM_Item displayItem = new SobekCM_Item {
                BibID = item.BibID
            };

            displayItem.Behaviors.IP_Restriction_Membership = ipRestrict;
            displayItem.Behaviors.Serial_Info.Clear();
            displayItem.Tracking.Born_Digital             = bornDigital;
            displayItem.Tracking.Tracking_Box             = trackingBox;
            displayItem.Tracking.Material_Received_Notes  = materialRecdNotes;
            displayItem.Tracking.Material_Received_Date   = materialRecdDate;
            displayItem.Tracking.Disposition_Advice       = dispositionAdvice;
            displayItem.Tracking.Disposition_Advice_Notes = dispositionAdviceNotes;
            if (title.Length > 0)
            {
                displayItem.Bib_Info.Main_Title.Clear();
                displayItem.Bib_Info.Main_Title.Title = title;
            }
            if (date.Length > 0)
            {
                displayItem.Bib_Info.Origin_Info.Date_Issued = date;
            }
            if ((level1.Length > 0) && (level1Order >= 0))
            {
                displayItem.Behaviors.Serial_Info.Add_Hierarchy(1, level1Order, level1);
                if ((level2.Length > 0) && (level2Order >= 0))
                {
                    displayItem.Behaviors.Serial_Info.Add_Hierarchy(2, level2Order, level2);
                    if ((level3.Length > 0) && (level3Order >= 0))
                    {
                        displayItem.Behaviors.Serial_Info.Add_Hierarchy(3, level3Order, level3);
                    }
                }
            }

            template.Render_Template_HTML(Output, displayItem, currentMode.Skin == currentMode.Default_Skin ? currentMode.Skin.ToUpper() : currentMode.Skin, isMozilla, user, currentMode.Language, Translator, currentMode.Base_URL, 1);

            // Add the second buttons at the bottom of the form
            Output.WriteLine("<!-- Add SAVE and CANCEL buttons to bottom of form -->");
            Output.WriteLine("<table width=\"100%\">");
            Output.WriteLine("  <tr>");
            Output.WriteLine("    <td width=\"480px\">&nbsp;</td>");
            Output.WriteLine("    <td align=\"right\">");
            Output.WriteLine("      <a onmousedown=\"addvolume_cancel_form(); return false;\"><img style=\"cursor: pointer;\" border=\"0px\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/cancel_button_g.gif\" alt=\"CANCEL\" /></a> &nbsp; &nbsp; ");
            Output.WriteLine("      <a onmousedown=\"addvolume_save_form(''); return false;\"><img style=\"cursor: pointer;\" border=\"0px\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button_g.gif\" alt=\"SAVE\" /></a>");
            Output.WriteLine("    </td>");
            Output.WriteLine("    <td width=\"20px\">&nbsp;</td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine("</table>");
            Output.WriteLine("<br />");
            Output.WriteLine("<hr />");
            Output.WriteLine("<table width=\"100%\" cellspacing=\"4px\" >");
            Output.WriteLine("  <tr height=\"25px\">");
            Output.WriteLine("    <td width=\"20px\">&nbsp;</td>");
            Output.WriteLine("    <td colspan=\"2\">In addition, the following actions are available:</td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine("  <tr height=\"30px\">");
            Output.WriteLine("    <td>&nbsp;</td>");
            Output.WriteLine("    <td width=\"80px\">&nbsp;</td>");
            Output.WriteLine("    <td>");
            Output.WriteLine("      <a onmousedown=\"addvolume_save_form('_edit'); return false;\"><img style=\"cursor: pointer;\" border=\"0px\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_edit.gif\" alt=\"SAVE AND EDIT ITEM\" /></a> &nbsp; &nbsp; ");
            Output.WriteLine("      <a onmousedown=\"addvolume_save_form('_addfiles'); return false;\"><img style=\"cursor: pointer;\" border=\"0px\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_add_files.gif\" alt=\"SAVE AND ADD FILES\" /></a> &nbsp; &nbsp; ");
//            Output.WriteLine("      <img style=\"cursor: pointer;\" border=\"0px\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_add_files_disabled.gif\" alt=\"SAVE AND ADD FILES\" /> &nbsp; &nbsp; ");

            Output.WriteLine("      <a onmousedown=\"addvolume_save_form('_again'); return false;\"><img style=\"cursor: pointer;\" border=\"0px\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_add_another.gif\" alt=\"SAVE AND ADD ANOTHER\" /></a>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine("</table>");

            Output.WriteLine("<br />");
            Output.WriteLine("</div>");
            Output.WriteLine("<br />");
        }
        /// <summary> This is an opportunity to write HTML directly into the main form, without
        /// using the pop-up html form architecture </summary>
        /// <param name="Output"> Textwriter to write the pop-up form HTML for this viewer </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <remarks> This text will appear within the ItemNavForm form tags </remarks>
        public override void Write_ItemNavForm_Closing(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Aggregations_Mgmt_AdminViewer.Write_ItemNavForm_Closing", "");

            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/jquery/jquery-ui-1.10.3.custom.min.js\"></script>");

            // Add the hidden field
            Output.WriteLine("<!-- Hidden field is used for postbacks to indicate what to save and reset -->");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_aggr_tosave\" name=\"admin_aggr_tosave\" value=\"\" />");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_aggr_reset\" name=\"admin_aggr_reset\" value=\"\" />");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_aggr_delete\" name=\"admin_aggr_delete\" value=\"\" />");
            Output.WriteLine();

            Output.WriteLine("<!-- Aggregations_Mgmt_AdminViewer.Write_ItemNavForm_Closing -->");
            Output.WriteLine("<script src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_admin.js\" type=\"text/javascript\"></script>");
            Output.WriteLine("<div class=\"sbkAdm_HomeText\">");

            if (actionMessage.Length > 0)
            {
                Output.WriteLine("  <br />");
                Output.WriteLine("  <div id=\"sbkAdm_ActionMessage\">" + actionMessage + "</div>");
            }

            Output.WriteLine("  <p>For clarification of any terms on this form, <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "adminhelp/aggregations\" target=\"ADMIN_INTERFACE_HELP\" >click here to view the help page</a>.</p>");

            // Find the matching type to display
            int index = 0;
            if (currentMode.My_Sobek_SubMode.Length > 0)
            {
                Int32.TryParse(currentMode.My_Sobek_SubMode, out index);
            }

            if ((index <= 0) || (index > codeManager.Types_Count))
            {

                Output.WriteLine("  <h2>New Item Aggregation</h2>");

                Output.WriteLine("  <div class=\"sbkAsav_NewDiv\">");
                Output.WriteLine("    <table class=\"sbkAdm_PopupTable\">");

                // Add line for aggregation code and aggregation type
                Output.WriteLine("      <tr>");
                Output.WriteLine("        <td style=\"width:120px;\"><label for=\"admin_aggr_code\">Code:</label></td>");
                Output.WriteLine("        <td><input class=\"sbkAsav_small_input sbkAdmin_Focusable\" name=\"admin_aggr_code\" id=\"admin_aggr_code\" type=\"text\" value=\"" + enteredCode + "\" /></td>");
                Output.WriteLine("        <td style=\"width:300px;text-align:right;\">");
                Output.WriteLine("          <label for=\"admin_aggr_type\">Type:</label> &nbsp; ");
                Output.WriteLine("          <select class=\"sbkAsav_select \" name=\"admin_aggr_type\" id=\"admin_aggr_type\">");
                if (enteredType == String.Empty)
                    Output.WriteLine("            <option value=\"\" selected=\"selected\" ></option>");

                Output.WriteLine(enteredType == "coll"
                                 ? "            <option value=\"coll\" selected=\"selected\" >Collection</option>"
                                 : "            <option value=\"coll\">Collection</option>");

                Output.WriteLine(enteredType == "group"
                                 ? "            <option value=\"group\" selected=\"selected\" >Collection Group</option>"
                                 : "            <option value=\"group\">Collection Group</option>");

                Output.WriteLine(enteredType == "exhibit"
                                 ? "            <option value=\"exhibit\" selected=\"selected\" >Exhibit</option>"
                                 : "            <option value=\"exhibit\">Exhibit</option>");

                Output.WriteLine(enteredType == "inst"
                                 ? "            <option value=\"inst\" selected=\"selected\" >Institution</option>"
                                 : "            <option value=\"inst\">Institution</option>");

                Output.WriteLine(enteredType == "subinst"
                                 ? "            <option value=\"subinst\" selected=\"selected\" >Institutional Division</option>"
                                 : "            <option value=\"subinst\">Institutional Division</option>");

                Output.WriteLine(enteredType == "subcoll"
                                 ? "            <option value=\"subcoll\" selected=\"selected\" >SubCollection</option>"
                                 : "            <option value=\"subcoll\">SubCollection</option>");

                Output.WriteLine("          </select>");
                Output.WriteLine("        </td>");
                Output.WriteLine("      </tr>");

                // Add the parent line
                Output.WriteLine("      <tr>");
                Output.WriteLine("        <td>");
                Output.WriteLine("          <label for=\"admin_aggr_parent\">Parent:</label></td><td colspan=\"2\">");
                Output.WriteLine("          <select class=\"sbkAsav_select_large\" name=\"admin_aggr_parent\" id=\"admin_aggr_parent\">");
                if (enteredParent == String.Empty)
                    Output.WriteLine("            <option value=\"\" selected=\"selected\" ></option>");
                foreach (Item_Aggregation_Related_Aggregations thisAggr in codeManager.All_Aggregations)
                {
                    if (enteredParent == thisAggr.ID.ToString())
                    {
                        Output.WriteLine("            <option value=\"" + thisAggr.ID + "\" selected=\"selected\" >" + thisAggr.Code + " - " + thisAggr.Name + "</option>");
                    }
                    else
                    {
                        Output.WriteLine("            <option value=\"" + thisAggr.ID + "\" >" + thisAggr.Code + " - " + thisAggr.Name + "</option>");
                    }
                }
                Output.WriteLine("          </select>");
                Output.WriteLine("        </td>");
                Output.WriteLine("      </tr>");

                // Add the full name line
                Output.WriteLine("      <tr><td><label for=\"admin_aggr_name\">Name (full):</label></td><td colspan=\"2\"><input class=\"sbkAsav_large_input sbkAdmin_Focusable\" name=\"admin_aggr_name\" id=\"admin_aggr_name\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(enteredName) + "\" /></td></tr>");

                // Add the short name line
                Output.WriteLine("      <tr><td><label for=\"admin_aggr_shortname\">Name (short):</label></td><td colspan=\"2\"><input class=\"sbkAsav_large_input sbkAdmin_Focusable\" name=\"admin_aggr_shortname\" id=\"admin_aggr_shortname\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(enteredShortname) + "\" /></td></tr>");

                // Add the link line
                Output.WriteLine("      <tr><td><label for=\"admin_aggr_link\">External Link:</label></td><td colspan=\"2\"><input class=\"sbkAsav_large_input sbkAdmin_Focusable\" name=\"admin_aggr_link\" id=\"admin_aggr_link\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(enteredLink) + "\" /></td></tr>");

                // Add the thematic heading line
                Output.WriteLine("      <tr>");
                Output.WriteLine("        <td><label for=\"admin_aggr_heading\">Thematic Heading:</label></td>");
                Output.WriteLine("        <td colspan=\"2\">");
                Output.WriteLine("          <select class=\"sbkAsav_select_large\" name=\"admin_aggr_heading\" id=\"admin_aggr_heading\">");
                Output.WriteLine("            <option value=\"-1\" selected=\"selected\" ></option>");
                foreach (Thematic_Heading thisHeading in thematicHeadings)
                {
                    Output.Write("            <option value=\"" + thisHeading.ThematicHeadingID + "\">" + HttpUtility.HtmlEncode(thisHeading.ThemeName) + "</option>");
                }
                Output.WriteLine("          </select>");
                Output.WriteLine("        </td>");
                Output.WriteLine("      </tr>");

                // Add the description box
                Output.WriteLine("      <tr style=\"vertical-align:top\"><td><label for=\"admin_aggr_desc\">Description:</label></td><td colspan=\"2\"><textarea rows=\"6\" name=\"admin_aggr_desc\" id=\"admin_aggr_desc\" class=\"sbkAsav_input sbkAdmin_Focusable\">" + HttpUtility.HtmlEncode(enteredDescription) + "</textarea></td></tr>");

                // Add checkboxes for is active and is hidden
                Output.Write(enteredIsActive
                                 ? "          <tr style=\"height:30px\"><td>Behavior:</td><td colspan=\"2\"><input class=\"sbkAsav_checkbox\" type=\"checkbox\" name=\"admin_aggr_isactive\" id=\"admin_aggr_isactive\" checked=\"checked\" /> <label for=\"admin_aggr_isactive\">Active?</label></td></tr> "
                                 : "          <tr style=\"height:30px\"><td>Behavior:</td><td colspan=\"2\"><input class=\"sbkAsav_checkbox\" type=\"checkbox\" name=\"admin_aggr_isactive\" id=\"admin_aggr_isactive\" /> <label for=\"admin_aggr_isactive\">Active?</label></td></tr> ");

                Output.Write(enteredIsHidden
                                 ? "          <tr><td></td><td colspan=\"2\"><input class=\"sbkAsav_checkbox\" type=\"checkbox\" name=\"admin_aggr_ishidden\" id=\"admin_aggr_ishidden\" checked=\"checked\" /> <label for=\"admin_aggr_ishidden\">Show in parent collection home page?</label></td></tr> "
                                 : "          <tr><td></td><td colspan=\"2\"><input class=\"sbkAsav_checkbox\" type=\"checkbox\" name=\"admin_aggr_ishidden\" id=\"admin_aggr_ishidden\" /> <label for=\"admin_aggr_ishidden\">Show in parent collection home page?</label></td></tr> ");

                // Add the SAVE button
                Output.WriteLine("      <tr style=\"height:30px; text-align: center;\"><td colspan=\"3\"><button title=\"Save new item aggregation\" class=\"sbkAdm_RoundButton\" onclick=\"return save_new_aggr();\">SAVE <img src=\"" + currentMode.Base_URL + "default/images/button_next_arrow.png\" class=\"sbkAdm_RoundButton_RightImg\" alt=\"\" /></button></td></tr>");
                Output.WriteLine("    </table>");
                Output.WriteLine("  </div>");
                Output.WriteLine();

                Output.WriteLine("  <h2 id=\"list\">Existing Item Aggregations</h2>");
                Output.WriteLine("  <p>Select a type below to view all matching item aggregations:</p>");
                Output.WriteLine("  <ul class=\"sbkAsav_List\">");
                int i = 1;
                foreach (string thisType in codeManager.All_Types)
                {
                    currentMode.My_Sobek_SubMode = i.ToString();
                    Output.WriteLine("    <li><a href=\"" + currentMode.Redirect_URL() + "\" >" + thisType.ToUpper() + "</a></li>");
                    i++;
                }
                currentMode.My_Sobek_SubMode = String.Empty;
                Output.WriteLine("  </ul>");
            }
            else
            {
                string aggregationType = codeManager.All_Types[index - 1];

                Output.WriteLine("  <h2>Other Actions</h2>");
                Output.WriteLine("  <ul class=\"sbkAsav_List\">");
                currentMode.My_Sobek_SubMode = String.Empty;
                Output.WriteLine("    <li><a href=\"" + currentMode.Redirect_URL() + "\">Add new item aggregation</a></li>");
                Output.WriteLine("    <li><a href=\"" + currentMode.Redirect_URL() + "#list\">View different aggregations</a></li>");
                currentMode.My_Sobek_SubMode = index.ToString();
                Output.WriteLine("  </ul>");
                Output.WriteLine();

                Output.WriteLine("  <h2>Existing " + aggregationType + "s</h2>");

                Output.WriteLine("  <table class=\"sbkAsav_Table sbkAdm_Table\">");
                Output.WriteLine("    <tr>");
                Output.WriteLine("      <th class=\"sbkAsav_TableHeader1\">ACTIONS</th>");
                Output.WriteLine("      <th class=\"sbkAsav_TableHeader2\">CODE</th>");
                Output.WriteLine("      <th class=\"sbkAsav_TableHeader3\">NAME</th>");
                Output.WriteLine("    </tr>");
                Output.WriteLine("    <tr><td class=\"sbkAdm_TableRule\" colspan=\"3\"></td></tr>");

                Output.WriteLine("    <tr class=\"sbkAsav_TableTitleRow\" style=\"\" >");
                if ((aggregationType.Length > 0) && (aggregationType[aggregationType.Length - 1] != 'S'))
                {
                    Output.WriteLine("      <td colspan=\"3\">" + aggregationType.ToUpper() + "S</td>");
                }
                else
                {
                    Output.WriteLine("      <td colspan=\"3\">" + aggregationType.ToUpper() + "</td>");
                }
                Output.WriteLine("    </tr>");

                // Show all matching rows
                string last_code = String.Empty;
                foreach (Item_Aggregation_Related_Aggregations thisAggr in codeManager.Aggregations_By_Type(aggregationType))
                {
                    if (thisAggr.Code != last_code)
                    {
                        last_code = thisAggr.Code;

                        // Build the action links
                        Output.WriteLine("    <tr>");
                        Output.Write("      <td class=\"sbkAdm_ActionLink\" >( ");
                        Output.Write("<a title=\"Click to edit this item aggregation\" href=\"" + currentMode.Base_URL + "l/admin/editaggr/" + thisAggr.Code + "\">edit</a> | ");
                        if (thisAggr.Active)
                            Output.Write("<a title=\"Click to view this item aggregation\" href=\"" + currentMode.Base_URL + "l/" + thisAggr.Code + "\">view</a> | ");
                        else
                            Output.Write("view | ");

                        Output.Write("<a title=\"Click to delete this item aggregation\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return delete_aggr('" + thisAggr.Code + "');\">delete</a> | ");

                        Output.WriteLine("<a title=\"Click to reset the instance in the application cache\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return reset_aggr('" + thisAggr.Code + "');\">reset</a> )</td>");

                        // Add the rest of the row with data
                        Output.WriteLine("      <td>" + thisAggr.Code + "</td>");
                        Output.WriteLine("      <td>" + thisAggr.Name + "</td>");
                        Output.WriteLine("    </tr>");
                        Output.WriteLine("    <tr><td class=\"sbkAdm_TableRule\" colspan=\"3\"></td></tr>");
                    }
                }

                Output.WriteLine("  </table>");
            }

            Output.WriteLine("  <br />");
            Output.WriteLine("</div>");
            Output.WriteLine();
        }
        /// <summary> Add the HTML to be displayed in the main SobekCM viewer area </summary>
        /// <param name="Output"> Textwriter to write the HTML for this viewer</param>
        /// <param name="Tracer">Trace object keeps a list of each method executed and important milestones in rendering</param>
        public override void Write_HTML(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Home_AdminViewer.Write_HTML", String.Empty);

            Output.WriteLine("<div class=\"sbkHav_MainText\" >");
            Output.WriteLine("  What would you like to edit today?");
            Output.WriteLine("  <table id=\"sbkHav_OptionsTable\">");

            // Edit aggregation aliases
            currentMode.Admin_Type = Admin_Type_Enum.Aliases;
            Output.WriteLine("    <tr><td style=\"width:35px;\"><a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Default_Images_URL + "forwarding.gif\" /></a></td><td><a href=\"" + currentMode.Redirect_URL() + "\">Aggregation Aliases</a></td></tr>");

            // Edit item aggregations
            currentMode.Admin_Type = Admin_Type_Enum.Aggregations_Mgmt;
            Output.WriteLine("    <tr><td style=\"width:35px;\"><a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Default_Images_URL + "building.gif\" /></a></td><td><a href=\"" + currentMode.Redirect_URL() + "\">Aggregation Management</a></td></tr>");


            // View and set SobekCM Builder Status
            currentMode.Admin_Type = Admin_Type_Enum.Builder_Status;
            Output.WriteLine("    <tr><td style=\"width:35px;\"><a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Default_Images_URL + "gears.png\" /></a></td><td><a href=\"" + currentMode.Redirect_URL() + "\">Builder Status</a></td></tr>");


            // Edit Default_Metadata
            currentMode.Admin_Type = Admin_Type_Enum.Default_Metadata;
            Output.WriteLine("    <tr><td style=\"width:35px;\"><a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Default_Images_URL + "pmets.gif\" /></a></td><td><a href=\"" + currentMode.Redirect_URL() + "\">Default Metadata</a></td></tr>");

            // Edit IP Restrictions
            currentMode.Admin_Type = Admin_Type_Enum.IP_Restrictions;
            Output.WriteLine("    <tr><td style=\"width:35px;\"><a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Default_Images_URL + "firewall.gif\" /></a></td><td><a href=\"" + currentMode.Redirect_URL() + "\">IP Restriction Ranges</a></td></tr>");

            // Edit Settings
            currentMode.Admin_Type = Admin_Type_Enum.Settings;
            Output.WriteLine("    <tr><td style=\"width:35px;\"><a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Default_Images_URL + "wrench.png\" /></a></td><td><a href=\"" + currentMode.Redirect_URL() + "\">System-Wide Settings</a></td></tr>");

            // Edit Thematic Headings
            currentMode.Admin_Type = Admin_Type_Enum.Thematic_Headings;
            Output.WriteLine("    <tr><td style=\"width:35px;\"></td><td><a href=\"" + currentMode.Redirect_URL() + "\">Thematic Headings</a></td></tr>");


            // Edit URL Portals
            currentMode.Admin_Type = Admin_Type_Enum.URL_Portals;
            Output.WriteLine("    <tr><td style=\"width:35px;\"><a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Default_Images_URL + "portals.gif\" /></a></td><td><a href=\"" + currentMode.Redirect_URL() + "\">URL Portals</a></td></tr>");

            if (user.Is_System_Admin)
            {
                // Edit users
                currentMode.Admin_Type = Admin_Type_Enum.Users;
                Output.WriteLine("    <tr><td style=\"width:35px;\"><a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Default_Images_URL + "users.gif\" /></a></td><td><a href=\"" + currentMode.Redirect_URL() + "\">Users and Groups</a></td></tr>");
            }

            // Edit web skins
            currentMode.Admin_Type = Admin_Type_Enum.Skins;
            Output.WriteLine("    <tr><td style=\"width:35px;\"><a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Default_Images_URL + "skins.gif\" /></a></td><td><a href=\"" + currentMode.Redirect_URL() + "\">Web Skins</a></td></tr>");

            // Edit wordmarks
            currentMode.Admin_Type = Admin_Type_Enum.Wordmarks;
            Output.WriteLine("    <tr><td style=\"width:35px;\"><a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Default_Images_URL + "wordmarks.gif\" /></a></td><td><a href=\"" + currentMode.Redirect_URL() + "\">Wordmarks / Icons</a></td></tr>");

            // Reset cache
            currentMode.Admin_Type = Admin_Type_Enum.Reset;
            Output.WriteLine("    <tr><td style=\"width:35px;\"><a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Default_Images_URL + "refresh.gif\" /></a></td><td><a href=\"" + currentMode.Redirect_URL() + "\">Reset Cache</a></td></tr>");

            currentMode.Admin_Type = Admin_Type_Enum.Home;

            Output.WriteLine("  </table>");

            Output.WriteLine("  <p>For clarification on any of these options, <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "adminhelp/tasks\" target=\"ADMIN_USER_HELP\" >click here to view the help page</a>.</p>");
            Output.WriteLine("  <p>You are currently running version " + SobekCM_Library_Settings.CURRENT_WEB_VERSION + ". ( <a href=\"http://ufdc.ufl.edu/sobekcm/development/history\">see release notes</a> )</p>");
            Output.WriteLine("</div>");
        }
Esempio n. 8
0
        /// <summary> This is an opportunity to write HTML directly into the main form, without
        /// using the pop-up html form architecture </summary>
        /// <param name="Output"> Textwriter to write the pop-up form HTML for this viewer </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <remarks> This text will appear within the ItemNavForm form tags </remarks>
        public override void Add_HTML_In_Main_Form(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Aliases_AdminViewer.Add_HTML_In_Main_Form", "Add any popup divisions for form elements");

            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/jquery/jquery-1.6.2.min.js\"></script>");
            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/jquery/jquery-ui-1.8.16.custom.min.js\"></script>");
            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_form.js\" ></script>");

            // Add the hidden field
            Output.WriteLine("<!-- Hidden field is used for postbacks to indicate what to save and reset -->");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_forwarding_tosave\" name=\"admin_forwarding_tosave\" value=\"\" />");
            Output.WriteLine();

            Output.WriteLine("<!-- Item Aggregation Aliases Edit Form -->");
            Output.WriteLine("<div class=\"admin_forwarding_popup_div\" id=\"form_forwarding\" style=\"display:none;\">");
            Output.WriteLine("  <div class=\"popup_title\"><table width=\"100%\"><tr><td align=\"left\">EDIT AGGREGATION ALIAS</td><td align=\"right\"> <a href=\"#template\" alt=\"CLOSE\" onclick=\"alias_form_close()\">X</a> &nbsp; </td></tr></table></div>");
            Output.WriteLine("  <br />");
            Output.WriteLine("  <table class=\"popup_table\">");

            // Add line for alias
            Output.WriteLine("    <tr><td width=\"120px\"><label for=\"form_forwarding_alias\">Alias:</label></td><td colspan=\"2\"><span class=\"form_linkline admin_existing_code_line\" id=\"form_forwarding_alias\"></span></td></tr>");

            // Add line for aggregation
            Output.WriteLine("    <tr><td><label for=\"form_forwarding_code\">Item Aggregation:</label></td><td colspan=\"2\"><input class=\"admin_forwarding_input\" name=\"form_forwarding_code\" id=\"form_forwarding_code\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('form_forwarding_code', 'admin_forwarding_input_focused')\" onblur=\"javascript:textbox_leave('form_forwarding_code', 'admin_forwarding_input')\" /></td></tr>");

            Output.WriteLine("  </table>");
            Output.WriteLine("  <br />");
            Output.WriteLine("  <center><a href=\"\" onclick=\"return alias_form_close();\"><img border=\"0\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/cancel_button_g.gif\" alt=\"CLOSE\" /></a> &nbsp; &nbsp; <input type=\"image\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button_g.gif\" value=\"Submit\" alt=\"Submit\"></center>");
            Output.WriteLine("</div>");

            Tracer.Add_Trace("Aliases_AdminViewer.Add_HTML_In_Main_Form", "Write the rest of the form ");

            Output.WriteLine("<!-- Aliases_AdminViewer.Add_HTML_In_Main_Form -->");
            Output.WriteLine("<script src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_admin.js\" type=\"text/javascript\"></script>");
            Output.WriteLine("<div class=\"SobekHomeText\">");

            if (actionMessage.Length > 0)
            {
                Output.WriteLine("  <br />");
                Output.WriteLine("  <center><b>" + actionMessage + "</b></center>");
            }

            Output.WriteLine("  <blockquote>");
            Output.WriteLine("    Use item aggregation aliases to allow a term to forward to an existing item aggregation. ");
            Output.WriteLine("    This creates a simpler URL and can forward from a discontinued item aggregation.<br /><br />");
            Output.WriteLine("    For more information about aggregation aliases and forwarding, <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "admin/aggraliases\" target=\"ADMIN_USER_HELP\" >click here to view the help page</a>.");
            Output.WriteLine("  </blockquote>");

            Output.WriteLine("  <span class=\"SobekAdminTitle\">New Item Aggregation Alias</span>");
            Output.WriteLine("    <blockquote>");
            Output.WriteLine("      <div class=\"admin_forwarding_new_div\">");
            Output.WriteLine("        <table class=\"popup_table\">");

            // Add line for alias
            Output.WriteLine("          <tr><td width=\"120px\"><label for=\"admin_forwarding_alias\">Alias:</label></td><td colspan=\"2\"><input class=\"admin_forwarding_input\" name=\"admin_forwarding_alias\" id=\"admin_forwarding_alias\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('admin_forwarding_alias', 'admin_forwarding_input_focused')\" onblur=\"javascript:textbox_leave('admin_forwarding_alias', 'admin_forwarding_input')\" /></td></tr>");

            // Add line for aggregation
            Output.WriteLine("          <tr><td><label for=\"admin_forwarding_code\">Item Aggregation:</label></td><td><input class=\"admin_forwarding_input\" name=\"admin_forwarding_code\" id=\"admin_forwarding_code\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('admin_forwarding_code', 'admin_forwarding_input_focused')\" onblur=\"javascript:textbox_leave('admin_forwarding_code', 'admin_forwarding_input')\" /></td>");

            Output.WriteLine("          <td><input type=\"image\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button.gif\" value=\"Submit\" alt=\"Submit\" onclick=\"return save_new_alias();\"/></td></tr>");

            //            Output.WriteLine("          <td><a onclick=\"return save_new_alias();\"><img border=\"0\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button.gif\" alt=\"SUBMIT\" /></a></td></tr>");
            Output.WriteLine("        </table>");


            //Output.WriteLine("        <center><input type=\"image\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button.gif\" value=\"Submit\" alt=\"Submit\"></center>");


            Output.WriteLine("      </div>");
            Output.WriteLine("    </blockquote>");
            Output.WriteLine("    <br />");

            Output.WriteLine("  <span class=\"SobekAdminTitle\">Existing Item Aggregation Aliases</span>");
            Output.WriteLine("    <blockquote>");
            Output.WriteLine("<table border=\"0px\" cellspacing=\"0px\" class=\"statsTable\">");
            Output.WriteLine("  <tr align=\"left\" bgcolor=\"#0022a7\" >");
            Output.WriteLine("    <th width=\"160px\" align=\"left\"><span style=\"color: White\"> &nbsp; ACTIONS</span></th>");
            Output.WriteLine("    <th width=\"180px\" align=\"left\"><span style=\"color: White\">ALIAS</span></th>");
            Output.WriteLine("    <th width=\"120px\" align=\"left\"><span style=\"color: White\">AGGREGATION</span></th>");
            Output.WriteLine("   </tr>");
            Output.WriteLine("  <tr><td bgcolor=\"#e7e7e7\" colspan=\"3\"></td></tr>");

            // Write the data for each interface
            foreach (KeyValuePair <string, string> thisForward in aggregationAliases)
            {
                // Build the action links
                Output.WriteLine("  <tr align=\"left\" >");
                Output.Write("    <td class=\"SobekAdminActionLink\" >( ");
                Output.Write("<a title=\"Click to edit\" id=\"VIEW_" + thisForward.Key + "\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return alias_form_popup('VIEW_" + thisForward.Key + "', '" + thisForward.Key + "','" + thisForward.Value + "');\">edit</a> | ");
                Output.Write("<a title=\"Click to view\" href=\"" + currentMode.Base_URL + thisForward.Key + "\" target=\"_PREVIEW\">view</a> | ");
                Output.Write("<a title=\"Delete this alias\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return delete_alias('" + thisForward.Key + "');\">delete</a> )</td>");

                // Add the rest of the row with data
                Output.WriteLine("    <td>" + thisForward.Key + "</span></td>");
                Output.WriteLine("    <td>" + thisForward.Value + "</span></td>");
                Output.WriteLine("   </tr>");
                Output.WriteLine("  <tr><td bgcolor=\"#e7e7e7\" colspan=\"3\"></td></tr>");
            }

            Output.WriteLine("</table>");
            Output.WriteLine("    </blockquote>");
            Output.WriteLine("    <br />");
            Output.WriteLine("</div>");
            Output.WriteLine();
        }
Esempio n. 9
0
        /// <summary> This is an opportunity to write HTML directly into the main form, without
        /// using the pop-up html form architecture </summary>
        /// <param name="Output"> Textwriter to write the pop-up form HTML for this viewer </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <remarks> This text will appear within the ItemNavForm form tags </remarks>
        public override void Add_HTML_In_Main_Form(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Aggregations_Mgmt_AdminViewer.Add_HTML_In_Main_Form", "");

            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/jquery/jquery-1.6.2.min.js\"></script>");
            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/jquery/jquery-ui-1.8.16.custom.min.js\"></script>");
            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_form.js\" ></script>");

            // Add the hidden field
            Output.WriteLine("<!-- Hidden field is used for postbacks to indicate what to save and reset -->");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_aggr_tosave\" name=\"admin_aggr_tosave\" value=\"\" />");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_aggr_reset\" name=\"admin_aggr_reset\" value=\"\" />");
            Output.WriteLine();

            Output.WriteLine("<!-- Aggregations_Mgmt_AdminViewer.Add_HTML_In_Main_Form -->");
            Output.WriteLine("<script src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_admin.js\" type=\"text/javascript\"></script>");
            Output.WriteLine("<div class=\"SobekHomeText\">");
            if (actionMessage.Length > 0)
            {
                Output.WriteLine("  <br />");
                Output.WriteLine("  <center><b>" + actionMessage + "</b></center>");
            }

            Output.WriteLine("  <blockquote>For clarification of any terms on this form, <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "admin/aggregations\" target=\"ADMIN_INTERFACE_HELP\" >click here to view the help page</a>.</blockquote>");


            // Find the matching type to display
            int index = 0;

            if (currentMode.My_Sobek_SubMode.Length > 0)
            {
                Int32.TryParse(currentMode.My_Sobek_SubMode, out index);
            }

            if ((index <= 0) || (index > codeManager.Types_Count))
            {
                Output.WriteLine("  <span class=\"SobekAdminTitle\">New Item Aggregation</span>");

                Output.WriteLine("    <blockquote>");
                Output.WriteLine("      <div class=\"admin_aggr_new_div\">");
                Output.WriteLine("        <table class=\"popup_table\">");

                // Add line for aggregation code and aggregation type
                Output.WriteLine("          <tr><td width=\"120px\"><label for=\"admin_aggr_code\">Code:</label></td>");
                Output.WriteLine("            <td><input class=\"admin_aggr_small_input\" name=\"admin_aggr_code\" id=\"admin_aggr_code\" type=\"text\" value=\"" + enteredCode + "\"  onfocus=\"javascript:textbox_enter('admin_aggr_code', 'admin_aggr_small_input_focused')\" onblur=\"javascript:textbox_leave('admin_aggr_code', 'admin_aggr_small_input')\" /></td>");
                Output.WriteLine("            <td width=\"300px\" align=\"right\"><label for=\"admin_aggr_type\">Type:</label> &nbsp; ");
                Output.Write("<select class=\"admin_aggr_select\" name=\"admin_aggr_type\" id=\"admin_aggr_type\">");
                if (enteredType == String.Empty)
                {
                    Output.Write("<option value=\"\" selected=\"selected\" ></option>");
                }

                Output.Write(enteredType == "coll"
                                 ? "<option value=\"coll\" selected=\"selected\" >Collection</option>"
                                 : "<option value=\"coll\">Collection</option>");

                Output.Write(enteredType == "group"
                                 ? "<option value=\"group\" selected=\"selected\" >Collection Group</option>"
                                 : "<option value=\"group\">Collection Group</option>");

                Output.Write(enteredType == "exhibit"
                                 ? "<option value=\"exhibit\" selected=\"selected\" >Exhibit</option>"
                                 : "<option value=\"exhibit\">Exhibit</option>");

                Output.Write(enteredType == "inst"
                                 ? "<option value=\"inst\" selected=\"selected\" >Institution</option>"
                                 : "<option value=\"inst\">Institution</option>");

                Output.Write(enteredType == "subinst"
                                 ? "<option value=\"subinst\" selected=\"selected\" >Institutional Division</option>"
                                 : "<option value=\"subinst\">Institutional Division</option>");

                Output.Write(enteredType == "subcoll"
                                 ? "<option value=\"subcoll\" selected=\"selected\" >SubCollection</option>"
                                 : "<option value=\"subcoll\">SubCollection</option>");

                Output.WriteLine("</select></td></tr>");

                // Add the parent line
                Output.Write("          <tr><td><label for=\"admin_aggr_parent\">Parent:</label></td><td colspan=\"2\">");
                Output.Write("<select class=\"admin_aggr_select_large\" name=\"admin_aggr_parent\" id=\"admin_aggr_parent\">");
                if (enteredParent == String.Empty)
                {
                    Output.Write("<option value=\"\" selected=\"selected\" ></option>");
                }
                foreach (Item_Aggregation_Related_Aggregations thisAggr in codeManager.All_Aggregations)
                {
                    if (enteredParent == thisAggr.ID.ToString())
                    {
                        Output.Write("<option value=\"" + thisAggr.ID + "\" selected=\"selected\" >" + thisAggr.Code + " - " + thisAggr.Name + "</option>");
                    }
                    else
                    {
                        Output.Write("<option value=\"" + thisAggr.ID + "\" >" + thisAggr.Code + " - " + thisAggr.Name + "</option>");
                    }
                }
                Output.WriteLine("<select></td></tr>");

                // Add the full name line
                Output.WriteLine("          <tr><td><label for=\"admin_aggr_name\">Name (full):</label></td><td colspan=\"2\"><input class=\"admin_aggr_large_input\" name=\"admin_aggr_name\" id=\"admin_aggr_name\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(enteredName) + "\" onfocus=\"javascript:textbox_enter('admin_aggr_name', 'admin_aggr_large_input_focused')\" onblur=\"javascript:textbox_leave('admin_aggr_name', 'admin_aggr_large_input')\" /></td></tr>");

                // Add the short name line
                Output.WriteLine("          <tr><td><label for=\"admin_aggr_shortname\">Name (short):</label></td><td colspan=\"2\"><input class=\"admin_aggr_large_input\" name=\"admin_aggr_shortname\" id=\"admin_aggr_shortname\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(enteredShortname) + "\" onfocus=\"javascript:textbox_enter('admin_aggr_shortname', 'admin_aggr_large_input_focused')\" onblur=\"javascript:textbox_leave('admin_aggr_shortname', 'admin_aggr_large_input')\" /></td></tr>");

                // Add the link line
                Output.WriteLine("          <tr><td><label for=\"admin_aggr_link\">External Link:</label></td><td colspan=\"2\"><input class=\"admin_aggr_large_input\" name=\"admin_aggr_link\" id=\"admin_aggr_link\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(enteredLink) + "\" onfocus=\"javascript:textbox_enter('admin_aggr_link', 'admin_aggr_large_input_focused')\" onblur=\"javascript:textbox_leave('admin_aggr_link', 'admin_aggr_large_input')\" /></td></tr>");

                // Add the description box
                int actual_cols = 75;
                if (currentMode.Browser_Type.ToUpper().IndexOf("FIREFOX") >= 0)
                {
                    actual_cols = 70;
                }
                Output.WriteLine("          <tr valign=\"top\"><td valign=\"top\"><label for=\"admin_aggr_desc\">Description:</label></td><td colspan=\"2\"><textarea rows=\"6\" cols=\"" + actual_cols + "\" name=\"admin_aggr_desc\" id=\"admin_aggr_desc\" class=\"admin_aggr_input\" onfocus=\"javascript:textbox_enter('admin_aggr_desc','admin_aggr_focused')\" onblur=\"javascript:textbox_leave('admin_aggr_desc','admin_aggr_input')\">" + HttpUtility.HtmlEncode(enteredDescription) + "</textarea></td></tr>");

                // Add checkboxes for is active and is hidden
                Output.Write(enteredIsActive
                                 ? "          <tr height=\"30px\"><td>Behavior:</td><td colspan=\"2\"><input class=\"admin_aggr_checkbox\" type=\"checkbox\" name=\"admin_aggr_isactive\" id=\"admin_aggr_isactive\" checked=\"checked\" /> <label for=\"admin_aggr_isactive\">Active?</label> "
                                 : "          <tr height=\"30px\"><td>Behavior:</td><td colspan=\"2\"><input class=\"admin_aggr_checkbox\" type=\"checkbox\" name=\"admin_aggr_isactive\" id=\"admin_aggr_isactive\" /> <label for=\"admin_aggr_isactive\">Active?</label> ");

                Output.Write("&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ");

                Output.Write(enteredIsHidden
                                 ? "<input class=\"admin_aggr_checkbox\" type=\"checkbox\" name=\"admin_aggr_ishidden\" id=\"admin_aggr_ishidden\" checked=\"checked\" /> <label for=\"admin_aggr_ishidden\">Hidden?</label> "
                                 : "<input class=\"admin_aggr_checkbox\" type=\"checkbox\" name=\"admin_aggr_ishidden\" id=\"admin_aggr_ishidden\" /> <label for=\"admin_aggr_ishidden\">Hidden?</label> ");
                Output.WriteLine("</td></tr>");

                Output.WriteLine("        </table>");

                Output.WriteLine("        <center><input type=\"image\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button.gif\" value=\"Submit\" alt=\"Submit\" onclick=\"return save_new_aggr();\"/></center>");

                Output.WriteLine("      </div>");
                Output.WriteLine("    </blockquote>");
                Output.WriteLine("    <br />");


                Output.WriteLine("  <span class=\"SobekAdminTitle\">Existing Item Aggregations</span>");
                Output.WriteLine("  <br /><br />");

                Output.WriteLine("  <a name=\"list\">");
                Output.WriteLine("  <blockquote>");
                Output.WriteLine("    Select a type below to view all matching item aggregations:");
                Output.WriteLine("    <blockquote>");
                int i = 1;
                foreach (string thisType in codeManager.All_Types)
                {
                    currentMode.My_Sobek_SubMode = i.ToString();
                    Output.WriteLine("      <a href=\"" + currentMode.Redirect_URL() + "\" >" + thisType.ToUpper() + "</a><br /><br />");
                    i++;
                }
                currentMode.My_Sobek_SubMode = String.Empty;
                Output.WriteLine("    </blockquote>");
                Output.WriteLine("  </blockquote>");
            }
            else
            {
                string aggregationType = codeManager.All_Types[index - 1];

                Output.WriteLine("  <span class=\"SobekAdminTitle\">Other Actions</span>");
                Output.WriteLine("    <blockquote>");
                currentMode.My_Sobek_SubMode = String.Empty;
                Output.WriteLine("      <a href=\"" + currentMode.Redirect_URL() + "\">Add new item aggregation</a><br /><br />");
                Output.WriteLine("      <a href=\"" + currentMode.Redirect_URL() + "#list\">View different aggregations</a>");
                currentMode.My_Sobek_SubMode = index.ToString();
                Output.WriteLine("    </blockquote>");
                Output.WriteLine("    <br />");

                Output.WriteLine("  <span class=\"SobekAdminTitle\">Existing " + aggregationType + "s</span>");
                Output.WriteLine("  <br /><br />");

                Output.WriteLine("    <blockquote>");

                Output.WriteLine("<table border=\"0px\" cellspacing=\"0px\" class=\"statsTable\">");
                Output.WriteLine("  <tr align=\"left\" bgcolor=\"#0022a7\" >");
                Output.WriteLine("    <th width=\"180px\" align=\"left\"><span style=\"color: White\"> &nbsp; ACTIONS</span></th>");
                Output.WriteLine("    <th width=\"120px\" align=\"left\"><span style=\"color: White\">CODE</span></th>");
                Output.WriteLine("    <th align=\"left\"><span style=\"color: White\">NAME</span></th>");
                Output.WriteLine("   </tr>");
                Output.WriteLine("  <tr><td bgcolor=\"#e7e7e7\" colspan=\"3\"></td></tr>");

                Output.WriteLine("  <tr align=\"left\" bgcolor=\"#7d90d5\" >");
                if ((aggregationType.Length > 0) && (aggregationType[aggregationType.Length - 1] != 'S'))
                {
                    Output.WriteLine("    <td colspan=\"3\"><span style=\"color: White\"><b> &nbsp; " + aggregationType.ToUpper() + "S</b></span></td>");
                }
                else
                {
                    Output.WriteLine("    <td colspan=\"3\"><span style=\"color: White\"><b> &nbsp; " + aggregationType.ToUpper() + "</b></span></td>");
                }
                Output.WriteLine("  </tr>");

                // Show all matching rows
                string last_code = String.Empty;
                foreach (Item_Aggregation_Related_Aggregations thisAggr in codeManager.Aggregations_By_Type(aggregationType))
                {
                    if (thisAggr.Code != last_code)
                    {
                        last_code = thisAggr.Code;

                        // Build the action links
                        Output.WriteLine("  <tr align=\"left\" >");
                        Output.Write("    <td class=\"SobekAdminActionLink\" >( ");
                        Output.Write("<a title=\"Click to edit this item aggregation\" id=\"EDIT_" + thisAggr.Code + "\" href=\"" + currentMode.Base_URL + "my/editaggr/" + thisAggr.Code + "\">edit</a> | ");
                        if (thisAggr.Active)
                        {
                            Output.Write("<a title=\"Click to view this item aggregation\" href=\"" + currentMode.Base_URL + "l/" + thisAggr.Code + "\">view</a> | ");
                        }
                        else
                        {
                            Output.Write("view | ");
                        }

                        Output.Write("<a title=\"Click to reset the instance in the application cache\" id=\"RESET_" + thisAggr.Code + "\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return reset_aggr('" + thisAggr.Code + "');\">reset</a> )</td>");

                        // Add the rest of the row with data
                        Output.WriteLine("    <td>" + thisAggr.Code + "</span></td>");
                        Output.WriteLine("    <td>" + thisAggr.Name + "</span></td>");
                        Output.WriteLine("   </tr>");
                        Output.WriteLine("  <tr><td bgcolor=\"#e7e7e7\" colspan=\"3\"></td></tr>");
                    }
                }

                Output.WriteLine("</table>");
                Output.WriteLine("    </blockquote>");
            }

            Output.WriteLine("    <br />");
            Output.WriteLine("</div>");
            Output.WriteLine();
        }
        /// <summary> This is an opportunity to write HTML directly into the main form, without
        /// using the pop-up html form architecture </summary>
        /// <param name="Output"> Textwriter to write the pop-up form HTML for this viewer </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <remarks> This text will appear within the ItemNavForm form tags </remarks>
        public override void Add_HTML_In_Main_Form(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Settings_AdminViewer.Add_HTML_In_Main_Form", "Write the rest of the form ");


            // Add the hidden field
            Output.WriteLine("<!-- Hidden field is used for postbacks to indicate what to save and reset -->");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_settings_action\" name=\"admin_settings_action\" value=\"\" />");
            Output.WriteLine();

            Output.WriteLine("<!-- Settings_AdminViewer.Add_HTML_In_Main_Form -->");
            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_form.js\" ></script>");
            Output.WriteLine("<script src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_admin.js\" type=\"text/javascript\"></script>");
            Output.WriteLine("<div class=\"SobekHomeText\">");

            if (actionMessage.Length > 0)
            {
                Output.WriteLine("  <br />");
                Output.WriteLine("  <center><b>" + actionMessage + "</b></center>");
            }

            // Determine if the Florida SUS settings should be displayed
            bool show_florida_sus = false;

            if ((settings.ContainsKey("Show Florida SUS Settings")) && (String.Compare(settings["Show Florida SUS Settings"], "true", true) == 0))
            {
                show_florida_sus = true;
            }

            Output.WriteLine("  <blockquote>");
            Output.WriteLine("    This form allows a user to view and edit all the main system-wide settings which allow the SobekCM web application and assorted related applications to function correctly within each custom architecture and each institution.<br /><br />");
            Output.WriteLine("    For more information about these settings, <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "admin/settings\" target=\"ADMIN_USER_HELP\" >click here to view the help page</a>.");
            Output.WriteLine("  </blockquote>");
            Output.WriteLine();
            Output.WriteLine("  <table width=\"100%\">");
            Output.WriteLine("    <tr>");
            Output.WriteLine("      <td width=\"300px\" align=\"left\">");
            Output.WriteLine("        <span class=\"SobekAdminTitle\">Current System-Wide Settings</span>");
            Output.WriteLine("      </td>");
            Output.WriteLine("      <td align=\"right\">");
            Output.WriteLine("        <a onmousedown=\"window.location.href='" + currentMode.Base_URL + "my/admin'; return false;\"><img style=\"cursor: pointer;\" border=\"0px\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/cancel_button_g.gif\" alt=\"CANCEL\" /></a> &nbsp; &nbsp; ");
            Output.WriteLine("        <a onmousedown=\"admin_settings_save(); return false;\"><img style=\"cursor: pointer;\" border=\"0px\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button_g.gif\" alt=\"SAVE\" /></a>");
            Output.WriteLine("      </td>");
            Output.WriteLine("      <td width=\"20px\">&nbsp;</td>");
            Output.WriteLine("    </tr>");
            Output.WriteLine("  </table>");
            Output.WriteLine();
            Output.WriteLine("  <blockquote>");
            Output.WriteLine("  <table border=\"0px\" cellspacing=\"0px\" class=\"statsTable\" width=\"100%\">");
            Output.WriteLine("    <tr align=\"left\" bgcolor=\"#0022a7\" height=\"30px\" >");
            Output.WriteLine("      <th width=\"230px\" align=\"left\"><span style=\"color: White\"> &nbsp; SETTING KEY</span></th>");
            Output.WriteLine("      <th width=\"420px\" align=\"center\"><span style=\"color: White\">SETTING VALUE</span></th>");
            Output.WriteLine("     </tr>");
            Output.WriteLine("    <tr><td bgcolor=\"#e7e7e7\" colspan=\"2\"></td></tr>");

            // Write the data for each interface
            bool odd_row = true;

            foreach (int setting_counter in idToSetting.Keys)
            {
                // Get the current setting information
                Setting_Info settingInfo = idToSetting[setting_counter];

                // If no Florida SUS-specific settings should be displayed, check to see
                // if this setting should be skipped
                if ((show_florida_sus) || (!settingInfo.Is_Florida_SUS_Setting))
                {
                    // Also, look for this value in the current settings
                    string setting_value = String.Empty;
                    if (settingInfo.isVariable)
                    {
                        if (settings.ContainsKey(settingInfo.Key))
                        {
                            setting_value = settings[settingInfo.Key];
                        }
                        if ((setting_value.Length == 0) && (((Variable_Setting_Info)settingInfo).Default_Value.Length > 0))
                        {
                            setting_value = ((Variable_Setting_Info)settingInfo).Default_Value;
                        }
                    }
                    else
                    {
                        setting_value = ((Constant_Setting_Info)settingInfo).Value;
                    }


                    // Build the action links
                    Output.WriteLine(odd_row
                                         ? "    <tr align=\"left\" valign=\"middle\" height=\"30px\" >"
                                         : "    <tr align=\"left\" valign=\"middle\" height=\"30px\" bgcolor=\"#eeeeee\" >");
                    Output.WriteLine("      <td><strong>" + settingInfo.Key + ":</strong></td>");
                    Output.WriteLine("      <td>");
                    Output.WriteLine("        <table>");
                    Output.WriteLine("          <tr valign=\"middle\">");
                    Output.WriteLine("            <td>");

                    // Is this a variable setting, which the user can change?
                    if (settingInfo.isVariable)
                    {
                        Variable_Setting_Info varSettingInfo = (Variable_Setting_Info)settingInfo;
                        if (varSettingInfo.Options.Length > 0)
                        {
                            Output.WriteLine("              <select id=\"setting" + setting_counter + "\" name=\"setting" + setting_counter + "\" class=\"admin_settings_select\" >");

                            bool option_found = false;
                            foreach (string thisValue in varSettingInfo.Options)
                            {
                                if (String.Compare(thisValue, setting_value, true) == 0)
                                {
                                    option_found = true;
                                    Output.WriteLine("                <option selected=\"selected\">" + setting_value + "</option>");
                                }
                                else
                                {
                                    Output.WriteLine("                <option>" + thisValue + "</option>");
                                }
                            }

                            if (!option_found)
                            {
                                Output.WriteLine("                <option selected=\"selected\">" + setting_value + "</option>");
                            }
                            Output.WriteLine("              </select>");
                        }
                        else
                        {
                            if ((varSettingInfo.Fixed_Input_Size > 0) && (varSettingInfo.Fixed_Input_Size < 360))
                            {
                                Output.WriteLine("              <input id=\"setting" + setting_counter + "\" name=\"setting" + setting_counter + "\" class=\"admin_settings_input\" type=\"text\"  style=\"width: " + varSettingInfo.Fixed_Input_Size + "px;\" value=\"" + HttpUtility.HtmlEncode(setting_value) + "\" onfocus=\"javascript:textbox_enter('setting" + setting_counter + "', 'admin_settings_input_focused')\" onblur=\"javascript:textbox_leave('setting" + setting_counter + "', 'admin_settings_input')\" />");
                            }
                            else
                            {
                                Output.WriteLine("              <input id=\"setting" + setting_counter + "\" name=\"setting" + setting_counter + "\" class=\"admin_settings_input\" type=\"text\" style=\"width: 360px;\" value=\"" + HttpUtility.HtmlEncode(setting_value) + "\" onfocus=\"javascript:textbox_enter('setting" + setting_counter + "', 'admin_settings_input_focused')\" onblur=\"javascript:textbox_leave('setting" + setting_counter + "', 'admin_settings_input')\" />");
                            }
                        }
                    }
                    else
                    {
                        if (setting_value.Trim().Length == 0)
                        {
                            Output.WriteLine("              <em>( no value )</em>");
                        }
                        else
                        {
                            Output.WriteLine("              " + HttpUtility.HtmlEncode(setting_value));
                        }
                    }

                    Output.WriteLine("            </td>");
                    Output.WriteLine("            <td>");
                    Output.WriteLine("              <img border=\"0px\" style=\"padding-left:5px; margin-top:3px; cursor:pointer; cursor:hand;\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + settingInfo.Help_Message.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" />");
                    Output.WriteLine("            </td>");
                    Output.WriteLine("          </tr valign=\"middle\">");
                    Output.WriteLine("        </table>");
                    Output.WriteLine("      </td>");
                    Output.WriteLine("    </tr>");
                    Output.WriteLine("    <tr><td bgcolor=\"#e7e7e7\" colspan=\"2\"></td></tr>");

                    odd_row = !odd_row;
                }
            }

            Output.WriteLine("  </table>");
            Output.WriteLine("  </blockquote>");

            Output.WriteLine();
            Output.WriteLine("  <table width=\"100%\">");
            Output.WriteLine("    <tr>");
            Output.WriteLine("      <td width=\"300px\" align=\"left\">&nbsp;</td>");
            Output.WriteLine("      <td align=\"right\">");
            Output.WriteLine("        <a onmousedown=\"window.location.href='" + currentMode.Base_URL + "my/admin'; return false;\"><img style=\"cursor: pointer;\" border=\"0px\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/cancel_button_g.gif\" alt=\"CANCEL\" /></a> &nbsp; &nbsp; ");
            Output.WriteLine("        <a onmousedown=\"admin_settings_save(); return false;\"><img style=\"cursor: pointer;\" border=\"0px\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button_g.gif\" alt=\"SAVE\" /></a>");
            Output.WriteLine("      </td>");
            Output.WriteLine("      <td width=\"20px\">&nbsp;</td>");
            Output.WriteLine("    </tr>");
            Output.WriteLine("  </table>");

            Output.WriteLine("  <br />");
            Output.WriteLine("</div>");
            Output.WriteLine();
        }
Esempio n. 11
0
        public override void Write_ItemNavForm_Opening(TextWriter Output, Custom_Tracer Tracer)
        {
            Output.WriteLine("<!-- Edit_Item_Metadata_MySobekViewer.Add_Controls -->");

            // Write the top item mimic html portion
            Write_Item_Type_Top(Output, item);

            Output.WriteLine("<div id=\"container-inner1000\">");
            Output.WriteLine("<div id=\"pagecontainer\">");

            Output.WriteLine("<div class=\"sbkMySobek_HomeText\">");
            Output.WriteLine("  <br />");
            if (!isProject)
            {
                Output.WriteLine("  <h2>Edit this item</h2>");
                Output.WriteLine("    <ul>");
                Output.WriteLine("      <li>Enter the data for this item below and press the SAVE button when all your edits are complete.</li>");
                Output.WriteLine("      <li>Clicking on the green plus button ( <img class=\"repeat_button\" src=\"" + currentMode.Base_URL + "default/images/new_element_demo.jpg\" /> ) will add another instance of the element, if the element is repeatable.</li>");

                if ((item.Using_Complex_Template) || (item.Contains_Complex_Content))
                {
                    if (item.Contains_Complex_Content)
                    {
                        Output.WriteLine("      <li>You are using the full editing form because this item contains complex elements or was derived from MARC.</li>");
                    }
                    else
                    {
                        Output.Write("      <li>You are using the full editing form.  Click");
                        Output.Write("<a href=\"#\" onclick=\"editmetadata_simplify();return false;\">here to return to the simplified version</a>.");
                        Output.WriteLine("</li>");
                    }
                }
                else
                {
                    Output.WriteLine("      <li>You are using the simplified editing form.  Click");
                    Output.Write("<a href=\"#\" onclick=\"editmetadata_complicate();return false;\">here to use the full form</a>.");
                    Output.WriteLine("</li>");
                }

                if (template.Code.ToUpper().IndexOf("MARC") > 0)
                {
                    Output.WriteLine("      <li>To open detailed edit forms, click on the linked metadata values.</li>");
                }
                Output.WriteLine("      <li>Click <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "help/editinstructions\" target=\"_EDIT_INSTRUCTIONS\">here for detailed instructions</a> on editing metadata online.</li>");
            }
            else
            {
                Output.WriteLine("  <b>Edit this project</b>");
                Output.WriteLine("    <ul>");
                Output.WriteLine("      <li>Enter the default data for this project below and press the SAVE button when all your edits are complete.</li>");
                Output.WriteLine("      <li>Clicking on the blue plus signs ( <img class=\"repeat_button\" src=\"" + currentMode.Base_URL + "default/images/new_element_demo.jpg\" /> ) will add another instance of the element, if the element is repeatable.</li>");
                Output.WriteLine("      <li>Click on the element names for detailed information inluding definitions, best practices, and technical information.</li>");
                Output.WriteLine("      <li>You are using the full editing form because you are editing a project.</li>");
            }

            Output.WriteLine("     </ul>");
            Output.WriteLine("</div>");
            Output.WriteLine();

            Output.WriteLine("<!-- Buttons to select each template page -->");
            Output.WriteLine("<a name=\"template\"> </a>");
            Output.WriteLine("<div id=\"tabContainer\" class=\"fulltabs\">");
            Output.WriteLine("  <div class=\"tabs\">");
            Output.WriteLine("    <ul>");


            int    page_iterator   = 1;
            string current_submode = currentMode.My_Sobek_SubMode;

            if (current_submode.Length == 0)
            {
                current_submode = "1";
            }
            while (page_iterator <= template.InputPages.Count)
            {
                if (current_submode[0].ToString() == page_iterator.ToString())
                {
                    Output.Write("      <li class=\"tabActiveHeader\">" + template.InputPages[page_iterator - 1].Title + "</li>");
                }
                else
                {
                    Output.Write("      <li onclick=\"editmetadata_newpage('" + page_iterator + "');\">" + template.InputPages[page_iterator - 1].Title + "</li>");
                }

                page_iterator++;
            }

            bool preview = false;

            if (!isProject)
            {
                if (page < 1)
                {
                    preview = true;
                    Output.Write("      <li class=\"tabActiveHeader\">Preview</li>");
                }
                else
                {
                    Output.Write("      <li onclick=\"editmetadata_newpage('0');\">Preview</li>");
                }
            }

            currentMode.My_Sobek_SubMode = current_submode;

            Output.WriteLine("    </ul>");
            Output.WriteLine("  </div>");
            Output.WriteLine("  <div class=\"graytabscontent\">");
            Output.WriteLine("    <div class=\"tabpage\" id=\"tabpage_1\">");

            // Add the first buttons
            Output.WriteLine("      <!-- Add SAVE and CANCEL buttons to top of form -->");
            Output.WriteLine("      <script src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_metadata.js\" type=\"text/javascript\"></script>");
            Output.WriteLine();
            Output.WriteLine("      <div class=\"sbkMySobek_RightButtons\">");
            Output.WriteLine("        <button onclick=\"editmetadata_cancel_form();return false;\" class=\"sbkMySobek_BigButton\"><img src=\"" + currentMode.Base_URL + "default/images/button_previous_arrow.png\" class=\"sbkMySobek_RoundButton_LeftImg\" alt=\"\" /> CANCEL </button> &nbsp; &nbsp; ");
            Output.WriteLine("        <button onclick=\"editmetadata_save_form();return false;\" class=\"sbkMySobek_BigButton\"> SAVE <img src=\"" + currentMode.Base_URL + "default/images/button_next_arrow.png\" class=\"sbkMySobek_RoundButton_RightImg\" alt=\"\" /></button>");
            Output.WriteLine("      </div>");
            Output.WriteLine("      <br /><br />");
            Output.WriteLine();


            Tracer.Add_Trace("Edit_Item_Metadata_MySobekViewer.Add_Controls", "Render template html");
            if (!preview)
            {
                if (page >= 1)
                {
                    bool isMozilla = currentMode.Browser_Type.ToUpper().IndexOf("FIREFOX") >= 0;

                    popUpFormsHtml = template.Render_Template_HTML(Output, item, currentMode.Skin == currentMode.Default_Skin ? currentMode.Skin.ToUpper() : currentMode.Skin, isMozilla, user, currentMode.Language, Translator, currentMode.Base_URL, ((int)page));
                }
            }
            else
            {
                show_preview(Output, currentMode.My_Sobek_SubMode, Tracer);
            }

            // Add the second buttons at the bottom of the form
            Output.WriteLine();
            Output.WriteLine("      <!-- Add SAVE and CANCEL buttons to bottom of form -->");
            Output.WriteLine("      <div class=\"sbkMySobek_RightButtons\">");
            Output.WriteLine("        <button onclick=\"editmetadata_cancel_form(); return false;\" class=\"sbkMySobek_BigButton\"><img src=\"" + currentMode.Base_URL + "default/images/button_previous_arrow.png\" class=\"sbkMySobek_RoundButton_LeftImg\" alt=\"\" /> CANCEL </button> &nbsp; &nbsp; ");
            Output.WriteLine("        <button onclick=\"editmetadata_save_form(); return false;\" class=\"sbkMySobek_BigButton\"> SAVE <img src=\"" + currentMode.Base_URL + "default/images/button_next_arrow.png\" class=\"sbkMySobek_RoundButton_RightImg\" alt=\"\" /></button>");
            Output.WriteLine("      </div>");
            Output.WriteLine("      <br />");
            Output.WriteLine("    </div>");
            Output.WriteLine("  </div>");
            Output.WriteLine("</div>");
            Output.WriteLine("</div>");
            Output.WriteLine("</div>");
            Output.WriteLine();
        }
        /// <summary> This is an opportunity to write HTML directly into the main form, without
        /// using the pop-up html form architecture </summary>
        /// <param name="Output"> Textwriter to write the pop-up form HTML for this viewer </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <remarks> This text will appear within the ItemNavForm form tags </remarks>
        public override void Write_ItemNavForm_Closing(TextWriter Output, Custom_Tracer Tracer)
        {
            // Set the help for these subelements
            const string PORTAL_NAME_HELP  = "Name for the system when accessed through this url portal.  This additionally identifies this url portal to administrators.\n\nFor example, Digital Library of the Caribbean, or University of Florida Digital Collections.";
            const string ABBREVIATION_HELP = "Abbreviation for the system, when accessed through this url portal.\n\nFor example, 'dLOC', or UFDC.";
            const string WEB_SKIN_HELP     = "Default web skin under which this url portal should be displayed.  If none is probided, it will default to the system web skin.";
            const string AGGREGATION_HELP  = "Default aggregation which should be displayed under this url portal.  If none is provided, this url portal will display the main system home page.";
            const string URL_SEGMENT_HELP  = "URL segment used for matching purposes to determine which url portal a user is accessing this system from.\n\nA blank URL portal will make this the default portal.";
            const string BASE_PURL_HELP    = "Base permanent link URL to be used when constructing permanent URLs for items which do not have itt explicitly entered.\n\nA blank value here will result in the current URL being used as the base for the purl.";

            Tracer.Add_Trace("Portals_AdminViewer.Write_ItemNavForm_Closing", "Adds the portal information to the main form");

            Output.WriteLine("<!-- Portals_AdminViewer.Write_ItemNavForm_Closing -->");
            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/jquery/jquery-ui-1.10.3.custom.min.js\"></script>");
            Output.WriteLine();

            // Add the hidden field
            Output.WriteLine("<!-- Hidden fields are used for postbacks to indicate what to save and reset -->");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_portal_action\" name=\"admin_portal_action\" value=\"\" />");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_portal_tosave\" name=\"admin_portal_tosave\" value=\"\" />");
            Output.WriteLine();

            // Only system admins can edit the URL portals
            if (user.Is_System_Admin)
            {
                Output.WriteLine("<!-- URL Portal Edit Form -->");
                Output.WriteLine("<div class=\"sbkPoav_PopupDiv\" id=\"form_portal\" style=\"display:none;\">");
                Output.WriteLine("  <div class=\"sbkAdm_PopupTitle\"><table style=\"width:100%;\"><tr style=\"height:20px;\"><td style=\"text-align:left;\">EDIT URL PORTAL</td><td style=\"text-align:right;\"> <a href=\"#template\" alt=\"CLOSE\" onclick=\"portal_form_close()\">X</a> &nbsp; </td></tr></table></div>");
                Output.WriteLine("  <br />");
                Output.WriteLine("  <table class=\"sbkAdm_PopupTable\">");

                // Add the line for the url portal name
                Output.WriteLine("    <tr>");
                Output.WriteLine("      <td style=\"width:145px;\"><label for=\"form_portal_name\">Portal Name:</label></td>");
                Output.WriteLine("      <td><input class=\"sbkPoav_input sbkAdmin_Focusable\" name=\"form_portal_name\" id=\"form_portal_name\" type=\"text\" value=\"\" /></td>");
                Output.WriteLine("      <td><img class=\"sbkPoav_HelpButton\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + PORTAL_NAME_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" title=\"" + PORTAL_NAME_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", " ") + "\" /></td>");
                Output.WriteLine("    </tr>");

                // Add the line for the url portal abbreviation
                Output.WriteLine("    <tr>");
                Output.WriteLine("      <td><label for=\"form_portal_abbr\">System Abbreviation:</label></td>");
                Output.WriteLine("      <td><input class=\"sbkPoav_input sbkAdmin_Focusable\" name=\"form_portal_abbr\" id=\"form_portal_abbr\" type=\"text\" value=\"\" /></td>");
                Output.WriteLine("      <td><img class=\"sbkPoav_HelpButton\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + ABBREVIATION_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" title=\"" + ABBREVIATION_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", " ") + "\" /></td>");
                Output.WriteLine("    </tr>");

                // Add the line for the default web skin
                Output.WriteLine("    <tr>");
                Output.WriteLine("      <td><label for=\"form_portal_skin\">Default Web Skin:</label></td>");
                Output.WriteLine("      <td>");

                //Output.WriteLine("        <input class=\"sbkPoav_input sbkAdmin_Focusable\" name=\"form_portal_skin\" id=\"form_portal_skin\" type=\"text\" value=\"\" /></td>");

                Output.WriteLine("        <select class=\"sbkPoav_select\" name=\"form_portal_skin\" id=\"form_portal_skin\">");
                Output.WriteLine("          <option value=\"\"></option>");

                foreach (string thisSkin in skinCollection.Ordered_Skin_Codes)
                {
                    Output.WriteLine("          <option value=\"" + thisSkin.ToLower() + "\">" + thisSkin.ToLower() + "</option>");
                }
                Output.WriteLine("        </select>");

                Output.WriteLine("      </td>");
                Output.WriteLine("      <td><img class=\"sbkPoav_HelpButton\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + WEB_SKIN_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" title=\"" + WEB_SKIN_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", " ") + "\" /></td>");
                Output.WriteLine("    </tr>");

                // Add the line for the default aggregation
                Output.WriteLine("    <tr>");
                Output.WriteLine("      <td><label for=\"form_portal_aggregation\">Default Aggregation:</label></td>");
                Output.WriteLine("      <td><input class=\"sbkPoav_input sbkAdmin_Focusable\" name=\"form_portal_aggregation\" id=\"form_portal_aggregation\" type=\"text\" value=\"\" /></td>");
                Output.WriteLine("      <td><img class=\"sbkPoav_HelpButton\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + AGGREGATION_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" title=\"" + AGGREGATION_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", " ") + "\" /></td>");
                Output.WriteLine("    </tr>");

                // Add the line for the base url segment
                Output.WriteLine("    <tr>");
                Output.WriteLine("      <td><label for=\"form_portal_url\">URL Segment:</label></td>");
                Output.WriteLine("      <td><input class=\"sbkPoav_input sbkAdmin_Focusable\" name=\"form_portal_url\" id=\"form_portal_url\" type=\"text\" value=\"\" /></td>");
                Output.WriteLine("      <td><img class=\"sbkPoav_HelpButton\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + URL_SEGMENT_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" title=\"" + URL_SEGMENT_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", " ") + "\" /></td>");
                Output.WriteLine("    </tr>");

                // Add the line for the base purl
                Output.WriteLine("    <tr>");
                Output.WriteLine("      <td><label for=\"form_portal_purl\">Base PURL:</label></td>");
                Output.WriteLine("      <td><input class=\"sbkPoav_input sbkAdmin_Focusable\" name=\"form_portal_purl\" id=\"form_portal_purl\" type=\"text\" value=\"\" /></td>");
                Output.WriteLine("      <td><img class=\"sbkPoav_HelpButton\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + BASE_PURL_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" title=\"" + BASE_PURL_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", " ") + "\" /></td>");
                Output.WriteLine("    </tr>");

                // Add the buttons and close out the pop-up table
                Output.WriteLine("    <tr style=\"height:35px; text-align: center; vertical-align: bottom;\">");
                Output.WriteLine("      <td colspan=\"3\">");
                Output.WriteLine("        <button title=\"Do not apply changes\" class=\"sbkAdm_RoundButton\" onclick=\"return portal_form_close();\"><img src=\"" + currentMode.Base_URL + "default/images/button_previous_arrow.png\" class=\"sbkAdm_RoundButton_LeftImg\" alt=\"\" /> CANCEL</button> &nbsp; &nbsp; ");
                Output.WriteLine("        <button title=\"Save changes to this existing portal\" class=\"sbkAdm_RoundButton\" type=\"submit\">SAVE <img src=\"" + currentMode.Base_URL + "default/images/button_next_arrow.png\" class=\"sbkAdm_RoundButton_RightImg\" alt=\"\" /></button>");
                Output.WriteLine("      </td>");
                Output.WriteLine("    </tr>");
                Output.WriteLine("  </table>");
                Output.WriteLine("</div>");
                Output.WriteLine();
            }

            Output.WriteLine("<script src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_admin.js\" type=\"text/javascript\"></script>");
            Output.WriteLine("<div class=\"sbkAdm_HomeText\">");

            if (actionMessage.Length > 0)
            {
                Output.WriteLine("  <br />");
                Output.WriteLine("  <div id=\"sbkAdm_ActionMessage\">" + actionMessage + "</div>");
            }

            Output.WriteLine("  <p>URL portals allow the same SobekCM library to have a very different look and feel and encompass different item aggregations.  Each portal is defined by the incoming URL and the URL for each incoming request is analyzed to ensure it is handled correctly.</p>");
            Output.WriteLine("  <p>For more information about URL portals, <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "adminhelp/portals\" target=\"ADMIN_USER_HELP\" >click here to view the help page</a>.</p>");

            // Add portal admin message
            int columns = 6;

            if (!user.Is_System_Admin)
            {
                Output.WriteLine("<p>Portal Admins have rights to see these settings. System Admins can change these settings.</p>");
                columns = 5;
            }
            else
            {
                Output.WriteLine("  <h2>New URL Portal</h2>");
                Output.WriteLine("  <p>To add a new URL portal to this system, enter the information below and press SAVE.</p>");
                Output.WriteLine("  <div class=\"sbkPoav_NewDiv\">");
                Output.WriteLine("    <table class=\"sbkAdm_PopupTable\">");

                Portal newPortal = new Portal(-1, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty);

                // Add the line for the url portal name
                Output.WriteLine("      <tr>");
                Output.WriteLine("        <td style=\"width:145px;\"><label for=\"admin_portal_name\">Portal Name:</label></td>");
                Output.WriteLine("        <td><input class=\"sbkPoav_input sbkAdmin_Focusable\" name=\"admin_portal_name\" id=\"admin_portal_name\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(newPortal.Name) + "\" /></td>");
                Output.WriteLine("        <td><img class=\"sbkPoav_HelpButton\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + PORTAL_NAME_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" title=\"" + PORTAL_NAME_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", " ") + "\" /></td>");
                Output.WriteLine("      </tr>");

                // Add the line for the url portal abbreviation
                Output.WriteLine("      <tr>");
                Output.WriteLine("        <td><label for=\"admin_portal_abbr\">System Abbreviation:</label></td>");
                Output.WriteLine("        <td><input class=\"sbkPoav_input sbkAdmin_Focusable\" name=\"admin_portal_abbr\" id=\"admin_portal_abbr\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(newPortal.Abbreviation) + "\" /></td>");
                Output.WriteLine("        <td><img class=\"sbkPoav_HelpButton\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + ABBREVIATION_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" title=\"" + ABBREVIATION_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", " ") + "\" /></td>");
                Output.WriteLine("      </tr>");

                // Add the line for the default web skin
                Output.WriteLine("      <tr>");
                Output.WriteLine("        <td><label for=\"admin_portal_skin\">Default Web Skin:</label></td>");

                Output.WriteLine("        <td>");

                //Output.WriteLine("        <input class=\"sbkPoav_input sbkAdmin_Focusable\" name=\"admin_portal_skin\" id=\"admin_portal_skin\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(newPortal.Default_Web_Skin) + "\" />");

                Output.WriteLine("          <select class=\"sbkPoav_select\" name=\"admin_portal_skin\" id=\"admin_portal_skin\">");

                if (newPortal.Default_Web_Skin.Trim().Length == 0)
                {
                    Output.WriteLine("            <option value=\"\" selected=\"selected\"></option>");
                }
                else
                {
                    Output.WriteLine("            <option value=\"\"></option>");
                }

                foreach (string thisSkin in skinCollection.Ordered_Skin_Codes)
                {
                    if (String.Compare(thisSkin, newPortal.Default_Web_Skin, StringComparison.OrdinalIgnoreCase) == 0)
                    {
                        Output.WriteLine("            <option value=\"" + thisSkin.ToLower() + "\" selected=\"selected\">" + thisSkin.ToLower() + "</option>");
                    }
                    else
                    {
                        Output.WriteLine("            <option value=\"" + thisSkin.ToLower() + "\">" + thisSkin.ToLower() + "</option>");
                    }
                }
                Output.WriteLine("          </select>");

                Output.WriteLine("        </td>");
                Output.WriteLine("        <td><img class=\"sbkPoav_HelpButton\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + WEB_SKIN_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" title=\"" + WEB_SKIN_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", " ") + "\" /></td>");
                Output.WriteLine("      </tr>");

                // Add the line for the default aggregation
                Output.WriteLine("      <tr>");
                Output.WriteLine("        <td><label for=\"admin_portal_aggregation\">Default Aggregation:</label></td>");
                Output.WriteLine("        <td><input class=\"sbkPoav_input sbkAdmin_Focusable\" name=\"admin_portal_aggregation\" id=\"admin_portal_aggregation\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(newPortal.Default_Aggregation) + "\" /></td>");
                Output.WriteLine("        <td><img class=\"sbkPoav_HelpButton\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + AGGREGATION_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" title=\"" + AGGREGATION_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", " ") + "\" /></td>");
                Output.WriteLine("      </tr>");

                // Add the line for the base url segment
                Output.WriteLine("      <tr>");
                Output.WriteLine("        <td><label for=\"admin_portal_url\">URL Segment:</label></td>");
                Output.WriteLine("        <td><input class=\"sbkPoav_input sbkAdmin_Focusable\" name=\"admin_portal_url\" id=\"admin_portal_url\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(newPortal.URL_Segment) + "\" /></td>");
                Output.WriteLine("        <td><img class=\"sbkPoav_HelpButton\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + URL_SEGMENT_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" title=\"" + URL_SEGMENT_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", " ") + "\" /></td>");
                Output.WriteLine("      </tr>");

                // Add the line for the base purl
                Output.WriteLine("      <tr>");
                Output.WriteLine("        <td><label for=\"admin_portal_purl\">Base PURL:</label></td>");
                Output.WriteLine("        <td><input class=\"sbkPoav_input sbkAdmin_Focusable\" name=\"admin_portal_purl\" id=\"admin_portal_purl\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(newPortal.Base_PURL) + "\" /></td>");
                Output.WriteLine("        <td><img class=\"sbkPoav_HelpButton\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + BASE_PURL_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", "\\n") + "');\" title=\"" + BASE_PURL_HELP.Replace("'", "").Replace("\\", "\\\\").Replace("\n", " ") + "\" /></td>");
                Output.WriteLine("      </tr>");

                // Add the SAVE button
                Output.WriteLine("      <tr style=\"height:30px; text-align: center;\"><td colspan=\"3\"><button title=\"Save new portal\" class=\"sbkAdm_RoundButton\" onclick=\"return save_new_portal();\">SAVE <img src=\"" + currentMode.Base_URL + "default/images/button_next_arrow.png\" class=\"sbkAdm_RoundButton_RightImg\" alt=\"\" /></button></td></tr>");
                Output.WriteLine("    </table>");
                Output.WriteLine("  </div>");
                Output.WriteLine("  <br />");
                Output.WriteLine();
            }

            Output.WriteLine("  <h2>Existing URL Portals</h2>");
            Output.WriteLine("  <p>The following URL portals are currently cached in this web application.</p>");

            Output.WriteLine("  <table class=\"sbkPoav_Table sbkAdm_Table\">");
            Output.WriteLine("    <tr>");
            if (user.Is_System_Admin)
            {
                Output.WriteLine("      <th class=\"sbkPoav_TableHeader1\">ACTIONS</th>");
            }
            Output.WriteLine("      <th class=\"sbkPoav_TableHeader2\">URL<br />SEGMENT</th>");
            Output.WriteLine("      <th class=\"sbkPoav_TableHeader3\">SYSTEM<br />ABBREVIATION</th>");
            Output.WriteLine("      <th class=\"sbkPoav_TableHeader4\">DEFAULT<br />WEB SKIN</th>");
            Output.WriteLine("      <th class=\"sbkPoav_TableHeader5\">DEFAULT<br />AGGREGATION</th>");
            Output.WriteLine("      <th class=\"sbkPoav_TableHeader6\">BASE<br />PURL</th>");
            Output.WriteLine("    </tr>");

            // Write the default portal first
            Output.WriteLine("    <tr>");
            if (user.Is_System_Admin)
            {
                if (portals.Default_Portal.ID > 0)
                {
                    Output.Write("      <td class=\"sbkAdm_ActionLink\" >( ");
                    Portal thisPortal = portals.Default_Portal;
                    Output.WriteLine("      <a title=\"Edit this portal\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return portal_form_popup( '" + thisPortal.ID + "','" + HttpUtility.HtmlEncode(thisPortal.Name.Replace("'", "")) + "','" + thisPortal.Abbreviation + "','" + thisPortal.Default_Web_Skin + "','" + thisPortal.Default_Aggregation + "','" + thisPortal.URL_Segment + "','" + thisPortal.Base_PURL + "');\">edit</a> ) </td>");
                }
                else
                {
                    Output.WriteLine("    <td>&nbsp;</td>");
                }
            }
            Output.WriteLine("      <td id=\"sbkPoav_DefaultCell\">default</td>");
            Output.WriteLine("      <td>" + portals.Default_Portal.Abbreviation + "</td>");
            Output.WriteLine("      <td>" + portals.Default_Portal.Default_Web_Skin + "</td>");
            Output.WriteLine("      <td>" + portals.Default_Portal.Default_Aggregation + "</td>");
            Output.WriteLine("      <td>" + portals.Default_Portal.Base_PURL + "</td>");
            Output.WriteLine("    </tr>");
            Output.WriteLine("    <tr><td class=\"sbkAdm_TableRule\" colspan=\"" + columns + "\"></td></tr>");

            // Write the data for each portal
            foreach (Portal thisPortal in portals.All_Portals)
            {
                if (thisPortal != portals.Default_Portal)
                {
                    Output.WriteLine("    <tr>");
                    if (user.Is_System_Admin)
                    {
                        Output.Write("      <td class=\"sbkAdm_ActionLink\" >( ");
                        Output.Write("<a title=\"Edit this portal\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return portal_form_popup( '" + thisPortal.ID + "','" + HttpUtility.HtmlEncode(thisPortal.Name.Replace("'", "")) + "','" + thisPortal.Abbreviation + "','" + thisPortal.Default_Web_Skin + "','" + thisPortal.Default_Aggregation + "','" + thisPortal.URL_Segment + "','" + thisPortal.Base_PURL + "');\">edit</a> | ");
                        Output.WriteLine("<a title=\"Delete this portal\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return delete_portal('" + thisPortal.ID + "','" + HttpUtility.HtmlEncode(thisPortal.Name.Replace("'", "")) + "');\">delete</a> )</td>");
                    }
                    Output.WriteLine("      <td>" + thisPortal.URL_Segment + "</td>");
                    Output.WriteLine("      <td>" + thisPortal.Abbreviation + "</td>");
                    Output.WriteLine("      <td>" + thisPortal.Default_Web_Skin + "</td>");
                    Output.WriteLine("      <td>" + thisPortal.Default_Aggregation + "</td>");
                    Output.WriteLine("      <td>" + thisPortal.Base_PURL + "</td>");
                    Output.WriteLine("    </tr>");
                    Output.WriteLine("    <tr><td class=\"sbkAdm_TableRule\" colspan=\"" + columns + "\"></td></tr>");
                }
            }
            Output.WriteLine("  </table>");
            Output.WriteLine("</div>");
        }
        /// <summary> This is an opportunity to write HTML directly into the main form, without
        /// using the pop-up html form architecture </summary>
        /// <param name="Output"> Textwriter to write the pop-up form HTML for this viewer </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <remarks> This text will appear within the ItemNavForm form tags </remarks>
        public override void Write_ItemNavForm_Closing(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Thematic_Headings_AdminViewer.Write_ItemNavForm_Closing", "Add any popup divisions for form elements");

            Output.WriteLine("<!-- Thematic_Headings_AdminViewer.Write_ItemNavForm_Closing -->");
            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/jquery/jquery-ui-1.10.3.custom.min.js\"></script>");

            // Add the hidden field
            Output.WriteLine("<!-- Hidden field is used for postbacks to indicate what to save and reset -->");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_heading_action\" name=\"admin_heading_action\" value=\"\" />");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_heading_tosave\" name=\"admin_heading_tosave\" value=\"\" />");
            Output.WriteLine();

            Output.WriteLine("<!-- Thematic Heading Edit Form -->");
            Output.WriteLine("<div class=\"sbkThav_PopupDiv\" id=\"form_heading\" style=\"display:none;\">");
            Output.WriteLine("  <div class=\"sbkAdm_PopupTitle\"><table style=\"width:100%;\"><tr><td style=\"text-align: left;\">EDIT THEMATIC HEADING</td><td style=\"text-align:right;\"> <a href=\"#template\" alt=\"CLOSE\" onclick=\"heading_form_close()\">X</a> &nbsp; </td></tr></table></div>");
            Output.WriteLine("  <br />");
            Output.WriteLine("  <table class=\"sbkAdm_PopupTable\">");

            // Add line for heading
            Output.WriteLine("    <tr><td style=\"width: 80px;\"><label for=\"form_heading_name\">Heading:</label></td><td colspan=\"2\"><input class=\"sbkThav_input sbkAdmin_Focusable\" name=\"form_heading_name\" id=\"form_heading_name\" type=\"text\" value=\"\" /></td></tr>");

            // Add the buttons
            Output.WriteLine("    <tr style=\"height:35px; text-align: center; vertical-align: bottom;\">");
            Output.WriteLine("      <td colspan=\"2\">");
            Output.WriteLine("        <button title=\"Do not apply changes\" class=\"sbkAdm_RoundButton\" onclick=\"return heading_form_close();\"><img src=\"" + currentMode.Base_URL + "default/images/button_previous_arrow.png\" class=\"sbkAdm_RoundButton_LeftImg\" alt=\"\" /> CANCEL</button> &nbsp; &nbsp; ");
            Output.WriteLine("        <button title=\"Save changes to this existing thematic heading\" class=\"sbkAdm_RoundButton\" type=\"submit\">SAVE <img src=\"" + currentMode.Base_URL + "default/images/button_next_arrow.png\" class=\"sbkAdm_RoundButton_RightImg\" alt=\"\" /></button> &nbsp; &nbsp; ");
            Output.WriteLine("      </td>");
            Output.WriteLine("    </tr>");
            Output.WriteLine("  </table>");
            Output.WriteLine("</div>");
            Output.WriteLine();


            Tracer.Add_Trace("Thematic_Headings_AdminViewer.Write_ItemNavForm_Closing", "Write the rest of the form ");

            Output.WriteLine("<script src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_admin.js\" type=\"text/javascript\"></script>");
            Output.WriteLine("<div class=\"sbkAdm_HomeText\">");

            if (actionMessage.Length > 0)
            {
                Output.WriteLine("  <br />");
                Output.WriteLine("  <div id=\"sbkAdm_ActionMessage\">" + actionMessage + "</div>");
            }

            Output.WriteLine("  <p>Thematic headings are the headings on the main library home page, under which all the item aggregation icons appear.</p>");
            Output.WriteLine("  <p>For more information about thematic headings, <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "adminhelp/headings\" target=\"ADMIN_USER_HELP\" >click here to view the help page</a>.</p>");
            Output.WriteLine();

            Output.WriteLine("  <h2>New Thematic Heading</h2>");
            Output.WriteLine("  <div class=\"sbkThav_NewDiv\">");
            Output.WriteLine("    <table class=\"sbkAdm_PopupTable\">");
            Output.WriteLine("      <tr>");
            Output.WriteLine("        <td><label for=\"admin_heading_name\">Heading:</label></td>");
            Output.WriteLine("        <td><input class=\"sbkThav_input sbkAdmin_Focusable\" name=\"admin_heading_name\" id=\"admin_heading_name\" type=\"text\" value=\"\" /></td>");
            Output.WriteLine("        <td><button title=\"Save new thematic heading\" class=\"sbkAdm_RoundButton\" onclick=\"return save_new_heading();\">SAVE <img src=\"" + currentMode.Base_URL + "default/images/button_next_arrow.png\" class=\"sbkAdm_RoundButton_RightImg\" alt=\"\" /></button></td>");
            Output.WriteLine("      </tr>");
            Output.WriteLine("    </table>");
            Output.WriteLine("  </div>");
            Output.WriteLine("  <br />");

            Output.WriteLine("  <h2>Existing Thematic Headings</h2>");
            Output.WriteLine("  <table class=\"sbkThav_Table sbkAdm_Table\">");
            Output.WriteLine("    <tr>");
            Output.WriteLine("      <th class=\"sbkThav_TableHeader1\">ACTIONS</th>");
            Output.WriteLine("      <th class=\"sbkThav_TableHeader2\">REORDER</th>");
            Output.WriteLine("      <th class=\"sbkThav_TableHeader3\">THEMATIC HEADING</th>");
            Output.WriteLine("     </tr>");
            Output.WriteLine("     <tr><td class=\"sbkAdm_TableRule\" colspan=\"3\"></td></tr>");

            // Write the data for each interface
            int current_order = 1;

            foreach (Thematic_Heading thisTheme in thematicHeadings)
            {
                // Build the action links
                Output.WriteLine("    <tr style=\"text-align:left;\" >");
                Output.Write("      <td class=\"sbkAdm_ActionLink\" >( ");
                Output.Write("<a title=\"Click to edit\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return heading_form_popup('" + thisTheme.ThemeName + "','" + thisTheme.ThematicHeadingID + "');\">edit</a> | ");
                Output.WriteLine("<a title=\"Delete this thematic heading\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return delete_heading('" + thisTheme.ThematicHeadingID + "', '" + thisTheme.ThemeName.Replace("\'", "") + "');\">delete</a> )</td>");

                Output.Write("      <td class=\"sbkAdm_ActionLink\">( ");
                Output.Write("<a title=\"Move this heading up in the order\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return move_heading_up('" + thisTheme.ThematicHeadingID + "', '" + current_order + "');\">up</a> | ");
                Output.WriteLine("<a title=\"Move this heading down in the order\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return move_heading_down('" + thisTheme.ThematicHeadingID + "', '" + current_order + "');\">down</a> )</td>");

                // Add the rest of the row with data
                Output.WriteLine("      <td>" + thisTheme.ThemeName + "</td>");
                Output.WriteLine("    </tr>");
                Output.WriteLine("    <tr><td class=\"sbkAdm_TableRule\" colspan=\"3\"></td></tr>");

                current_order++;
            }

            Output.WriteLine("  </table>");
            Output.WriteLine("  <br />");
            Output.WriteLine("</div>");
            Output.WriteLine();
        }
Esempio n. 14
0
        /// <summary> Add the HTML to be displayed in the main SobekCM viewer area </summary>
        /// <param name="Output"> Textwriter to write the HTML for this viewer</param>
        /// <param name="Tracer">Trace object keeps a list of each method executed and important milestones in rendering</param>
        public override void  Add_HTML_In_Main_Form(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Edit_Item_Behaviors_MySobekViewer.Add_HTML_In_Main_Form", "");

            Output.WriteLine("<!-- Hidden field is used for postbacks to add new form elements (i.e., new name, new other titles, etc..) -->");
            Output.WriteLine("<input type=\"hidden\" id=\"behaviors_request\" name=\"behaviors_request\" value=\"\" />");


            Output.WriteLine("<!-- Edit_Item_Behaviors_MySobekViewer.Add_HTML_In_Main_Form -->");
            Output.WriteLine("<div class=\"SobekText\">");
            Output.WriteLine("  <br />");

            Output.WriteLine("  <b>Edit this item's behaviors within this library.</b>");
            Output.WriteLine("    <ul>");
            Output.WriteLine("      <li>Enter the data for this item below and press the SAVE button when all your edits are complete.</li>");
            Output.WriteLine("      <li>Clicking on the green plus button ( <img class=\"repeat_button\" src=\"" + currentMode.Base_URL + "default/images/new_element_demo.jpg\" /> ) will add another instance of the element, if the element is repeatable.</li>");
            Output.WriteLine("      <li>Click <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "help/behaviors\" target=\"_EDIT_INSTRUCTIONS\">here for detailed instructions</a> on editing behaviors online.</li>");


            Output.WriteLine("     </ul>");
            Output.WriteLine("</div>");
            Output.WriteLine();

            Output.WriteLine("<a name=\"template\"> </a>");
            Output.WriteLine("<br />");
            Output.WriteLine("<div class=\"ViewsBrowsesRow\">");
            Output.WriteLine(Selected_Tab_Start + "BEHAVIORS" + Selected_Tab_End + " ");
            Output.WriteLine("</div>");
            Output.WriteLine("<div class=\"SobekEditPanel\">");
            Output.WriteLine("<!-- Add SAVE and CANCEL buttons to top of form -->");
            Output.WriteLine("<script src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_metadata.js\" type=\"text/javascript\"></script>");
            Output.WriteLine("<table width=\"100%\">");
            Output.WriteLine("  <tr>");
            Output.WriteLine("    <td width=\"480px\">&nbsp;</td>");
            Output.WriteLine("    <td align=\"right\">");
            Output.WriteLine("      <a onmousedown=\"behaviors_cancel_form(); return false;\"><img style=\"cursor: pointer;\" border=\"0px\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/cancel_button_g.gif\" alt=\"CANCEL\" /></a> &nbsp; &nbsp; ");
            Output.WriteLine("      <a onmousedown=\"behaviors_save_form(); return false;\"><img style=\"cursor: pointer;\" border=\"0px\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button_g.gif\" alt=\"SAVE\" /></a>");
            Output.WriteLine("    </td>");
            Output.WriteLine("    <td width=\"20px\">&nbsp;</td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine("</table>");

            bool isMozilla = false;

            if (currentMode.Browser_Type.ToUpper().IndexOf("FIREFOX") >= 0)
            {
                isMozilla = true;
            }
            template.Render_Template_HTML(Output, item, currentMode.Skin == currentMode.Default_Skin ? currentMode.Skin.ToUpper() : currentMode.Skin, isMozilla, user, currentMode.Language, Translator, currentMode.Base_URL, 1);

            // Add the second buttons at the bottom of the form
            Output.WriteLine("<!-- Add SAVE and CANCEL buttons to bottom of form -->");
            Output.WriteLine("<table width=\"100%\">");
            Output.WriteLine("  <tr>");
            Output.WriteLine("    <td width=\"480px\">&nbsp;</td>");
            Output.WriteLine("    <td align=\"right\">");
            Output.WriteLine("      <a onmousedown=\"behaviors_cancel_form(); return false;\"><img style=\"cursor: pointer;\" border=\"0px\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/cancel_button_g.gif\" alt=\"CANCEL\" /></a> &nbsp; &nbsp; ");
            Output.WriteLine("      <a onmousedown=\"behaviors_save_form(); return false;\"><img style=\"cursor: pointer;\" border=\"0px\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button_g.gif\" alt=\"SAVE\" /></a>");
            Output.WriteLine("    </td>");
            Output.WriteLine("    <td width=\"20px\">&nbsp;</td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine("</table>");
            Output.WriteLine("</div>");
            Output.WriteLine("<br />");
        }
        /// <summary> Add the HTML to be displayed in the main SobekCM viewer area </summary>
        /// <param name="Output"> Textwriter to write the HTML for this viewer</param>
        /// <param name="Tracer">Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <remarks> This class does nothing, since the wordmarks list is added as controls, not HTML </remarks>
        public override void Write_HTML(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Wordmarks_AdminViewer.Write_HTML", "Do nothing");

            Output.WriteLine("<!-- Wordmarks_AdminViewer.Write_HTML -->");

            Tracer.Add_Trace("Wordmarks_AdminViewer.Write_ItemNavForm_Closing", "Add any popup divisions for form elements");

            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/jquery/jquery-ui-1.10.3.custom.min.js\"></script>");

            // Start this added form
            string post_url = HttpUtility.HtmlEncode(HttpContext.Current.Items["Original_URL"].ToString());

            Output.WriteLine("<form name=\"sbkAdm_AddedForm\" method=\"post\" action=\"" + post_url + "\" id=\"sbkAdm_AddedForm\" >");

            // Add the hidden field
            Output.WriteLine("<!-- Hidden field is used for postbacks to indicate what to save and reset -->");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_wordmark_code_tosave\" name=\"admin_wordmark_code_tosave\" value=\"\" />");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_wordmark_code_delete\" name=\"admin_wordmark_code_delete\" value=\"\" />");
            Output.WriteLine();

            Output.WriteLine("<!-- Wordmarks Edit Form -->");
            Output.WriteLine("<div class=\"sbkWav_PopupDiv\" id=\"form_wordmark\" name=\"form_wordmark\" style=\"display:none;\">");
            Output.WriteLine("  <div class=\"sbkAdm_PopupTitle\"><table style=\"width:100%\"><tr><td style=\"text-align:left;\">EDIT WORDMARK / ICON <td><td style=\"text-align:right;\"> <a href=\"#template\" alt=\"CLOSE\" onclick=\"wordmark_form_close()\">X</a> &nbsp; </td></tr></table></div>");
            Output.WriteLine("  <br />");
            Output.WriteLine("  <table class=\"sbkAdm_PopupTable\">");

            // Add line for interface code and base interface code
            Output.WriteLine("    <tr style=\"text-align:left;\">");
            Output.WriteLine("      <td><label for=\"form_wordmark_code\">Wordmark Code:</label></td>");
            Output.WriteLine("      <td><span class=\"form_linkline admin_existing_code_line\" id=\"form_wordmark_code\"></span></td>");
            Output.WriteLine("    </tr>");

            // Add line for filename
            Output.WriteLine("    <tr><td><label for=\"form_wordmark_file\">Image File:</label></td><td><input readonly=\"readonly\" class=\"sbkWav_medium_input sbkAdmin_Focusable\" name=\"form_wordmark_file\" id=\"form_wordmark_file\" type=\"text\" value=\"\" /></td></tr>");

            // Add line for title
            Output.WriteLine("    <tr><td><label for=\"form_wordmark_title\">Title:</label></td><td><input class=\"sbkWav_large_input sbkAdmin_Focusable\" name=\"form_wordmark_title\" id=\"form_wordmark_title\" type=\"text\" value=\"\" /></td></tr>");

            // Add line for banner link
            Output.WriteLine("    <tr><td><label for=\"form_wordmark_link\">Link:</label></td><td><input class=\"sbkWav_large_input sbkAdmin_Focusable\" name=\"form_wordmark_link\" id=\"form_wordmark_link\" type=\"text\" value=\"\" /></td></tr>");

            // Add the buttons
            Output.WriteLine("    <tr style=\"height:35px; text-align: center; vertical-align: bottom;\">");
            Output.WriteLine("      <td colspan=\"2\">");
            Output.WriteLine("        <button title=\"Do not apply changes\" class=\"sbkAdm_RoundButton\" onclick=\"return wordmark_form_close();\"><img src=\"" + currentMode.Base_URL + "default/images/button_previous_arrow.png\" class=\"sbkAdm_RoundButton_LeftImg\" alt=\"\" /> CANCEL</button> &nbsp; &nbsp; ");
            Output.WriteLine("        <button title=\"Save changes to this existing wordmark\" class=\"sbkAdm_RoundButton\" type=\"submit\">SAVE <img src=\"" + currentMode.Base_URL + "default/images/button_next_arrow.png\" class=\"sbkAdm_RoundButton_RightImg\" alt=\"\" /></button> &nbsp; &nbsp; ");
            Output.WriteLine("      </td>");
            Output.WriteLine("    </tr>");
            Output.WriteLine("  </table>");
            Output.WriteLine("</div>");

            Tracer.Add_Trace("Wordmarks_AdminViewer.Write_HTML", "Write the HTML for the rest of the form");

            Output.WriteLine();
            Output.WriteLine("<script src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_admin.js\" type=\"text/javascript\"></script>");
            Output.WriteLine("<div class=\"sbkAdm_HomeText\">");

            if (actionMessage.Length > 0)
            {
                Output.WriteLine("  <br />");
                Output.WriteLine("  <div id=\"sbkAdm_ActionMessage\">" + actionMessage + "</div>");
            }

            Output.WriteLine("  <p>For clarification of any terms on this form, <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "adminhelp/wordmarks\" target=\"ADMIN_WORDMARK_HELP\" >click here to view the help page</a>.</p>");



            Output.WriteLine("  <h2>New Wordmark / Icon</h2>");
            Output.WriteLine("  <p>Add a new wordmark to this repository.  If you have not yet uploaded the image to use, do this first.</p>");

            if (loweredFiles.Count > 0)
            {
                Output.WriteLine("  <div style=\"width:210px; float:right;\"><img id=\"sbkWav_SelectedImage\" name=\"sbkWav_SelectedImage\" src=\"" + currentMode.Base_URL + "design/wordmarks/" + loweredFiles[0] + "\" alt=\"Missing\" Title=\"Selected image file\" /></div>");

                Output.WriteLine("    <div class=\"sbkWav_NewDiv\">");
                Output.WriteLine("      <table class=\"sbkAdm_PopupTable\">");

                // Add line for wordmark code
                Output.WriteLine("        <tr>");
                Output.WriteLine("          <td style=\"width:120px\"><label for=\"admin_wordmark_code\">Wordmark Code:</label></td>");
                Output.WriteLine("          <td><input class=\"sbkWav_small_input sbkAdmin_Focusable\" name=\"admin_wordmark_code\" id=\"admin_wordmark_code\" type=\"text\" value=\"\" /></td>");
                Output.WriteLine("        </tr>");

                // Add line for filename
                Output.WriteLine("        <tr>");
                Output.WriteLine("          <td><label for=\"admin_wordmark_file\">Image File:</label></td>");
                Output.WriteLine("          <td>");
                Output.WriteLine("            <select class=\"sbkWav_medium_input\" name=\"admin_wordmark_file\" id=\"admin_wordmark_file\" onchange=\"wordmark_select_changed('" + currentMode.Base_URL + "design/wordmarks/');\">");

                foreach (string thisFile in loweredFiles)
                {
                    Output.WriteLine("              <option value=\"" + thisFile + "\">" + thisFile + "</option>");
                }

                Output.WriteLine("            </select>");
                Output.WriteLine("          </td>");
                Output.WriteLine("        </tr>");


                // Add line for title
                Output.WriteLine("        <tr><td><label for=\"admin_wordmark_title\">Title:</label></td><td><input class=\"sbkWav_large_input sbkAdmin_Focusable\" name=\"admin_wordmark_title\" id=\"admin_wordmark_title\" type=\"text\" value=\"\" /></td></tr>");

                // Add line for banner link
                Output.WriteLine("        <tr><td><label for=\"admin_wordmark_link\">Link:</label></td><td><input class=\"sbkWav_large_input sbkAdmin_Focusable\" name=\"admin_wordmark_link\" id=\"admin_wordmark_link\" type=\"text\" value=\"\" /></td></tr>");

                // Add the SAVE button
                Output.WriteLine("        <tr style=\"height:30px; text-align: center;\"><td colspan=\"2\"><button title=\"Save new wordmark\" class=\"sbkAdm_RoundButton\" onclick=\"return save_new_wordmark();\">SAVE <img src=\"" + currentMode.Base_URL + "default/images/button_next_arrow.png\" class=\"sbkAdm_RoundButton_RightImg\" alt=\"\" /></button></td></tr>");
                Output.WriteLine("      </table>");
                Output.WriteLine("    </div>");
            }
            else
            {
                Output.WriteLine("  <br />");
            }

            Output.WriteLine("  </div>");
            Output.WriteLine("  <br />");
            Output.WriteLine("</form>");

            Output.WriteLine("<div class=\"sbkAdm_HomeText\">");
            Output.WriteLine("  <h2>Upload New Image File</h2>");
            Output.WriteLine("  <blockquote>");
            Output.WriteLine("  Browse to a new wordmark image file below and then select Upload to add the new wordmark image file.  The image should be a jpeg, gif, bmp, or png file.<br /><br />");
        }
Esempio n. 16
0
        /// <summary> Add the HTML to be displayed in the main SobekCM viewer area </summary>
        /// <param name="Output"> Textwriter to write the HTML for this viewer</param>
        /// <param name="Tracer">Trace object keeps a list of each method executed and important milestones in rendering</param>
        public override void Write_ItemNavForm_Closing(TextWriter Output, Custom_Tracer Tracer)
        {
            const string NEWVOLUME = "NEW VOLUME";

            Tracer.Add_Trace("Group_Add_Volume_MySobekViewer.Write_ItemNavForm_Closing", "");

            Output.WriteLine("<!-- Hidden field is used for postbacks to add new form elements (i.e., new name, new other titles, etc..) -->");
            Output.WriteLine("<input type=\"hidden\" id=\"action\" name=\"action\" value=\"\" />");

            Output.WriteLine("<div id=\"sbkIsw_Titlebar\">");

            string grouptitle = item.Behaviors.GroupTitle;

            if (grouptitle.Length > 125)
            {
                Output.WriteLine("\t<h1 itemprop=\"name\"><abbr title=\"" + grouptitle + "\">" + grouptitle.Substring(0, 120) + "...</abbr></h1>");
            }
            else
            {
                Output.WriteLine("\t<h1 itemprop=\"name\">" + grouptitle + "</h1>");
            }

            Output.WriteLine("</div>");
            Output.WriteLine("<div class=\"sbkMenu_Bar\" id=\"sbkIsw_MenuBar\" style=\"height:20px\">&nbsp;</div>");

            Output.WriteLine("<div id=\"container-inner1000\">");
            Output.WriteLine("<div id=\"pagecontainer\">");


            Output.WriteLine("<!-- Group_Add_Volume_MySobekViewer.Write_ItemNavForm_Closing -->");
            Output.WriteLine("<div class=\"sbkMySobek_HomeText\">");
            Output.WriteLine("  <br />");
            Output.WriteLine("  <h2>Add a new volume to this existing title/item group</h2>");
            Output.WriteLine("    <ul>");
            Output.WriteLine("      <li>Only enter data that you wish to override the data in the existing base volume.</li>");
            //Output.WriteLine("      <li>Clicking on the green plus button ( <img class=\"repeat_button\" src=\"" + currentMode.Base_URL + "default/images/new_element_demo.jpg\" /> ) will add another instance of the element, if the element is repeatable.</li>");
            Output.WriteLine("      <li>Click <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "help/addvolume\" target=\"_EDIT_INSTRUCTIONS\">here for detailed instructions</a> on adding new volumes online.</li>");
            Output.WriteLine("     </ul>");
            Output.WriteLine("</div>");
            Output.WriteLine();

            if (message.Length > 0)
            {
                Output.WriteLine("" + message + "<br />");
            }

            Output.WriteLine("<a name=\"template\"> </a>");
            Output.WriteLine("<div id=\"tabContainer\" class=\"fulltabs\">");
            Output.WriteLine("  <div class=\"tabs\">");
            Output.WriteLine("    <ul>");
            Output.WriteLine("      <li id=\"tabHeader_1\" class=\"tabActiveHeader\">" + NEWVOLUME + "</li>");
            Output.WriteLine("    </ul>");
            Output.WriteLine("  </div>");
            Output.WriteLine("  <div class=\"graytabscontent\">");
            Output.WriteLine("    <div class=\"tabpage\" id=\"tabpage_1\">");

            Output.WriteLine("      <!-- Add SAVE and CANCEL buttons to top of form -->");
            Output.WriteLine("      <script src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_metadata.js\" type=\"text/javascript\"></script>");
            Output.WriteLine();

            Output.WriteLine("      <div class=\"sbkMySobek_RightButtons\">");
            Output.WriteLine("        <button onclick=\"addvolume_cancel_form(); return false;\" class=\"sbkMySobek_BigButton\"><img src=\"" + currentMode.Base_URL + "default/images/button_previous_arrow.png\" class=\"sbkMySobek_RoundButton_LeftImg\" alt=\"\" /> CANCEL </button> &nbsp; &nbsp; ");
            Output.WriteLine("        <button onclick=\"addvolume_save_form(''); return false;\" class=\"sbkMySobek_BigButton\"> SAVE <img src=\"" + currentMode.Base_URL + "default/images/button_next_arrow.png\" class=\"sbkMySobek_RoundButton_RightImg\" alt=\"\" /></button> &nbsp; &nbsp; ");
            Output.WriteLine("        <button onclick=\"addvolume_save_form('_again'); return false;\" class=\"sbkMySobek_BigButton\">SAVE & ADD ANOTHER</button>");
            Output.WriteLine("      </div>");
            Output.WriteLine("      <br /><br />");
            Output.WriteLine();

            // Output.WriteLine("    <td width=\"460px\"> Import metadata and behaviors from existing volume: &nbsp; ");
            Output.WriteLine("      <div style=\"text-align:left;padding-left:58px; padding-bottom: 10px;\">Import from existing volume: &nbsp; ");
            Output.WriteLine("        <select id=\"base_volume\" name=\"base_volume\" class=\"addvolume_base_volume\">");

            DataColumn vidColumn  = itemsInTitle.Item_Table.Columns["VID"];
            bool       first      = true;
            DataView   sortedView = new DataView(itemsInTitle.Item_Table)
            {
                Sort = "VID DESC"
            };

            foreach (DataRowView itemRowView in sortedView)
            {
                if (first)
                {
                    Output.WriteLine("          <option value=\"" + itemRowView.Row[vidColumn] + "\" selected=\"selected\">" + itemRowView.Row[vidColumn] + "</option>");
                    first = false;
                }
                else
                {
                    Output.WriteLine("          <option value=\"" + itemRowView.Row[vidColumn] + "\">" + itemRowView.Row[vidColumn] + "</option>");
                }
            }
            Output.WriteLine("        </select>");
            Output.WriteLine("      </div>");
            Output.WriteLine();

            bool isMozilla = currentMode.Browser_Type.ToUpper().IndexOf("FIREFOX") >= 0;

            // Create a new blank item for display purposes
            SobekCM_Item displayItem = new SobekCM_Item {
                BibID = item.BibID
            };

            displayItem.Behaviors.IP_Restriction_Membership = ipRestrict;
            displayItem.Behaviors.Serial_Info.Clear();
            displayItem.Tracking.Born_Digital             = bornDigital;
            displayItem.Tracking.Tracking_Box             = trackingBox;
            displayItem.Tracking.Material_Received_Notes  = materialRecdNotes;
            displayItem.Tracking.Material_Received_Date   = materialRecdDate;
            displayItem.Tracking.Disposition_Advice       = dispositionAdvice;
            displayItem.Tracking.Disposition_Advice_Notes = dispositionAdviceNotes;
            if (title.Length > 0)
            {
                displayItem.Bib_Info.Main_Title.Clear();
                displayItem.Bib_Info.Main_Title.Title = title;
            }
            if (date.Length > 0)
            {
                displayItem.Bib_Info.Origin_Info.Date_Issued = date;
            }
            if ((level1.Length > 0) && (level1Order >= 0))
            {
                displayItem.Behaviors.Serial_Info.Add_Hierarchy(1, level1Order, level1);
                if ((level2.Length > 0) && (level2Order >= 0))
                {
                    displayItem.Behaviors.Serial_Info.Add_Hierarchy(2, level2Order, level2);
                    if ((level3.Length > 0) && (level3Order >= 0))
                    {
                        displayItem.Behaviors.Serial_Info.Add_Hierarchy(3, level3Order, level3);
                    }
                }
            }

            template.Render_Template_HTML(Output, displayItem, currentMode.Skin == currentMode.Default_Skin ? currentMode.Skin.ToUpper() : currentMode.Skin, isMozilla, user, currentMode.Language, Translator, currentMode.Base_URL, 1);

            // Add the second buttons at the bottom of the form
            Output.WriteLine("      <!-- Add SAVE and CANCEL buttons to bottom of form -->");
            Output.WriteLine("      <div class=\"sbkMySobek_RightButtons\">");
            Output.WriteLine("        <button onclick=\"addvolume_cancel_form(); return false;\" class=\"sbkMySobek_BigButton\"><img src=\"" + currentMode.Base_URL + "default/images/button_previous_arrow.png\" class=\"sbkMySobek_RoundButton_LeftImg\" alt=\"\" /> CANCEL </button> &nbsp; &nbsp; ");
            Output.WriteLine("        <button onclick=\"addvolume_save_form(''); return false;\" class=\"sbkMySobek_BigButton\"> SAVE <img src=\"" + currentMode.Base_URL + "default/images/button_next_arrow.png\" class=\"sbkMySobek_RoundButton_RightImg\" alt=\"\" /></button> &nbsp; &nbsp; ");
            Output.WriteLine("      </div>");
            Output.WriteLine();

            Output.WriteLine("      <br /><br />");
            Output.WriteLine("      <hr />");
            Output.WriteLine();

            Output.WriteLine("      <p>In addition, the following actions are available:</p>");
            Output.WriteLine("      <button onclick=\"addvolume_save_form('_edit'); return false;\" class=\"sbkMySobek_RoundButton\">SAVE & EDIT ITEM</button> &nbsp; &nbsp; ");
            Output.WriteLine("      <button onclick=\"addvolume_save_form('_addfiles'); return false;\" class=\"sbkMySobek_RoundButton\">SAVE & ADD FILES</button> &nbsp; &nbsp; ");
            Output.WriteLine("      <button onclick=\"addvolume_save_form('_again'); return false;\" class=\"sbkMySobek_RoundButton\">SAVE & ADD ANOTHER</button>");

            Output.WriteLine("    </div>");
            Output.WriteLine("  </div>");
            Output.WriteLine("</div>");
            Output.WriteLine("</div>");
            Output.WriteLine("</div>");
        }
        /// <summary> Add controls directly to the form, either to the main control area or to the file upload placeholder </summary>
        /// <param name="placeHolder"> Main place holder to which all main controls are added </param>
        /// <param name="uploadFilesPlaceHolder"> Place holder is used for uploading file </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param>
        public override void Add_Controls(PlaceHolder placeHolder, PlaceHolder uploadFilesPlaceHolder, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Edit_Item_Metadata_MySobekViewer.Add_Controls", "");

            StringBuilder temp_builder = new StringBuilder(2000);

            temp_builder.AppendLine("<!-- Edit_Item_Metadata_MySobekViewer.Add_Controls -->");
            temp_builder.AppendLine("<div class=\"SobekHomeText\">");
            temp_builder.AppendLine("  <br />");
            if (!isProject)
            {
                temp_builder.AppendLine("  <b>Edit this item</b>");
                temp_builder.AppendLine("    <ul>");
                temp_builder.AppendLine("      <li>Enter the data for this item below and press the SAVE button when all your edits are complete.</li>");
                temp_builder.AppendLine("      <li>Clicking on the green plus button ( <img class=\"repeat_button\" src=\"" + currentMode.Base_URL + "default/images/new_element_demo.jpg\" /> ) will add another instance of the element, if the element is repeatable.</li>");

                if ((item.Using_Complex_Template) || (item.Contains_Complex_Content))
                {
                    if (item.Contains_Complex_Content)
                    {
                        temp_builder.AppendLine("      <li>You are using the full editing form because this item contains complex elements or was derived from MARC.</li>");
                    }
                    else
                    {
                        temp_builder.AppendLine("      <li>You are using the full editing form.  Click");
                        placeHolder.Controls.Add(new LiteralControl(temp_builder.ToString()));
                        temp_builder.Remove(0, temp_builder.Length);

                        LinkButton simplifyButton = new LinkButton {
                            Text = "here to return to the simplified version."
                        };
                        simplifyButton.Click += simplifyButton_Click;
                        placeHolder.Controls.Add(simplifyButton);

                        temp_builder.Append("      </li>");
                    }
                }
                else
                {
                    temp_builder.AppendLine("      <li>You are using the simplified editing form.  Click");
                    placeHolder.Controls.Add(new LiteralControl(temp_builder.ToString()));
                    temp_builder.Remove(0, temp_builder.Length);

                    LinkButton complicateButton = new LinkButton {
                        Text = "here to use the full form."
                    };
                    complicateButton.Click += complicateButton_Click;
                    placeHolder.Controls.Add(complicateButton);

                    temp_builder.Append("      </li>");
                }

                if (template.Code.ToUpper().IndexOf("MARC") > 0)
                {
                    temp_builder.AppendLine("      <li>To open detailed edit forms, click on the linked metadata values.</li>");
                }
                temp_builder.AppendLine("      <li>Click <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "help/editinstructions\" target=\"_EDIT_INSTRUCTIONS\">here for detailed instructions</a> on editing metadata online.</li>");
            }
            else
            {
                temp_builder.AppendLine("  <b>Edit this project</b>");
                temp_builder.AppendLine("    <ul>");
                temp_builder.AppendLine("      <li>Enter the default data for this project below and press the SAVE button when all your edits are complete.</li>");
                temp_builder.AppendLine("      <li>Clicking on the blue plus signs ( <img class=\"repeat_button\" src=\"" + currentMode.Base_URL + "default/images/new_element_demo.jpg\" /> ) will add another instance of the element, if the element is repeatable.</li>");
                temp_builder.AppendLine("      <li>Click on the element names for detailed information inluding definitions, best practices, and technical information.</li>");
                temp_builder.AppendLine("      <li>You are using the full editing form because you are editing a project.</li>");
            }

            temp_builder.AppendLine("     </ul>");
            temp_builder.AppendLine("</div>");
            temp_builder.AppendLine();

            string view_class = "ViewsBrowsesRow";

            if (page == 0.2)
            {
                temp_builder.AppendLine("</div> <!-- Temporary stop page container so the METS preview can extend wider -->");
                view_class = "ViewsBrowsesRow_Wide";
            }

            temp_builder.AppendLine("<!-- Buttons to select each template page -->");
            LiteralControl viewBrowsesLiteral2 = new LiteralControl(temp_builder + "<a name=\"template\"> </a>\n<br />\n<div class=\"" + view_class + "\">\n  ");

            placeHolder.Controls.Add(viewBrowsesLiteral2);


            int    page_iterator   = 1;
            string current_submode = currentMode.My_Sobek_SubMode;

            if (current_submode.Length == 0)
            {
                current_submode = "1";
            }
            while (page_iterator <= template.InputPages.Count)
            {
                if (current_submode[0].ToString() == page_iterator.ToString())
                {
                    currentMode.My_Sobek_SubMode = page_iterator.ToString();
                    LinkButton linkButton = new LinkButton
                    {
                        Text = Selected_Tab_Start + template.InputPages[page_iterator - 1].Title.ToUpper() + Selected_Tab_End + " ",
                        ID   = "newpagebutton" + page_iterator
                    };
                    linkButton.Click += linkButton_Click;
                    placeHolder.Controls.Add(linkButton);
                }
                else
                {
                    currentMode.My_Sobek_SubMode = page_iterator.ToString();
                    LinkButton linkButton = new LinkButton
                    {
                        Text = Unselected_Tab_Start + template.InputPages[page_iterator - 1].Title.ToUpper() + Unselected_Tab_End + " ",
                        ID   = "newpagebutton" + page_iterator
                    };
                    linkButton.Click += linkButton_Click;
                    placeHolder.Controls.Add(linkButton);
                }

                page_iterator++;
            }

            bool preview = false;

            if (!isProject)
            {
                if (page < 1)
                {
                    preview = true;
                    LiteralControl currentPageLiteral = new LiteralControl(Selected_Tab_Start + "PREVIEW" + Selected_Tab_End + " ");
                    placeHolder.Controls.Add(currentPageLiteral);
                }
                else
                {
                    currentMode.My_Sobek_SubMode = "0";
                    LinkButton linkButton = new LinkButton
                    {
                        Text = Unselected_Tab_Start + "PREVIEW" + Unselected_Tab_End + " "
                    };
                    linkButton.Click += linkButton_Click;
                    linkButton.ID     = "newpagebutton0";
                    placeHolder.Controls.Add(linkButton);
                }
            }

            currentMode.My_Sobek_SubMode = current_submode;


            LiteralControl first_literal = new LiteralControl("\n</div>\n\n<div class=\"SobekEditPanel\">\n\n");

            if (page == 0.2)
            {
                first_literal.Text = "</div>\n\n<center>\n\n<div class=\"SobekEditPanel_Wide\">\n\n";
            }
            placeHolder.Controls.Add(first_literal);

            // Add the first buttons
            placeHolder.Controls.Add(new LiteralControl("<!-- Add SAVE and CANCEL buttons to top of form -->\n<script src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_metadata.js\" type=\"text/javascript\"></script>\n<table width=\"100%\">\n  <tr>\n    <td width=\"480px\">&nbsp;</td>\n    <td align=\"right\">"));

            double lastPage = page;

            if (page < 1)
            {
                page = 1;
            }

            LiteralControl cancelButton = new LiteralControl("<a onmousedown=\"javascript:myufdc_cancel_form('" + ((int)page) + "')\"><img style=\"cursor: pointer;\" border=\"0px\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/cancel_button_g.gif\" alt=\"CANCEL\" /></a>\n");

            placeHolder.Controls.Add(cancelButton);

            LiteralControl saveButton = new LiteralControl("<a onmousedown=\"javascript:myufdc_save_form('" + ((int)page) + "')\"><img style=\"cursor: pointer;\" border=\"0px\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button_g.gif\" alt=\"SAVE\" /></a>\n");

            placeHolder.Controls.Add(saveButton);

            page = lastPage;


            //System.Web.UI.WebControls.ImageButton cancelButton = new System.Web.UI.WebControls.ImageButton();
            //cancelButton.ImageUrl = "design/skins/" + currentMode.Base_Skin + "/buttons/cancel_button_g.gif";
            //cancelButton.AlternateText = "CANCEL";
            //cancelButton.Click += new System.Web.UI.ImageClickEventHandler(cancelButton_Click);
            //placeHolder.Controls.Add(cancelButton);
            //placeHolder.Controls.Add(new System.Web.UI.LiteralControl("  &nbsp; "));
            //System.Web.UI.WebControls.ImageButton saveButton = new System.Web.UI.WebControls.ImageButton();
            //saveButton.ImageUrl = "design/skins/" + currentMode.Base_Skin + "/buttons/save_button_g.gif";
            //saveButton.AlternateText = "SAVE";
            //saveButton.Click += new System.Web.UI.ImageClickEventHandler(saveButton_Click);
            //placeHolder.Controls.Add(saveButton);
            placeHolder.Controls.Add(new LiteralControl("</td>\n    <td width=\"20px\">&nbsp;</td>\n  </tr>\n</table>\n"));



            StringBuilder builder = new StringBuilder(2000);
            StringWriter  output  = new StringWriter(builder);

            Tracer.Add_Trace("Edit_Item_Metadata_MySobekViewer.Add_Controls", "Render template html");
            if (!preview)
            {
                if (page >= 1)
                {
                    bool isMozilla = false;
                    if (currentMode.Browser_Type.ToUpper().IndexOf("FIREFOX") >= 0)
                    {
                        isMozilla = true;
                    }

                    popUpFormsHtml = template.Render_Template_HTML(output, item, currentMode.Skin == currentMode.Default_Skin ? currentMode.Skin.ToUpper() : currentMode.Skin, isMozilla, user, currentMode.Language, Translator, currentMode.Base_URL, ((int)page));
                }
            }
            else
            {
                show_preview(output, currentMode.My_Sobek_SubMode, Tracer);
            }

            // Add the second buttons at the bottom of the form
            builder.Append("\n<!-- Add SAVE and CANCEL buttons to bottom of form -->\n<table width=\"100%\">\n  <tr>\n    <td width=\"480px\">&nbsp;</td>\n    <td align=\"right\">");


            LiteralControl last_button_literal1 = new LiteralControl(builder.ToString());

            placeHolder.Controls.Add(last_button_literal1);

            lastPage = page;
            if (page < 1)
            {
                page = 1;
            }

            LiteralControl cancelButton2 = new LiteralControl("<a onmousedown=\"javascript:myufdc_cancel_form('" + ((int)page) + "')\"><img style=\"cursor: pointer;\" border=\"0px\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/cancel_button_g.gif\" alt=\"CANCEL\" /></a>\n");

            placeHolder.Controls.Add(cancelButton2);

            LiteralControl saveButton2 = new LiteralControl("<a onmousedown=\"javascript:myufdc_save_form('" + ((int)page) + "')\"><img style=\"cursor: pointer;\" border=\"0px\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button_g.gif\" alt=\"SAVE\" /></a>\n");

            placeHolder.Controls.Add(saveButton2);
            page = lastPage;

            //System.Web.UI.WebControls.ImageButton cancelButton2 = new System.Web.UI.WebControls.ImageButton();
            //cancelButton2.ImageUrl = "design/skins/" + currentMode.Base_Skin + "/buttons/cancel_button_g.gif";
            //cancelButton2.AlternateText = "CANCEL";
            //cancelButton2.Click += new System.Web.UI.ImageClickEventHandler(cancelButton_Click);
            //placeHolder.Controls.Add(cancelButton2);
            //placeHolder.Controls.Add(new System.Web.UI.LiteralControl("  &nbsp; "));
            //System.Web.UI.WebControls.ImageButton saveButton2 = new System.Web.UI.WebControls.ImageButton();
            //saveButton2.ImageUrl = "design/skins/" + currentMode.Base_Skin + "/buttons/save_button_g.gif";
            //saveButton2.AlternateText = "SAVE";
            //saveButton2.Click += new System.Web.UI.ImageClickEventHandler(saveButton_Click);
            //placeHolder.Controls.Add(saveButton2);

            placeHolder.Controls.Add(page != 0.2
                                         ? new LiteralControl("</td>\n    <td width=\"20px\">&nbsp;</td>\n  </tr>\n</table>\n\n</div>\n<br />\n")
                                         : new LiteralControl("</td>\n    <td width=\"20px\">&nbsp;</td>\n  </tr>\n</table>\n\n</div>\n</center>\n<br />\n<div id=\"pagecontainer_resumed\">\n"));

            // If there was a delayed popup requested, do that now
            if (HttpContext.Current.Session["delayed_popup"] != null)
            {
                string popup = HttpContext.Current.Session["delayed_popup"].ToString().Trim();
                HttpContext.Current.Session.Remove("delayed_popup");

                switch (popup)
                {
                case "relateditem":
                    int related_item_count = item.Bib_Info.RelatedItems_Count;
                    if (related_item_count > 0)
                    {
                        StringBuilder delayed_popup_builder = new StringBuilder();
                        delayed_popup_builder.AppendLine();
                        delayed_popup_builder.AppendLine("<!-- Popup the delayed box -->");
                        delayed_popup_builder.AppendLine("<script type=\"text/javascript\">popup_focus('form_related_item_" + related_item_count + "', 'form_related_item_term_" + related_item_count + "', 'form_relateditem_title_" + related_item_count + "', 575, 620 );</script>");
                        delayed_popup_builder.AppendLine();
                        placeHolder.Controls.Add(new LiteralControl(delayed_popup_builder.ToString()));
                    }
                    break;

                case "subject":
                    int subject_index = 0;
                    if (item.Bib_Info.Subjects_Count > 0)
                    {
                        subject_index += item.Bib_Info.Subjects.Count(thisSubject => thisSubject.Class_Type == Subject_Info_Type.Standard);
                    }
                    if (subject_index > 0)
                    {
                        StringBuilder delayed_popup_builder = new StringBuilder();
                        delayed_popup_builder.AppendLine();
                        delayed_popup_builder.AppendLine("<!-- Popup the delayed box -->");
                        delayed_popup_builder.AppendLine("<script type=\"text/javascript\">popup_focus('form_subject_" + subject_index + "', 'form_subject_term_" + subject_index + "', 'formsubjecttopic1_" + subject_index + "', 310, 600 );</script>");
                        delayed_popup_builder.AppendLine();
                        placeHolder.Controls.Add(new LiteralControl(delayed_popup_builder.ToString()));
                    }
                    break;

                case "spatial":
                    int spatial_index = 0;
                    if (item.Bib_Info.Subjects_Count > 0)
                    {
                        spatial_index += item.Bib_Info.Subjects.Count(thisSubject => thisSubject.Class_Type == Subject_Info_Type.Hierarchical_Spatial);
                    }
                    if (spatial_index > 0)
                    {
                        StringBuilder delayed_popup_builder = new StringBuilder();
                        delayed_popup_builder.AppendLine();
                        delayed_popup_builder.AppendLine("<!-- Popup the delayed box -->");
                        delayed_popup_builder.AppendLine("<script type=\"text/javascript\">popup_focus('form_spatial_" + spatial_index + "', 'form_spatial_term_" + spatial_index + "', 'formspatialcontinent_" + spatial_index + "', 590, 550 );</script>");
                        delayed_popup_builder.AppendLine();
                        placeHolder.Controls.Add(new LiteralControl(delayed_popup_builder.ToString()));
                    }
                    break;

                case "name":
                    int name_count = 0;
                    if ((item.Bib_Info.hasMainEntityName) && (item.Bib_Info.Main_Entity_Name.hasData))
                    {
                        name_count++;
                    }
                    name_count += item.Bib_Info.Names_Count;

                    if (name_count > 0)
                    {
                        StringBuilder delayed_popup_builder = new StringBuilder();
                        delayed_popup_builder.AppendLine();
                        delayed_popup_builder.AppendLine("<!-- Popup the delayed box -->");
                        delayed_popup_builder.AppendLine("<script type=\"text/javascript\">popup_focus('form_name_" + name_count + "', 'form_name_line_" + name_count + "', 'form_name_full_" + name_count + "', 475, 700 );</script>");
                        delayed_popup_builder.AppendLine();
                        placeHolder.Controls.Add(new LiteralControl(delayed_popup_builder.ToString()));
                    }
                    break;

                case "title":
                    int title_count = item.Bib_Info.Other_Titles_Count;
                    if ((item.Bib_Info.hasSeriesTitle) && (item.Bib_Info.SeriesTitle.Title.Length > 0))
                    {
                        title_count++;
                    }
                    if (title_count > 0)
                    {
                        StringBuilder delayed_popup_builder = new StringBuilder();
                        delayed_popup_builder.AppendLine();
                        delayed_popup_builder.AppendLine("<!-- Popup the delayed box -->");
                        delayed_popup_builder.AppendLine("<script type=\"text/javascript\">popup_focus('form_othertitle_" + title_count + "', 'form_othertitle_line_" + title_count + "', 'formothertitletitle_" + title_count + "', 295, 675 );</script>");
                        delayed_popup_builder.AppendLine();
                        placeHolder.Controls.Add(new LiteralControl(delayed_popup_builder.ToString()));
                    }
                    break;
                }
            }
        }
        /// <summary> This is an opportunity to write HTML directly into the main form, without
        /// using the pop-up html form architecture </summary>
        /// <param name="Output"> Textwriter to write the pop-up form HTML for this viewer </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <remarks> This text will appear within the ItemNavForm form tags </remarks>
        public override void Add_HTML_In_Main_Form(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Projects_AdminViewer.Add_HTML_In_Main_Form", "Add any popup divisions for form elements");

            // Add the scripts needed
            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/jquery/jquery-1.6.2.min.js\"></script>");
            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/jquery/jquery-ui-1.8.16.custom.min.js\"></script>");
            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_form.js\" ></script>");

            // Add the hidden field
            Output.WriteLine("<!-- Hidden field is used for postbacks to indicate what to save -->");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_project_tosave\" name=\"admin_project_tosave\" value=\"\" />");
            Output.WriteLine();

            Output.WriteLine("<!-- Projects Rename Form -->");
            Output.WriteLine("<div class=\"admin_project_popup_div\" id=\"form_project\" style=\"display:none;\">");
            Output.WriteLine("  <div class=\"popup_title\"><table width=\"100%\"><tr><td align=\"left\">RENAME PROJECT</td><td align=\"right\"> <a href=\"#template\" alt=\"CLOSE\" onclick=\"project_form_close()\">X</a> &nbsp; </td></tr></table></div>");
            Output.WriteLine("  <br />");
            Output.WriteLine("  <table class=\"popup_table\">");

            // Add line for code
            Output.Write("    <tr align=\"left\"><td width=\"120px\"><label for=\"form_project_code\">Project Code:</label></td>");
            Output.Write("<td><span class=\"form_linkline admin_existing_code_line\" id=\"form_project_code\"></span></td>");

            // Add line for name
            Output.WriteLine("    <tr><td><label for=\"form_project_name\">Project Name:</label></td><td><input class=\"admin_project_large_input\" name=\"form_project_name\" id=\"form_project_name\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('form_project_name', 'admin_project_large_input_focused')\" onblur=\"javascript:textbox_leave('form_project_name', 'admin_project_large_input')\" /></td></tr>");

            Output.WriteLine("  </table>");
            Output.WriteLine("  <br />");
            Output.WriteLine("  <center><a href=\"\" onclick=\"return project_form_close();\"><img border=\"0\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/cancel_button_g.gif\" alt=\"CLOSE\" /></a> &nbsp; &nbsp; <input type=\"image\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button_g.gif\" value=\"Submit\" alt=\"Submit\"></center>");
            Output.WriteLine("</div>");

            Tracer.Add_Trace("Projects_AdminViewer.Add_HTML_In_Main_Form", "Write the rest of the form html");

            // Get the list of all projects
            DataSet projectsSet = SobekCM_Database.Get_All_Projects_Templates(Tracer);

            Output.WriteLine("<!-- Projects_AdminViewer.Add_HTML_In_Main_Form -->");
            Output.WriteLine("<script src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_admin.js\" type=\"text/javascript\"></script>");
            Output.WriteLine("<div class=\"SobekHomeText\">");

            if (actionMessage.Length > 0)
            {
                Output.WriteLine("  <br />");
                Output.WriteLine("  <center><b>" + actionMessage + "</b></center>");
            }

            Output.WriteLine("  <blockquote>For clarification of any terms on this form, <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "admin/projects\" target=\"PROJECTS_INTERFACE_HELP\" >click here to view the help page</a>.</blockquote>");

            Output.WriteLine("  <span class=\"SobekAdminTitle\">New Project</span>");
            Output.WriteLine("    <blockquote>");
            Output.WriteLine("      <div class=\"admin_project_new_div\">");
            Output.WriteLine("        <table class=\"popup_table\">");

            // Add line for code and base code
            Output.Write("          <tr><td width=\"120px\"><label for=\"admin_project_code\">Project Code:</label></td>");
            Output.Write("<td><input class=\"admin_project_small_input\" name=\"admin_project_code\" id=\"admin_project_code\" type=\"text\" value=\"\"  onfocus=\"javascript:textbox_enter('admin_project_code', 'admin_project_small_input_focused')\" onblur=\"javascript:textbox_leave('admin_project_code', 'admin_project_small_input')\" /></td>");
            Output.Write("<td width=\"285px\" ><label for=\"admin_project_base\">Base Project Code:</label> &nbsp;  <select class=\"admin_project_select\" name=\"admin_project_base\" id=\"admin_project_base\">");
            Output.Write("<option value=\"(none)\" selected=\"selected\">(none)</option>");
            foreach (DataRow thisRow in projectsSet.Tables[0].Rows)
            {
                Output.Write("<option value=\"" + thisRow["ProjectCode"] + "\" >" + thisRow["ProjectCode"] + "</option>");
            }
            Output.WriteLine("</select></td></tr>");

            // Add line for name
            Output.WriteLine("          <tr><td><label for=\"admin_project_name\">Project Name:</label></td><td colspan=\"2\"><input class=\"admin_project_large_input\" name=\"admin_project_name\" id=\"admin_project_name\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('admin_project_name', 'admin_project_large_input_focused')\" onblur=\"javascript:textbox_leave('admin_project_name', 'admin_project_large_input')\" /></td></tr>");
            Output.WriteLine("        </table>");
            Output.WriteLine("        <br />");
            Output.WriteLine("        <center><input type=\"image\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button.gif\" value=\"Submit\" alt=\"Submit\" onclick=\"return save_new_project();\"/></center>");
            Output.WriteLine("      </div>");
            Output.WriteLine("    </blockquote>");
            Output.WriteLine("  <span class=\"SobekAdminTitle\">Existing Projects</span>");
            Output.WriteLine("    <blockquote>");
            Output.WriteLine("<table border=\"0px\" cellspacing=\"0px\" class=\"statsTable\">");
            Output.WriteLine("  <tr align=\"left\" bgcolor=\"#0022a7\" >");
            Output.WriteLine("    <th width=\"110px\" align=\"left\"><span style=\"color: White\"> &nbsp; ACTIONS</span></th>");
            Output.WriteLine("    <th width=\"140px\" align=\"left\"><span style=\"color: White\">CODE</span></th>");
            Output.WriteLine("    <th width=\"450px\" align=\"left\"><span style=\"color: White\">NAME</span></th>");
            Output.WriteLine("   </tr>");
            Output.WriteLine("  <tr><td bgcolor=\"#e7e7e7\" colspan=\"3\"></td></tr>");

            currentMode.My_Sobek_SubMode = "XXXXXXX";
            string redirect = currentMode.Redirect_URL();

            // Write the data for each interface
            foreach (DataRow thisRow in projectsSet.Tables[0].Rows)
            {
                // Pull all these values
                string code = thisRow["ProjectCode"].ToString();
                string name = thisRow["ProjectName"].ToString();

                // Build the action links
                Output.WriteLine("  <tr align=\"left\" >");
                Output.Write("    <td class=\"SobekAdminActionLink\" >( ");
                Output.Write("<a title=\"Click to edit this project\" id=\"EDIT_" + code + "\" href=\"" + redirect.Replace("XXXXXXX", "1" + code) + "\" >edit</a> | ");
                Output.Write("<a title=\"Click to change the name of this project\" id=\"RENAME_" + code + "\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return project_form_popup('RENAME_" + code + "', '" + code + "','" + name + "');\">rename</a> )</td>");

                // Add the rest of the row with data
                Output.WriteLine("    <td>" + code + "</span></td>");
                Output.WriteLine("    <td>" + name + "</span></td>");
                Output.WriteLine("   </tr>");
                Output.WriteLine("  <tr><td bgcolor=\"#e7e7e7\" colspan=\"3\"></td></tr>");
            }

            Output.WriteLine("</table>");
            Output.WriteLine("    </blockquote>");
            Output.WriteLine("    <br />");
            Output.WriteLine("</div>");
            Output.WriteLine();
        }
        /// <summary> This is an opportunity to write HTML directly into the main form, without
        /// using the pop-up html form architecture </summary>
        /// <param name="Output"> Textwriter to write the pop-up form HTML for this viewer </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <remarks> This text will appear within the ItemNavForm form tags </remarks>
        public override void Write_ItemNavForm_Closing(TextWriter Output, Custom_Tracer Tracer)
        {
            Output.WriteLine("<!-- IP_Restrictions_AdminViewer.Write_ItemNavForm_Closing -->");

            // Add the stylesheet(s)and javascript  needed
            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_admin.js\" ></script>");
            Output.WriteLine();

            // Add the hidden field
            Output.WriteLine("<!-- Hidden field is used for postbacks to indicate what to save and reset -->");
            if (thisRange != null)
            {
                Output.WriteLine("<input type=\"hidden\" id=\"rangeid\" name=\"rangeid\" value=\"" + thisRange.RangeID + "\" />");
            }
            Output.WriteLine("<input type=\"hidden\" id=\"action\" name=\"action\" value=\"\" />");
            Output.WriteLine();

            Output.WriteLine("<div class=\"sbkAdm_HomeText\">");

            if (!String.IsNullOrEmpty(actionMessage))
            {
                Output.WriteLine("  <br />");
                Output.WriteLine("  <div id=\"sbkAdm_ActionMessage\">" + actionMessage + "</div>");
            }

            if ((details != null) && (thisRange != null) && (details.Tables[0].Rows.Count > 0))
            {
                Tracer.Add_Trace("IP_Restrictions_AdminViewer.Write_ItemNavForm_Closing", "Display details regarding one IP restrictive range");

                // Assign some of the values from the details to the range
                thisRange.Title = details.Tables[0].Rows[0]["Title"].ToString();
                thisRange.Notes = details.Tables[0].Rows[0]["Notes"].ToString();

                // Add the save and cancel button and link to help
                currentMode.My_Sobek_SubMode = String.Empty;
                Output.WriteLine("  <br />");
                Output.WriteLine("  <table style=\"width:750px;\">");
                Output.WriteLine("    <tr>");
                Output.WriteLine("      <td> &nbsp; &nbsp; &nbsp; For clarification of any terms on this form, <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "adminhelp/restrictions\" target=\"ADMIN_USER_HELP\" >click here to view the help page</a>.</td>");
                Output.WriteLine("      <td style=\"text-align:right\">");
                if (user.Is_System_Admin)
                {
                    Output.WriteLine("        <button title=\"Do not apply changes\" class=\"sbkAdm_RoundButton\" onclick=\"parent.location='" + currentMode.Redirect_URL() + "';return false;\"><img src=\"" + currentMode.Base_URL + "default/images/button_previous_arrow.png\" class=\"sbkAdm_RoundButton_LeftImg\" alt=\"\" /> CANCEL</button> &nbsp; &nbsp; ");
                    Output.WriteLine("        <button title=\"Save changes to this IP restriction range\" class=\"sbkAdm_RoundButton\" type=\"submit\">SAVE <img src=\"" + currentMode.Base_URL + "default/images/button_next_arrow.png\" class=\"sbkAdm_RoundButton_RightImg\" alt=\"\" /></button>");
                }
                else
                {
                    Output.WriteLine("        <button title=\"Do not apply changes\" class=\"sbkAdm_RoundButton\" onclick=\"parent.location='" + currentMode.Redirect_URL() + "';return false;\"><img src=\"" + currentMode.Base_URL + "default/images/button_previous_arrow.png\" class=\"sbkAdm_RoundButton_LeftImg\" alt=\"\" /> BACK</button> &nbsp; &nbsp; ");
                }
                Output.WriteLine("      </td>");
                Output.WriteLine("    </tr>");
                Output.WriteLine("  </table>");
                Output.WriteLine();

                // Add portal admin message
                string readonly_tag = String.Empty;
                int    columns      = 4;
                if (!user.Is_System_Admin)
                {
                    Output.WriteLine("<p>Portal Admins have rights to see these settings. System Admins can change these settings.</p>");
                    readonly_tag = " readonly=\"readonly\"";
                    columns      = 3;
                }

                // Add all the basic information
                Output.WriteLine("  <h2>Basic Information</h2>");
                Output.WriteLine("  <div class=\"sbkIpav_NewDiv\">");
                Output.WriteLine("    <table class=\"sbkAdm_PopupTable\">");

                // Add line for range title
                Output.WriteLine("      <tr>");
                Output.WriteLine("        <td style=\"width:120px;\"><label for=\"admin_title\">Title:</label></td>");
                Output.WriteLine("        <td><input class=\"sbkIpav_large_input sbkAdmin_Focusable\" name=\"admin_title\" id=\"admin_title\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisRange.Title) + "\" " + readonly_tag + " /></td>");
                Output.WriteLine("      </tr>");

                // Add the notes text area box
                Output.WriteLine("      <tr style=\"vertical-align:top\"><td><label for=\"admin_notes\">Notes:</label></td><td colspan=\"2\"><textarea rows=\"5\" name=\"admin_notes\" id=\"admin_notes\" class=\"sbkIpav_input sbkAdmin_Focusable\"" + readonly_tag + ">" + HttpUtility.HtmlEncode(thisRange.Notes) + "</textarea></td></tr>");

                // Add the message text area box
                Output.WriteLine("      <tr style=\"vertical-align:top\"><td><label for=\"admin_message\">Message:</label></td><td colspan=\"2\"><textarea rows=\"10\" name=\"admin_message\" id=\"admin_message\" class=\"sbkIpav_input sbkAdmin_Focusable\"" + readonly_tag + " >" + HttpUtility.HtmlEncode(thisRange.Item_Restricted_Statement) + "</textarea></td></tr>");

                Output.WriteLine("    </table>");
                Output.WriteLine("  </div>");
                Output.WriteLine();

                Output.WriteLine("  <h2>IP Addresses</h2>");

                Output.WriteLine("  <table class=\"sbkIpav_Table sbkAdm_Table\">");
                Output.WriteLine("    <tr>");
                if (user.Is_System_Admin)
                {
                    Output.WriteLine("      <th class=\"sbkIpav_TableHeader1\">ACTIONS</th>");
                }
                Output.WriteLine("      <th class=\"sbkIpav_TableHeader2\">START IP</th>");
                Output.WriteLine("      <th class=\"sbkIpav_TableHeader3\">END IP</th>");
                Output.WriteLine("      <th class=\"sbkIpav_TableHeader4\">LABEL</th>");
                Output.WriteLine("    </tr>");

                foreach (DataRow thisRow in details.Tables[1].Rows)
                {
                    // Get the primary key for this IP address
                    string ip_primary = thisRow["IP_SingleID"].ToString();

                    // Build the action links
                    Output.WriteLine("    <tr>");

                    if (user.Is_System_Admin)
                    {
                        Output.WriteLine("      <td class=\"sbkAdm_ActionLink\" >( <a title=\"Click to clear this ip address\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return clear_ip_address('" + ip_primary + "');\">clear</a> )</td>");
                    }

                    // Add the rest of the row with data
                    Output.WriteLine("      <td><input class=\"sbkIpav_small_input sbkAdmin_Focusable\" name=\"admin_ipstart_" + ip_primary + "\" id=\"admin_ipstart_" + ip_primary + "\" type=\"text\" value=\"" + thisRow["StartIP"].ToString().Trim() + "\" /></td>");
                    Output.WriteLine("      <td><input class=\"sbkIpav_small_input sbkAdmin_Focusable\" name=\"admin_ipend_" + ip_primary + "\" id=\"admin_ipend_" + ip_primary + "\" type=\"text\" value=\"" + thisRow["EndIP"].ToString().Trim() + "\" /></td>");
                    Output.WriteLine("      <td><input class=\"sbkIpav_medium_input sbkAdmin_Focusable\" name=\"admin_iplabel_" + ip_primary + "\" id=\"admin_iplabel_" + ip_primary + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisRow["Notes"].ToString().Trim()) + "\" /></td>");
                    Output.WriteLine("     </tr>");
                    Output.WriteLine("    <tr><td class=\"sbkAdm_TableRule\" colspan=\"" + columns + "\"></td></tr>");
                }


                // Now, always add ten empty IP rows here, for system administrators
                if (user.Is_System_Admin)
                {
                    for (int i = 1; i < 10; i++)
                    {
                        Output.WriteLine("    <tr>");
                        Output.WriteLine("      <td class=\"sbkAdm_ActionLink\" >( <a title=\"Click to clear this ip address\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return clear_ip_address('new" + i + "');\">clear</a> )</td>");

                        // Add the rest of the row with data
                        Output.WriteLine("      <td><input class=\"sbkIpav_small_input sbkAdmin_Focusable\" name=\"admin_ipstart_new" + i + "\" id=\"admin_ipstart_new" + i + "\" type=\"text\" value=\"\" /></td>");
                        Output.WriteLine("      <td><input class=\"sbkIpav_small_input sbkAdmin_Focusable\" name=\"admin_ipend_new" + i + "\" id=\"admin_ipend_new" + i + "\" type=\"text\" value=\"\" /></td>");
                        Output.WriteLine("      <td><input class=\"sbkIpav_medium_input sbkAdmin_Focusable\" name=\"admin_iplabel_new" + i + "\" id=\"admin_iplabel_new" + i + "\" type=\"text\" value=\"\" /></td>");
                        Output.WriteLine("    </tr>");
                        Output.WriteLine("    <tr><td class=\"sbkAdm_TableRule\" colspan=\"4\"></td></tr>");
                    }
                }

                Output.WriteLine("  </table>");
                Output.WriteLine("</div>");

                return;
            }

            Tracer.Add_Trace("IP_Restrictions_AdminViewer.Write_ItemNavForm_Closing", "Display main IP restrictive range admin form");


            Output.WriteLine("  <p>Restrictive ranges of IP addresses may be used to restrict access to digital resources.  This form allows system administrators to edit the individual IP addresses and contiguous IP addresses associated with an existing restrictive range.</p>");
            Output.WriteLine("  <p>For more information about IP restriction ranges and this form, <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "adminhelp/restrictions\" target=\"ADMIN_USER_HELP\" >click here to view the help page</a>.</p>");
            Output.WriteLine();

            if (user.Is_System_Admin)
            {
                // Add all the basic information
                Output.WriteLine("  <h2>New IP Restrictive Range</h2>");
                Output.WriteLine("  <div class=\"sbkIpav_NewDiv\">");
                Output.WriteLine("    <table class=\"sbkAdm_PopupTable\">");

                // Add line for range title
                Output.WriteLine("      <tr>");
                Output.WriteLine("        <td style=\"width:120px;\"><label for=\"admin_title\">Title:</label></td>");
                Output.WriteLine("        <td><input class=\"sbkIpav_large_input sbkAdmin_Focusable\" name=\"new_admin_title\" id=\"new_admin_title\" type=\"text\" value=\"\" /></td>");
                Output.WriteLine("      </tr>");

                // Add the notes text area box
                Output.WriteLine("      <tr style=\"vertical-align:top\"><td><label for=\"admin_notes\">Notes:</label></td><td colspan=\"2\"><textarea rows=\"5\" name=\"new_admin_notes\" id=\"new_admin_notes\" class=\"sbkIpav_input sbkAdmin_Focusable\" ></textarea></td></tr>");

                // Add the message text area box
                Output.WriteLine("      <tr style=\"vertical-align:top\"><td><label for=\"admin_message\">Message:</label></td><td colspan=\"2\"><textarea rows=\"10\" name=\"new_admin_message\" id=\"new_admin_message\" class=\"sbkIpav_input sbkAdmin_Focusable\" ></textarea></td></tr>");
                // Add the SAVE button
                Output.WriteLine("      <tr style=\"height:30px; text-align: center;\"><td></td><td><button title=\"Save new IP restrictive range\" class=\"sbkAdm_RoundButton\" onclick=\"return save_new_ip_range();\">SAVE <img src=\"" + currentMode.Base_URL + "default/images/button_next_arrow.png\" class=\"sbkAdm_RoundButton_RightImg\" alt=\"\" /></button></td></tr>");
                Output.WriteLine("    </table>");
                Output.WriteLine("  </div>");
                Output.WriteLine();
            }
            else
            {
                // Add portal admin message
                Output.WriteLine("<p>Portal Admins have rights to see these settings. System Admins can change these settings.</p>");
            }

            Output.WriteLine("  <h2>Existing Ranges</h2>");
            if (ipRestrictionInfo.Count == 0)
            {
                Output.WriteLine("  <p>No existing IP restrictive ranges exist.</p>");
                if (user.Is_System_Admin)
                {
                    Output.WriteLine("<p>To add one, enter the information above and press SAVE.</p>");
                }
            }
            else
            {
                Output.WriteLine("  <p>Select an IP restrictive range below to view or edit:</p>");
                Output.WriteLine("  <ul id=\"sbkIpav_RangeList\">");

                for (int i = 0; i < ipRestrictionInfo.Count; i++)
                {
                    currentMode.My_Sobek_SubMode = ipRestrictionInfo[i].RangeID.ToString();
                    Output.WriteLine("<li><a href=\"" + currentMode.Redirect_URL() + "\">" + ipRestrictionInfo[i].Title + "</a></li>");
                }

                Output.WriteLine("  </ul>");
            }

            Output.WriteLine("</div>");
        }
Esempio n. 20
0
        /// <summary> This is an opportunity to write HTML directly into the main form, without
        /// using the pop-up html form architecture </summary>
        /// <param name="Output"> Textwriter to write the pop-up form HTML for this viewer </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <remarks> This text will appear within the ItemNavForm form tags </remarks>
        public override void Add_HTML_In_Main_Form(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Skins_AdminViewer.Add_HTML_In_Main_Form", "Add any popup divisions for form elements");

            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/jquery/jquery-1.6.2.min.js\"></script>");
            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/jquery/jquery-ui-1.8.16.custom.min.js\"></script>");
            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_form.js\" ></script>");

            // Add the hidden field
            Output.WriteLine("<!-- Hidden field is used for postbacks to indicate what to save and reset -->");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_interface_tosave\" name=\"admin_interface_tosave\" value=\"\" />");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_interface_reset\" name=\"admin_interface_reset\" value=\"\" />");
            Output.WriteLine();

            Output.WriteLine("<!-- HTML Skins Edit Form -->");
            Output.WriteLine("<div class=\"admin_interface_popup_div\" id=\"form_interface\" style=\"display:none;\">");
            Output.WriteLine("  <div class=\"popup_title\"><table width=\"100%\"><tr><td align=\"left\">EDIT WEB SKIN</td><td align=\"right\"> <a href=\"#template\" alt=\"CLOSE\" onclick=\"interface_form_close()\">X</a> &nbsp; </td></tr></table></div>");
            Output.WriteLine("  <br />");
            Output.WriteLine("  <table class=\"popup_table\">");

            // Add line for interface code and base interface code
            Output.Write("    <tr align=\"left\"><td width=\"112px\"><label for=\"form_interface_code\">Web Skin Code:</label></td>");
            Output.Write("<td width=\"220px\"><span class=\"form_linkline admin_existing_code_line\" id=\"form_interface_code\"></span></td>");

            Output.WriteLine("<td><label for=\"form_interface_basecode\">Base Skin Code:</label> &nbsp; <input class=\"admin_interface_small_input\" name=\"form_interface_basecode\" id=\"form_interface_basecode\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('form_interface_basecode', 'admin_interface_small_input_focused')\" onblur=\"javascript:textbox_leave('form_interface_basecode', 'admin_interface_small_input')\" /></td></tr>");

            // Add line for banner link
            Output.WriteLine("    <tr align=\"left\"><td><label for=\"form_interface_link\">Banner Link:</label></td><td colspan=\"2\"><input class=\"admin_interface_large_input\" name=\"form_interface_link\" id=\"form_interface_link\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('form_interface_link', 'admin_interface_large_input_focused')\" onblur=\"javascript:textbox_leave('form_interface_link', 'admin_interface_large_input')\" /></td></tr>");

            // Add line for notes
            Output.WriteLine("    <tr align=\"left\"><td><label for=\"form_interface_notes\">Notes:</label></td><td colspan=\"2\"><input class=\"admin_interface_large_input\" name=\"form_interface_notes\" id=\"form_interface_notes\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('form_interface_notes', 'admin_interface_large_input_focused')\" onblur=\"javascript:textbox_leave('form_interface_notes', 'admin_interface_large_input')\" /></td></tr>");

            // Add checkboxes for overriding the header/footer and overriding banner
            Output.WriteLine("          <tr><td>Flags:</td><td><input class=\"admin_interface_checkbox\" type=\"checkbox\" name=\"form_interface_header_override\" id=\"form_interface_header_override\" checked=\"checked\" /> <label for=\"form_interface_header_override\">Override header and footer?</label></td><td><input class=\"admin_interface_checkbox\" type=\"checkbox\" name=\"form_interface_banner_override\" id=\"form_interface_banner_override\" /> <label for=\"form_interface_banner_override\">Override banner?</label></td></tr>");
            Output.WriteLine("          <tr><td>&nbsp;</td><td><input class=\"admin_interface_checkbox\" type=\"checkbox\" name=\"form_interface_top_nav\" id=\"form_interface_top_nav\" /> <label for=\"form_interface_top_nav\">Suppress top-level navigation?</label></td><td><input class=\"admin_interface_checkbox\" type=\"checkbox\" name=\"form_interface_buildlaunch\" id=\"form_interface_buildlaunch\" /> <label for=\"form_interface_buildlaunch\">Build on launch?</label></td></tr>");
            Output.WriteLine("  </table>");
            Output.WriteLine("  <br />");
            Output.WriteLine("  <center><a href=\"\" onclick=\"return interface_form_close();\"><img border=\"0\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/cancel_button_g.gif\" alt=\"CLOSE\" /></a> &nbsp; &nbsp; <input type=\"image\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button_g.gif\" value=\"Submit\" alt=\"Submit\"></center>");
            Output.WriteLine("</div>");


            Tracer.Add_Trace("Skins_AdminViewer.Add_HTML_In_Main_Form", "");

            Output.WriteLine("<!-- Skins_AdminViewer.Add_HTML_In_Main_Form -->");
            Output.WriteLine("<script src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_admin.js\" type=\"text/javascript\"></script>");
            Output.WriteLine("<div class=\"SobekHomeText\">");

            if (actionMessage.Length > 0)
            {
                Output.WriteLine("  <br />");
                Output.WriteLine("  <center><b>" + actionMessage + "</b></center>");
            }

            Output.WriteLine("  <blockquote>For clarification of any terms on this form, <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "admin/webskins\" target=\"ADMIN_INTERFACE_HELP\" >click here to view the help page</a>.</blockquote>");

            Output.WriteLine("  <span class=\"SobekAdminTitle\">New Web Skin</span>");
            Output.WriteLine("    <blockquote>");
            Output.WriteLine("      <div class=\"admin_interface_new_div\">");
            Output.WriteLine("        <table class=\"popup_table\">");

            // Add line for interface code and base interface code
            Output.Write("          <tr><td width=\"112px\"><label for=\"admin_interface_code\">Web Skin Code:</label></td>");
            Output.Write("<td width=\"220px\"><input class=\"admin_interface_small_input\" name=\"admin_interface_code\" id=\"admin_interface_code\" type=\"text\" value=\"\"  onfocus=\"javascript:textbox_enter('admin_interface_code', 'admin_interface_small_input_focused')\" onblur=\"javascript:textbox_leave('admin_interface_code', 'admin_interface_small_input')\" /></td>");
            Output.WriteLine("<td><label for=\"admin_interface_basecode\">Base Skin Code:</label> &nbsp; <input class=\"admin_interface_small_input\" name=\"admin_interface_basecode\" id=\"admin_interface_basecode\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('admin_interface_basecode', 'admin_interface_small_input_focused')\" onblur=\"javascript:textbox_leave('admin_interface_basecode', 'admin_interface_small_input')\" /></td></tr>");

            // Add line for banner link
            Output.WriteLine("          <tr><td><label for=\"admin_interface_link\">Banner Link:</label></td><td colspan=\"2\"><input class=\"admin_interface_large_input\" name=\"admin_interface_link\" id=\"admin_interface_link\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('admin_interface_link', 'admin_interface_large_input_focused')\" onblur=\"javascript:textbox_leave('admin_interface_link', 'admin_interface_large_input')\" /></td></tr>");

            // Add line for notes
            Output.WriteLine("          <tr><td><label for=\"admin_interface_notes\">Notes:</label></td><td colspan=\"2\"><input class=\"admin_interface_large_input\" name=\"admin_interface_notes\" id=\"admin_interface_notes\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('admin_interface_notes', 'admin_interface_large_input_focused')\" onblur=\"javascript:textbox_leave('admin_interface_notes', 'admin_interface_large_input')\" /></td></tr>");

            // Add checkboxes for overriding the header/footer and overriding banner
            Output.WriteLine("          <tr><td>Flags:</td><td><input class=\"admin_interface_checkbox\" type=\"checkbox\" name=\"admin_interface_header_override\" id=\"admin_interface_header_override\" checked=\"checked\" /> <label for=\"admin_interface_header_override\">Override header and footer?</label></td><td><input class=\"admin_interface_checkbox\" type=\"checkbox\" name=\"admin_interface_banner_override\" id=\"admin_interface_banner_override\" /> <label for=\"admin_interface_banner_override\">Override banner?</label></td></tr>");
            Output.WriteLine("          <tr><td>&nbsp;</td><td><input class=\"admin_interface_checkbox\" type=\"checkbox\" name=\"admin_interface_top_nav\" id=\"admin_interface_top_nav\" /> <label for=\"admin_interface_top_nav\">Suppress top-level navigation?</label></td><td><input class=\"admin_interface_checkbox\" type=\"checkbox\" name=\"admin_interface_buildlaunch\" id=\"admin_interface_buildlaunch\" /> <label for=\"admin_interface_buildlaunch\">Build on launch?</label></td></tr>");
            Output.WriteLine("          <tr><td>&nbsp;</td><td colspan=\"2\"><input class=\"admin_interface_checkbox\" type=\"checkbox\" name=\"admin_interface_copycurrent\" id=\"admin_interface_copycurrent\" /> <label for=\"admin_interface_copycurrent\">Copy current files for this new web skin if folder does not exist?</label></td></tr>");
            Output.WriteLine("        </table>");
            Output.WriteLine("        <br />");
            Output.WriteLine("        <center><input type=\"image\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button.gif\" value=\"Submit\" alt=\"Submit\" onclick=\"return save_new_interface();\"/></center>");


            Output.WriteLine("      </div>");
            Output.WriteLine("    </blockquote>");
            Output.WriteLine("    <br />");
            Output.WriteLine("  <span class=\"SobekAdminTitle\">Existing Web Skins</span>");

            // Get the list of all aggregations
            Output.WriteLine("    <blockquote>");
            Output.WriteLine("<table border=\"0px\" cellspacing=\"0px\" class=\"statsTable\">");
            Output.WriteLine("  <tr align=\"left\" bgcolor=\"#0022a7\" >");
            Output.WriteLine("    <th width=\"180px\" align=\"left\"><span style=\"color: White\"> &nbsp; ACTIONS</span></th>");
            Output.WriteLine("    <th width=\"90px\" align=\"left\"><span style=\"color: White\">CODE</span></th>");
            Output.WriteLine("    <th width=\"90px\" align=\"left\"><span style=\"color: White\">BASE</span></th>");
            Output.WriteLine("    <th width=\"300px\" align=\"left\"><span style=\"color: White\">NOTES</span></th>");
            Output.WriteLine("   </tr>");
            Output.WriteLine("  <tr><td bgcolor=\"#e7e7e7\" colspan=\"4\"></td></tr>");

            // Get the view URL
            string current_skin = currentMode.Skin;

            currentMode.Skin = "TESTSKINCODE";
            string view_url = currentMode.Redirect_URL();

            currentMode.Skin = current_skin;

            // Write the data for each interface
            foreach (DataRow thisRow in skinCollection.Skin_Table.Rows)
            {
                // Pull all these values
                string code           = thisRow["WebSkinCode"].ToString();
                string base_code      = thisRow["BaseInterface"].ToString();
                string notes          = thisRow["Notes"].ToString();
                bool   overrideHeader = Convert.ToBoolean(thisRow["OverrideHeaderFooter"]);
                bool   overrideBanner = Convert.ToBoolean(thisRow["OverrideBanner"]);
                bool   buildOnLaunch  = Convert.ToBoolean(thisRow["Build_On_Launch"]);
                bool   suppressTopNav = Convert.ToBoolean(thisRow["SuppressTopNavigation"]);
                string bannerLink     = thisRow["BannerLink"].ToString();

                // Build the action links
                Output.WriteLine("  <tr align=\"left\" >");
                Output.Write("    <td class=\"SobekAdminActionLink\" >( ");
                Output.Write("<a title=\"Click to edit\" id=\"EDIT_" + code + "\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return interface_form_popup('EDIT_" + code + "', '" + code + "','" + base_code + "','" + bannerLink + "','" + notes + "','" + overrideBanner + "','" + overrideHeader + "','" + suppressTopNav + "','" + buildOnLaunch + "');\">edit</a> | ");
                Output.Write("<a title=\"Click to view\" href=\"" + view_url.Replace("testskincode", code) + "\" >view</a> | ");
                Output.WriteLine("<a title=\"Click to reset\" href=\"javascript:reset_interface('" + code + "');\">reset</a> )</td>");

                // Add the rest of the row with data
                Output.WriteLine("    <td>" + code + "</span></td>");
                Output.WriteLine("    <td>" + base_code + "</span></td>");
                Output.WriteLine("    <td>" + notes + "</span></td>");
                Output.WriteLine("   </tr>");
                Output.WriteLine("  <tr><td bgcolor=\"#e7e7e7\" colspan=\"4\"></td></tr>");
            }

            Output.WriteLine("</table>");
            Output.WriteLine("    </blockquote>");
            Output.WriteLine("    <br />");
            Output.WriteLine("</div>");
            Output.WriteLine();
        }
        /// <summary> This is an opportunity to write HTML directly into the main form, without
        /// using the pop-up html form architecture </summary>
        /// <param name="Output"> Textwriter to write the pop-up form HTML for this viewer </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <remarks> This text will appear within the ItemNavForm form tags </remarks>
        public override void Add_HTML_In_Main_Form(TextWriter Output, Custom_Tracer Tracer)
        {
            if ((details != null) && (details.Tables[0].Rows.Count > 0))
            {
                Tracer.Add_Trace("IP_Restrictions_AdminViewer.Add_HTML_In_Main_Form", "Display details regarding one IP restrictive range");

                // Assign some of the values from the details to the range
                thisRange.Title = details.Tables[0].Rows[0]["Title"].ToString();
                thisRange.Notes = details.Tables[0].Rows[0]["Notes"].ToString();

                // Add the stylesheet(s)and javascript  needed
                Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_form.js\" ></script>");
                Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_admin.js\" ></script>");

                // Add the hidden field
                Output.WriteLine("<!-- Hidden field is used for postbacks to indicate what to save and reset -->");
                Output.WriteLine("<input type=\"hidden\" id=\"rangeid\" name=\"rangeid\" value=\"" + thisRange.RangeID + "\" />");
                Output.WriteLine("<input type=\"hidden\" id=\"action\" name=\"action\" value=\"\" />");
                Output.WriteLine();

                // Start the HTML rendering
                Output.WriteLine("<div class=\"SobekHomeText\">");

                // Add the save and cancel button and link to help
                currentMode.My_Sobek_SubMode = String.Empty;
                Output.WriteLine("  <br />");
                Output.WriteLine("  <table width=\"750px\"><tr><td align=\"left\"> &nbsp; &nbsp; &nbsp; For clarification of any terms on this form, <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "admin/restrictions\" target=\"ADMIN_USER_HELP\" >click here to view the help page</a>.</td><td align=\"right\"><a href=\"" + currentMode.Redirect_URL() + "\"><img border=\"0\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/cancel_button_22.gif\" alt=\"CLOSE\" /></a> &nbsp; <input type=\"image\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button.gif\" value=\"Submit\" alt=\"Submit\"></td></tr></table>");

                // Add all the basic information
                Output.WriteLine("  <span class=\"SobekAdminTitle\">Basic Information</span>");
                Output.WriteLine("  <blockquote>");
                Output.WriteLine("    <div class=\"admin_aggr_new_div\">");
                Output.WriteLine("      <table class=\"popup_table\">");

                // Add line for range title
                Output.WriteLine("        <tr>");
                Output.WriteLine("          <td width=\"120px\"><label for=\"admin_title\">Title:</label></td>");
                Output.WriteLine("          <td><input class=\"admin_ip_large_input\" name=\"admin_title\" id=\"admin_title\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisRange.Title) + "\"  onfocus=\"javascript:textbox_enter('admin_title', 'admin_ip_large_input_focused')\" onblur=\"javascript:textbox_leave('admin_title', 'admin_ip_large_input')\" /></td>");
                Output.WriteLine("        </tr>");

                // Compute the size of the text boxes
                int actual_cols = 75;
                if (currentMode.Browser_Type.ToUpper().IndexOf("FIREFOX") >= 0)
                {
                    actual_cols = 70;
                }

                // Add the notes text area box
                Output.WriteLine("        <tr valign=\"top\"><td valign=\"top\"><label for=\"admin_notes\">Notes:</label></td><td colspan=\"2\"><textarea rows=\"5\" cols=\"" + actual_cols + "\" name=\"admin_notes\" id=\"admin_notes\" class=\"admin_ip_input\" onfocus=\"javascript:textbox_enter('admin_notes','admin_ip_focused')\" onblur=\"javascript:textbox_leave('admin_notes','admin_ip_input')\">" + HttpUtility.HtmlEncode(thisRange.Notes) + "</textarea></td></tr>");

                // Add the message text area box
                Output.WriteLine("        <tr valign=\"top\"><td valign=\"top\"><label for=\"admin_message\">Message:</label></td><td colspan=\"2\"><textarea rows=\"10\" cols=\"" + actual_cols + "\" name=\"admin_message\" id=\"admin_message\" class=\"admin_ip_input\" onfocus=\"javascript:textbox_enter('admin_message','admin_ip_focused')\" onblur=\"javascript:textbox_leave('admin_message','admin_ip_input')\">" + HttpUtility.HtmlEncode(thisRange.Item_Restricted_Statement) + "</textarea></td></tr>");

                Output.WriteLine("      </table>");
                Output.WriteLine("    </div>");
                Output.WriteLine("  </blockquote>");
                Output.WriteLine("  <br />");



                Output.WriteLine("  <span class=\"SobekAdminTitle\">IP Addresses</span>");
                Output.WriteLine("  <br /><br />");
                Output.WriteLine("    <blockquote>");

                Output.WriteLine("<table border=\"0px\" cellspacing=\"0px\" class=\"statsTable\">");
                Output.WriteLine("  <tr align=\"left\" bgcolor=\"#0022a7\" >");
                Output.WriteLine("    <th width=\"90px\" align=\"left\"><span style=\"color: White\"> &nbsp; ACTIONS</span></th>");
                Output.WriteLine("    <th width=\"135px\" align=\"left\"><span style=\"color: White\">START IP</span></th>");
                Output.WriteLine("    <th width=\"135px\" align=\"left\"><span style=\"color: White\">END IP</span></th>");
                Output.WriteLine("    <th width=\"250px\" align=\"left\"><span style=\"color: White\">LABEL</span></th>");
                Output.WriteLine("  </tr>");

                foreach (DataRow thisRow in details.Tables[1].Rows)
                {
                    // Get the primary key for this IP address
                    string ip_primary = thisRow["IP_SingleID"].ToString();

                    // Build the action links
                    Output.WriteLine("  <tr align=\"left\" >");
                    Output.Write("    <td class=\"SobekAdminActionLink\" >( ");
                    Output.WriteLine("<a title=\"Click to clear this ip address\" id=\"CLEAR_" + ip_primary + "\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return clear_ip_address('" + ip_primary + "');\">clear</a> )</td>");

                    // Add the rest of the row with data
                    Output.WriteLine("    <td><input class=\"admin_ip_small_input\" name=\"admin_ipstart_" + ip_primary + "\" id=\"admin_ipstart_" + ip_primary + "\" type=\"text\" value=\"" + thisRow["StartIP"].ToString().Trim() + "\"  onfocus=\"javascript:textbox_enter('admin_ipstart_" + ip_primary + "', 'admin_ip_small_input_focused')\" onblur=\"javascript:textbox_leave('admin_ipstart_" + ip_primary + "', 'admin_ip_small_input')\" /></td>");
                    Output.WriteLine("    <td><input class=\"admin_ip_small_input\" name=\"admin_ipend_" + ip_primary + "\" id=\"admin_ipend_" + ip_primary + "\" type=\"text\" value=\"" + thisRow["EndIP"].ToString().Trim() + "\"  onfocus=\"javascript:textbox_enter('admin_ipend_" + ip_primary + "', 'admin_ip_small_input_focused')\" onblur=\"javascript:textbox_leave('admin_ipend_" + ip_primary + "', 'admin_ip_small_input')\" /></td>");
                    Output.WriteLine("    <td><input class=\"admin_ip_medium_input\" name=\"admin_iplabel_" + ip_primary + "\" id=\"admin_iplabel_" + ip_primary + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisRow["Notes"].ToString().Trim()) + "\"  onfocus=\"javascript:textbox_enter('admin_iplabel_" + ip_primary + "', 'admin_ip_medium_input_focused')\" onblur=\"javascript:textbox_leave('admin_iplabel_" + ip_primary + "', 'admin_ip_medium_input')\" /></td>");
                    Output.WriteLine("   </tr>");
                    Output.WriteLine("  <tr><td bgcolor=\"#e7e7e7\" colspan=\"4\"></td></tr>");
                }

                // Now, always add ten empty IP rows here
                for (int i = 1; i < 10; i++)
                {
                    Output.WriteLine("  <tr align=\"left\" >");
                    Output.Write("    <td class=\"SobekAdminActionLink\" >( ");
                    Output.WriteLine("<a title=\"Click to clear this ip address\" id=\"CLEAR_new" + i + "\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return clear_ip_address('new" + i + "');\">clear</a> )</td>");

                    // Add the rest of the row with data
                    Output.WriteLine("    <td><input class=\"admin_ip_small_input\" name=\"admin_ipstart_new" + i + "\" id=\"admin_ipstart_new" + i + "\" type=\"text\" value=\"\"  onfocus=\"javascript:textbox_enter('admin_ipstart_new" + i + "', 'admin_ip_small_input_focused')\" onblur=\"javascript:textbox_leave('admin_ipstart_new" + i + "', 'admin_ip_small_input')\" /></td>");
                    Output.WriteLine("    <td><input class=\"admin_ip_small_input\" name=\"admin_ipend_new" + i + "\" id=\"admin_ipend_new" + i + "\" type=\"text\" value=\"\"  onfocus=\"javascript:textbox_enter('admin_ipend_new" + i + "', 'admin_ip_small_input_focused')\" onblur=\"javascript:textbox_leave('admin_ipend_new" + i + "', 'admin_ip_small_input')\" /></td>");
                    Output.WriteLine("    <td><input class=\"admin_ip_medium_input\" name=\"admin_iplabel_new" + i + "\" id=\"admin_iplabel_new" + i + "\" type=\"text\" value=\"\"  onfocus=\"javascript:textbox_enter('admin_iplabel_new" + i + "', 'admin_ip_medium_input_focused')\" onblur=\"javascript:textbox_leave('admin_iplabel_new" + i + "', 'admin_ip_medium_input')\" /></td>");
                    Output.WriteLine("   </tr>");
                    Output.WriteLine("  <tr><td bgcolor=\"#e7e7e7\" colspan=\"4\"></td></tr>");
                }

                Output.WriteLine("</table>");
                Output.WriteLine("    </blockquote>");

                Output.WriteLine("</div>");

                return;
            }

            Tracer.Add_Trace("IP_Restrictions_AdminViewer.Add_HTML_In_Main_Form", "Display main IP restrictive range admin form");
            Output.WriteLine("<div class=\"SobekHomeText\">");
            Output.WriteLine("  <blockquote>");
            Output.WriteLine("    Restrictive ranges of IP addresses may be used to restrict access to digital resources.  This form allows system administrators to edit the individual IP addresses and contiguous IP addresses associated with an existing restrictive range.<br /><br />");
            Output.WriteLine("    For more information about IP restriction ranges and this form, <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "admin/restrictions\" target=\"ADMIN_USER_HELP\" >click here to view the help page</a>.");
            Output.WriteLine("  </blockquote>");
            Output.WriteLine("  <span class=\"SobekAdminTitle\">Existing Ranges</span>");
            Output.WriteLine("  <blockquote>");
            Output.WriteLine("    Select an IP restrictive range below to view or edit:<br />");
            Output.WriteLine("    <blockquote>");

            for (int i = 0; i < ipRestrictionInfo.Count; i++)
            {
                currentMode.My_Sobek_SubMode = ipRestrictionInfo[i].RangeID.ToString();
                Output.WriteLine("<a href=\"" + currentMode.Redirect_URL() + "\">" + ipRestrictionInfo[i].Title + "</a><br /><br />");
            }

            Output.WriteLine("    </blockquote>");
            Output.WriteLine("  </blockquote>");
            Output.WriteLine("  <br />");
            Output.WriteLine("</div>");
        }
        /// <summary> Add the HTML to be displayed in the main SobekCM viewer area </summary>
        /// <param name="Output"> Textwriter to write the HTML for this viewer</param>
        /// <param name="Tracer">Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <remarks> This class does nothing, since the individual metadata elements are added as controls, not HTML </remarks>
        public override void Write_ItemNavForm_Closing(TextWriter Output, Custom_Tracer Tracer)
        {
            const string BEHAVIORS = "BEHAVIORS";

            Tracer.Add_Trace("Edit_Group_Behaviors_MySobekViewer.Write_ItemNavForm_Closing", "");

            Output.WriteLine("<!-- Hidden field is used for postbacks to add new form elements (i.e., new name, new other titles, etc..) -->");
            Output.WriteLine("<input type=\"hidden\" id=\"behaviors_request\" name=\"behaviors_request\" value=\"\" />");

            Output.WriteLine("<div id=\"sbkIsw_Titlebar\">");

            string grouptitle = item.Behaviors.GroupTitle;

            if (grouptitle.Length > 125)
            {
                Output.WriteLine("\t<h1 itemprop=\"name\"><abbr title=\"" + grouptitle + "\">" + grouptitle.Substring(0, 120) + "...</abbr></h1>");
            }
            else
            {
                Output.WriteLine("\t<h1 itemprop=\"name\">" + grouptitle + "</h1>");
            }

            Output.WriteLine("</div>");
            Output.WriteLine("<div class=\"sbkMenu_Bar\" id=\"sbkIsw_MenuBar\" style=\"height:20px\">&nbsp;</div>");

            Output.WriteLine("<div id=\"container-inner1000\">");
            Output.WriteLine("<div id=\"pagecontainer\">");

            Output.WriteLine("<!-- Edit_Group_Behaviors_MySobekViewer.Write_ItemNavForm_Closing -->");
            Output.WriteLine("<div class=\"sbkMySobek_HomeText\">");
            Output.WriteLine("  <br />");

            Output.WriteLine("  <h2>Edit the behaviors associated with this item group within this library</h2>");
            Output.WriteLine("    <ul>");
            Output.WriteLine("      <li>Enter the data for this item group below and press the SAVE button when all your edits are complete.</li>");
            Output.WriteLine("      <li>Clicking on the green plus button ( <img class=\"repeat_button\" src=\"" + currentMode.Base_URL + "default/images/new_element_demo.jpg\" /> ) will add another instance of the element, if the element is repeatable.</li>");
            Output.WriteLine("      <li>Click <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "help/groupbehaviors\" target=\"_EDIT_INSTRUCTIONS\">here for detailed instructions</a> on editing behaviors online.</li>");


            Output.WriteLine("     </ul>");
            Output.WriteLine("</div>");
            Output.WriteLine();

            Output.WriteLine("<a name=\"template\"> </a>");
            Output.WriteLine("<div id=\"tabContainer\" class=\"fulltabs\">");
            Output.WriteLine("  <div class=\"tabs\">");
            Output.WriteLine("    <ul>");
            Output.WriteLine("      <li id=\"tabHeader_1\" class=\"tabActiveHeader\">" + BEHAVIORS + "</li>");
            Output.WriteLine("    </ul>");
            Output.WriteLine("  </div>");
            Output.WriteLine("  <div class=\"graytabscontent\">");
            Output.WriteLine("    <div class=\"tabpage\" id=\"tabpage_1\">");

            Output.WriteLine("      <!-- Add SAVE and CANCEL buttons to top of form -->");
            Output.WriteLine("      <script src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_metadata.js\" type=\"text/javascript\"></script>");
            Output.WriteLine();

            Output.WriteLine("      <div class=\"sbkMySobek_RightButtons\">");
            Output.WriteLine("        <button onclick=\"behaviors_cancel_form(); return false;\" class=\"sbkMySobek_BigButton\"><img src=\"" + currentMode.Base_URL + "default/images/button_previous_arrow.png\" class=\"sbkMySobek_RoundButton_LeftImg\" alt=\"\" /> CANCEL </button> &nbsp; &nbsp; ");
            Output.WriteLine("        <button onclick=\"behaviors_save_form(); return false;\" class=\"sbkMySobek_BigButton\"> SAVE <img src=\"" + currentMode.Base_URL + "default/images/button_next_arrow.png\" class=\"sbkMySobek_RoundButton_RightImg\" alt=\"\" /></button>");
            Output.WriteLine("      </div>");
            Output.WriteLine("      <br /><br />");
            Output.WriteLine();

            bool isMozilla = currentMode.Browser_Type.ToUpper().IndexOf("FIREFOX") >= 0;

            template.Render_Template_HTML(Output, item, currentMode.Skin == currentMode.Default_Skin ? currentMode.Skin.ToUpper() : currentMode.Skin, isMozilla, user, currentMode.Language, Translator, currentMode.Base_URL, 1);

            // Add the second buttons at the bottom of the form
            Output.WriteLine();
            Output.WriteLine("      <!-- Add SAVE and CANCEL buttons to bottom of form -->");
            Output.WriteLine("      <div class=\"sbkMySobek_RightButtons\">");
            Output.WriteLine("        <button onclick=\"behaviors_cancel_form(); return false;\" class=\"sbkMySobek_BigButton\"><img src=\"" + currentMode.Base_URL + "default/images/button_previous_arrow.png\" class=\"sbkMySobek_RoundButton_LeftImg\" alt=\"\" /> CANCEL </button> &nbsp; &nbsp; ");
            Output.WriteLine("        <button onclick=\"behaviors_save_form(); return false;\" class=\"sbkMySobek_BigButton\"> SAVE <img src=\"" + currentMode.Base_URL + "default/images/button_next_arrow.png\" class=\"sbkMySobek_RoundButton_RightImg\" alt=\"\" /></button>");
            Output.WriteLine("      </div>");
            Output.WriteLine("      <br />");
            Output.WriteLine("    </div>");
            Output.WriteLine("  </div>");
            Output.WriteLine("</div>");
            Output.WriteLine("</div>");
            Output.WriteLine("</div>");
        }
        /// <summary> This is an opportunity to write HTML directly into the main form, without
        /// using the pop-up html form architecture </summary>
        /// <param name="Output"> Textwriter to write the pop-up form HTML for this viewer </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <remarks> This text will appear within the ItemNavForm form tags </remarks>
        public override void Write_ItemNavForm_Closing(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Skins_AdminViewer.Write_ItemNavForm_Closing", "Add any popup divisions for form elements");

            Output.WriteLine("<!-- Skins_AdminViewer.Write_ItemNavForm_Closing -->");
            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/jquery/jquery-ui-1.10.3.custom.min.js\"></script>");

            // Add the hidden field
            Output.WriteLine("<!-- Hidden field is used for postbacks to indicate what to save and reset -->");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_interface_tosave\" name=\"admin_interface_tosave\" value=\"\" />");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_interface_reset\" name=\"admin_interface_reset\" value=\"\" />");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_interface_delete\" name=\"admin_interface_delete\" value=\"\" />");
            Output.WriteLine();

            Output.WriteLine("<!-- HTML Skins Edit Form -->");
            Output.WriteLine("<div class=\"sbkSav_PopupDiv\" id=\"form_interface\" style=\"display:none;\">");
            Output.WriteLine("  <div class=\"sbkAdm_PopupTitle\"><table style=\"width:100%;\"><tr><td style=\"text-align:left;\">EDIT WEB SKIN</td><td style=\"text-align:right;\"> <a href=\"#template\" alt=\"CLOSE\" onclick=\"interface_form_close()\">X</a> &nbsp; </td></tr></table></div>");
            Output.WriteLine("  <br />");
            Output.WriteLine("  <table class=\"sbkAdm_PopupTable\">");

            // Add line for interface code and base interface code
            Output.WriteLine("    <tr style=\"height:25px;\">");
            Output.WriteLine("      <td style=\"width:112px;\"><label for=\"form_interface_code\">Web Skin Code:</label></td>");
            Output.WriteLine("      <td style=\"width:220px;\"><span class=\"form_linkline admin_existing_code_line\" id=\"form_interface_code\"></span></td>");
            Output.WriteLine("      <td style=\"text-align:right;\"><label for=\"form_interface_basecode\">Base Skin Code:</label> &nbsp; <input class=\"sbkSav_small_input1 sbkAdmin_Focusable\" name=\"form_interface_basecode\" id=\"form_interface_basecode\" type=\"text\" value=\"\" /></td>");
            Output.WriteLine("    </tr>");

            // Add line for banner link
            Output.WriteLine("    <tr style=\"height:25px;\"><td><label for=\"form_interface_link\">Banner Link:</label></td><td colspan=\"2\"><input class=\"sbkSav_large_input sbkAdmin_Focusable\" name=\"form_interface_link\" id=\"form_interface_link\" type=\"text\" value=\"\" /></td></tr>");

            // Add line for notes
            Output.WriteLine("    <tr style=\"height:25px;\"><td><label for=\"form_interface_notes\">Notes:</label></td><td colspan=\"2\"><input class=\"sbkSav_large_input sbkAdmin_Focusable\" name=\"form_interface_notes\" id=\"form_interface_notes\" type=\"text\" value=\"\" /></td></tr>");

            // Add checkboxes for overriding the header/footer and overriding banner
            Output.WriteLine("          <tr style=\"height:15px;\"><td>Flags:</td><td><input class=\"sbkSav_checkbox\" type=\"checkbox\" name=\"form_interface_header_override\" id=\"form_interface_header_override\" checked=\"checked\" /> <label for=\"form_interface_header_override\">Override header and footer?</label></td><td><input class=\"sbkSav_checkbox\" type=\"checkbox\" name=\"form_interface_banner_override\" id=\"form_interface_banner_override\" /> <label for=\"form_interface_banner_override\">Override banner?</label></td></tr>");
            Output.WriteLine("          <tr style=\"height:15px;\"><td>&nbsp;</td><td><input class=\"sbkSav_checkbox\" type=\"checkbox\" name=\"form_interface_top_nav\" id=\"form_interface_top_nav\" /> <label for=\"form_interface_top_nav\">Suppress top-level navigation?</label></td><td><input class=\"sbkSav_checkbox\" type=\"checkbox\" name=\"form_interface_buildlaunch\" id=\"form_interface_buildlaunch\" /> <label for=\"form_interface_buildlaunch\">Build on launch?</label></td></tr>");


            // Add the buttons
            Output.WriteLine("    <tr style=\"height:35px; text-align: center; vertical-align: bottom;\">");
            Output.WriteLine("      <td colspan=\"3\">");
            Output.WriteLine("        <button title=\"Do not apply changes\" class=\"sbkAdm_RoundButton\" onclick=\"return interface_form_close();\"><img src=\"" + currentMode.Base_URL + "default/images/button_previous_arrow.png\" class=\"sbkAdm_RoundButton_LeftImg\" alt=\"\" /> CANCEL</button> &nbsp; &nbsp; ");
            Output.WriteLine("        <button title=\"Save changes to this existing web skin\" class=\"sbkAdm_RoundButton\" type=\"submit\">SAVE <img src=\"" + currentMode.Base_URL + "default/images/button_next_arrow.png\" class=\"sbkAdm_RoundButton_RightImg\" alt=\"\" /></button>");
            Output.WriteLine("      </td>");
            Output.WriteLine("    </tr>");
            Output.WriteLine("  </table>");
            Output.WriteLine("</div>");
            Output.WriteLine();

            Output.WriteLine("<script src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_admin.js\" type=\"text/javascript\"></script>");
            Output.WriteLine("<div class=\"sbkAdm_HomeText\">");

            if (!String.IsNullOrEmpty(actionMessage))
            {
                Output.WriteLine("  <br />");
                Output.WriteLine("  <div id=\"sbkAdm_ActionMessage\">" + actionMessage + "</div>");
            }

            Output.WriteLine("  <p>For clarification of any terms on this form, <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "adminhelp/webskins\" target=\"ADMIN_INTERFACE_HELP\" >click here to view the help page</a>.</p>");

            Output.WriteLine("  <h2>New Web Skin</h2>");
            Output.WriteLine("  <div class=\"sbkSav_NewDiv\">");
            Output.WriteLine("    <table class=\"sbkAdm_PopupTable\">");

            // Add line for interface code and base interface code
            Output.WriteLine("      <tr style=\"height:25px;\">");
            Output.WriteLine("        <td style=\"width:112px;\"><label for=\"admin_interface_code\">Web Skin Code:</label></td>");
            Output.WriteLine("        <td style=\"width:220px;\"><input class=\"sbkSav_small_input sbkAdmin_Focusable\" name=\"admin_interface_code\" id=\"admin_interface_code\" type=\"text\" value=\"\" /></td>");
            Output.WriteLine("        <td style=\"text-align:right;\"><label for=\"admin_interface_basecode\">Base Skin Code:</label> &nbsp; <input class=\"sbkSav_small_input2 sbkAdmin_Focusable\" name=\"admin_interface_basecode\" id=\"admin_interface_basecode\" type=\"text\" value=\"\" /></td>");
            Output.WriteLine("      </tr>");

            // Add line for banner link
            Output.WriteLine("      <tr style=\"height:25px;\"><td><label for=\"admin_interface_link\">Banner Link:</label></td><td colspan=\"2\"><input class=\"sbkSav_large_input sbkAdmin_Focusable\" name=\"admin_interface_link\" id=\"admin_interface_link\" type=\"text\" value=\"\" /></td></tr>");

            // Add line for notes
            Output.WriteLine("      <tr style=\"height:25px;\"><td><label for=\"admin_interface_notes\">Notes:</label></td><td colspan=\"2\"><input class=\"sbkSav_large_input sbkAdmin_Focusable\" name=\"admin_interface_notes\" id=\"admin_interface_notes\" type=\"text\" value=\"\" /></td></tr>");

            // Add checkboxes for overriding the header/footer and overriding banner
            Output.WriteLine("      <tr style=\"height:15px;\"><td>Flags:</td><td><input class=\"sbkSav_checkbox\" type=\"checkbox\" name=\"admin_interface_header_override\" id=\"admin_interface_header_override\" checked=\"checked\" /> <label for=\"admin_interface_header_override\">Override header and footer?</label></td><td><input class=\"sbkSav_checkbox\" type=\"checkbox\" name=\"admin_interface_banner_override\" id=\"admin_interface_banner_override\" /> <label for=\"admin_interface_banner_override\">Override banner?</label></td></tr>");
            Output.WriteLine("      <tr style=\"height:15px;\"><td>&nbsp;</td><td><input class=\"sbkSav_checkbox\" type=\"checkbox\" name=\"admin_interface_top_nav\" id=\"admin_interface_top_nav\" /> <label for=\"admin_interface_top_nav\">Suppress top-level navigation?</label></td><td><input class=\"sbkSav_checkbox\" type=\"checkbox\" name=\"admin_interface_buildlaunch\" id=\"admin_interface_buildlaunch\" /> <label for=\"admin_interface_buildlaunch\">Build on launch?</label></td></tr>");
            Output.WriteLine("      <tr style=\"height:15px;\"><td>&nbsp;</td><td colspan=\"2\"><input class=\"sbkSav_checkbox\" type=\"checkbox\" name=\"admin_interface_copycurrent\" id=\"admin_interface_copycurrent\" /> <label for=\"admin_interface_copycurrent\">Copy current files for this new web skin if folder does not exist?</label></td></tr>");

            // Add the SAVE button
            Output.WriteLine("      <tr style=\"height:30px; text-align: center;\"><td colspan=\"3\"><button title=\"Save new web skin\" class=\"sbkAdm_RoundButton\" onclick=\"return save_new_interface();\">SAVE <img src=\"" + currentMode.Base_URL + "default/images/button_next_arrow.png\" class=\"sbkAdm_RoundButton_RightImg\" alt=\"\" /></button></td></tr>");
            Output.WriteLine("    </table>");
            Output.WriteLine("  </div>");
            Output.WriteLine();
            Output.WriteLine("  <h2>Existing Web Skins</h2>");

            // Get the list of all aggregations
            Output.WriteLine("  <table class=\"sbkSav_Table sbkAdm_Table\">");
            Output.WriteLine("    <tr>");
            Output.WriteLine("      <th class=\"sbkSav_TableHeader1\">ACTIONS</th>");
            Output.WriteLine("      <th class=\"sbkSav_TableHeader2\">CODE</th>");
            Output.WriteLine("      <th class=\"sbkSav_TableHeader3\">BASE</th>");
            Output.WriteLine("      <th class=\"sbkSav_TableHeader4\">NOTES</th>");
            Output.WriteLine("    </tr>");
            Output.WriteLine("    <tr><td class=\"sbkAdm_TableRule\" colspan=\"4\"></td></tr>");

            // Get the view URL
            string current_skin = currentMode.Skin;

            currentMode.Skin = "TESTSKINCODE";
            string view_url = currentMode.Redirect_URL();

            currentMode.Skin = current_skin;

            // Write the data for each interface
            foreach (DataRow thisRow in skinCollection.Skin_Table.Rows)
            {
                // Pull all these values
                string code           = thisRow["WebSkinCode"].ToString();
                string base_code      = thisRow["BaseInterface"].ToString();
                string notes          = thisRow["Notes"].ToString();
                bool   overrideHeader = Convert.ToBoolean(thisRow["OverrideHeaderFooter"]);
                bool   overrideBanner = Convert.ToBoolean(thisRow["OverrideBanner"]);
                bool   buildOnLaunch  = Convert.ToBoolean(thisRow["Build_On_Launch"]);
                bool   suppressTopNav = Convert.ToBoolean(thisRow["SuppressTopNavigation"]);
                string bannerLink     = thisRow["BannerLink"].ToString();

                // Build the action links
                Output.WriteLine("    <tr>");
                Output.Write("      <td class=\"sbkAdm_ActionLink\" >( ");
                Output.Write("<a title=\"Click to edit\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return interface_form_popup('" + code + "','" + base_code + "','" + bannerLink + "','" + notes + "','" + overrideBanner + "','" + overrideHeader + "','" + suppressTopNav + "','" + buildOnLaunch + "');\">edit</a> | ");
                Output.Write("<a title=\"Click to view\" href=\"" + view_url.Replace("testskincode", code) + "\" >view</a> | ");
                Output.Write("<a title=\"Click to reset\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"reset_interface('" + code + "');\">reset</a> | ");

                if (user.Is_System_Admin)
                {
                    Output.WriteLine("<a title=\"Click to delete this web skin\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\"  onclick=\"return delete_interface('" + code + "');\">delete</a> )</td>");
                }
                else
                {
                    Output.WriteLine("<a title=\"Only SYSTEM administrators can delete web skins\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\"  onclick=\"alert('Only SYSTEM administrators can delete web skins'); return false;\">delete</a> )</td>");
                }


                // Add the rest of the row with data
                Output.WriteLine("      <td>" + code + "</span></td>");
                Output.WriteLine("      <td>" + base_code + "</span></td>");
                Output.WriteLine("      <td>" + notes + "</span></td>");
                Output.WriteLine("    </tr>");
                Output.WriteLine("    <tr><td class=\"sbkAdm_TableRule\" colspan=\"4\"></td></tr>");
            }

            Output.WriteLine("  </table>");
            Output.WriteLine("  <br />");
            Output.WriteLine("</div>");
            Output.WriteLine();
        }
        private void Write_Edit_User_Group_Form(TextWriter Output, Custom_Tracer Tracer)
        {
            Output.WriteLine("  <div class=\"SobekHomeText\">");
            Output.WriteLine("  <br />");
            Output.WriteLine("  <b>Edit this user group's permissions and abilities</b>");
            Output.WriteLine("    <ul>");
            Output.WriteLine("      <li>Enter the permissions for this user group below and press the SAVE button when all your edits are complete.</li>");
            Output.WriteLine("      <li>For clarification of any terms on this form, <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "admin/users\" target=\"ADMIN_USER_HELP\" >click here to view the help page</a>.</li>");
            Output.WriteLine("     </ul>");
            Output.WriteLine("  </div>");

            Output.WriteLine("  <div class=\"ViewsBrowsesRow\">");
            Output.WriteLine("    " + Selected_Tab_Start + " GROUP INFORMATION " + Selected_Tab_End);
            Output.WriteLine("  </div>");

            Output.WriteLine("  <div class=\"SobekEditPanel\">");

            // Add the buttons
            string last_mode = currentMode.My_Sobek_SubMode;

            currentMode.My_Sobek_SubMode = String.Empty;
            currentMode.Admin_Type       = Admin_Type_Enum.Users;
            Output.WriteLine("  <table width=\"100%px\"><tr><td width=\"480px\">&nbsp;</td><td align=\"right\"><a href=\"" + currentMode.Redirect_URL() + "\"><img border=\"0\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/cancel_button_g.gif\" alt=\"CLOSE\" /></a> &nbsp; <input type=\"image\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button_g.gif\" value=\"Submit\" alt=\"Submit\"></td><td width=\"20px\">&nbsp;</td></tr></table>");
            currentMode.My_Sobek_SubMode = last_mode;
            currentMode.Admin_Type       = Admin_Type_Enum.User_Groups;


            Output.WriteLine("  <span class=\"SobekEditItemSectionTitle_first\"> &nbsp; Basic Information</span>");
            Output.WriteLine("  <blockquote>");
            Output.WriteLine("    <table>");
            Output.WriteLine("      <tr><td><b><label for=\"groupName\">Name:</label></b></td><td><input id=\"groupName\" name=\"groupName\" class=\"admin_small_input\" value=\"" + editGroup.Name + "\" type=\"text\" onfocus=\"javascript:textbox_enter('groupName', 'admin_small_input_focused')\" onblur=\"javascript:textbox_leave('groupName', 'admin_small_input')\" /></td></tr>");
            Output.WriteLine("      <tr><td><b><label for=\"groupDescription\">Description:</label></b></td><td><input id=\"groupDescription\" name=\"groupDescription\" class=\"admin_large_input\" value=\"" + editGroup.Description + "\" type=\"text\" onfocus=\"javascript:textbox_enter('groupDescription', 'admin_large_input_focused')\" onblur=\"javascript:textbox_leave('groupDescription', 'admin_large_input')\" /></td></tr>");
            Output.WriteLine("    </table>");
            Output.WriteLine("  </blockquote>");
            Output.WriteLine("  <br />");

            Output.WriteLine("  <span class=\"SobekEditItemSectionTitle\"> &nbsp; Global Permissions</span><br />");
            Output.WriteLine(editGroup.Can_Submit
                                 ? "    <input class=\"admin_user_checkbox\" type=\"checkbox\" name=\"admin_user_submit\" id=\"admin_user_submit\" checked=\"checked\" /> <label for=\"admin_user_submit\">Can submit items</label> <br />"
                                 : "    <input class=\"admin_user_checkbox\" type=\"checkbox\" name=\"admin_user_submit\" id=\"admin_user_submit\" /> <label for=\"admin_user_submit\">Can submit items</label> <br />");

            Output.WriteLine(editGroup.Is_Internal_User
                                 ? "    <input class=\"admin_user_checkbox\" type=\"checkbox\" name=\"admin_user_internal\" id=\"admin_user_internal\" checked=\"checked\" /> <label for=\"admin_user_internal\">Is internal user</label> <br />"
                                 : "    <input class=\"admin_user_checkbox\" type=\"checkbox\" name=\"admin_user_internal\" id=\"admin_user_internal\" /> <label for=\"admin_user_internal\">Is internal user</label> <br />");

            bool canEditAll = editGroup.Editable_Regular_Expressions.Any(thisRegularExpression => thisRegularExpression == "[A-Z]{2}[A-Z|0-9]{4}[0-9]{4}");

            Output.WriteLine(canEditAll
                                 ? "    <input class=\"admin_user_checkbox\" type=\"checkbox\" name=\"admin_user_editall\" id=\"admin_user_editall\" checked=\"checked\" /> <label for=\"admin_user_editall\">Can edit <u>all</u> items</label> <br />"
                                 : "    <input class=\"admin_user_checkbox\" type=\"checkbox\" name=\"admin_user_editall\" id=\"admin_user_editall\" /> <label for=\"admin_user_editall\">Can edit <u>all</u> items</label> <br />");

            Output.WriteLine(editGroup.Is_System_Admin
                                 ? "    <input class=\"admin_user_checkbox\" type=\"checkbox\" name=\"admin_user_admin\" id=\"admin_user_admin\" checked=\"checked\" /> <label for=\"admin_user_admin\">Is system administrator</label> <br />"
                                 : "    <input class=\"admin_user_checkbox\" type=\"checkbox\" name=\"admin_user_admin\" id=\"admin_user_admin\" /> <label for=\"admin_user_admin\">Is system administrator</label> <br />");

            Output.WriteLine("  <br />");
            Output.WriteLine("  <br />");


            Output.WriteLine("  <span class=\"SobekEditItemSectionTitle\"> &nbsp; Templates and Projects</span>");
            Output.WriteLine("  <blockquote>");
            Output.WriteLine("    <table width=\"600px\">");

            DataSet projectTemplateSet = SobekCM_Database.Get_All_Projects_Templates(Tracer);

            Output.WriteLine("      <tr valign=\"top\" >");
            Output.WriteLine("        <td wdith=\"300px\">");
            Output.WriteLine("<table border=\"0px\" cellspacing=\"0px\" class=\"statsWhiteTable\">");
            Output.WriteLine("  <tr align=\"left\" bgcolor=\"#0022a7\" >");
            Output.WriteLine("    <th width=\"180px\" align=\"left\"><span style=\"color: White\">TEMPLATES</span></th>");
            Output.WriteLine("   </tr>");
            Output.WriteLine("  <tr ><td bgcolor=\"#e7e7e7\"></td></tr>");

            ReadOnlyCollection <string> user_templates = editGroup.Templates;

            foreach (DataRow thisTemplate in projectTemplateSet.Tables[1].Rows)
            {
                string template_name = thisTemplate["TemplateName"].ToString();
                string template_code = thisTemplate["TemplateCode"].ToString();

                Output.Write("  <tr align=\"left\"><td><input type=\"checkbox\" name=\"admin_user_template_" + template_code + "\" id=\"admin_user_template_" + template_code + "\"");
                if (user_templates.Contains(template_code))
                {
                    Output.Write(" checked=\"checked\"");
                }
                if (template_name.Length > 0)
                {
                    Output.WriteLine(" /> &nbsp; <acronym title=\"" + template_name.Replace("\"", "'") + "\"><label for=\"admin_user_template_" + template_code + "\">" + template_code + "</label></acronym></td></tr>");
                }
                else
                {
                    Output.WriteLine(" /> &nbsp; <label for=\"admin_user_template_" + template_code + "\">" + template_code + "</label></td></tr>");
                }
                Output.WriteLine("  <tr><td bgcolor=\"#e7e7e7\"></td></tr>");
            }
            Output.WriteLine("</table>");
            Output.WriteLine("        </td>");

            Output.WriteLine("        <td>");
            Output.WriteLine("<table border=\"0px\" cellspacing=\"0px\" class=\"statsWhiteTable\">");
            Output.WriteLine("  <tr align=\"left\" bgcolor=\"#0022a7\" >");
            Output.WriteLine("    <th width=\"180px\" align=\"left\"><span style=\"color: White\">PROJECTS</span></th>");
            Output.WriteLine("   </tr>");
            Output.WriteLine("  <tr><td bgcolor=\"#e7e7e7\"></td></tr>");

            ReadOnlyCollection <string> user_projects = editGroup.Projects;

            foreach (DataRow thisProject in projectTemplateSet.Tables[0].Rows)
            {
                string project_name = thisProject["ProjectName"].ToString();
                string project_code = thisProject["ProjectCode"].ToString();

                Output.Write("  <tr align=\"left\"><td><input type=\"checkbox\" name=\"admin_user_project_" + project_code + "\" id=\"admin_user_project_" + project_code + "\"");
                if (user_projects.Contains(project_code))
                {
                    Output.Write(" checked=\"checked\"");
                }
                if (project_name.Length > 0)
                {
                    Output.WriteLine(" /> &nbsp; <acronym title=\"" + project_name.Replace("\"", "'") + "\"><label for=\"admin_user_project_" + project_code + "\">" + project_code + "</label></acronym></td></tr>");
                }
                else
                {
                    Output.WriteLine(" /> &nbsp; <label for=\"admin_user_project_" + project_code + "\">" + project_code + "</label></td></tr>");
                }

                Output.WriteLine("  <tr><td bgcolor=\"#e7e7e7\"></td></tr>");
            }
            Output.WriteLine("</table>");
            Output.WriteLine("        </td>");

            Output.WriteLine("      </tr>");
            Output.WriteLine("   </table>");
            Output.WriteLine("  </blockquote>");

            Output.WriteLine("  <br />");
            Output.WriteLine("  <br />");
            Output.WriteLine("  <span class=\"SobekEditItemSectionTitle\"> &nbsp; Aggregations</span>");
            Output.WriteLine("  <br />");
            Output.WriteLine("  <br />");
            Output.WriteLine("<table><tr><td width=\"30px\">&nbsp;</td><td>");
            Output.WriteLine("<table border=\"0px\" cellspacing=\"0px\" class=\"statsWhiteTable\">");

            // Get the list of collections lists in the user object
            ReadOnlyCollection <User_Editable_Aggregation> aggregations_in_editable_user = editGroup.Aggregations;
            Dictionary <string, User_Editable_Aggregation> lookup_aggs = aggregations_in_editable_user.ToDictionary(thisAggr => thisAggr.Code.ToLower());

            // Step through each aggregation type
            foreach (string aggregationType in codeManager.All_Types)
            {
                Output.WriteLine("  <tr align=\"left\" bgcolor=\"#0022a7\" >");
                if ((aggregationType.Length > 0) && (aggregationType[aggregationType.Length - 1] != 'S'))
                {
                    Output.WriteLine("    <td colspan=\"6\"><span style=\"color: White\"><b>" + aggregationType.ToUpper() + "S</b></span></td>");
                }
                else
                {
                    Output.WriteLine("    <td colspan=\"6\"><span style=\"color: White\"><b>" + aggregationType.ToUpper() + "</b></span></td>");
                }
                Output.WriteLine("  </tr>");

                Output.WriteLine("  <tr align=\"left\" bgcolor=\"#7d90d5\" >");
                Output.WriteLine("    <td width=\"57px\" align=\"left\"><span style=\"color: White\"><acronym title=\"Can select this aggregation when editing or submitting an item\">CAN<br />SELECT</acronym></span></td>");
                Output.WriteLine("    <td width=\"50px\" align=\"left\"><span style=\"color: White\"><acronym title=\"Can edit any item in this aggregation\">CAN<br />EDIT</acronym></span></td>");
                Output.WriteLine("    <td width=\"50px\" align=\"left\"><span style=\"color: White\"><acronym title=\"Can perform curatorial or collection manager tasks on this aggregation\">IS<br />CURATOR</acronym></span></td>");
                Output.WriteLine("    <td align=\"left\" colspan=\"2\"><span style=\"color: White\">ITEM AGGREGATION</span></td>");
                Output.WriteLine("   </tr>");

                // Show all matching rows
                foreach (Item_Aggregation_Related_Aggregations thisAggr in codeManager.Aggregations_By_Type(aggregationType))
                {
                    Output.WriteLine("  <tr align=\"left\" >");
                    if (!lookup_aggs.ContainsKey(thisAggr.Code))
                    {
                        Output.WriteLine("    <td><input type=\"checkbox\" name=\"admin_project_select_" + thisAggr.Code + "\" id=\"admin_project_select_" + thisAggr.Code + "\" /></td>");
                        Output.WriteLine("    <td><input type=\"checkbox\" name=\"admin_project_edit_" + thisAggr.Code + "\" id=\"admin_project_edit_" + thisAggr.Code + "\" /></td>");
                        Output.WriteLine("    <td><input type=\"checkbox\" name=\"admin_project_admin_" + thisAggr.Code + "\" id=\"admin_project_admin_" + thisAggr.Code + "\" /></td>");
                    }
                    else
                    {
                        if (lookup_aggs[thisAggr.Code].CanSelect)
                        {
                            Output.WriteLine("    <td><input type=\"checkbox\" name=\"admin_project_select_" + thisAggr.Code + "\" id=\"admin_project_select_" + thisAggr.Code + "\" checked=\"checked\" /></td>");
                        }
                        else
                        {
                            Output.WriteLine("    <td><input type=\"checkbox\" name=\"admin_project_select_" + thisAggr.Code + "\" id=\"admin_project_select_" + thisAggr.Code + "\" /></td>");
                        }

                        if (lookup_aggs[thisAggr.Code].CanEditItems)
                        {
                            Output.WriteLine("    <td><input type=\"checkbox\" name=\"admin_project_edit_" + thisAggr.Code + "\" id=\"admin_project_edit_" + thisAggr.Code + "\" checked=\"checked\" /></td>");
                        }
                        else
                        {
                            Output.WriteLine("    <td><input type=\"checkbox\" name=\"admin_project_edit_" + thisAggr.Code + "\" id=\"admin_project_edit_" + thisAggr.Code + "\" /></td>");
                        }

                        if (lookup_aggs[thisAggr.Code].IsCurator)
                        {
                            Output.WriteLine("    <td><input type=\"checkbox\" name=\"admin_project_admin_" + thisAggr.Code + "\" id=\"admin_project_admin_" + thisAggr.Code + "\" checked=\"checked\" /></td>");
                        }
                        else
                        {
                            Output.WriteLine("    <td><input type=\"checkbox\" name=\"admin_project_admin_" + thisAggr.Code + "\" id=\"admin_project_admin_" + thisAggr.Code + "\" /></td>");
                        }
                    }

                    Output.WriteLine("    <td>" + thisAggr.Code + "</td>");
                    Output.WriteLine("    <td>" + thisAggr.Name + "</td>");
                    Output.WriteLine("   </tr>");
                    Output.WriteLine("  <tr><td bgcolor=\"#e7e7e7\" colspan=\"6\"></td></tr>");
                }
            }

            Output.WriteLine("</table>");
            Output.WriteLine("</td></tr></table>");
            Output.WriteLine("<br />");

            // Add the buttons
            currentMode.My_Sobek_SubMode = String.Empty;
            Output.WriteLine("  <table width=\"100%px\"><tr><td width=\"480px\">&nbsp;</td><td align=\"right\"><a href=\"" + currentMode.Redirect_URL() + "\"><img border=\"0\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/cancel_button_g.gif\" alt=\"CLOSE\" /></a> &nbsp; <input type=\"image\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button_g.gif\" value=\"Submit\" alt=\"Submit\"></td><td width=\"20px\">&nbsp;</td></tr></table>");
            currentMode.My_Sobek_SubMode = last_mode;

            Output.WriteLine("</div>");
        }
Esempio n. 25
0
        /// <summary> Add the HTML to be displayed in the main SobekCM viewer area </summary>
        /// <param name="Output"> Textwriter to write the HTML for this viewer</param>
        /// <param name="Tracer">Trace object keeps a list of each method executed and important milestones in rendering</param>
        public override void Write_HTML(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Home_AdminViewer.Write_HTML", String.Empty);

            Output.WriteLine("<div class=\"SobekHomeText\" >");
            Output.WriteLine("<table width=\"700\"><tr><td width=\"200px\">&nbsp;</td>");
            Output.WriteLine("<td><div style=\"font-size:larger\">");
            Output.WriteLine("<br />");
            Output.WriteLine("<br />");
            Output.WriteLine("What would you like to edit today?");
            Output.WriteLine("<blockquote>");

            Output.WriteLine("<table>");

            // Edit item aggregations
            currentMode.Admin_Type = Admin_Type_Enum.Aggregations_Mgmt;
            Output.WriteLine("<tr valign=\"middle\" height=\"40px\"><td width=\"35px\"><a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Default_Images_URL + "building.gif\" /></a></td><td><a href=\"" + currentMode.Redirect_URL() + "\">Item Aggregations</a></td></tr>");

            // Edit interfaces
            currentMode.Admin_Type = Admin_Type_Enum.Interfaces;
            Output.WriteLine("<tr valign=\"middle\" height=\"40px\"><td width=\"35px\"><a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Default_Images_URL + "skins.gif\" /></a></td><td><a href=\"" + currentMode.Redirect_URL() + "\">Web Skins</a></td></tr>");

            // Edit wordmarks
            currentMode.Admin_Type = Admin_Type_Enum.Wordmarks;
            Output.WriteLine("<tr valign=\"middle\" height=\"40px\"><td width=\"35px\"><a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Default_Images_URL + "wordmarks.gif\" /></a></td><td><a href=\"" + currentMode.Redirect_URL() + "\">Wordmarks / Icons</a></td></tr>");

            // Edit forwarding
            currentMode.Admin_Type = Admin_Type_Enum.Forwarding;
            Output.WriteLine("<tr valign=\"middle\" height=\"40px\"><td width=\"35px\"><a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Default_Images_URL + "forwarding.gif\" /></a></td><td><a href=\"" + currentMode.Redirect_URL() + "\">Aggregation Aliases</a></td></tr>");

            // Edit Projects
            currentMode.Admin_Type = Admin_Type_Enum.Projects;
            Output.WriteLine("<tr valign=\"middle\" height=\"40px\"><td width=\"35px\"><a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Default_Images_URL + "pmets.gif\" /></a></td><td><a href=\"" + currentMode.Redirect_URL() + "\">Projects</a></td></tr>");

            // Edit Thematic Headings
            currentMode.Admin_Type = Admin_Type_Enum.Thematic_Headings;
            Output.WriteLine("<tr valign=\"middle\" height=\"40px\"><td width=\"35px\"></td><td><a href=\"" + currentMode.Redirect_URL() + "\">Thematic Headings</a></td></tr>");

            if (user.Is_System_Admin)
            {
                // Edit users
                currentMode.Admin_Type = Admin_Type_Enum.Users;
                Output.WriteLine("<tr valign=\"middle\" height=\"40px\"><td width=\"35px\"><a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Default_Images_URL + "users.gif\" /></a></td><td><a href=\"" + currentMode.Redirect_URL() + "\">Registered Users and Groups</a></td></tr>");

                // Edit IP Restrictions
                currentMode.Admin_Type = Admin_Type_Enum.IP_Restrictions;
                Output.WriteLine("<tr valign=\"middle\" height=\"40px\"><td width=\"35px\"><a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Default_Images_URL + "firewall.gif\" /></a></td><td><a href=\"" + currentMode.Redirect_URL() + "\">IP Restriction Ranges</a></td></tr>");

                // Edit URL Portals
                currentMode.Admin_Type = Admin_Type_Enum.URL_Portals;
                Output.WriteLine("<tr valign=\"middle\" height=\"40px\"><td width=\"35px\"><a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Default_Images_URL + "portals.gif\" /></a></td><td><a href=\"" + currentMode.Redirect_URL() + "\">URL Portals</a></td></tr>");

                // Edit Settings
                currentMode.Admin_Type = Admin_Type_Enum.Settings;
                Output.WriteLine("<tr valign=\"middle\" height=\"40px\"><td width=\"35px\"><a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Default_Images_URL + "wrench.png\" /></a></td><td><a href=\"" + currentMode.Redirect_URL() + "\">System-Wide Settings</a></td></tr>");

                // View and set SobekCM Builder Status
                currentMode.Admin_Type = Admin_Type_Enum.Builder_Status;
                Output.WriteLine("<tr valign=\"middle\" height=\"40px\"><td width=\"35px\"><a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Default_Images_URL + "gears.png\" /></a></td><td><a href=\"" + currentMode.Redirect_URL() + "\">SobekCM Builder Status</a></td></tr>");
            }

            // Reset cache
            currentMode.Admin_Type = Admin_Type_Enum.Reset;
            Output.WriteLine("<tr valign=\"middle\" height=\"40px\"><td width=\"35px\"><a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Default_Images_URL + "refresh.gif\" /></a></td><td><a href=\"" + currentMode.Redirect_URL() + "\">Reset Cache</a></td></tr>");

            currentMode.Admin_Type = Admin_Type_Enum.Home;

            Output.WriteLine("</table>");
            Output.WriteLine("</blockquote>");
            Output.WriteLine("<br />");
            Output.WriteLine("</div>");
            Output.WriteLine("</td></tr></table>");
            Output.WriteLine(" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; For clarification on any of these options, <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "admin/tasks\" target=\"ADMIN_USER_HELP\" >click here to view the help page</a>.<br /><br />");
            Output.WriteLine(" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; You are currently running version " + SobekCM_Library_Settings.CURRENT_WEB_VERSION + ". ( <a href=\"http://ufdc.ufl.edu/sobekcm/development/history\">see release notes</a> )<br /><br />");
            Output.WriteLine("</div>");
        }
Esempio n. 26
0
        /// <summary> This is an opportunity to write HTML directly into the main form, without
        /// using the pop-up html form architecture </summary>
        /// <param name="Output"> Textwriter to write the pop-up form HTML for this viewer </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <remarks> This text will appear within the ItemNavForm form tags </remarks>
        public override void Write_ItemNavForm_Closing(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Aliases_AdminViewer.Write_ItemNavForm_Closing", "Add any popup divisions for form elements");

            Output.WriteLine("<!-- Aliases_AdminViewer.Write_ItemNavForm_Closing -->");
            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/jquery/jquery-ui-1.10.3.custom.min.js\"></script>");

            // Add the hidden field
            Output.WriteLine("<!-- Hidden field is used for postbacks to indicate what to save and reset -->");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_forwarding_tosave\" name=\"admin_forwarding_tosave\" value=\"\" />");
            Output.WriteLine();

            Output.WriteLine("<!-- Item Aggregation Aliases Edit Form -->");
            Output.WriteLine("<div class=\"sbkAav_PopupDiv\" id=\"form_forwarding\" style=\"display:none;\">");
            Output.WriteLine("  <div class=\"sbkAdm_PopupTitle\"><table style=\"width:100%;\"><tr><td style=\"text-align:left;\">EDIT AGGREGATION ALIAS</td><td style=\"text-align:right;\"> <a href=\"#template\" alt=\"CLOSE\" onclick=\"alias_form_close()\">X</a> &nbsp; </td></tr></table></div>");
            Output.WriteLine("  <br />");
            Output.WriteLine("  <table class=\"sbkAdm_PopupTable\">");

            // Add line for alias
            Output.WriteLine("    <tr style=\"height: 30px;\"><td style=\"width:120px;\"><label for=\"form_forwarding_alias\">Alias:</label></td><td colspan=\"2\"><span class=\"form_linkline admin_existing_code_line\" id=\"form_forwarding_alias\"></span></td></tr>");

            // Add line for aggregation
            Output.WriteLine("    <tr style=\"height: 30px;\"><td><label for=\"form_forwarding_code\">Item Aggregation:</label></td><td colspan=\"2\"><input class=\"sbkAav_input sbkAdmin_Focusable\" name=\"form_forwarding_code\" id=\"form_forwarding_code\" type=\"text\" value=\"\" /></td></tr>");

            // Add the buttons and close the table
            Output.WriteLine("    <tr style=\"height:35px; text-align: center; vertical-align: bottom;\">");
            Output.WriteLine("      <td colspan=\"2\"> &nbsp; &nbsp; ");
            Output.WriteLine("        <button title=\"Do not apply changes\" class=\"sbkAdm_RoundButton\" onclick=\"return alias_form_close();\"><img src=\"" + currentMode.Base_URL + "default/images/button_previous_arrow.png\" class=\"sbkAdm_RoundButton_LeftImg\" alt=\"\" /> CANCEL</button> &nbsp; &nbsp; ");
            Output.WriteLine("        <button title=\"Save changes to this existing aggregation alias\" class=\"sbkAdm_RoundButton\" type=\"submit\">SAVE <img src=\"" + currentMode.Base_URL + "default/images/button_next_arrow.png\" class=\"sbkAdm_RoundButton_RightImg\" alt=\"\" /></button>");
            Output.WriteLine("      </td>");
            Output.WriteLine("    </tr>");
            Output.WriteLine("  </table>");
            Output.WriteLine("</div>");
            Output.WriteLine();

            Tracer.Add_Trace("Aliases_AdminViewer.Write_ItemNavForm_Closing", "Write the rest of the form ");

            Output.WriteLine("<script src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_admin.js\" type=\"text/javascript\"></script>");
            Output.WriteLine("<div class=\"sbkAdm_HomeText\">");

            if (actionMessage.Length > 0)
            {
                Output.WriteLine("  <br />");
                Output.WriteLine("  <div id=\"sbkAdm_ActionMessage\">" + actionMessage + "</div>");
            }

            Output.WriteLine("  <p>Use item aggregation aliases to allow a term to forward to an existing item aggregation. ");
            Output.WriteLine("  This creates a simpler URL and can forward from a discontinued item aggregation.</p>");
            Output.WriteLine("  <p>For more information about aggregation aliases and forwarding, <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "adminhelp/aggraliases\" target=\"ADMIN_USER_HELP\" >click here to view the help page</a>.</p>");

            Output.WriteLine("  <h2>New Item Aggregation Alias</h2>");
            Output.WriteLine("    <div class=\"sbkAav_NewDiv\">");
            Output.WriteLine("      <table class=\"sbkAdm_PopupTable\">");

            // Add line for alias
            Output.WriteLine("        <tr><td style=\"width:120px;\"><label for=\"admin_forwarding_alias\">Alias:</label></td><td colspan=\"2\"><input class=\"sbkAav_input sbkAdmin_Focusable\" name=\"admin_forwarding_alias\" id=\"admin_forwarding_alias\" type=\"text\" value=\"\" /></td></tr>");

            // Add line for aggregation
            Output.WriteLine("        <tr><td><label for=\"admin_forwarding_code\">Item Aggregation:</label></td><td><input class=\"sbkAav_input sbkAdmin_Focusable\" name=\"admin_forwarding_code\" id=\"admin_forwarding_code\" type=\"text\" value=\"\" /></td><td><button title=\"Save new aggregation alias\" class=\"sbkAdm_RoundButton\" onclick=\"return save_new_alias();\">SAVE <img src=\"" + currentMode.Base_URL + "default/images/button_next_arrow.png\" class=\"sbkAdm_RoundButton_RightImg\" alt=\"\" /></button></td></tr>");
            Output.WriteLine("      </table>");
            Output.WriteLine("    </div>");
            Output.WriteLine("  <br />");



            Output.WriteLine("  <h2>Existing Item Aggregation Aliases</h2>");

            if (aggregationAliases.Count > 0)
            {
                Output.WriteLine("  <table class=\"sbkAav_Table sbkAdm_Table\">");
                Output.WriteLine("    <tr>");
                Output.WriteLine("      <th class=\"sbkAav_TableHeader1\">ACTIONS</th>");
                Output.WriteLine("      <th class=\"sbkAav_TableHeader2\">ALIAS</th>");
                Output.WriteLine("      <th class=\"sbkAav_TableHeader3\">AGGREGATION</th>");
                Output.WriteLine("    </tr>");
                Output.WriteLine("    <tr><td class=\"sbkAdm_TableRule\" colspan=\"3\"></td></tr>");

                SortedList <string, string> sorter = new SortedList <string, string>();
                foreach (KeyValuePair <string, string> thisForward in aggregationAliases)
                {
                    sorter.Add(thisForward.Key, thisForward.Value);
                }

                // Write the data for each interface
                foreach (KeyValuePair <string, string> thisForward in sorter)
                {
                    // Build the action links
                    Output.WriteLine("    <tr>");
                    Output.Write("    <td class=\"sbkAdm_ActionLink\" >( ");
                    Output.Write("<a title=\"Click to edit\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return alias_form_popup('" + thisForward.Key + "','" + thisForward.Value + "');\">edit</a> | ");
                    Output.Write("<a title=\"Click to view\" href=\"" + currentMode.Base_URL + thisForward.Key + "\" target=\"_PREVIEW\">view</a> | ");
                    if (user.Is_System_Admin)
                    {
                        Output.Write("<a title=\"Delete this alias\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return delete_alias('" + thisForward.Key + "');\">delete</a> )</td>");
                    }
                    else
                    {
                        Output.Write("<a title=\"Only SYSTEM administrators can delete aliases\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"alert('Only SYSTEM administrators can delete aliases');return false;\">delete</a> )</td>");
                    }

                    // Add the rest of the row with data
                    Output.WriteLine("      <td>" + thisForward.Key + "</span></td>");
                    Output.WriteLine("      <td>" + thisForward.Value + "</span></td>");
                    Output.WriteLine("    </tr>");
                    Output.WriteLine("    <tr><td class=\"sbkAdm_TableRule\" colspan=\"3\"></td></tr>");
                }

                Output.WriteLine("  </table>");
            }
            else
            {
                Output.WriteLine("  <p>No existing aggregation aliases exist. To add one, enter the information above and press SAVE.</p>");
            }
            Output.WriteLine("  <br />");
            Output.WriteLine("</div>");
            Output.WriteLine();
        }
Esempio n. 27
0
        /// <summary> This is an opportunity to write HTML directly into the main form, without
        /// using the pop-up html form architecture </summary>
        /// <param name="Output"> Textwriter to write the pop-up form HTML for this viewer </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <remarks> This text will appear within the ItemNavForm form tags </remarks>
        public override void Add_HTML_In_Main_Form(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Wordmarks_AdminViewer.Add_HTML_In_Main_Form", "Add any popup divisions for form elements");

            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/jquery/jquery-1.6.2.min.js\"></script>");
            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/jquery/jquery-ui-1.8.16.custom.min.js\"></script>");
            Output.WriteLine("<script type=\"text/javascript\" src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_form.js\" ></script>");

            // Add the hidden field
            Output.WriteLine("<!-- Hidden field is used for postbacks to indicate what to save and reset -->");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_wordmark_code_tosave\" name=\"admin_wordmark_code_tosave\" value=\"\" />");
            Output.WriteLine("<input type=\"hidden\" id=\"admin_wordmark_code_delete\" name=\"admin_wordmark_code_delete\" value=\"\" />");
            Output.WriteLine();

            Output.WriteLine("<!-- Wordmarks Edit Form -->");
            Output.WriteLine("<div class=\"admin_wordmark_popup_div\" id=\"form_wordmark\" style=\"display:none;\">");
            Output.WriteLine("  <div class=\"popup_title\"><table width=\"100%\"><tr><td align=\"left\">EDIT WORDMARK / ICON <td><td align=\"right\"> <a href=\"#template\" alt=\"CLOSE\" onclick=\"wordmark_form_close()\">X</a> &nbsp; </td></tr></table></div>");
            Output.WriteLine("  <br />");
            Output.WriteLine("  <table class=\"popup_table\">");

            // Add line for interface code and base interface code
            Output.Write("    <tr align=\"left\"><td width=\"120px\"><label for=\"form_wordmark_code\">Wordmark Code:</label></td>");
            Output.WriteLine("<td><span class=\"form_linkline admin_existing_code_line\" id=\"form_wordmark_code\"></span></td>");

            // Add line for filename
            Output.WriteLine("          <tr><td><label for=\"form_wordmark_file\">Image File:</label></td><td><input class=\"admin_wordmark_medium_input\" name=\"form_wordmark_file\" id=\"form_wordmark_file\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('form_wordmark_file', 'admin_wordmark_medium_input_focused')\" onblur=\"javascript:textbox_leave('form_wordmark_file', 'admin_wordmark_medium_input')\" /></td></tr>");

            // Add line for title
            Output.WriteLine("          <tr><td><label for=\"form_wordmark_title\">Title:</label></td><td><input class=\"admin_wordmark_large_input\" name=\"form_wordmark_title\" id=\"form_wordmark_title\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('form_wordmark_title', 'admin_wordmark_large_input_focused')\" onblur=\"javascript:textbox_leave('form_wordmark_title', 'admin_wordmark_large_input')\" /></td></tr>");

            // Add line for banner link
            Output.WriteLine("          <tr><td><label for=\"form_wordmark_link\">Link:</label></td><td><input class=\"admin_wordmark_large_input\" name=\"form_wordmark_link\" id=\"form_wordmark_link\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('form_wordmark_link', 'admin_wordmark_large_input_focused')\" onblur=\"javascript:textbox_leave('form_wordmark_link', 'admin_wordmark_large_input')\" /></td></tr>");

            Output.WriteLine("  </table>");
            Output.WriteLine("  <br />");
            Output.WriteLine("  <center><a href=\"\" onclick=\"return wordmark_form_close();\"><img border=\"0\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/cancel_button_g.gif\" alt=\"CLOSE\" /></a> &nbsp; &nbsp; <input type=\"image\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button_g.gif\" value=\"Submit\" alt=\"Submit\"></center>");
            Output.WriteLine("</div>");

            Tracer.Add_Trace("Wordmarks_AdminViewer.Add_HTML_In_Main_Form", "Write the HTML for the rest of the form");

            Output.WriteLine("<!-- Wordmarks_AdminViewer.Add_HTML_In_Main_Form -->");
            Output.WriteLine("<script src=\"" + currentMode.Base_URL + "default/scripts/sobekcm_admin.js\" type=\"text/javascript\"></script>");
            Output.WriteLine("<div class=\"SobekHomeText\">");

            if (actionMessage.Length > 0)
            {
                Output.WriteLine("  <br />");
                Output.WriteLine("  <center><b>" + actionMessage + "</b></center>");
            }

            Output.WriteLine("  <blockquote>For clarification of any terms on this form, <a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "admin/wordmarks\" target=\"ADMIN_WORDMARK_HELP\" >click here to view the help page</a>.</blockquote>");

            Output.WriteLine("  <span class=\"SobekAdminTitle\">New Wordmark / Icon</span>");
            Output.WriteLine("    <blockquote>");
            Output.WriteLine("      <div class=\"admin_wordmark_new_div\">");
            Output.WriteLine("        <table class=\"popup_table\">");

            // Add line for wordmark code
            Output.Write("          <tr><td width=\"120px\"><label for=\"admin_wordmark_code\">Wordmark Code:</label></td>");
            Output.Write("<td><input class=\"admin_wordmark_small_input\" name=\"admin_wordmark_code\" id=\"admin_wordmark_code\" type=\"text\" value=\"\"  onfocus=\"javascript:textbox_enter('admin_wordmark_code', 'admin_wordmark_small_input_focused')\" onblur=\"javascript:textbox_leave('admin_wordmark_code', 'admin_wordmark_small_input')\" /></td></tr>");

            // Add line for filename
            Output.WriteLine("          <tr><td><label for=\"admin_wordmark_file\">Image File:</label></td><td><input class=\"admin_wordmark_medium_input\" name=\"admin_wordmark_file\" id=\"admin_wordmark_file\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('admin_wordmark_file', 'admin_wordmark_medium_input_focused')\" onblur=\"javascript:textbox_leave('admin_wordmark_file', 'admin_wordmark_medium_input')\" /></td></tr>");

            // Add line for title
            Output.WriteLine("          <tr><td><label for=\"admin_wordmark_title\">Title:</label></td><td><input class=\"admin_wordmark_large_input\" name=\"admin_wordmark_title\" id=\"admin_wordmark_title\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('admin_wordmark_title', 'admin_wordmark_large_input_focused')\" onblur=\"javascript:textbox_leave('admin_wordmark_title', 'admin_wordmark_large_input')\" /></td></tr>");

            // Add line for banner link
            Output.WriteLine("          <tr><td><label for=\"admin_wordmark_link\">Link:</label></td><td><input class=\"admin_wordmark_large_input\" name=\"admin_wordmark_link\" id=\"admin_wordmark_link\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('admin_wordmark_link', 'admin_wordmark_large_input_focused')\" onblur=\"javascript:textbox_leave('admin_wordmark_link', 'admin_wordmark_large_input')\" /></td></tr>");

            Output.WriteLine("        </table>");
            Output.WriteLine("        <br />");
            Output.WriteLine("        <center><input type=\"image\" src=\"" + currentMode.Base_URL + "design/skins/" + currentMode.Base_Skin + "/buttons/save_button.gif\" value=\"Submit\" alt=\"Submit\" onclick=\"return save_new_wordmark();\"/></center>");
            Output.WriteLine("      </div>");
            Output.WriteLine("    </blockquote>");
            Output.WriteLine("    <br />");

            Output.WriteLine("  <span class=\"SobekAdminTitle\">Existing Wordmarks / Icons</span>");

            // Get the list of all wordmarks
            Dictionary <string, Wordmark_Icon> wordmarks = new Dictionary <string, Wordmark_Icon>();

            SobekCM_Database.Populate_Icon_List(wordmarks, Tracer);

            Output.WriteLine("<table border=\"0px\" cellspacing=\"0px\" width=\"100%\" class=\"statsTable\">");
            Output.WriteLine("  <tr><td bgcolor=\"#e7e7e7\" colspan=\"4\"></td></tr>");
            Output.WriteLine("  <tr align=\"center\" valign=\"bottom\" >");

            int current_column = 0;
            SortedList <string, Wordmark_Icon> sortedIcons = new SortedList <string, Wordmark_Icon>();

            foreach (Wordmark_Icon thisIcon in wordmarks.Values)
            {
                sortedIcons.Add(thisIcon.Code, thisIcon);
            }

            foreach (Wordmark_Icon thisIcon in sortedIcons.Values)
            {
                Output.Write("    <td width=\"200px\">");
                if (thisIcon.Link.Length > 0)
                {
                    Output.Write("<a href=\"" + thisIcon.Link + "\" target=\"_blank\">");
                }
                Output.Write("<img border=\"0px\" class=\"UfdcItemWorkdmark\" src=\"" + currentMode.Base_URL + "design/wordmarks/" + thisIcon.Image_FileName + "\"");
                if (thisIcon.Title.Length > 0)
                {
                    Output.Write(" title=\"" + thisIcon.Title + "\"");
                }
                Output.Write(" />");
                if (thisIcon.Link.Length > 0)
                {
                    Output.Write("</a>");
                }
                Output.Write("<br /><b>" + thisIcon.Code + "</b>");

                // Build the action links
                Output.Write("<br /><span class=\"SobekAdminActionLink\" >( ");
                Output.Write("<a title=\"Click to edit\" id=\"VIEW_" + thisIcon.Code + "\" href=\"" + currentMode.Base_URL + "l/technical/javascriptrequired\" onclick=\"return wordmark_form_popup('VIEW_" + thisIcon.Code + "', '" + thisIcon.Code + "', '" + thisIcon.Title.Replace("'", "") + "','" + thisIcon.Image_FileName + "','" + thisIcon.Link + "');\">edit</a> | ");
                Output.Write("<a title=\"Click to delete\" href=\"javascript:delete_wordmark('" + thisIcon.Code + "');\">delete</a> )</span>");
                Output.WriteLine("</td>");

                current_column++;

                if (current_column >= 4)
                {
                    Output.WriteLine("  </tr>");
                    Output.WriteLine("  <tr><td bgcolor=\"#e7e7e7\" colspan=\"4\"></td></tr>");
                    Output.WriteLine("  <tr align=\"center\" valign=\"bottom\" >");
                    current_column = 0;
                }
            }

            Output.WriteLine("  <tr><td bgcolor=\"#e7e7e7\" colspan=\"4\"></td></tr>");

            Output.WriteLine("</table>");
            Output.WriteLine("    <br />");
            Output.WriteLine("</div>");
            Output.WriteLine();
        }