/// <summary> Constructor for a new instance of the Advanced_Search_YearRange_AggregationViewer class </summary> /// <param name="Current_Aggregation"> Current item aggregation object </param> /// <param name="Current_Mode"> Mode / navigation information for the current request</param> public Advanced_Search_YearRange_AggregationViewer(Item_Aggregation Current_Aggregation, SobekCM_Navigation_Object Current_Mode) : base(Current_Aggregation, Current_Mode) { // Compute the redirect stem to use string fields = currentMode.Search_Fields; string searchCollections = currentMode.SubAggregation; Display_Mode_Enum lastMode = currentMode.Mode; Aggregation_Type_Enum aggrType = currentMode.Aggregation_Type; currentMode.SubAggregation = String.Empty; string searchString = currentMode.Search_String; currentMode.Search_String = String.Empty; currentMode.Search_Fields = String.Empty; currentMode.Mode = Display_Mode_Enum.Results; currentMode.Search_Precision = Search_Precision_Type_Enum.Inflectional_Form; string redirectStem = currentMode.Redirect_URL(); currentMode.Search_String = searchString; currentMode.Search_Fields = fields; currentMode.SubAggregation = searchCollections; currentMode.Mode = lastMode; currentMode.Aggregation_Type = aggrType; scriptActionName = "Javascript:advanced_search_years_sobekcm('" + redirectStem + "')"; }
/// <summary> Constructor for a new instance of the Full_Text_Search_AggregationViewer class </summary> /// <param name="RequestSpecificValues"> All the necessary, non-global data specific to the current request </param> /// <param name="ViewBag"> Aggregation-specific request information, such as aggregation object and any browse object requested </param> public Full_Text_Search_AggregationViewer(RequestCache RequestSpecificValues, AggregationViewBag ViewBag) : base(RequestSpecificValues, ViewBag) { // Determine the sub text to use const string SUB_CODE = "s="; // Save the search term if (RequestSpecificValues.Current_Mode.Search_String.Length > 0) { textBoxValue = RequestSpecificValues.Current_Mode.Search_String; } // Determine the complete script action name Display_Mode_Enum displayMode = RequestSpecificValues.Current_Mode.Mode; Search_Type_Enum searchType = RequestSpecificValues.Current_Mode.Search_Type; Aggregation_Type_Enum aggrType = RequestSpecificValues.Current_Mode.Aggregation_Type; RequestSpecificValues.Current_Mode.Mode = Display_Mode_Enum.Results; RequestSpecificValues.Current_Mode.Search_Type = Search_Type_Enum.Full_Text; string search_string = RequestSpecificValues.Current_Mode.Search_String; RequestSpecificValues.Current_Mode.Search_String = String.Empty; RequestSpecificValues.Current_Mode.Search_Fields = String.Empty; RequestSpecificValues.Current_Mode.Search_Precision = Search_Precision_Type_Enum.Inflectional_Form; arg2 = String.Empty; arg1 = UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode); // Get the browse all url, if enabled browse_url = String.Empty; if (ViewBag.Hierarchy_Object.Can_Browse_Items) { RequestSpecificValues.Current_Mode.Mode = Display_Mode_Enum.Aggregation; RequestSpecificValues.Current_Mode.Aggregation_Type = Aggregation_Type_Enum.Browse_Info; RequestSpecificValues.Current_Mode.Info_Browse_Mode = "all"; browse_url = UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode); } RequestSpecificValues.Current_Mode.Mode = Display_Mode_Enum.Search; if ((!RequestSpecificValues.Current_Mode.Show_Selection_Panel.HasValue) || (!RequestSpecificValues.Current_Mode.Show_Selection_Panel.Value) || (ViewBag.Hierarchy_Object.Children_Count == 0)) { Search_Script_Action = "fulltext_search_sobekcm('" + arg1 + "', '" + browse_url + "');"; } else { Search_Script_Action = "fulltext_select_search_sobekcm('" + arg1 + "', '" + SUB_CODE + "')"; arg2 = SUB_CODE; } RequestSpecificValues.Current_Mode.Mode = displayMode; RequestSpecificValues.Current_Mode.Aggregation_Type = aggrType; RequestSpecificValues.Current_Mode.Search_Type = searchType; RequestSpecificValues.Current_Mode.Search_String = search_string; RequestSpecificValues.Current_Mode.Info_Browse_Mode = String.Empty; }
/// <summary> Constructor for a new instance of the Rotating_Highlight_MimeType_AggregationViewer class </summary> /// <param name="RequestSpecificValues"> All the necessary, non-global data specific to the current request </param> /// <param name="ViewBag"> Aggregation-specific request information, such as aggregation object and any browse object requested </param> public Rotating_Highlight_MimeType_AggregationViewer(RequestCache RequestSpecificValues, AggregationViewBag ViewBag) : base(RequestSpecificValues, ViewBag) { // Determine the sub text to use const string SUB_CODE = "s="; Sharing_Buttons_HTML = String.Empty; // Save the search term if (RequestSpecificValues.Current_Mode.Search_String.Length > 0) { textBoxValue = RequestSpecificValues.Current_Mode.Search_String; } // Determine the complete script action name Display_Mode_Enum displayMode = RequestSpecificValues.Current_Mode.Mode; Aggregation_Type_Enum aggrType = RequestSpecificValues.Current_Mode.Aggregation_Type; Search_Type_Enum searchType = RequestSpecificValues.Current_Mode.Search_Type; RequestSpecificValues.Current_Mode.Mode = Display_Mode_Enum.Results; RequestSpecificValues.Current_Mode.Search_Type = Search_Type_Enum.Basic; RequestSpecificValues.Current_Mode.Search_Precision = Search_Precision_Type_Enum.Inflectional_Form; string search_string = RequestSpecificValues.Current_Mode.Search_String; RequestSpecificValues.Current_Mode.Search_String = String.Empty; RequestSpecificValues.Current_Mode.Search_Fields = String.Empty; arg2 = String.Empty; arg1 = UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode); RequestSpecificValues.Current_Mode.Mode = Display_Mode_Enum.Aggregation; RequestSpecificValues.Current_Mode.Aggregation_Type = Aggregation_Type_Enum.Browse_Info; RequestSpecificValues.Current_Mode.Info_Browse_Mode = "all"; browse_url = UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode); RequestSpecificValues.Current_Mode.Info_Browse_Mode = String.Empty; RequestSpecificValues.Current_Mode.Aggregation_Type = Aggregation_Type_Enum.Home; if ((!RequestSpecificValues.Current_Mode.Show_Selection_Panel.HasValue) || (!RequestSpecificValues.Current_Mode.Show_Selection_Panel.Value) || (ViewBag.Hierarchy_Object.Children_Count == 0)) { Search_Script_Action = "basic_search_sobekcm('" + arg1 + "', '" + browse_url + "')"; } else { Search_Script_Action = "basic_select_search_sobekcm('" + arg1 + "', '" + SUB_CODE + "')"; arg2 = SUB_CODE; } RequestSpecificValues.Current_Mode.Mode = displayMode; RequestSpecificValues.Current_Mode.Aggregation_Type = aggrType; RequestSpecificValues.Current_Mode.Search_Type = searchType; RequestSpecificValues.Current_Mode.Search_String = search_string; // Get the front banner frontBannerInfo = ViewBag.Hierarchy_Object.FrontBannerObj; }
/// <summary> Constructor for a new instance of the Newspaper_Search_AggregationViewer class </summary> /// <param name="RequestSpecificValues"> All the necessary, non-global data specific to the current request </param> /// <param name="ViewBag"> Aggregation-specific request information, such as aggregation object and any browse object requested </param> public Newspaper_Search_AggregationViewer(RequestCache RequestSpecificValues, AggregationViewBag ViewBag) : base(RequestSpecificValues, ViewBag) { // Determine the sub text to use const string SUB_CODE = "s="; // Save the search term if (RequestSpecificValues.Current_Mode.Search_String.Length > 0) { textBoxValue = RequestSpecificValues.Current_Mode.Search_String; } // Compute the redirect stem to use string fields = RequestSpecificValues.Current_Mode.Search_Fields; string search_string = RequestSpecificValues.Current_Mode.Search_String; Aggregation_Type_Enum aggrType = RequestSpecificValues.Current_Mode.Aggregation_Type; RequestSpecificValues.Current_Mode.Search_String = String.Empty; RequestSpecificValues.Current_Mode.Search_Fields = String.Empty; RequestSpecificValues.Current_Mode.Home_Type = Home_Type_Enum.List; RequestSpecificValues.Current_Mode.Mode = Display_Mode_Enum.Results; RequestSpecificValues.Current_Mode.Search_Precision = Search_Precision_Type_Enum.Inflectional_Form; string redirect_stem = UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode).Replace("&m=hhh", "").Replace("m=hht", "").Replace("&m=lhh", "").Replace("m=lht", ""); // Get the browse all url, if enabled browse_url = String.Empty; if (ViewBag.Hierarchy_Object.Can_Browse_Items) { RequestSpecificValues.Current_Mode.Mode = Display_Mode_Enum.Aggregation; RequestSpecificValues.Current_Mode.Aggregation_Type = Aggregation_Type_Enum.Browse_Info; RequestSpecificValues.Current_Mode.Info_Browse_Mode = "all"; browse_url = UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode); } RequestSpecificValues.Current_Mode.Search_String = search_string; RequestSpecificValues.Current_Mode.Search_Fields = fields; RequestSpecificValues.Current_Mode.Aggregation_Type = aggrType; RequestSpecificValues.Current_Mode.Info_Browse_Mode = String.Empty; // Write the advanced search box arg2 = String.Empty; arg1 = redirect_stem; if ((ViewBag.Hierarchy_Object.Children_Count > 0) && ((RequestSpecificValues.Current_Mode.Show_Selection_Panel.HasValue) && (RequestSpecificValues.Current_Mode.Show_Selection_Panel.Value))) { Search_Script_Action = "newspaper_select_search_sobekcm('" + arg1 + "', '" + SUB_CODE + "', '" + browse_url + "');"; arg2 = SUB_CODE; } else { Search_Script_Action = "newspaper_search_sobekcm('" + arg1 + "');"; } }
/// <summary> Constructor for a new instance of the Basic_Search_AggregationViewer class </summary> /// <param name="Current_Aggregation"> Current item aggregation object </param> /// <param name="Current_Mode"> Mode / navigation information for the current request</param> public Rotating_Highlight_Search_AggregationViewer(Item_Aggregation Current_Aggregation, SobekCM_Navigation_Object Current_Mode) : base(Current_Aggregation, Current_Mode) { // Determine the sub text to use const string SUB_CODE = "s="; Sharing_Buttons_HTML = String.Empty; // Save the search term if (currentMode.Search_String.Length > 0) { textBoxValue = currentMode.Search_String; } // Determine the complete script action name Display_Mode_Enum displayMode = currentMode.Mode; Aggregation_Type_Enum aggrType = currentMode.Aggregation_Type; Search_Type_Enum searchType = currentMode.Search_Type; currentMode.Mode = Display_Mode_Enum.Results; currentMode.Search_Type = Search_Type_Enum.Basic; currentMode.Search_Precision = Search_Precision_Type_Enum.Inflectional_Form; string search_string = currentMode.Search_String; currentMode.Search_String = String.Empty; currentMode.Search_Fields = String.Empty; arg2 = String.Empty; arg1 = currentMode.Redirect_URL(); currentMode.Aggregation_Type = Aggregation_Type_Enum.Browse_Info; currentMode.Info_Browse_Mode = "all"; browse_url = currentMode.Redirect_URL(); currentMode.Info_Browse_Mode = String.Empty; currentMode.Aggregation_Type = Aggregation_Type_Enum.Home; if ((!currentMode.Show_Selection_Panel) || (Current_Aggregation.Children_Count == 0)) { scriptActionName = "basic_search_sobekcm('" + arg1 + "', '" + browse_url + "')"; } else { scriptActionName = "basic_select_search_sobekcm('" + arg1 + "', '" + SUB_CODE + "')"; arg2 = SUB_CODE; } currentMode.Mode = displayMode; currentMode.Aggregation_Type = aggrType; currentMode.Search_Type = searchType; currentMode.Search_String = search_string; // Get the front banner frontBannerInfo = Current_Aggregation.Front_Banner_Image(currentMode.Language); }
/// <summary> Constructor for a new instance of the Newspaper_Search_AggregationViewer class </summary> /// <param name="Current_Aggregation"> Current item aggregation object </param> /// <param name="Current_Mode"> Mode / navigation information for the current request</param> public Newspaper_Search_AggregationViewer(Item_Aggregation Current_Aggregation, SobekCM_Navigation_Object Current_Mode) : base(Current_Aggregation, Current_Mode) { // Determine the sub text to use const string SUB_CODE = "s="; // Save the search term if (currentMode.Search_String.Length > 0) { textBoxValue = currentMode.Search_String; } // Compute the redirect stem to use string fields = currentMode.Search_Fields; string search_string = currentMode.Search_String; Aggregation_Type_Enum aggrType = currentMode.Aggregation_Type; currentMode.Search_String = String.Empty; currentMode.Search_Fields = String.Empty; currentMode.Home_Type = Home_Type_Enum.List; currentMode.Mode = Display_Mode_Enum.Results; currentMode.Search_Precision = Search_Precision_Type_Enum.Inflectional_Form; string redirect_stem = currentMode.Redirect_URL().Replace("&m=hhh", "").Replace("m=hht", "").Replace("&m=lhh", "").Replace("m=lht", ""); currentMode.Mode = Display_Mode_Enum.Aggregation; currentMode.Aggregation_Type = Aggregation_Type_Enum.Browse_Info; currentMode.Info_Browse_Mode = "all"; browse_url = currentMode.Redirect_URL(); currentMode.Search_String = search_string; currentMode.Search_Fields = fields; currentMode.Aggregation_Type = aggrType; currentMode.Info_Browse_Mode = String.Empty; // Write the advanced search box arg2 = String.Empty; arg1 = redirect_stem; if ((Current_Aggregation.Children_Count > 0) && (currentMode.Show_Selection_Panel)) { scriptActionName = "newspaper_select_search_sobekcm('" + arg1 + "', '" + SUB_CODE + "', '" + browse_url + "');"; arg2 = SUB_CODE; } else { scriptActionName = "newspaper_search_sobekcm('" + arg1 + "');"; } }
/// <summary> Constructor for a new instance of the Full_Text_Search_AggregationViewer class </summary> /// <param name="Current_Aggregation"> Current item aggregation object </param> /// <param name="Current_Mode"> Mode / navigation information for the current request</param> public Full_Text_Search_AggregationViewer(Item_Aggregation Current_Aggregation, SobekCM_Navigation_Object Current_Mode) : base(Current_Aggregation, Current_Mode) { // Determine the sub text to use const string SUB_CODE = "s="; // Save the search term if (currentMode.Search_String.Length > 0) { textBoxValue = currentMode.Search_String; } // Determine the complete script action name Display_Mode_Enum displayMode = currentMode.Mode; Search_Type_Enum searchType = currentMode.Search_Type; Aggregation_Type_Enum aggrType = currentMode.Aggregation_Type; currentMode.Mode = Display_Mode_Enum.Results; currentMode.Search_Type = Search_Type_Enum.Full_Text; string search_string = currentMode.Search_String; currentMode.Search_String = String.Empty; currentMode.Search_Fields = String.Empty; currentMode.Search_Precision = Search_Precision_Type_Enum.Inflectional_Form; arg2 = String.Empty; arg1 = currentMode.Redirect_URL(); currentMode.Mode = Display_Mode_Enum.Aggregation; currentMode.Aggregation_Type = Aggregation_Type_Enum.Browse_Info; currentMode.Info_Browse_Mode = "all"; browse_url = currentMode.Redirect_URL(); currentMode.Mode = Display_Mode_Enum.Search; if ((!currentMode.Show_Selection_Panel) || (Current_Aggregation.Children_Count == 0)) { scriptActionName = "fulltext_search_sobekcm('" + arg1 + "', '" + browse_url + "');"; } else { scriptActionName = "fulltext_select_search_sobekcm('" + arg1 + "', '" + SUB_CODE + "')"; arg2 = SUB_CODE; } currentMode.Mode = displayMode; currentMode.Aggregation_Type = aggrType; currentMode.Search_Type = searchType; currentMode.Search_String = search_string; currentMode.Info_Browse_Mode = String.Empty; }
/// <summary> Constructor for a new instance of the dLOC_Search_AggregationViewer class </summary> /// <param name="RequestSpecificValues"> All the necessary, non-global data specific to the current request </param> /// <param name="ViewBag"> Aggregation-specific request information, such as aggregation object and any browse object requested </param> public dLOC_Search_AggregationViewer(RequestCache RequestSpecificValues, AggregationViewBag ViewBag) : base(RequestSpecificValues, ViewBag) { textBoxValue = String.Empty; if (RequestSpecificValues.Current_Mode.Search_String.Length > 0) { textBoxValue = RequestSpecificValues.Current_Mode.Search_String.Replace(",newspaper", ""); } // Determine the complete script action name Display_Mode_Enum displayMode = RequestSpecificValues.Current_Mode.Mode; Aggregation_Type_Enum aggrType = RequestSpecificValues.Current_Mode.Aggregation_Type; Search_Type_Enum searchType = RequestSpecificValues.Current_Mode.Search_Type; RequestSpecificValues.Current_Mode.Mode = Display_Mode_Enum.Results; RequestSpecificValues.Current_Mode.Search_Type = Search_Type_Enum.Full_Text; string search_string = RequestSpecificValues.Current_Mode.Search_String; RequestSpecificValues.Current_Mode.Search_String = String.Empty; RequestSpecificValues.Current_Mode.Search_Fields = String.Empty; arg2 = String.Empty; RequestSpecificValues.Current_Mode.Search_Precision = Search_Precision_Type_Enum.Inflectional_Form; arg1 = UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode); // Get the browse all url, if enabled browse_url = String.Empty; if (ViewBag.Hierarchy_Object.Can_Browse_Items) { RequestSpecificValues.Current_Mode.Mode = Display_Mode_Enum.Aggregation; RequestSpecificValues.Current_Mode.Aggregation_Type = Aggregation_Type_Enum.Browse_Info; RequestSpecificValues.Current_Mode.Info_Browse_Mode = "all"; browse_url = UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode); } Search_Script_Action = "dloc_search_sobekcm('" + arg1 + "', '" + browse_url + "');"; RequestSpecificValues.Current_Mode.Mode = displayMode; RequestSpecificValues.Current_Mode.Aggregation_Type = aggrType; RequestSpecificValues.Current_Mode.Search_Type = searchType; RequestSpecificValues.Current_Mode.Search_String = search_string; RequestSpecificValues.Current_Mode.Info_Browse_Mode = String.Empty; }
/// <summary> Constructor for a new instance of the Advanced_Search_YearRange_AggregationViewer class </summary> /// <param name="RequestSpecificValues"> All the necessary, non-global data specific to the current request </param> /// <param name="ViewBag"> Aggregation-specific request information, such as aggregation object and any browse object requested </param> public Advanced_Search_YearRange_AggregationViewer(RequestCache RequestSpecificValues, AggregationViewBag ViewBag) : base(RequestSpecificValues, ViewBag) { // Compute the redirect stem to use string fields = RequestSpecificValues.Current_Mode.Search_Fields; string searchCollections = RequestSpecificValues.Current_Mode.SubAggregation; Display_Mode_Enum lastMode = RequestSpecificValues.Current_Mode.Mode; Aggregation_Type_Enum aggrType = RequestSpecificValues.Current_Mode.Aggregation_Type; RequestSpecificValues.Current_Mode.SubAggregation = String.Empty; string searchString = RequestSpecificValues.Current_Mode.Search_String; RequestSpecificValues.Current_Mode.Search_String = String.Empty; RequestSpecificValues.Current_Mode.Search_Fields = String.Empty; RequestSpecificValues.Current_Mode.Mode = Display_Mode_Enum.Results; RequestSpecificValues.Current_Mode.Search_Precision = Search_Precision_Type_Enum.Inflectional_Form; string redirectStem = UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode); // Get the browse all url, if enabled string browse_url = String.Empty; if (ViewBag.Hierarchy_Object.Can_Browse_Items) { RequestSpecificValues.Current_Mode.Mode = Display_Mode_Enum.Aggregation; RequestSpecificValues.Current_Mode.Aggregation_Type = Aggregation_Type_Enum.Browse_Info; RequestSpecificValues.Current_Mode.Info_Browse_Mode = "all"; browse_url = UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode); } RequestSpecificValues.Current_Mode.Search_String = searchString; RequestSpecificValues.Current_Mode.Search_Fields = fields; RequestSpecificValues.Current_Mode.SubAggregation = searchCollections; RequestSpecificValues.Current_Mode.Mode = lastMode; RequestSpecificValues.Current_Mode.Aggregation_Type = aggrType; Search_Script_Action = "advanced_search_years_sobekcm('" + redirectStem + "','" + browse_url + "')"; }
/// <summary> Constructor for a new instance of the dLOC_Search_AggregationViewer class </summary> /// <param name="Current_Aggregation"> Current item aggregation object </param> /// <param name="Current_Mode"> Mode / navigation information for the current request</param> public dLOC_Search_AggregationViewer(Item_Aggregation Current_Aggregation, SobekCM_Navigation_Object Current_Mode) : base(Current_Aggregation, Current_Mode) { textBoxValue = String.Empty; if (currentMode.Search_String.Length > 0) { textBoxValue = currentMode.Search_String.Replace(",newspaper", ""); } // Determine the complete script action name Display_Mode_Enum displayMode = currentMode.Mode; Aggregation_Type_Enum aggrType = currentMode.Aggregation_Type; Search_Type_Enum searchType = currentMode.Search_Type; currentMode.Mode = Display_Mode_Enum.Results; currentMode.Search_Type = Search_Type_Enum.Full_Text; string search_string = currentMode.Search_String; currentMode.Search_String = String.Empty; currentMode.Search_Fields = String.Empty; arg2 = String.Empty; currentMode.Search_Precision = Search_Precision_Type_Enum.Inflectional_Form; arg1 = currentMode.Redirect_URL(); currentMode.Mode = Display_Mode_Enum.Aggregation; currentMode.Aggregation_Type = Aggregation_Type_Enum.Browse_Info; currentMode.Info_Browse_Mode = "all"; browse_url = currentMode.Redirect_URL(); scriptActionName = "dloc_search_sobekcm('" + arg1 + "', '" + browse_url + "');"; currentMode.Mode = displayMode; currentMode.Aggregation_Type = aggrType; currentMode.Search_Type = searchType; currentMode.Search_String = search_string; currentMode.Info_Browse_Mode = String.Empty; }
/// <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 = ViewBag.Hierarchy_Object.Browse_By_Pages; // Determine if this is an internal user and create list of internal user browses List <string> internal_browses = new List <string>(); if ((RequestSpecificValues.Current_User != null) && ((RequestSpecificValues.Current_User.Is_Internal_User) || (RequestSpecificValues.Current_User.Is_Aggregation_Curator(RequestSpecificValues.Current_Mode.Aggregation)))) { // Just add every metadata field here foreach (Item_Aggregation_Metadata_Type field in ViewBag.Hierarchy_Object.Browseable_Fields) { internal_browses.Add(field.DisplayTerm); } } // Retain the original short code (or the first public code) string original_browse_mode = RequestSpecificValues.Current_Mode.Info_Browse_Mode.ToLower(); // Get any paging URL and retain original page int current_page = RequestSpecificValues.Current_Mode.Page.HasValue ? RequestSpecificValues.Current_Mode.Page.Value : 1; RequestSpecificValues.Current_Mode.Page = 1; string page_url = UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode, false); string url_options = UrlWriterHelper.URL_Options(RequestSpecificValues.Current_Mode); 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_Data_Type == Item_Aggregation_Child_Source_Data_Enum.Static_HTML) { sortedBrowses[thisBrowse.Code.ToLower()] = thisBrowse; } else { Metadata_Search_Field facetField = UI_ApplicationCache_Gateway.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_Data_Type == Item_Aggregation_Child_Source_Data_Enum.Static_HTML) { if (original_browse_mode != thisBrowse.Code) { RequestSpecificValues.Current_Mode.Info_Browse_Mode = thisBrowse.Code; Output.WriteLine("<a href=\"" + UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode).Replace("&", "&") + "\">" + thisBrowse.Label + "</a><br />"); } else { Output.WriteLine(thisBrowse.Label + "<br />"); } } else { Metadata_Search_Field facetField = UI_ApplicationCache_Gateway.Settings.Metadata_Search_Field_By_Display_Name(thisBrowse.Code); if (thisBrowse.Code.ToLower().Replace("_", " ") != original_browse_mode.Replace("_", " ")) { RequestSpecificValues.Current_Mode.Info_Browse_Mode = thisBrowse.Code.ToLower().Replace(" ", "_"); Output.WriteLine("<a href=\"" + UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode).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 = UI_ApplicationCache_Gateway.Settings.Metadata_Search_Field_By_Facet_Name(thisShort); if (facetField != null) { if (thisShort.ToLower() != original_browse_mode) { RequestSpecificValues.Current_Mode.Info_Browse_Mode = thisShort.ToLower().Replace(" ", "_"); Output.WriteLine("<a href=\"" + UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode).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\" id=\"main-content\" role=\"main\">"); RequestSpecificValues.Current_Mode.Info_Browse_Mode = original_browse_mode; // Was this static or metadata browse by? if ((browseObject != null) && (browseObject.Source_Data_Type == Item_Aggregation_Child_Source_Data_Enum.Static_HTML)) { // Read the content file for this browse string source_file = UI_ApplicationCache_Gateway.Settings.Servers.Base_Design_Location + ViewBag.Hierarchy_Object.ObjDirectory.Replace("/", "\\") + browseObject.Source; HTML_Based_Content staticBrowseContent = HTML_Based_Content_Reader.Read_HTML_File(source_file, true, Tracer); if (staticBrowseContent == null) { staticBrowseContent = new HTML_Based_Content("Unable to find source file!\n\n" + ViewBag.Hierarchy_Object.ObjDirectory.Replace("/", "\\") + browseObject.Source, browseObject.Code); } // Apply current user settings for this string browseInfoDisplayText = staticBrowseContent.Apply_Settings_To_Static_Text(staticBrowseContent.Content, ViewBag.Hierarchy_Object, RequestSpecificValues.HTML_Skin.Skin_Code, RequestSpecificValues.HTML_Skin.Base_Skin_Code, RequestSpecificValues.Current_Mode.Base_URL, UrlWriterHelper.URL_Options(RequestSpecificValues.Current_Mode), Tracer); // Is this an admin? bool isAdmin = (RequestSpecificValues.Current_User != null) && (RequestSpecificValues.Current_User.Is_Aggregation_Admin(ViewBag.Hierarchy_Object.Code)); Aggregation_Type_Enum aggrType = RequestSpecificValues.Current_Mode.Aggregation_Type; // Output the adjusted home html if (isAdmin) { Output.WriteLine("<div id=\"sbkSbia_MainTextEditable\">"); Output.WriteLine(browseInfoDisplayText); RequestSpecificValues.Current_Mode.Aggregation_Type = Aggregation_Type_Enum.Child_Page_Edit; Output.WriteLine(" <div id=\"sbkSbia_EditableTextLink\"><a href=\"" + UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode) + "\" title=\"Edit this page's text\"><img src=\"" + Static_Resources_Gateway.Edit_Gif + "\" alt=\"\" />edit content</a></div>"); RequestSpecificValues.Current_Mode.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(browseInfoDisplayText); Output.WriteLine("</div>"); } } 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 RequestSpecificValues.Current_Mode.Mode = Display_Mode_Enum.Results; RequestSpecificValues.Current_Mode.Search_Precision = Search_Precision_Type_Enum.Exact_Match; RequestSpecificValues.Current_Mode.Search_Type = Search_Type_Enum.Advanced; Metadata_Search_Field facetField = UI_ApplicationCache_Gateway.Settings.Metadata_Search_Field_By_Display_Name(original_browse_mode); RequestSpecificValues.Current_Mode.Search_Fields = facetField.Web_Code; RequestSpecificValues.Current_Mode.Search_String = "\"<%TERM%>\""; string search_url = UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode); 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(RequestSpecificValues.Current_Mode.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 RequestSpecificValues.Current_Mode.Mode = Display_Mode_Enum.Aggregation; RequestSpecificValues.Current_Mode.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(); }
/// <summary> Add a single hit against an institutional aggregation </summary> /// <param name="Code"> Institutional aggregation code </param> /// <param name="Mode"> Mode information </param> /// <param name="AggrType"> Aggregation type, if this is aggregation mode </param> /// <param name="SessionID"> ID for the session from which this hit originated </param> public void Add_Institution_Hit(string Code, Display_Mode_Enum Mode, Aggregation_Type_Enum AggrType, int SessionID) { // Determine if this session is already linked to this institution int increment_session = 0; if (institution_sessions.ContainsKey(Code)) { // This code has been found before, but was this session among them previous sessions? if (!institution_sessions[Code].Contains(SessionID)) { // New session! increment_session = 1; institution_sessions[Code].Add(SessionID); } } else { // This institution has not been hit yet at all increment_session = 1; List<int> new_institution_id_list = new List<int> {SessionID}; institution_sessions.Add(Code, new_institution_id_list); } // Create or fetch the data row for this collection DataRow newRow; if (institution_rows.ContainsKey(Code)) { newRow = institution_rows[Code]; } else { newRow = institution_stats.NewRow(); newRow["code"] = Code; newRow["sessions"] = 0; newRow["home_page_hits"] = 0; newRow["browse_hits"] = 0; newRow["advanced_search_hits"] = 0; newRow["results_hits"] = 0; institution_stats.Rows.Add(newRow); institution_rows.Add(Code, newRow); } // If this is a new session, increment that counter if (increment_session > 0) { newRow["sessions"] = Convert.ToInt32(newRow["sessions"]) + 1; } // If there is no mode, this is home page switch (Mode) { case Display_Mode_Enum.Aggregation: switch (AggrType) { case Aggregation_Type_Enum.Browse_By: case Aggregation_Type_Enum.Browse_Info: case Aggregation_Type_Enum.Browse_Map: newRow["browse_hits"] = Convert.ToInt32(newRow["browse_hits"]) + 1; break; default: // Just call this home page then. newRow["home_page_hits"] = Convert.ToInt32(newRow["home_page_hits"]) + 1; break; } break; case Display_Mode_Enum.Search: newRow["advanced_search_hits"] = Convert.ToInt32(newRow["advanced_search_hits"]) + 1; break; case Display_Mode_Enum.Results: newRow["results_hits"] = Convert.ToInt32(newRow["results_hits"]) + 1; break; default: // Just call this home page then. newRow["home_page_hits"] = Convert.ToInt32(newRow["home_page_hits"]) + 1; break; } }
/// <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 if (ViewBag.Static_Web_Content == null) { return; } string static_browse_info_text = ViewBag.Static_Web_Content.Apply_Settings_To_Static_Text(ViewBag.Static_Web_Content.Content, ViewBag.Hierarchy_Object, RequestSpecificValues.HTML_Skin.Skin_Code, RequestSpecificValues.HTML_Skin.Base_Skin_Code, RequestSpecificValues.Current_Mode.Base_URL, UrlWriterHelper.URL_Options(RequestSpecificValues.Current_Mode), Tracer); bool isAdmin = (RequestSpecificValues.Current_User != null) && (RequestSpecificValues.Current_User.Is_Aggregation_Admin(ViewBag.Hierarchy_Object.Code)); if ((RequestSpecificValues.Current_Mode.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(ViewBag.Static_Web_Content.Title) + "\" /></td>"); Output.WriteLine(" <td><img class=\"sbkSbia_HelpButton\" src=\"" + Static_Resources_Gateway.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(ViewBag.Static_Web_Content.Author) + "\" /></td>"); Output.WriteLine(" <td><img class=\"sbkSbia_HelpButton\" src=\"" + Static_Resources_Gateway.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(ViewBag.Static_Web_Content.Date) + "\" /></td>"); Output.WriteLine(" <td><img class=\"sbkSbia_HelpButton\" src=\"" + Static_Resources_Gateway.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(ViewBag.Static_Web_Content.Description) + "\" /></td>"); Output.WriteLine(" <td><img class=\"sbkSbia_HelpButton\" src=\"" + Static_Resources_Gateway.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(ViewBag.Static_Web_Content.Keywords) + "\" /></td>"); Output.WriteLine(" <td><img class=\"sbkSbia_HelpButton\" src=\"" + Static_Resources_Gateway.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>"); string extra_head_info = ViewBag.Static_Web_Content.Extra_Head_Info ?? String.Empty; Output.WriteLine(" <td><textarea rows=\"3\" class=\"sbkSbia_HeaderTextArea sbk_Focusable\" name=\"admin_childpage_extrahead\" id=\"admin_childpage_extrahead\" type=\"text\">" + HttpUtility.HtmlEncode(extra_head_info) + "</textarea></td>"); Output.WriteLine(" <td><img class=\"sbkSbia_HelpButton\" src=\"" + Static_Resources_Gateway.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(" <div id=\"sbkSbia_MainText\">"); Output.WriteLine(" <textarea id=\"sbkSbia_ChildTextEdit\" name=\"sbkSbia_ChildTextEdit\" >"); Output.WriteLine(static_browse_info_text.Replace("<%", "[%").Replace("%>", "%]")); Output.WriteLine(" </textarea>"); Output.WriteLine(" </div>"); Output.WriteLine(); Output.WriteLine(" <div id=\"sbkSbia_TextEditButtons\">"); RequestSpecificValues.Current_Mode.Aggregation_Type = Aggregation_Type_Enum.Browse_Info; if (ViewBag.Browse_Object.Browse_Type == Item_Aggregation_Child_Visibility_Enum.Metadata_Browse_By) { RequestSpecificValues.Current_Mode.Aggregation_Type = Aggregation_Type_Enum.Browse_By; } Output.WriteLine(" <button title=\"Do not apply changes\" class=\"roundbutton\" onclick=\"window.location.href='" + UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode) + "';return false;\"><img src=\"" + Static_Resources_Gateway.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\" onclick=\"CKEDITOR.instances.sbkSbia_ChildTextEdit.updateElement();\">SAVE <img src=\"" + Static_Resources_Gateway.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 = RequestSpecificValues.Current_Mode.Aggregation_Type; Output.WriteLine("<section id=\"main-content\" role=\"main\">"); // Output the adjusted home html if (isAdmin) { Output.WriteLine("<div id=\"sbkSbia_MainTextEditable\">"); Output.WriteLine(static_browse_info_text); RequestSpecificValues.Current_Mode.Aggregation_Type = Aggregation_Type_Enum.Child_Page_Edit; Output.WriteLine(" <div id=\"sbkSbia_EditableTextLink\"><a href=\"" + UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode) + "\" title=\"Edit this page's text\"><img src=\"" + Static_Resources_Gateway.Edit_Gif + "\" alt=\"\" />edit content</a></div>"); RequestSpecificValues.Current_Mode.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("</section>"); } Output.WriteLine("<br />"); Output.WriteLine(); }