/// <summary> Add the HTML to be displayed below the search box </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 writes the HTML from the static browse or info page here </remarks> public override void Add_Secondary_HTML(TextWriter Output, Custom_Tracer Tracer) { if (Tracer != null) { Tracer.Add_Trace("Static_Browse_Info_AggregationViewer.Add_Secondary_HTML", "Adding HTML"); } Output.WriteLine("<div class=\"SobekResultsPanel\" align=\"center\">"); // Get the adjusted text for this user's session string static_browse_info_text = staticWebContent.Apply_Settings_To_Static_Text(staticWebContent.Static_Text, currentCollection, htmlSkin.Skin_Code, htmlSkin.Base_Skin_Code, currentMode.Base_URL, currentMode.URL_Options(), Tracer); //Output this static, adjusted text Output.WriteLine(static_browse_info_text); Output.WriteLine("</div>"); Output.WriteLine("<br />"); Output.WriteLine(); }
/// <summary> Add the HTML to be displayed below the search box </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 writes the HTML from the static browse or info page here </remarks> public override void Add_Secondary_HTML(TextWriter Output, Custom_Tracer Tracer) { if (Tracer != null) { Tracer.Add_Trace("Static_Browse_Info_AggregationViewer.Add_Secondary_HTML", "Adding HTML"); } // Get the adjusted text for this user's session string static_browse_info_text = staticWebContent.Apply_Settings_To_Static_Text(staticWebContent.Static_Text, currentCollection, htmlSkin.Skin_Code, htmlSkin.Base_Skin_Code, currentMode.Base_URL, currentMode.URL_Options(), Tracer); bool isAdmin = (currentUser != null) && (currentUser.Is_Aggregation_Admin(currentCollection.Code)); if ((currentMode.Aggregation_Type == Aggregation_Type_Enum.Child_Page_Edit) && (isAdmin)) { const string TITLE_HELP = "Help for the title place holder"; const string AUTHOR_HELP = "Help for the author place holder"; const string DATE_HELP = "Help for the date place holder"; const string DESCRIPTION_HELP = "Help for the description place holder"; const string KEYWORDS_HELP = "Help for the keywords place holder"; const string EXTRA_HEAD_HELP = "Help for the extra head place holder"; string post_url = HttpUtility.HtmlEncode(HttpContext.Current.Items["Original_URL"].ToString()); Output.WriteLine("<form name=\"home_edit_form\" method=\"post\" action=\"" + post_url + "\" id=\"addedForm\" >"); Output.WriteLine(" <a href=\"\" onclick=\"return show_header_info()\" id=\"sbkSbia_HeaderInfoDivShowLink\">show header data (advanced)</a><br />"); Output.WriteLine(" <div id=\"sbkSbia_HeaderInfoDiv\" style=\"display:none;\">"); Output.WriteLine(" <div style=\"font-style:italic; padding:0 5px 5px 5px; text-align:left;\">The data below describes the content of this static child page and is used by some search engine indexing algorithms. By default, it will not show in text of the page, but will be included in the head tag of the page.</div>"); Output.WriteLine(" <table id=\"sbkSbia_HeaderTable\">"); Output.WriteLine(" <tr>"); Output.WriteLine(" <td style=\"width:50px\"> </td>"); Output.WriteLine(" <td class=\"sbkSbia_HeaderTableLabel\"><label for=\"admin_childpage_title\">Title:</label></td>"); Output.WriteLine(" <td><input class=\"sbkSbia_HeaderInput sbk_Focusable\" name=\"admin_childpage_title\" id=\"admin_childpage_title\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(staticWebContent.Title) + "\" /></td>"); Output.WriteLine(" <td><img class=\"sbkSbia_HelpButton\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + TITLE_HELP + "');\" title=\"" + TITLE_HELP + "\" /></td>"); Output.WriteLine(" </tr>"); Output.WriteLine(" <tr>"); Output.WriteLine(" <td> </td>"); Output.WriteLine(" <td class=\"sbkSbia_HeaderTableLabel\"><label for=\"admin_childpage_author\">Author:</label></td>"); Output.WriteLine(" <td><input class=\"sbkSbia_HeaderInput sbk_Focusable\" name=\"admin_childpage_author\" id=\"admin_childpage_author\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(staticWebContent.Author) + "\" /></td>"); Output.WriteLine(" <td><img class=\"sbkSbia_HelpButton\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + AUTHOR_HELP + "');\" title=\"" + AUTHOR_HELP + "\" /></td>"); Output.WriteLine(" </tr>"); Output.WriteLine(" <tr>"); Output.WriteLine(" <td> </td>"); Output.WriteLine(" <td class=\"sbkSbia_HeaderTableLabel\"><label for=\"admin_childpage_date\">Date:</label></td>"); Output.WriteLine(" <td><input class=\"sbkSbia_HeaderInput sbk_Focusable\" name=\"admin_childpage_date\" id=\"admin_childpage_date\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(staticWebContent.Date) + "\" /></td>"); Output.WriteLine(" <td><img class=\"sbkSbia_HelpButton\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + DATE_HELP + "');\" title=\"" + DATE_HELP + "\" /></td>"); Output.WriteLine(" </tr>"); Output.WriteLine(" <tr>"); Output.WriteLine(" <td> </td>"); Output.WriteLine(" <td class=\"sbkSbia_HeaderTableLabel\"><label for=\"admin_childpage_description\">Description:</label></td>"); Output.WriteLine(" <td><input class=\"sbkSbia_HeaderInput sbk_Focusable\" name=\"admin_childpage_description\" id=\"admin_childpage_description\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(staticWebContent.Description) + "\" /></td>"); Output.WriteLine(" <td><img class=\"sbkSbia_HelpButton\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + DESCRIPTION_HELP + "');\" title=\"" + DESCRIPTION_HELP + "\" /></td>"); Output.WriteLine(" </tr>"); Output.WriteLine(" <tr>"); Output.WriteLine(" <td> </td>"); Output.WriteLine(" <td class=\"sbkSbia_HeaderTableLabel\"><label for=\"admin_childpage_keywords\">Keywords:</label></td>"); Output.WriteLine(" <td><input class=\"sbkSbia_HeaderInput sbk_Focusable\" name=\"admin_childpage_keywords\" id=\"admin_childpage_keywords\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(staticWebContent.Keywords) + "\" /></td>"); Output.WriteLine(" <td><img class=\"sbkSbia_HelpButton\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + KEYWORDS_HELP + "');\" title=\"" + KEYWORDS_HELP + "\" /></td>"); Output.WriteLine(" </tr>"); Output.WriteLine(" <tr style=\"vertical-align:top;\">"); Output.WriteLine(" <td> </td>"); Output.WriteLine(" <td class=\"sbkSbia_HeaderTableLabel\" style=\"padding-top:5px\"><label for=\"admin_childpage_extrahead\">HTML Head Info:</label></td>"); Output.WriteLine(" <td><textarea rows=\"3\" class=\"sbkSbia_HeaderTextArea sbk_Focusable\" name=\"admin_childpage_extrahead\" id=\"admin_childpage_extrahead\" type=\"text\">" + HttpUtility.HtmlEncode(staticWebContent.Extra_Head_Info) + "</textarea></td>"); Output.WriteLine(" <td><img class=\"sbkSbia_HelpButton\" src=\"" + currentMode.Base_URL + "default/images/help_button.jpg\" onclick=\"alert('" + EXTRA_HEAD_HELP + "');\" title=\"" + EXTRA_HEAD_HELP + "\" /></td>"); Output.WriteLine(" </tr>"); Output.WriteLine(" </table>"); Output.WriteLine(" <br />"); Output.WriteLine(" </div>"); Output.WriteLine(" <textarea id=\"sbkSbia_ChildTextEdit\" name=\"sbkSbia_ChildTextEdit\" >"); Output.WriteLine(static_browse_info_text); Output.WriteLine(" </textarea>"); Output.WriteLine(); Output.WriteLine(" <div id=\"sbkSbia_TextEditButtons\">"); currentMode.Aggregation_Type = Aggregation_Type_Enum.Browse_Info; if (browseObject.Browse_Type == Item_Aggregation_Child_Page.Visibility_Type.METADATA_BROWSE_BY) { currentMode.Aggregation_Type = Aggregation_Type_Enum.Browse_By; } Output.WriteLine(" <button title=\"Do not apply changes\" class=\"roundbutton\" onclick=\"window.location.href='" + currentMode.Redirect_URL() + "';return false;\"><img src=\"" + currentMode.Base_URL + "default/images/button_previous_arrow.png\" class=\"roundbutton_img_left\" alt=\"\" /> CANCEL</button> "); Output.WriteLine(" <button title=\"Save changes to this child page text\" class=\"roundbutton\" type=\"submit\">SAVE <img src=\"" + currentMode.Base_URL + "default/images/button_next_arrow.png\" class=\"roundbutton_img_right\" alt=\"\" /></button>"); Output.WriteLine(" </div>"); Output.WriteLine("</form>"); Output.WriteLine("<br /><br />"); Output.WriteLine(); } else { Aggregation_Type_Enum aggrType = currentMode.Aggregation_Type; // Output the adjusted home html if (isAdmin) { Output.WriteLine("<div id=\"sbkSbia_MainTextEditable\">"); Output.WriteLine(static_browse_info_text); currentMode.Aggregation_Type = Aggregation_Type_Enum.Child_Page_Edit; Output.WriteLine(" <div id=\"sbkSbia_EditableTextLink\"><a href=\"" + currentMode.Redirect_URL() + "\" title=\"Edit this home text\"><img src=\"" + currentMode.Base_URL + "default/images/edit.gif\" alt=\"\" />edit content</a></div>"); currentMode.Aggregation_Type = aggrType; Output.WriteLine("</div>"); Output.WriteLine(); Output.WriteLine("<script>"); Output.WriteLine(" $(\"#sbkSbia_MainTextEditable\").mouseover(function() { $(\"#sbkSbia_EditableTextLink\").css(\"display\",\"inline-block\"); });"); Output.WriteLine(" $(\"#sbkSbia_MainTextEditable\").mouseout(function() { $(\"#sbkSbia_EditableTextLink\").css(\"display\",\"none\"); });"); Output.WriteLine("</script>"); Output.WriteLine(); } else { Output.WriteLine("<div id=\"sbkSbia_MainText\">"); Output.WriteLine(static_browse_info_text); Output.WriteLine("</div>"); } } Output.WriteLine("<br />"); Output.WriteLine(); }
/// <summary> Add the HTML to be displayed below the search box </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 writes the HTML from the static browse or info page here </remarks> public override void Add_Secondary_HTML(TextWriter Output, Custom_Tracer Tracer) { if (Tracer != null) { Tracer.Add_Trace("Metadata_Browse_AggregationViewer.Add_Secondary_HTML", "Adding HTML"); } // Get collection of (public) browse bys linked to this aggregation ReadOnlyCollection <Item_Aggregation_Child_Page> public_browses = currentCollection.Browse_By_Pages(currentMode.Language); // Determine if this is an internal user and create list of internal user browses List <string> internal_browses = new List <string>(); if ((currentUser != null) && ((currentUser.Is_Internal_User) || (currentUser.Is_Aggregation_Curator(currentMode.Aggregation)))) { // Just add every metadata field here foreach (Metadata_Search_Field field in SobekCM_Library_Settings.All_Metadata_Fields) { if ((field.Web_Code.Length > 0) && (currentCollection.Browseable_Fields.Contains(field.ID))) { internal_browses.Add(field.Display_Term); } } } // Retain the original short code (or the first public code) string original_browse_mode = currentMode.Info_Browse_Mode.ToLower(); // Get any paging URL and retain original page int current_page = currentMode.Page; currentMode.Page = 1; string page_url = currentMode.Redirect_URL(false); string url_options = currentMode.URL_Options(); if (url_options.Length > 0) { url_options = "?" + url_options.Replace("&", "&"); } if ((public_browses.Count > 1) || (internal_browses.Count > 0)) { Output.WriteLine("<table>"); Output.WriteLine("<tr style=\"vertical-align:top;\">"); Output.WriteLine("<td id=\"sbkMebv_FacetOuterColumn\">"); Output.WriteLine("<div class=\"sbkMebv_FacetColumn\">"); Output.WriteLine("<div class=\"sbkMebv_FacetColumnTitle\">BROWSE BY:</div>"); Output.WriteLine("<br />"); if (public_browses.Count > 0) { // Sort these by title SortedList <string, Item_Aggregation_Child_Page> sortedBrowses = new SortedList <string, Item_Aggregation_Child_Page>(); foreach (Item_Aggregation_Child_Page thisBrowse in public_browses) { if (thisBrowse.Source == Item_Aggregation_Child_Page.Source_Type.Static_HTML) { sortedBrowses[thisBrowse.Code.ToLower()] = thisBrowse; } else { Metadata_Search_Field facetField = SobekCM_Library_Settings.Metadata_Search_Field_By_Name(thisBrowse.Code); if (facetField != null) { string facetName = facetField.Display_Term; if (internal_browses.Contains(facetName)) { internal_browses.Remove(facetName); } sortedBrowses[facetName.ToLower()] = thisBrowse; } } } Output.WriteLine(internal_browses.Count > 0 ? "<b> Public Browses</b><br />" : "<b> Browses</b><br />"); Output.WriteLine("<div class=\"sbkMebv_FacetBox\">"); foreach (Item_Aggregation_Child_Page thisBrowse in sortedBrowses.Values) { // Static HTML or metadata browse by? if (thisBrowse.Source == Item_Aggregation_Child_Page.Source_Type.Static_HTML) { if (original_browse_mode != thisBrowse.Code) { currentMode.Info_Browse_Mode = thisBrowse.Code; Output.WriteLine("<a href=\"" + currentMode.Redirect_URL().Replace("&", "&") + "\">" + thisBrowse.Get_Label(currentMode.Language) + "</a><br />"); } else { Output.WriteLine(thisBrowse.Get_Label(currentMode.Language) + "<br />"); } } else { Metadata_Search_Field facetField = SobekCM_Library_Settings.Metadata_Search_Field_By_Display_Name(thisBrowse.Code); if (thisBrowse.Code.ToLower().Replace("_", " ") != original_browse_mode.Replace("_", " ")) { currentMode.Info_Browse_Mode = thisBrowse.Code.ToLower().Replace(" ", "_"); Output.WriteLine("<a href=\"" + currentMode.Redirect_URL().Replace("&", "&") + "\">" + facetField.Display_Term + "</a><br />"); } else { Output.WriteLine(facetField.Display_Term + "<br />"); } } } Output.WriteLine("</div>"); Output.WriteLine("<br />"); } if (internal_browses.Count > 0) { Output.WriteLine("<b> Internal Browses</b><br />"); Output.WriteLine("<div class=\"sbkMebv_FacetBox\">"); foreach (string thisShort in internal_browses) { Metadata_Search_Field facetField = SobekCM_Library_Settings.Metadata_Search_Field_By_Facet_Name(thisShort); if (facetField != null) { if (thisShort.ToLower() != original_browse_mode) { currentMode.Info_Browse_Mode = thisShort.ToLower().Replace(" ", "_"); Output.WriteLine("<a href=\"" + currentMode.Redirect_URL().Replace("&", "&") + "\">" + facetField.Display_Term + "</a><br />"); } else { Output.WriteLine(facetField.Display_Term + "<br />"); } } } Output.WriteLine("</div>"); Output.WriteLine("<br />"); } Output.WriteLine("<br />"); Output.WriteLine("<br />"); Output.WriteLine("<br />"); Output.WriteLine("<br />"); Output.WriteLine("<br />"); Output.WriteLine("</div>"); Output.WriteLine("</td>"); Output.WriteLine("<td>"); } Output.WriteLine("<div class=\"sbkMebv_ResultsPanel\">"); currentMode.Info_Browse_Mode = original_browse_mode; // Was this static or metadata browse by? if ((browseObject != null) && (browseObject.Source == Item_Aggregation_Child_Page.Source_Type.Static_HTML)) { // Read the content file for this browse HTML_Based_Content staticBrowseContent = browseObject.Get_Static_Content(currentMode.Language, currentMode.Base_URL, SobekCM_Library_Settings.Base_Design_Location + currentCollection.ObjDirectory, Tracer); // Apply current user settings for this string browseInfoDisplayText = staticBrowseContent.Apply_Settings_To_Static_Text(staticBrowseContent.Static_Text, currentCollection, htmlSkin.Skin_Code, htmlSkin.Base_Skin_Code, currentMode.Base_URL, currentMode.URL_Options(), Tracer); // Add this to the output stream Output.WriteLine(browseInfoDisplayText); } else { //Output the results if ((results != null) && (results.Count > 0)) { // Determine which letters appear List <char> letters_appearing = new List <char>(); char last_char = '\n'; if (results.Count > 100) { foreach (string thisValue in results) { if (thisValue.Length > 0) { char this_first_char = Char.ToLower(thisValue[0]); int ascii = this_first_char; if (ascii < 97) { this_first_char = 'a'; } if (ascii > 122) { this_first_char = 'z'; } if (this_first_char != last_char) { if (!letters_appearing.Contains(this_first_char)) { letters_appearing.Add(this_first_char); } last_char = this_first_char; } } } } // Get the search URL currentMode.Mode = Display_Mode_Enum.Results; currentMode.Search_Precision = Search_Precision_Type_Enum.Exact_Match; currentMode.Search_Type = Search_Type_Enum.Advanced; Metadata_Search_Field facetField = SobekCM_Library_Settings.Metadata_Search_Field_By_Display_Name(original_browse_mode); currentMode.Search_Fields = facetField.Web_Code; currentMode.Search_String = "\"<%TERM%>\""; string search_url = currentMode.Redirect_URL(); Output.WriteLine("<br />"); if (results.Count < 100) { foreach (string thisResult in results) { Output.WriteLine("<a href=\"" + search_url.Replace("%3c%25TERM%25%3e", thisResult.Trim().Replace(",", "%2C").Replace("&", "%26").Replace("\"", "%22").Replace("&", "&")) + "\">" + thisResult.Replace("\"", """).Replace("&", "&") + "</a><br />"); } } else if (results.Count < 500) { // Determine the actual page first int first_valid_page = -1; if ((letters_appearing.Contains('a')) || (letters_appearing.Contains('b'))) { first_valid_page = 1; } if ((letters_appearing.Contains('c')) || (letters_appearing.Contains('d')) || (letters_appearing.Contains('e'))) { if (first_valid_page < 0) { first_valid_page = 2; } } if ((letters_appearing.Contains('f')) || (letters_appearing.Contains('g')) || (letters_appearing.Contains('h'))) { if (first_valid_page < 0) { first_valid_page = 3; } } if ((letters_appearing.Contains('i')) || (letters_appearing.Contains('j')) || (letters_appearing.Contains('k'))) { if (first_valid_page < 0) { first_valid_page = 4; } } if ((letters_appearing.Contains('l')) || (letters_appearing.Contains('m')) || (letters_appearing.Contains('n'))) { if (first_valid_page < 0) { first_valid_page = 5; } } if ((letters_appearing.Contains('o')) || (letters_appearing.Contains('p')) || (letters_appearing.Contains('q'))) { if (first_valid_page < 0) { first_valid_page = 6; } } if ((letters_appearing.Contains('r')) || (letters_appearing.Contains('s')) || (letters_appearing.Contains('t'))) { if (first_valid_page < 0) { first_valid_page = 7; } } if ((letters_appearing.Contains('u')) || (letters_appearing.Contains('v')) || (letters_appearing.Contains('w'))) { if (first_valid_page < 0) { first_valid_page = 8; } } if ((letters_appearing.Contains('x')) || (letters_appearing.Contains('y')) || (letters_appearing.Contains('z'))) { if (first_valid_page < 0) { first_valid_page = 9; } } // Define the limits of the page value if ((current_page < first_valid_page) || (current_page > 9)) { current_page = first_valid_page; } // Add the links for paging through results Output.WriteLine("<div class=\"sbkMebv_NavRow\">"); if ((letters_appearing.Contains('a')) || (letters_appearing.Contains('b'))) { if (current_page == 1) { Output.WriteLine("<span class=\"sbkMebv_NavRowCurrent\">AB</span> "); } else { Output.WriteLine("<a href=\"" + page_url + "/1" + url_options + "\" class=\"mbb1\">AB</a> "); } } else { Output.WriteLine("<span class=\"sbkMebv_NavRowDisabled\">AB</span> "); } if ((letters_appearing.Contains('c')) || (letters_appearing.Contains('d')) || (letters_appearing.Contains('e'))) { if (current_page == 2) { Output.WriteLine("<span class=\"sbkMebv_NavRowCurrent\">CDE</span> "); } else { Output.WriteLine("<a href=\"" + page_url + "/2" + url_options + "\">CDE</a> "); } } else { Output.WriteLine("<span class=\"sbkMebv_NavRowDisabled\">CDE</span> "); } if ((letters_appearing.Contains('f')) || (letters_appearing.Contains('g')) || (letters_appearing.Contains('h'))) { if (current_page == 3) { Output.WriteLine("<span class=\"sbkMebv_NavRowCurrent\">FGH</span> "); } else { Output.WriteLine("<a href=\"" + page_url + "/3" + url_options + "\">FGH</a> "); } } else { Output.WriteLine("<span class=\"sbkMebv_NavRowDisabled\">FGH</span> "); } if ((letters_appearing.Contains('i')) || (letters_appearing.Contains('j')) || (letters_appearing.Contains('k'))) { if (current_page == 4) { Output.WriteLine("<span class=\"sbkMebv_NavRowCurrent\">IJK</span> "); } else { Output.WriteLine("<a href=\"" + page_url + "/4" + url_options + "\">IJK</a> "); } } else { Output.WriteLine("<span class=\"sbkMebv_NavRowDisabled\">IJK</span> "); } if ((letters_appearing.Contains('l')) || (letters_appearing.Contains('m')) || (letters_appearing.Contains('n'))) { if (current_page == 5) { Output.WriteLine("<span class=\"sbkMebv_NavRowCurrent\">LMN</span> "); } else { Output.WriteLine("<a href=\"" + page_url + "/5" + url_options + "\">LMN</a> "); } } else { Output.WriteLine("<span class=\"sbkMebv_NavRowDisabled\">LMN</span> "); } if ((letters_appearing.Contains('o')) || (letters_appearing.Contains('p')) || (letters_appearing.Contains('q'))) { if (current_page == 6) { Output.WriteLine("<span class=\"sbkMebv_NavRowCurrent\">OPQ</span> "); } else { Output.WriteLine("<a href=\"" + page_url + "/6" + url_options + "\">OPQ</a> "); } } else { Output.WriteLine("<span class=\"sbkMebv_NavRowDisabled\">OPQ</span> "); } if ((letters_appearing.Contains('r')) || (letters_appearing.Contains('s')) || (letters_appearing.Contains('t'))) { if (current_page == 7) { Output.WriteLine("<span class=\"sbkMebv_NavRowCurrent\">RST</span> "); } else { Output.WriteLine("<a href=\"" + page_url + "/7" + url_options + "\">RST</a> "); } } else { Output.WriteLine("<span class=\"sbkMebv_NavRowDisabled\">RST</span> "); } if ((letters_appearing.Contains('u')) || (letters_appearing.Contains('v')) || (letters_appearing.Contains('w'))) { if (current_page == 8) { Output.WriteLine("<span class=\"sbkMebv_NavRowCurrent\">UVW</span> "); } else { Output.WriteLine("<a href=\"" + page_url + "/8" + url_options + "\">UVW</a> "); } } else { Output.WriteLine("<span class=\"sbkMebv_NavRowDisabled\">UVW</span> "); } if ((letters_appearing.Contains('x')) || (letters_appearing.Contains('y')) || (letters_appearing.Contains('z'))) { if (current_page == 9) { Output.WriteLine("<span class=\"sbkMebv_NavRowCurrent\">XYZ</span> "); } else { Output.WriteLine("<a href=\"" + page_url + "/9" + url_options + "\">XYZ</a> "); } } else { Output.WriteLine("<span class=\"sbkMebv_NavRowDisabled\" >XYZ</span> "); } Output.WriteLine("</div>"); Output.WriteLine("<br />"); Output.WriteLine("<br />"); // Find the start character and last character, per the page char first_char = ' '; char stop_char = 'c'; switch (current_page) { case 2: first_char = 'c'; stop_char = 'f'; break; case 3: first_char = 'f'; stop_char = 'i'; break; case 4: first_char = 'i'; stop_char = 'l'; break; case 5: first_char = 'l'; stop_char = 'o'; break; case 6: first_char = 'o'; stop_char = 'r'; break; case 7: first_char = 'r'; stop_char = 'u'; break; case 8: first_char = 'u'; stop_char = 'x'; break; case 9: first_char = 'x'; stop_char = '}'; break; } // Add the pertinent rows foreach (string thisValue in results) { if (thisValue.Length > 0) { char this_first_char = Char.ToLower(thisValue[0]); if ((this_first_char >= first_char) && (this_first_char < stop_char)) { Output.WriteLine("<a href=\"" + search_url.Replace("%3c%25TERM%25%3e", thisValue.Trim().Replace(",", "%2C").Replace("&", "%26").Replace("\"", "%22")).Replace("&", "&") + "\">" + thisValue.Replace("\"", """).Replace("&", "&") + "</a><br />"); } } } } else { // Determine the first valid page char label_char = 'a'; int first_valid_page = -1; int counter = 1; while (label_char <= 'z') { if (letters_appearing.Contains(label_char)) { if (first_valid_page < 0) { first_valid_page = counter; } } counter++; label_char = (char)((label_char) + 1); } // Define the limits of the page value if ((current_page < first_valid_page) || (current_page > 26)) { current_page = first_valid_page; } // Add the links for paging through results label_char = 'a'; counter = 1; Output.WriteLine("<div class=\"sbkMebv_NavRow\">"); while (label_char <= 'z') { if (letters_appearing.Contains(label_char)) { if (current_page == counter) { Output.WriteLine("<span class=\"sbkMebv_NavRowCurrent\">" + Char.ToUpper(label_char) + "</span> "); } else { Output.WriteLine("<a href=\"" + page_url + "/" + counter + url_options + "\" >" + Char.ToUpper(label_char) + "</a> "); } } else { Output.WriteLine("<span class=\"sbkMebv_NavRowDisabled\" >" + Char.ToUpper(label_char) + "</span> "); } counter++; label_char = (char)((label_char) + 1); } Output.WriteLine("</div>"); Output.WriteLine("<br />"); Output.WriteLine("<br />"); // Find the start character and last character, per the page char first_char = ' '; char stop_char = 'b'; if (current_page > 1) { first_char = (char)(96 + current_page); stop_char = (char)(97 + current_page); } // Add the pertinent rows foreach (string thisValue in results) { if (thisValue.Length > 0) { char this_first_char = Char.ToLower(thisValue[0]); if ((this_first_char >= first_char) && (this_first_char < stop_char)) { Output.WriteLine("<a href=\"" + search_url.Replace("%3c%25TERM%25%3e", thisValue.Trim().Replace(",", "%2C").Replace("&", "%26").Replace("\"", "%22")).Replace("&", "&") + "\">" + thisValue.Replace("\"", """).Replace("&", "&") + "</a><br />"); } } } } } else { Output.WriteLine("<br /><br /><br /><br />"); Output.WriteLine(currentMode.Info_Browse_Mode.Length == 0 ? "<center>Select a metadata field to browse by from the list on the left</center>" : "<center>NO MATCHING VALUES</center>"); Output.WriteLine("<br /><br />"); } } // Set the current mode back currentMode.Mode = Display_Mode_Enum.Aggregation; currentMode.Aggregation_Type = Aggregation_Type_Enum.Browse_By; Output.WriteLine("</div>"); Output.WriteLine("<br />"); if ((public_browses.Count > 1) || (internal_browses.Count > 0)) { Output.WriteLine("</td>"); Output.WriteLine("</tr>"); Output.WriteLine("</table>"); } Output.WriteLine(); }