/// <summary> Constructor for a new instance of the Wordmarks_AdminViewer class </summary>
        /// <param name="User"> Authenticated user information </param>
        /// <param name="Current_Mode"> Mode / navigation information for the current request</param>
        /// <param name="Tracer">Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <remarks> Postback from editing an existing wordmark, deleting a wordmark, or creating a new wordmark is handled here in the constructor </remarks>
        public Wordmarks_AdminViewer(User_Object User, SobekCM_Navigation_Object Current_Mode, Custom_Tracer Tracer) : base(User)
        {
            Tracer.Add_Trace("Wordmarks_AdminViewer.Constructor", String.Empty);

            // Save the mode and settings  here
            currentMode = Current_Mode;

            // Set action message to nothing to start
            actionMessage = String.Empty;

            // If the user cannot edit this, go back
            if ((user == null) || ((!user.Is_System_Admin) && (!user.Is_Portal_Admin)))
            {
                currentMode.Mode          = Display_Mode_Enum.My_Sobek;
                currentMode.My_Sobek_Type = My_Sobek_Type_Enum.Home;
                currentMode.Redirect();
                return;
            }

            // Get the wordmark directory and ensure it exists
            wordmarkDirectory = HttpContext.Current.Server.MapPath("design/wordmarks");
            if (!Directory.Exists(wordmarkDirectory))
            {
                Directory.CreateDirectory(wordmarkDirectory);
            }

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

            // If this is a postback, handle any events first
            // if (currentMode.isPostBack)
            // {
            try
            {
                // Pull the standard values
                NameValueCollection form = HttpContext.Current.Request.Form;
                if (form["admin_wordmark_code_delete"] != null)
                {
                    string delete_value      = form["admin_wordmark_code_delete"].ToUpper().Trim();
                    string save_value        = form["admin_wordmark_code_tosave"].ToUpper().Trim();
                    string new_wordmark_code = form["admin_wordmark_code"].ToUpper().Trim();

                    // Was this a reset request?
                    if (delete_value.Length > 0)
                    {
                        // If the value to delete does not have a period, then it has no extension,
                        // so this is to delete a USED wordmark which is both a file AND in the database
                        if (delete_value.IndexOf(".") < 0)
                        {
                            Tracer.Add_Trace("Wordmarks_AdminViewer.Constructor", "Delete wordmark '" + delete_value + "' from the database");

                            // Get the wordmark, so we can also delete the file
                            Wordmark_Icon deleteIcon = wordmarks[delete_value];

                            // Delete from the database
                            if (SobekCM_Database.Delete_Icon(delete_value, Tracer))
                            {
                                // Set the deleted wordmark message
                                actionMessage = "Deleted wordmark <i>" + delete_value + "</i>";

                                // Try to delete the file related to this wordmark now
                                if ((deleteIcon != null) && (File.Exists(wordmarkDirectory + "\\" + deleteIcon.Image_FileName)))
                                {
                                    try
                                    {
                                        File.Delete(wordmarkDirectory + "\\" + deleteIcon.Image_FileName);
                                    }
                                    catch (Exception)
                                    {
                                        actionMessage = "Deleted wordmark <i>" + delete_value + "</i> but unable to delete the file <i>" + deleteIcon.Image_FileName + "</i>";
                                    }
                                }

                                // Repull the wordmark list now
                                wordmarks = new Dictionary <string, Wordmark_Icon>();
                                SobekCM_Database.Populate_Icon_List(wordmarks, Tracer);
                            }
                            else
                            {
                                // Report the error
                                if (SobekCM_Database.Last_Exception == null)
                                {
                                    actionMessage = "Unable to delete wordmark <i>" + delete_value + "</i> since it is in use";
                                }
                                else
                                {
                                    actionMessage = "Unknown error while deleting wordmark <i>" + delete_value + "</i>";
                                }
                            }
                        }
                        else
                        {
                            // This is to delete just a file, which presumably is unused by the system
                            // and does not appear in the database
                            // Try to delete the file related to this wordmark now
                            if (File.Exists(wordmarkDirectory + "\\" + delete_value))
                            {
                                try
                                {
                                    File.Delete(wordmarkDirectory + "\\" + delete_value);
                                    actionMessage = "Deleted unused image file <i>" + delete_value + "</i>";
                                }
                                catch (Exception)
                                {
                                    actionMessage = "Unable to delete unused image <i>" + delete_value + "</i>";
                                }
                            }
                        }
                    }
                    else
                    {
                        // Or.. was this a save request
                        if (save_value.Length > 0)
                        {
                            Tracer.Add_Trace("Wordmarks_AdminViewer.Constructor", "Save wordmark '" + save_value + "'");

                            // Was this to save a new interface (from the main page) or edit an existing (from the popup form)?
                            if (save_value == new_wordmark_code)
                            {
                                string new_file  = form["admin_wordmark_file"].Trim();
                                string new_link  = form["admin_wordmark_link"].Trim();
                                string new_title = form["admin_wordmark_title"].Trim();

                                // Save this new wordmark
                                if (SobekCM_Database.Save_Icon(new_wordmark_code, new_file, new_link, new_title, Tracer) > 0)
                                {
                                    actionMessage = "Saved new wordmark <i>" + save_value + "</i>";
                                }
                                else
                                {
                                    actionMessage = "Unable to save new wordmark <i>" + save_value + "</i>";
                                }
                            }
                            else
                            {
                                string edit_file  = form["form_wordmark_file"].Trim();
                                string edit_link  = form["form_wordmark_link"].Trim();
                                string edit_title = form["form_wordmark_title"].Trim();

                                // Save this existing wordmark
                                if (SobekCM_Database.Save_Icon(save_value, edit_file, edit_link, edit_title, Tracer) > 0)
                                {
                                    actionMessage = "Edited existing wordmark <i>" + save_value + "</i>";
                                }
                                else
                                {
                                    actionMessage = "Unable to edit existing wordmark <i>" + save_value + "</i>";
                                }
                            }

                            // Repull the wordmark list now
                            wordmarks = new Dictionary <string, Wordmark_Icon>();
                            SobekCM_Database.Populate_Icon_List(wordmarks, Tracer);
                        }
                    }
                }
            }
            catch (Exception)
            {
                actionMessage = "Unknown error caught while handing request.";
            }
            //}

            // Get the list of wordmarks in the directory
            string[] allFiles = SobekCM_File_Utilities.GetFiles(wordmarkDirectory, "*.jpg|*.jpeg|*.png|*.gif|*.bmp");
            loweredFiles = allFiles.Select(ThisFileName => new FileInfo(ThisFileName)).Select(ThisFileInfo => ThisFileInfo.Name.ToLower()).ToList();
            loweredFiles.Sort();

            // Get the list of all assigned wordmark files
            foreach (Wordmark_Icon thisWordmark in wordmarks.Values)
            {
                if (loweredFiles.Contains(thisWordmark.Image_FileName.ToLower()))
                {
                    loweredFiles.Remove(thisWordmark.Image_FileName.ToLower());
                }
            }
        }
Example #2
0
        /// <summary> Verifies that each global object is built and builds them upon request </summary>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
        /// <param name="Reload_All"> Flag indicates if everything should be reloaded/repopulated</param>
        /// <param name="Skins"> [REF] Collection of all the web skins </param>
        /// <param name="Translator"> [REF] Language support object which handles simple translational duties </param>
        /// <param name="Code_Manager"> [REF] List of valid collection codes, including mapping from the Sobek collections to Greenstone collections</param>
        /// <param name="All_Items_Lookup"> [REF] Lookup object used to pull basic information about any item loaded into this library </param>
        /// <param name="Icon_Dictionary"> [REF] Dictionary of information about every wordmark/icon in this digital library </param>
        /// <param name="Stats_Date_Range"> [REF] Object contains the start and end dates for the statistical data in the database </param>
        /// <param name="Thematic_Headings"> [REF] Headings under which all the highlighted collections on the main home page are organized </param>
        /// <param name="Aggregation_Aliases"> [REF] List of all existing aliases for existing aggregations </param>
        /// <param name="IP_Restrictions"> [REF] List of all IP Restriction ranges in use by this digital library </param>
        /// <param name="URL_Portals"> [REF] List of all web portals into this system </param>
        /// <param name="Mime_Types">[REF] Dictionary of MIME types by extension</param>
        public static void Build_Application_State(Custom_Tracer Tracer, bool Reload_All,
                                                   ref SobekCM_Skin_Collection Skins, ref Language_Support_Info Translator,
                                                   ref Aggregation_Code_Manager Code_Manager, ref Item_Lookup_Object All_Items_Lookup,
                                                   ref Dictionary <string, Wordmark_Icon> Icon_Dictionary,
                                                   ref Statistics_Dates Stats_Date_Range,
                                                   ref List <Thematic_Heading> Thematic_Headings,
                                                   ref Dictionary <string, string> Aggregation_Aliases,
                                                   ref IP_Restriction_Ranges IP_Restrictions,
                                                   ref Portal_List URL_Portals,
                                                   ref Dictionary <string, Mime_Type_Info> Mime_Types)
        {
            // Should we reload the data from the exteral configuraiton file?
            if (Reload_All)
            {
                SobekCM_Library_Settings.Read_Configuration_File();
                SobekCM_Database.Connection_String = SobekCM_Library_Settings.Database_Connection_String;
                SobekCM_Library_Settings.Refresh(SobekCM_Database.Get_Settings_Complete(null));
            }

            // If there is no database connection string, there is a problem
            if (String.IsNullOrEmpty(SobekCM_Library_Settings.Database_Connection_String))
            {
                throw new ApplicationException("Missing database connection string!");
            }

            // Set the database connection strings
            Resource_Object.Database.SobekCM_Database.Connection_String = SobekCM_Library_Settings.Database_Connection_String;
            SobekCM_Database.Connection_String = SobekCM_Library_Settings.Database_Connection_String;

            // Set the workflow and disposition types
            if ((SobekCM_Library_Settings.Need_Workflow_And_Disposition_Types) || (Reload_All))
            {
                SobekCM_Library_Settings.Set_Workflow_And_Disposition_Types(SobekCM_Database.All_WorkFlow_Types, SobekCM_Database.All_Possible_Disposition_Types);
            }

            // Set the metadata types
            if ((SobekCM_Library_Settings.Need_Metadata_Types) || (Reload_All))
            {
                SobekCM_Library_Settings.Set_Metadata_Types(SobekCM_Database.Get_Metadata_Fields(null));
            }

            // Set the search stop words
            if ((SobekCM_Library_Settings.Need_Search_Stop_Words) || (Reload_All))
            {
                SobekCM_Library_Settings.Search_Stop_Words = SobekCM_Database.Search_Stop_Words(Tracer);
            }

            // Check the list of thematic headings
            if ((Thematic_Headings == null) || (Reload_All))
            {
                if (Thematic_Headings != null)
                {
                    lock (Thematic_Headings)
                    {
                        if (!SobekCM_Database.Populate_Thematic_Headings(Thematic_Headings, Tracer))
                        {
                            Thematic_Headings = null;
                            throw SobekCM_Database.Last_Exception;
                        }
                    }
                }
                else
                {
                    Thematic_Headings = new List <Thematic_Heading>();
                    if (!SobekCM_Database.Populate_Thematic_Headings(Thematic_Headings, Tracer))
                    {
                        Thematic_Headings = null;
                        throw SobekCM_Database.Last_Exception;
                    }
                }
            }

            // Check the list of forwardings
            if ((Aggregation_Aliases == null) || (Reload_All))
            {
                if (Aggregation_Aliases != null)
                {
                    lock (Aggregation_Aliases)
                    {
                        SobekCM_Database.Populate_Aggregation_Aliases(Aggregation_Aliases, Tracer);
                    }
                }
                else
                {
                    Aggregation_Aliases = new Dictionary <string, string>();
                    SobekCM_Database.Populate_Aggregation_Aliases(Aggregation_Aliases, Tracer);
                }
            }

            // Check the list of constant skins
            if ((Skins == null) || (Skins.Count == 0) || (Reload_All))
            {
                if (Skins != null)
                {
                    lock (Skins)
                    {
                        SobekCM_Skin_Collection_Builder.Populate_Default_Skins(Skins, Tracer);
                    }
                }
                else
                {
                    Skins = new SobekCM_Skin_Collection();
                    SobekCM_Skin_Collection_Builder.Populate_Default_Skins(Skins, Tracer);
                }
            }

            // Check the list of all web portals
            if ((URL_Portals == null) || (URL_Portals.Count == 0) || (Reload_All))
            {
                if (URL_Portals != null)
                {
                    lock (URL_Portals)
                    {
                        SobekCM_Database.Populate_URL_Portals(URL_Portals, Tracer);
                    }
                }
                else
                {
                    URL_Portals = new Portal_List();
                    SobekCM_Database.Populate_URL_Portals(URL_Portals, Tracer);
                }
            }

            // Check the translation table has been loaded
            if ((Translator == null) || (Reload_All))
            {
                // Get the translation hashes into memory
                if (Translator != null)
                {
                    lock (Translator)
                    {
                        SobekCM_Database.Populate_Translations(Translator, Tracer);
                    }
                }
                else
                {
                    Translator = new Language_Support_Info();
                    SobekCM_Database.Populate_Translations(Translator, Tracer);
                }
            }

            // Check that the conversion from SobekCM Codes to Greenstone Codes has been loaded
            if ((Code_Manager == null) || (Reload_All))
            {
                if (Code_Manager != null)
                {
                    lock (Code_Manager)
                    {
                        SobekCM_Database.Populate_Code_Manager(Code_Manager, Tracer);
                    }
                }
                else
                {
                    Code_Manager = new Aggregation_Code_Manager();
                    SobekCM_Database.Populate_Code_Manager(Code_Manager, Tracer);
                }
            }

            // Check the statistics date range information
            if ((Stats_Date_Range == null) || (Reload_All))
            {
                if (Stats_Date_Range != null)
                {
                    // Get the translation hashes into memory
                    lock (Stats_Date_Range)
                    {
                        SobekCM_Database.Populate_Statistics_Dates(Stats_Date_Range, Tracer);
                    }
                }
                else
                {
                    Stats_Date_Range = new Statistics_Dates();
                    SobekCM_Database.Populate_Statistics_Dates(Stats_Date_Range, Tracer);
                }
            }

            // Get the Icon list
            if ((Icon_Dictionary == null) || (Reload_All))
            {
                if (Icon_Dictionary != null)
                {
                    // Get the translation hashes into memory
                    lock (Icon_Dictionary)
                    {
                        SobekCM_Database.Populate_Icon_List(Icon_Dictionary, Tracer);
                    }
                }
                else
                {
                    Icon_Dictionary = new Dictionary <string, Wordmark_Icon>();
                    SobekCM_Database.Populate_Icon_List(Icon_Dictionary, Tracer);
                }
            }

            // Check the list of ip range restrictions
            if ((IP_Restrictions == null) || (Reload_All))
            {
                if (IP_Restrictions != null)
                {
                    lock (IP_Restrictions)
                    {
                        DataTable ipRestrictionTbl = SobekCM_Database.Get_IP_Restriction_Ranges(Tracer);
                        if (ipRestrictionTbl != null)
                        {
                            IP_Restrictions.Populate_IP_Ranges(ipRestrictionTbl);
                        }
                    }
                }
                else
                {
                    DataTable ipRestrictionTbl = SobekCM_Database.Get_IP_Restriction_Ranges(Tracer);
                    if (ipRestrictionTbl != null)
                    {
                        IP_Restrictions = new IP_Restriction_Ranges();
                        IP_Restrictions.Populate_IP_Ranges(ipRestrictionTbl);
                    }
                }
            }


            // Get the MIME type list
            if ((Mime_Types == null) || (Reload_All))
            {
                if (Mime_Types != null)
                {
                    // Get the translation hashes into memory
                    lock (Mime_Types)
                    {
                        SobekCM_Database.Populate_MIME_List(Mime_Types, Tracer);
                    }
                }
                else
                {
                    Mime_Types = new Dictionary <string, Mime_Type_Info>();
                    SobekCM_Database.Populate_MIME_List(Mime_Types, Tracer);
                }
            }
        }
Example #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("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();
        }