Example #1
0
        /// <summary> Add controls directly to the form in the main control area placeholder</summary>
        /// <param name="MainPlaceHolder"> Main place holder ( &quot;mainPlaceHolder&quot; ) in the itemNavForm form, widely used throughout the application</param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
        public void Add_Controls(PlaceHolder MainPlaceHolder, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Admin_HtmlSubwriter.Add_Controls", "Build admin viewer and add controls");

            // Add the banner now
            if (((RequestSpecificValues.Current_Mode.Logon_Required) || (adminViewer.Contains_Popup_Forms)) && (!(adminViewer is Edit_Item_Metadata_MySobekViewer)))
            {
                if (!adminViewer.Viewer_Behaviors.Contains(HtmlSubwriter_Behaviors_Enum.Suppress_Banner))
                {
                    // Start to build the result to write, with the banner
                    StringBuilder header_builder = new StringBuilder();
                    StringWriter  header_writer  = new StringWriter(header_builder);
                    Add_Banner(header_writer, "sbkAhs_BannerDiv", WebPage_Title.Replace("{0} ", ""), RequestSpecificValues.Current_Mode, RequestSpecificValues.HTML_Skin, RequestSpecificValues.Top_Collection);

                    // Now, add this literal
                    LiteralControl header_literal = new LiteralControl(header_builder.ToString());
                    MainPlaceHolder.Controls.Add(header_literal);
                }
            }

            // Add any controls needed
            adminViewer.Add_Controls(MainPlaceHolder, Tracer);
        }
Example #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("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);
        }