/// <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) && (currentMode.My_Sobek_Type == My_Sobek_Type_Enum.New_Item) && ((currentMode.My_Sobek_SubMode.Length == 0) || (currentMode.My_Sobek_SubMode[0] != '1')))
            {
                currentMode.My_Sobek_SubMode = "1";
            }


            if ((!mySobekViewer.Contains_Popup_Forms) && (!currentMode.Logon_Required))
            {
                bool template_banner_override = false;
                if ((user != null) && (currentMode.My_Sobek_Type == My_Sobek_Type_Enum.New_Item))
                {
                    if (((New_Group_And_Item_MySobekViewer)mySobekViewer).Current_Template_Banner.Length > 0)
                    {
                        string template_banner = ((New_Group_And_Item_MySobekViewer)mySobekViewer).Current_Template_Banner;
                        template_banner_override = true;
                        Output.WriteLine("<img id=\"mainBanner\" src=\"" + template_banner + "\" alt=\"MISSING BANNER\" />");
                    }
                }
                if ((!template_banner_override) && (currentMode.My_Sobek_Type != My_Sobek_Type_Enum.Group_Add_Volume))
                {
                    Add_Banner(Output);
                }

                // A few cases skip the view selectors at the top entirely
                if (mySobekViewer.Standard_Navigation_Type != MySobek_Included_Navigation_Enum.NONE)
                {
                    // Write the general view type selector stuff
                    Write_General_View_Type_Selectors(Output);
                }
            }

            // Add the text here
            mySobekViewer.Write_HTML(Output, Tracer);
            return(false);
        }
Ejemplo n.º 2
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("MySobek_HtmlSubwriter.Write_HTML", "Rendering HTML");

            if ((HttpContext.Current.Session["agreement_date"] == null) && (currentMode.My_Sobek_Type == My_Sobek_Type_Enum.New_Item) && ((currentMode.My_Sobek_SubMode.Length == 0) || (currentMode.My_Sobek_SubMode[0] != '1')))
            {
                currentMode.My_Sobek_SubMode = "1";
            }
            // A few cases skip the view selectors at the top entirely
            if (mySobekViewer.Standard_Navigation_Type == MySobek_Included_Navigation_Enum.Standard)
            {
                // 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 />");
            }
            else if (mySobekViewer.Standard_Navigation_Type == MySobek_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 = Mode.SobekCM_Instance_Abbreviation + " Home";

                // Add the 'SOBEK HOME' first menu option and suboptions
                Mode.Mode             = Display_Mode_Enum.Aggregation;
                Mode.Aggregation_Type = Aggregation_Type_Enum.Home;
                Mode.Home_Type        = Home_Type_Enum.List;
                Output.WriteLine("\t\t<li id=\"sbkUsm_Home\" class=\"sbkMenu_Home\"><a href=\"" + Mode.Redirect_URL() + "\" class=\"sbkMenu_NoPadding\"><img src=\"" + Mode.Default_Images_URL + "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
                currentMode.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);
        }