/// <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("Usage_Statistics_AggregationViewer.Add_Secondary_HTML", "Adding HTML"); } const string collectionViews = "COLLECTION VIEWS"; const string itemViews = "ITEM VIEWS"; const string topTitles = "TOP TITLES"; const string topItems = "TOP ITEMS"; const string definitions = "DEFINITIONS"; Output.WriteLine("<div class=\"ShowSelectRow\">"); // Save and normalize the submode string submode = currentMode.Info_Browse_Mode.ToLower(); if ((submode != "views") && (submode != "itemviews") && (submode != "titles") && (submode != "items") && (submode != "definitions")) { submode = "views"; } if (submode == "views") { Output.WriteLine(" <img src=\"" + currentMode.Base_Design_URL + "skins/" + currentMode.Base_Skin + "/tabs/cLD_s.gif\" border=\"0\" class=\"tab_image\" alt=\"\" /><span class=\"tab_s\">" + collectionViews + "</span><img src=\"" + currentMode.Base_Design_URL + "skins/" + currentMode.Base_Skin + "/tabs/cRD_s.gif\" border=\"0\" class=\"tab_image\" alt=\"\" /></a>"); } else { currentMode.Info_Browse_Mode = "views"; Output.WriteLine(" <a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Base_Design_URL + "skins/" + currentMode.Base_Skin + "/tabs/cLD.gif\" border=\"0\" class=\"tab_image\" alt=\"\" /><span class=\"tab\">" + collectionViews + "</span><img src=\"" + currentMode.Base_Design_URL + "skins/" + currentMode.Base_Skin + "/tabs/cRD.gif\" border=\"0\" class=\tab_image\" alt=\"\" /></a>"); } if (submode == "itemviews") { Output.WriteLine(" <img src=\"" + currentMode.Base_Design_URL + "skins/" + currentMode.Base_Skin + "/tabs/cLD_s.gif\" border=\"0\" class=\"tab_image\" alt=\"\" /><span class=\"tab_s\">" + itemViews + "</span><img src=\"" + currentMode.Base_Design_URL + "skins/" + currentMode.Base_Skin + "/tabs/cRD_s.gif\" border=\"0\" class=\"tab_image\" alt=\"\" /></a>"); } else { currentMode.Info_Browse_Mode = "itemviews"; Output.WriteLine(" <a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Base_Design_URL + "skins/" + currentMode.Base_Skin + "/tabs/cLD.gif\" border=\"0\" class=\"tab_image\" alt=\"\" /><span class=\"tab\">" + itemViews + "</span><img src=\"" + currentMode.Base_Design_URL + "skins/" + currentMode.Base_Skin + "/tabs/cRD.gif\" border=\"0\" class=\tab_image\" alt=\"\" /></a>"); } if (submode == "titles") { Output.WriteLine(" <img src=\"" + currentMode.Base_Design_URL + "skins/" + currentMode.Base_Skin + "/tabs/cLD_s.gif\" border=\"0\" class=\"tab_image\" alt=\"\" /><span class=\"tab_s\">" + topTitles + "</span><img src=\"" + currentMode.Base_Design_URL + "skins/" + currentMode.Base_Skin + "/tabs/cRD_s.gif\" border=\"0\" class=\"tab_image\" alt=\"\" /></a>"); } else { currentMode.Info_Browse_Mode = "titles"; Output.WriteLine(" <a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Base_Design_URL + "skins/" + currentMode.Base_Skin + "/tabs/cLD.gif\" border=\"0\" class=\"tab_image\" alt=\"\" /><span class=\"tab\">" + topTitles + "</span><img src=\"" + currentMode.Base_Design_URL + "skins/" + currentMode.Base_Skin + "/tabs/cRD.gif\" border=\"0\" class=\tab_image\" alt=\"\" /></a>"); } if (submode == "items") { Output.WriteLine(" <img src=\"" + currentMode.Base_Design_URL + "skins/" + currentMode.Base_Skin + "/tabs/cLD_s.gif\" border=\"0\" class=\"tab_image\" alt=\"\" /><span class=\"tab_s\">" + topItems + "</span><img src=\"" + currentMode.Base_Design_URL + "skins/" + currentMode.Base_Skin + "/tabs/cRD_s.gif\" border=\"0\" class=\"tab_image\" alt=\"\" /></a>"); } else { currentMode.Info_Browse_Mode = "items"; Output.WriteLine(" <a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Base_Design_URL + "skins/" + currentMode.Base_Skin + "/tabs/cLD.gif\" border=\"0\" class=\"tab_image\" alt=\"\" /><span class=\"tab\">" + topItems + "</span><img src=\"" + currentMode.Base_Design_URL + "skins/" + currentMode.Base_Skin + "/tabs/cRD.gif\" border=\"0\" class=\tab_image\" alt=\"\"/></a>"); } if (submode == "definitions") { Output.WriteLine(" <img src=\"" + currentMode.Base_Design_URL + "skins/" + currentMode.Base_Skin + "/tabs/cLD_s.gif\" border=\"0\" class=\"tab_image\" alt=\"\" /><span class=\"tab_s\">" + definitions + "</span><img src=\"" + currentMode.Base_Design_URL + "skins/" + currentMode.Base_Skin + "/tabs/cRD_s.gif\" border=\"0\" class=\"tab_image\" alt=\"\" /></a>"); } else { currentMode.Info_Browse_Mode = "definitions"; Output.WriteLine(" <a href=\"" + currentMode.Redirect_URL() + "\"><img src=\"" + currentMode.Base_Design_URL + "skins/" + currentMode.Base_Skin + "/tabs/cLD.gif\" border=\"0\" class=\"tab_image\" alt=\"\" /><span class=\"tab\">" + definitions + "</span><img src=\"" + currentMode.Base_Design_URL + "skins/" + currentMode.Base_Skin + "/tabs/cRD.gif\" border=\"0\" class=\tab_image\" alt=\"\" /></a>"); } currentMode.Info_Browse_Mode = submode; Output.WriteLine("</div>"); Output.WriteLine("<br />"); // Show the next data, depending on type switch (submode) { case "views": add_collection_usage_history(Output, SobekCM_Database.Get_Aggregation_Statistics_History(currentCollection.Code, Tracer), Tracer); break; case "itemviews": add_item_usage_history(Output, SobekCM_Database.Get_Aggregation_Statistics_History(currentCollection.Code, Tracer), Tracer); break; case "titles": add_titles_by_collection(Output, currentCollection.Code, Tracer); break; case "items": add_items_by_collection(Output, currentCollection.Code, Tracer); break; case "definitions": add_usage_definitions(Output, Tracer); 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("Usage_Statistics_AggregationViewer.Add_Secondary_HTML", "Adding HTML"); } const string COLLECTION_VIEWS = "COLLECTION VIEWS"; const string ITEM_VIEWS = "ITEM VIEWS"; const string TOP_TITLES = "TOP TITLES"; const string TOP_ITEMS = "TOP ITEMS"; const string DEFINITIONS = "DEFINITIONS"; Output.WriteLine("<div class=\"ShowSelectRow\">"); Output.WriteLine(" <ul class=\"sbk_FauxDownwardTabsList\">"); // Save and normalize the submode string submode = "views"; if (!String.IsNullOrEmpty(RequestSpecificValues.Current_Mode.Info_Browse_Mode)) { submode = RequestSpecificValues.Current_Mode.Info_Browse_Mode.ToLower(); } if ((submode != "views") && (submode != "itemviews") && (submode != "titles") && (submode != "items") && (submode != "definitions")) { submode = "views"; } if (submode == "views") { Output.WriteLine(" <li class=\"current\">" + COLLECTION_VIEWS + "</li>"); } else { RequestSpecificValues.Current_Mode.Info_Browse_Mode = "views"; Output.WriteLine(" <li><a href=\"" + UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode) + "\">" + COLLECTION_VIEWS + "</a></li>"); } if (submode == "itemviews") { Output.WriteLine(" <li class=\"current\">" + ITEM_VIEWS + "</li>"); } else { RequestSpecificValues.Current_Mode.Info_Browse_Mode = "itemviews"; Output.WriteLine(" <li><a href=\"" + UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode) + "\">" + ITEM_VIEWS + "</a></li>"); } if (submode == "titles") { Output.WriteLine(" <li class=\"current\">" + TOP_TITLES + "</li>"); } else { RequestSpecificValues.Current_Mode.Info_Browse_Mode = "titles"; Output.WriteLine(" <li><a href=\"" + UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode) + "\">" + TOP_TITLES + "</a></li>"); } if (submode == "items") { Output.WriteLine(" <li class=\"current\">" + TOP_ITEMS + "</li>"); } else { RequestSpecificValues.Current_Mode.Info_Browse_Mode = "items"; Output.WriteLine(" <li><a href=\"" + UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode) + "\">" + TOP_ITEMS + "</a></li>"); } if (submode == "definitions") { Output.WriteLine(" <li class=\"current\">" + DEFINITIONS + "</li>"); } else { RequestSpecificValues.Current_Mode.Info_Browse_Mode = "definitions"; Output.WriteLine(" <li><a href=\"" + UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode) + "\">" + DEFINITIONS + "</a></li>"); } RequestSpecificValues.Current_Mode.Info_Browse_Mode = submode; Output.WriteLine(" </ul>"); Output.WriteLine("</div>"); Output.WriteLine("<br />"); // Show the next data, depending on type switch (submode) { case "views": add_collection_usage_history(Output, SobekCM_Database.Get_Aggregation_Statistics_History(ViewBag.Hierarchy_Object.Code, Tracer), Tracer); break; case "itemviews": add_item_usage_history(Output, SobekCM_Database.Get_Aggregation_Statistics_History(ViewBag.Hierarchy_Object.Code, Tracer), Tracer); break; case "titles": add_titles_by_collection(Output, ViewBag.Hierarchy_Object.Code, Tracer); break; case "items": add_items_by_collection(Output, ViewBag.Hierarchy_Object.Code, Tracer); break; case "definitions": add_usage_definitions(Output, Tracer); break; } }