예제 #1
0
        /// <summary> Writes the HTML generated to browse the results of a search directly to the response stream </summary>
        /// <param name="Output"> Stream to which to write the HTML for this subwriter </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
        /// <returns> TRUE -- Value indicating if html writer should finish the page immediately after this, or if there are other controls or routines which need to be called first </returns>
        public override bool Write_HTML(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Search_Results_HtmlSubwriter.Write_HTML", "Rendering HTML");

            // If this skin has top-level navigation suppressed, skip the top tabs
            if (htmlSkin.Suppress_Top_Navigation)
            {
                Output.WriteLine("<br />");
            }
            else
            {
                // Add the main aggrgeation menu here
                MainMenus_Helper_HtmlSubWriter.Add_Aggregation_Search_Results_Menu(Output, currentMode, currentUser, Current_Aggregation, translations, codeManager, false);
            }

            if (resultsStatistics != null)
            {
                if (writeResult == null)
                {
                    Tracer.Add_Trace("Search_Results_HtmlSubwriter.Write_HTML", "Building Result DataSet Writer");
                    writeResult = new PagedResults_HtmlSubwriter(resultsStatistics, pagedResults, codeManager, translations, allItemsTable, currentUser, currentMode, Tracer)
                    {
                        Current_Aggregation = Current_Aggregation, Skin = htmlSkin, Mode = currentMode
                    };
                }
                writeResult.Write_HTML(Output, Tracer);
            }

            return(true);
        }
        /// <summary> Writes the HTML generated to browse the results of a search directly to the response stream </summary>
        /// <param name="Output"> Stream to which to write the HTML for this subwriter </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
        /// <returns> TRUE -- Value indicating if html writer should finish the page immediately after this, or if there are other controls or routines which need to be called first </returns>
        public override bool Write_HTML(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Search_Results_HtmlSubwriter.Write_HTML", "Rendering HTML");

            // If this skin has top-level navigation suppressed, skip the top tabs
            if ((RequestSpecificValues.HTML_Skin.Suppress_Top_Navigation.HasValue) && (RequestSpecificValues.HTML_Skin.Suppress_Top_Navigation.Value))
            {
                Output.WriteLine("<br />");
            }
            else
            {
                // Add the main aggrgeation menu here
                MainMenus_Helper_HtmlSubWriter.Add_Aggregation_Search_Results_Menu(Output, RequestSpecificValues, hierarchyObject, false);
            }

            if (RequestSpecificValues.Results_Statistics != null)
            {
                if (writeResult == null)
                {
                    Tracer.Add_Trace("Search_Results_HtmlSubwriter.Write_HTML", "Building Result DataSet Writer");
                    writeResult = new PagedResults_HtmlSubwriter(RequestSpecificValues, RequestSpecificValues.Results_Statistics, RequestSpecificValues.Paged_Results);
                }
                writeResult.Write_HTML(Output, Tracer);
            }

            return(true);
        }
예제 #3
0
        /// <summary> Writes the HTML generated by this my sobek html subwriter directly to the response stream </summary>
        /// <param name="Output"> Stream to which to write the HTML for this subwriter </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
        /// <returns> Value indicating if html writer should finish the page immediately after this, or if there are other controls or routines which need to be called first </returns>
        public override bool Write_HTML(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Admin_HtmlSubwriter.Write_HTML", "Rendering HTML");

            // if (CurrentMode.Admin_Type == Admin_Type_Enum.Wordmarks)
            //     return false;

            if ((!adminViewer.Contains_Popup_Forms) && (!currentMode.Logon_Required))
            {
                if (currentMode.Admin_Type != Admin_Type_Enum.Aggregation_Single)
                {
                    // Add the banner
                    Add_Banner(Output, "sbkAhs_BannerDiv", currentMode, htmlSkin, currentCollection);

                    // Add the user-specific main menu
                    MainMenus_Helper_HtmlSubWriter.Add_UserSpecific_Main_Menu(Output, currentMode, user);

                    // Start the page container
                    Output.WriteLine("<div id=\"pagecontainer\">");
                    Output.WriteLine("<br />");

                    // Add the box with the title
                    if ((currentMode.My_Sobek_Type != My_Sobek_Type_Enum.Folder_Management) || (currentMode.My_Sobek_SubMode != "submitted items"))
                    {
                        Output.WriteLine("<div class=\"SobekSearchPanel\">");
                        if (adminViewer != null)
                        {
                            Output.WriteLine("  <h1>" + adminViewer.Web_Title + "</h1>");
                        }
                        else if (user != null)
                        {
                            Output.WriteLine("  <h1>Welcome back, " + user.Nickname + "</h1>");
                        }
                        Output.WriteLine("</div>");
                        Output.WriteLine();
                    }
                }
            }

            // Add the text here
            adminViewer.Write_HTML(Output, Tracer);
            return(false);
        }
        /// <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 adds the search tips by calling the base method <see cref="abstractAggregationViewer.Add_Simple_Search_Tips"/> </remarks>
        public override void Add_Secondary_HTML(TextWriter Output, Custom_Tracer Tracer)
        {
            if (Tracer != null)
            {
                Tracer.Add_Trace("Custom_Home_Page_AggregationViewer.Add_Secondary_HTML", "Add the entire custom page, doing suitable replacements");
            }

            // Do all the replacements
            string        text          = ViewBag.Hierarchy_Object.HomePageHtml.Content; //.Content;
            StringBuilder textToDisplay = new StringBuilder(text);

            // Determine if certain (more costly) replacements are even needed
            bool header_replacement_needed = text.IndexOf("%HEADER%") > 0;
            bool footer_replacement_needed = text.IndexOf("%FOOTER%") > 0;
            bool menu_replacement_needed   = text.IndexOf("%MAINMENU%") > 0;

            // If necessary, replace the header
            if (header_replacement_needed)
            {
                StringBuilder headerBuilder = new StringBuilder();
                StringWriter  headerWriter  = new StringWriter(headerBuilder);
                HeaderFooter_Helper_HtmlSubWriter.Add_Header(headerWriter, RequestSpecificValues, "container-inner-custom", ViewBag.Hierarchy_Object.ShortName, null, ViewBag.Hierarchy_Object, null);
                string header = headerBuilder.ToString();
                textToDisplay = textToDisplay.Replace("<%HEADER%>", header).Replace("[%HEADER%]", header);
            }

            // If necessary, replace the footer
            if (footer_replacement_needed)
            {
                StringBuilder footerBuilder = new StringBuilder();
                StringWriter  footerWriter  = new StringWriter(footerBuilder);
                HeaderFooter_Helper_HtmlSubWriter.Add_Footer(footerWriter, RequestSpecificValues, null, ViewBag.Hierarchy_Object, null);
                string footer = footerBuilder.ToString();
                textToDisplay = textToDisplay.Replace("<%FOOTER%>", footer).Replace("[%FOOTER%]", footer);
            }

            // If necessary, insert the main menu
            if (menu_replacement_needed)
            {
                StringBuilder menuBuilder = new StringBuilder();
                StringWriter  menuWriter  = new StringWriter(menuBuilder);
                MainMenus_Helper_HtmlSubWriter.Add_Aggregation_Main_Menu(menuWriter, RequestSpecificValues, ViewBag.Hierarchy_Object);
                string menu = menuBuilder.ToString();
                textToDisplay = textToDisplay.Replace("<%MAINMENU%>", menu).Replace("[%MAINMENU%]", menu);
            }

            // Determine the different counts as strings
            string page_count  = "0";
            string item_count  = "0";
            string title_count = "0";

            if (ViewBag.Hierarchy_Object.Statistics != null)
            {
                page_count  = Int_To_Comma_String(ViewBag.Hierarchy_Object.Statistics.Page_Count);
                item_count  = Int_To_Comma_String(ViewBag.Hierarchy_Object.Statistics.Item_Count);
                title_count = Int_To_Comma_String(ViewBag.Hierarchy_Object.Statistics.Title_Count);
            }

            string url_options = UrlWriterHelper.URL_Options(RequestSpecificValues.Current_Mode);
            string urlOptions1 = String.Empty;
            string urlOptions2 = String.Empty;

            if (url_options.Length > 0)
            {
                urlOptions1 = "?" + url_options;
                urlOptions2 = "&" + url_options;
            }

            string home_text = textToDisplay.ToString().Replace("<%BASEURL%>", RequestSpecificValues.Current_Mode.Base_URL).Replace("<%URLOPTS%>", url_options).Replace("<%?URLOPTS%>", urlOptions1).Replace("<%&URLOPTS%>", urlOptions2).Replace("<%INTERFACE%>", RequestSpecificValues.Current_Mode.Base_Skin_Or_Skin).Replace("<%WEBSKIN%>", RequestSpecificValues.Current_Mode.Base_Skin_Or_Skin).Replace("<%PAGES%>", page_count).Replace("<%ITEMS%>", item_count).Replace("<%TITLES%>", title_count);


            Output.Write(home_text);
        }
        /// <summary> Writes the HTML generated by this my sobek html subwriter directly to the response stream </summary>
        /// <param name="Output"> Stream to which to write the HTML for this subwriter </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
        /// <returns> Value indicating if html writer should finish the page immediately after this, or if there are other controls or routines which need to be called first </returns>
        public override bool Write_HTML(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("MySobek_HtmlSubwriter.Write_HTML", "Rendering HTML");

            if ((HttpContext.Current.Session["agreement_date"] == null) && (RequestSpecificValues.Current_Mode.My_Sobek_Type == My_Sobek_Type_Enum.New_Item) && ((RequestSpecificValues.Current_Mode.My_Sobek_SubMode.Length == 0) || (RequestSpecificValues.Current_Mode.My_Sobek_SubMode[0] != '1')))
            {
                RequestSpecificValues.Current_Mode.My_Sobek_SubMode = "1";
            }
            // A few cases skip the view selectors at the top entirely
            if (mySobekViewer.Standard_Navigation_Type == MySobek_Admin_Included_Navigation_Enum.Standard)
            {
                // Add the user-specific main menu
                MainMenus_Helper_HtmlSubWriter.Add_UserSpecific_Main_Menu(Output, RequestSpecificValues);

                // Start the page container
                Output.WriteLine("<div id=\"pagecontainer\">");
                Output.WriteLine("<br />");
            }
            else if (mySobekViewer.Standard_Navigation_Type == MySobek_Admin_Included_Navigation_Enum.LogOn)
            {
                // Add the item views
                Output.WriteLine("<!-- Add the main user-specific menu -->");
                Output.WriteLine("<div id=\"sbkUsm_MenuBar\" class=\"sbkMenu_Bar\">");
                Output.WriteLine("<ul class=\"sf-menu\">");

                // Get ready to draw the tabs
                string sobek_home_text = RequestSpecificValues.Current_Mode.Instance_Abbreviation + " Home";

                // Add the 'SOBEK HOME' first menu option and suboptions
                RequestSpecificValues.Current_Mode.Mode             = Display_Mode_Enum.Aggregation;
                RequestSpecificValues.Current_Mode.Aggregation_Type = Aggregation_Type_Enum.Home;
                RequestSpecificValues.Current_Mode.Home_Type        = Home_Type_Enum.List;
                Output.WriteLine("\t\t<li id=\"sbkUsm_Home\" class=\"sbkMenu_Home\"><a href=\"" + UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode) + "\" class=\"sbkMenu_NoPadding\"><img src=\"" + Static_Resources_Gateway.Home_Png + "\" /> <div class=\"sbkMenu_HomeText\">" + sobek_home_text + "</div></a></li>");
                Output.WriteLine("\t</ul></div>");

                Output.WriteLine("<!-- Initialize the main user menu -->");
                Output.WriteLine("<script>");
                Output.WriteLine("  jQuery(document).ready(function () {");
                Output.WriteLine("     jQuery('ul.sf-menu').superfish();");
                Output.WriteLine("  });");
                Output.WriteLine("</script>");
                Output.WriteLine();

                // Restore the current view information type
                RequestSpecificValues.Current_Mode.Mode = Display_Mode_Enum.My_Sobek;

                // Start the page container
                Output.WriteLine("<div id=\"pagecontainer\">");
                Output.WriteLine("<br />");
            }
            else if (!Subwriter_Behaviors.Contains(HtmlSubwriter_Behaviors_Enum.MySobek_Subwriter_Mimic_Item_Subwriter))
            {
                // Start the page container
                Output.WriteLine("<div id=\"pagecontainer\">");
            }

            // Add the text here
            mySobekViewer.Write_HTML(Output, Tracer);

            return(false);
        }
예제 #6
0
        /// <summary> Writes the HTML generated by this my sobek html subwriter directly to the response stream </summary>
        /// <param name="Output"> Stream to which to write the HTML for this subwriter </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
        /// <returns> Value indicating if html writer should finish the page immediately after this, or if there are other controls or routines which need to be called first </returns>
        public override bool Write_HTML(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Admin_HtmlSubwriter.Write_HTML", "Rendering HTML");

            // if (CurrentMode.Admin_Type == Admin_Type_Enum.Wordmarks)
            //     return false;

            if ((!adminViewer.Contains_Popup_Forms) && (!RequestSpecificValues.Current_Mode.Logon_Required))
            {
                if ((RequestSpecificValues.Current_Mode.Admin_Type != Admin_Type_Enum.Aggregation_Single) && (RequestSpecificValues.Current_Mode.Admin_Type != Admin_Type_Enum.Skins_Single) && (RequestSpecificValues.Current_Mode.Admin_Type != Admin_Type_Enum.Add_Collection_Wizard))
                {
                    // Add the banner
                    if (!adminViewer.Viewer_Behaviors.Contains(HtmlSubwriter_Behaviors_Enum.Suppress_Banner))
                    {
                        Add_Banner(Output, "sbkAhs_BannerDiv", WebPage_Title.Replace("{0} ", ""), RequestSpecificValues.Current_Mode, RequestSpecificValues.HTML_Skin, RequestSpecificValues.Top_Collection);
                    }

                    // Add the RequestSpecificValues.Current_User-specific main menu
                    MainMenus_Helper_HtmlSubWriter.Add_UserSpecific_Main_Menu(Output, RequestSpecificValues);

                    // Start the page container
                    Output.WriteLine("<div id=\"pagecontainer\">");
                    Output.WriteLine("<br />");

                    // Add the box with the title
                    if (((RequestSpecificValues.Current_Mode.My_Sobek_Type != My_Sobek_Type_Enum.Folder_Management) || (RequestSpecificValues.Current_Mode.My_Sobek_SubMode != "submitted items")) && (RequestSpecificValues.Current_Mode.Admin_Type != Admin_Type_Enum.WebContent_Single))
                    {
                        // Add the title
                        Output.WriteLine("<div class=\"sbkAdm_TitleDiv sbkAdm_TitleDivBorder\">");
                        if (adminViewer != null)
                        {
                            if (adminViewer.Viewer_Icon.Length > 0)
                            {
                                Output.WriteLine("  <img id=\"sbkAdm_TitleDivImg\" src=\"" + adminViewer.Viewer_Icon + "\" alt=\"\" />");
                            }
                            Output.WriteLine("  <h1>" + adminViewer.Web_Title + "</h1>");
                        }
                        else if (RequestSpecificValues.Current_User != null)
                        {
                            Output.WriteLine("  <h1>Welcome back, " + RequestSpecificValues.Current_User.Nickname + "</h1>");
                        }
                        Output.WriteLine("</div>");
                        Output.WriteLine();

                        // Add some administrative breadcrumbs here
                        if (adminViewer != null)
                        {
                            // Keep the current values
                            Admin_Type_Enum adminType   = RequestSpecificValues.Current_Mode.Admin_Type;
                            ushort          page        = RequestSpecificValues.Current_Mode.Page.HasValue ? RequestSpecificValues.Current_Mode.Page.Value : ((ushort)1);
                            string          browse_code = RequestSpecificValues.Current_Mode.Info_Browse_Mode;
                            //string aggregation = RequestSpecificValues.Current_Mode.Aggregation;
                            //string mySobekMode = RequestSpecificValues.Current_Mode.My_Sobek_SubMode;

                            // Get the URL for the home page
                            RequestSpecificValues.Current_Mode.Mode             = Display_Mode_Enum.Aggregation;
                            RequestSpecificValues.Current_Mode.Aggregation_Type = Aggregation_Type_Enum.Home;
                            RequestSpecificValues.Current_Mode.Home_Type        = Home_Type_Enum.List;
                            string home_url = UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode);

                            if (adminViewer is Home_AdminViewer)
                            {
                                // Render the breadcrumbns
                                Output.WriteLine("<div class=\"sbkAdm_Breadcrumbs\">");
                                Output.WriteLine("  <a href=\"" + home_url + "\">" + RequestSpecificValues.Current_Mode.Instance_Abbreviation + " Home</a> > ");
                                Output.WriteLine("  System Administrative Tasks");
                                Output.WriteLine("</div>");
                            }
                            else
                            {
                                // Get the URL for the system admin menu
                                RequestSpecificValues.Current_Mode.Mode       = Display_Mode_Enum.Administrative;
                                RequestSpecificValues.Current_Mode.Admin_Type = Admin_Type_Enum.Home;
                                string menu_url = UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode);

                                // Restor everything
                                RequestSpecificValues.Current_Mode.Admin_Type = adminType;

                                // Render the breadcrumbns
                                Output.WriteLine("<div class=\"sbkAdm_Breadcrumbs\">");
                                Output.WriteLine("  <a href=\"" + home_url + "\">" + RequestSpecificValues.Current_Mode.Instance_Abbreviation + " Home</a> > ");
                                Output.WriteLine("  <a href=\"" + menu_url + "\">System Administrative Tasks</a> > ");
                                Output.WriteLine("  " + adminViewer.Web_Title);
                                Output.WriteLine("</div>");
                            }

                            RequestSpecificValues.Current_Mode.Page             = page;
                            RequestSpecificValues.Current_Mode.Info_Browse_Mode = browse_code;
                        }
                    }
                }
            }

            // Add the text here
            adminViewer.Write_HTML(Output, Tracer);
            return(false);
        }