/// <summary> Returns a built collection viewer matching request </summary> /// <param name="ViewType"> Aggregation view type </param> /// <param name="Current_Aggregation"> Current item aggregation object </param> /// <param name="Current_Mode"> Mode / navigation information for the current request </param> /// <returns> Collection viewer that extends the <see cref="abstractAggregationViewer"/> class. </returns> public static abstractAggregationViewer Get_Viewer(Item_Aggregation.CollectionViewsAndSearchesEnum ViewType, Item_Aggregation Current_Aggregation, SobekCM_Navigation_Object Current_Mode) { switch (ViewType) { case Item_Aggregation.CollectionViewsAndSearchesEnum.Advanced_Search: return(new Advanced_Search_AggregationViewer(Current_Aggregation, Current_Mode)); case Item_Aggregation.CollectionViewsAndSearchesEnum.Basic_Search: string frontBannerImage = Current_Aggregation.Front_Banner_Image(Current_Mode.Language); if ((frontBannerImage.Length > 0) && (Current_Aggregation.Highlights.Count > 0)) { return(new Rotating_Highlight_Search_AggregationViewer(Current_Aggregation, Current_Mode)); } return(new Basic_Search_AggregationViewer(Current_Aggregation, Current_Mode)); case Item_Aggregation.CollectionViewsAndSearchesEnum.FullText_Search: return(new Full_Text_Search_AggregationViewer(Current_Aggregation, Current_Mode)); case Item_Aggregation.CollectionViewsAndSearchesEnum.No_Home_Search: return(new No_Search_AggregationViewer()); case Item_Aggregation.CollectionViewsAndSearchesEnum.Newspaper_Search: return(new Newspaper_Search_AggregationViewer(Current_Aggregation, Current_Mode)); case Item_Aggregation.CollectionViewsAndSearchesEnum.Map_Search: return(new Map_Search_AggregationViewer(Current_Aggregation, Current_Mode)); case Item_Aggregation.CollectionViewsAndSearchesEnum.dLOC_FullText_Search: return(new dLOC_Search_AggregationViewer(Current_Aggregation, Current_Mode)); default: return(null); } }
/// <summary> Compares the collection view type and the search type from the current http request </summary> /// <param name="SearchType1"> Search type from the list of collection views and searches </param> /// <param name="SearchType2"> Search type from the current http request </param> /// <returns> TRUE if they are analagous, otherwise FALSE </returns> public static bool Do_Search_Types_Match(Item_Aggregation.CollectionViewsAndSearchesEnum SearchType1, Search_Type_Enum SearchType2) { switch (SearchType1) { case Item_Aggregation.CollectionViewsAndSearchesEnum.Advanced_Search: return(SearchType2 == Search_Type_Enum.Advanced); case Item_Aggregation.CollectionViewsAndSearchesEnum.Advanced_Search_YearRange: return(SearchType2 == Search_Type_Enum.Advanced); case Item_Aggregation.CollectionViewsAndSearchesEnum.Basic_Search: return(SearchType2 == Search_Type_Enum.Basic); case Item_Aggregation.CollectionViewsAndSearchesEnum.Basic_Search_YearRange: return(SearchType2 == Search_Type_Enum.Basic); case Item_Aggregation.CollectionViewsAndSearchesEnum.FullText_Search: return(SearchType2 == Search_Type_Enum.Full_Text); case Item_Aggregation.CollectionViewsAndSearchesEnum.Map_Search: return(SearchType2 == Search_Type_Enum.Map); case Item_Aggregation.CollectionViewsAndSearchesEnum.Map_Search_Beta: return(SearchType2 == Search_Type_Enum.Map_Beta); case Item_Aggregation.CollectionViewsAndSearchesEnum.Newspaper_Search: return(SearchType2 == Search_Type_Enum.Newspaper); case Item_Aggregation.CollectionViewsAndSearchesEnum.DLOC_FullText_Search: return(SearchType2 == Search_Type_Enum.dLOC_Full_Text); default: return(false); } }
/// <summary> Returns the HTML for one element within tab which appears over the search box in the collection view </summary> /// <param name="ThisView"> Collection view type for this tab </param> /// <param name="Current_Mode"> Mode / navigation information for the current request, to see if the tab is currently selected or not and determine current skin language </param> /// <param name="Translations"> Language support object for writing the name of the view in the appropriate interface language </param> /// <returns> HTML to display the tab, including the link if it is not currently selected </returns> public static string Menu_Get_Nav_Bar_HTML(Item_Aggregation.CollectionViewsAndSearchesEnum ThisView, SobekCM_Navigation_Object Current_Mode, Language_Support_Info Translations) { string skinCode = Current_Mode.Base_Skin; switch (ThisView) { case Item_Aggregation.CollectionViewsAndSearchesEnum.Advanced_Search: case Item_Aggregation.CollectionViewsAndSearchesEnum.Advanced_Search_YearRange: return(Menu_HTML_Helper(skinCode, Search_Type_Enum.Advanced, Translations.Get_Translation("ADVANCED SEARCH", Current_Mode.Language), Current_Mode)); case Item_Aggregation.CollectionViewsAndSearchesEnum.Basic_Search: case Item_Aggregation.CollectionViewsAndSearchesEnum.Basic_Search_YearRange: return(Menu_HTML_Helper(skinCode, Search_Type_Enum.Basic, Translations.Get_Translation("BASIC SEARCH", Current_Mode.Language), Current_Mode)); case Item_Aggregation.CollectionViewsAndSearchesEnum.Map_Search: return(Menu_HTML_Helper(skinCode, Search_Type_Enum.Map, Translations.Get_Translation("MAP SEARCH", Current_Mode.Language), Current_Mode)); case Item_Aggregation.CollectionViewsAndSearchesEnum.Map_Search_Beta: return(Menu_HTML_Helper(skinCode, Search_Type_Enum.Map_Beta, Translations.Get_Translation("MAP SEARCH", Current_Mode.Language), Current_Mode)); case Item_Aggregation.CollectionViewsAndSearchesEnum.Newspaper_Search: return(Menu_HTML_Helper(skinCode, Search_Type_Enum.Newspaper, Translations.Get_Translation("NEWSPAPER SEARCH", Current_Mode.Language), Current_Mode)); case Item_Aggregation.CollectionViewsAndSearchesEnum.Admin_View: return(String.Empty); // HTML_Helper(Skin_Code, SobekCM.Library.Navigation.Search_Type_Enum.Admin_View, Translations.Get_Translation("ADMIN", Current_Mode.Language), Current_Mode, Downward_Tabs); case Item_Aggregation.CollectionViewsAndSearchesEnum.DLOC_FullText_Search: return(Menu_HTML_Helper(skinCode, Search_Type_Enum.dLOC_Full_Text, Translations.Get_Translation("TEXT SEARCH", Current_Mode.Language), Current_Mode)); case Item_Aggregation.CollectionViewsAndSearchesEnum.FullText_Search: return(Menu_HTML_Helper(skinCode, Search_Type_Enum.Full_Text, Translations.Get_Translation("TEXT SEARCH", Current_Mode.Language), Current_Mode)); } return(String.Empty); }
/// <summary> Returns the HTML for one tab which appears over the search box in the collection view </summary> /// <param name="thisView"> Collection view type for this tab </param> /// <param name="Current_Mode"> Mode / navigation information for the current request, to see if the tab is currently selected or not and determine current skin language </param> /// <param name="Translations"> Language support object for writing the name of the view in the appropriate interface language </param> /// <param name="Downward_Tabs"> Flag indicates if this tab faces downward, rather than the default upward </param> /// <returns> HTML to display the tab, including the link if it is not currently selected </returns> public static string Get_Nav_Bar_HTML(Item_Aggregation.CollectionViewsAndSearchesEnum thisView, SobekCM_Navigation_Object Current_Mode, Language_Support_Info Translations, bool Downward_Tabs) { string skinCode = Current_Mode.Base_Skin; switch (thisView) { case Item_Aggregation.CollectionViewsAndSearchesEnum.Advanced_Search: if (Current_Mode.Is_Robot) { return("<img src=\"" + Current_Mode.Base_URL + "design/skins/" + skinCode + "/tabs/cL.gif\" border=\"0\" class=\"tab_image\" alt=\"\" /><span class=\"tab\"> ADVANCED SEARCH </span><img src=\"" + Current_Mode.Base_URL + "design/skins/" + skinCode + "/tabs/cR.gif\" border=\"0\" class=\"tab_image\" alt=\"\" />" + Environment.NewLine); } return(HTML_Helper(skinCode, Search_Type_Enum.Advanced, Translations.Get_Translation("ADVANCED SEARCH", Current_Mode.Language), Current_Mode, Downward_Tabs)); case Item_Aggregation.CollectionViewsAndSearchesEnum.Basic_Search: return(HTML_Helper(skinCode, Search_Type_Enum.Basic, Translations.Get_Translation("BASIC SEARCH", Current_Mode.Language), Current_Mode, Downward_Tabs)); case Item_Aggregation.CollectionViewsAndSearchesEnum.Map_Search: return(HTML_Helper(skinCode, Search_Type_Enum.Map, Translations.Get_Translation("MAP SEARCH", Current_Mode.Language), Current_Mode, Downward_Tabs)); case Item_Aggregation.CollectionViewsAndSearchesEnum.Newspaper_Search: return(HTML_Helper(skinCode, Search_Type_Enum.Newspaper, Translations.Get_Translation("NEWSPAPER SEARCH", Current_Mode.Language), Current_Mode, Downward_Tabs)); case Item_Aggregation.CollectionViewsAndSearchesEnum.Admin_View: return(String.Empty); // HTML_Helper(Skin_Code, SobekCM.Library.Navigation.Search_Type_Enum.Admin_View, Translations.Get_Translation("ADMIN", Current_Mode.Language), Current_Mode, Downward_Tabs); case Item_Aggregation.CollectionViewsAndSearchesEnum.dLOC_FullText_Search: return(HTML_Helper(skinCode, Search_Type_Enum.dLOC_Full_Text, Translations.Get_Translation("TEXT SEARCH", Current_Mode.Language), Current_Mode, Downward_Tabs)); case Item_Aggregation.CollectionViewsAndSearchesEnum.FullText_Search: return(HTML_Helper(skinCode, Search_Type_Enum.Full_Text, Translations.Get_Translation("TEXT SEARCH", Current_Mode.Language), Current_Mode, Downward_Tabs)); } return(String.Empty); }