private void Write_General_View_Type_Selectors(TextWriter Output)
        {
            // Get ready to draw the tabs
            string       sobek_home    = currentMode.SobekCM_Instance_Abbreviation.ToUpper() + " HOME";
            string       my_sobek_home = "my" + currentMode.SobekCM_Instance_Abbreviation.ToUpper() + " HOME";
            const string myLibrary     = "MY LIBRARY";
            const string myPreferences = "MY ACCOUNT";
            const string internalTab   = "INTERNAL";
            string       sobek_admin   = "SYSTEM ADMIN";

            if ((user != null) && (user.Is_Portal_Admin) && (!user.Is_System_Admin))
            {
                sobek_admin = "PORTAL ADMIN";
            }

            Admin_Type_Enum mySobekType = currentMode.Admin_Type;
            string          submode     = currentMode.My_Sobek_SubMode;

            currentMode.My_Sobek_SubMode = String.Empty;

            Output.WriteLine("<div class=\"ViewsBrowsesRow\">");
            Output.WriteLine("");

            // Write the Sobek home tab
            currentMode.Mode      = Display_Mode_Enum.Aggregation_Home;
            currentMode.Home_Type = Home_Type_Enum.List;
            Output.WriteLine("  <a href=\"" + currentMode.Redirect_URL() + "\">" + Unselected_Tab_Start + sobek_home + Unselected_Tab_End + "</a>");
            currentMode.Mode = Display_Mode_Enum.My_Sobek;

            if (user != null && ((HttpContext.Current.Session["user"] != null) && (currentMode.My_Sobek_Type != My_Sobek_Type_Enum.Log_Out) && (!user.Is_Temporary_Password)))
            {
                // Write the mySobek home tab
                currentMode.My_Sobek_Type = My_Sobek_Type_Enum.Home;
                Output.WriteLine("  <a href=\"" + currentMode.Redirect_URL() + "\">" + Unselected_Tab_Start + my_sobek_home + Unselected_Tab_End + "</a>");

                // Write the folders tab
                currentMode.My_Sobek_Type = My_Sobek_Type_Enum.Folder_Management;
                Output.WriteLine("  <a href=\"" + currentMode.Redirect_URL() + "\">" + Unselected_Tab_Start + myLibrary + Unselected_Tab_End + "</a>");

                // Write the preferences tab
                currentMode.My_Sobek_Type = My_Sobek_Type_Enum.Preferences;
                Output.WriteLine("  <a href=\"" + currentMode.Redirect_URL() + "\">" + Unselected_Tab_Start + myPreferences + Unselected_Tab_End + "</a>");

                // If this user is internal, add that
                if (user.Is_Internal_User)
                {
                    currentMode.Mode = Display_Mode_Enum.Internal;
                    Output.WriteLine("  <a href=\"" + currentMode.Redirect_URL() + "\">" + Unselected_Tab_Start + internalTab + Unselected_Tab_End + "</a>");
                    currentMode.Mode = Display_Mode_Enum.My_Sobek;
                }

                // Write the sobek admin tab
                if ((user.Is_System_Admin) || (user.Is_Portal_Admin))
                {
                    currentMode.Mode       = Display_Mode_Enum.Administrative;
                    currentMode.Admin_Type = Admin_Type_Enum.Home;
                    Output.WriteLine("  <a href=\"" + currentMode.Redirect_URL() + "\">" + Unselected_Tab_Start + sobek_admin + Unselected_Tab_End + "</a>");
                    currentMode.Mode = Display_Mode_Enum.My_Sobek;
                }
            }

            currentMode.Mode             = Display_Mode_Enum.Administrative;
            currentMode.Admin_Type       = mySobekType;
            currentMode.My_Sobek_SubMode = submode;

            Output.WriteLine("");
            Output.WriteLine("</div>");
            Output.WriteLine();

            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();
            }
        }
Exemple #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);
        }
        private void Write_Admin_View_Type_Selectors(TextWriter Output)
        {
            const string aggregations     = "AGGREGATIONS";
            const string interfaces       = "WEB SKINS";
            const string wordmarks        = "WORDMARKS";
            const string forwarding       = "ALIASES";
            const string users            = "USERS";
            const string projects         = "PROJECTS";
            const string restrictions     = "RESTRICTIONS";
            const string portals          = "PORTALS";
            const string builder          = "BUILDER";
            const string thematicHeadings = "THEMATIC HEADINGS";

            Admin_Type_Enum mySobekType = currentMode.Admin_Type;
            string          submode     = currentMode.My_Sobek_SubMode;

            currentMode.My_Sobek_SubMode = String.Empty;

            Output.WriteLine("<div class=\"ShowSelectRow\">");
            Output.WriteLine("");

            // Write the aggregations tab
            if (mySobekType == Admin_Type_Enum.Aggregations_Mgmt)
            {
                Output.WriteLine("  " + Down_Selected_Tab_Start + aggregations + Down_Selected_Tab_End);
            }
            else
            {
                currentMode.Admin_Type = Admin_Type_Enum.Aggregations_Mgmt;
                Output.WriteLine("  <a href=\"" + currentMode.Redirect_URL() + "\">" + Down_Tab_Start + aggregations + Down_Tab_End + "</a>");
            }

            // Write the interfaces tab
            if (mySobekType == Admin_Type_Enum.Interfaces)
            {
                Output.WriteLine("  " + Down_Selected_Tab_Start + interfaces + Down_Selected_Tab_End);
            }
            else
            {
                currentMode.Admin_Type = Admin_Type_Enum.Interfaces;
                Output.WriteLine("  <a href=\"" + currentMode.Redirect_URL() + "\">" + Down_Tab_Start + interfaces + Down_Tab_End + "</a>");
            }

            // Write the wordmarks / icon tab
            if (mySobekType == Admin_Type_Enum.Wordmarks)
            {
                Output.WriteLine("  " + Down_Selected_Tab_Start + wordmarks + Down_Selected_Tab_End);
            }
            else
            {
                currentMode.Admin_Type = Admin_Type_Enum.Wordmarks;
                Output.WriteLine("  <a href=\"" + currentMode.Redirect_URL() + "\">" + Down_Tab_Start + wordmarks + Down_Tab_End + "</a>");
            }

            // Write the forwarding tab
            if (mySobekType == Admin_Type_Enum.Forwarding)
            {
                Output.WriteLine("  " + Down_Selected_Tab_Start + forwarding + Down_Selected_Tab_End);
            }
            else
            {
                currentMode.Admin_Type = Admin_Type_Enum.Forwarding;
                Output.WriteLine("  <a href=\"" + currentMode.Redirect_URL() + "\">" + Down_Tab_Start + forwarding + Down_Tab_End + "</a>");
            }

            // Write the projects tab
            if (mySobekType == Admin_Type_Enum.Projects)
            {
                Output.WriteLine("  " + Down_Selected_Tab_Start + projects + Down_Selected_Tab_End);
            }
            else
            {
                currentMode.Admin_Type = Admin_Type_Enum.Projects;
                Output.WriteLine("  <a href=\"" + currentMode.Redirect_URL() + "\">" + Down_Tab_Start + projects + Down_Tab_End + "</a>");
            }

            if (!user.Is_System_Admin)
            {
                // Write the thematic headings tab
                if (mySobekType == Admin_Type_Enum.Thematic_Headings)
                {
                    Output.WriteLine("  " + Down_Selected_Tab_Start + thematicHeadings + Down_Selected_Tab_End);
                }
                else
                {
                    currentMode.Admin_Type = Admin_Type_Enum.Thematic_Headings;
                    Output.WriteLine("  <a href=\"" + currentMode.Redirect_URL() + "\">" + Down_Tab_Start + thematicHeadings + Down_Tab_End + "</a>");
                }
            }
            else
            {
                // Write the users tab
                if ((mySobekType == Admin_Type_Enum.Users) || (mySobekType == Admin_Type_Enum.User_Groups))
                {
                    if (submode.Length > 0)
                    {
                        currentMode.Admin_Type       = Admin_Type_Enum.User_Groups;
                        currentMode.My_Sobek_SubMode = String.Empty;
                        Output.WriteLine("  <a href=\"" + currentMode.Redirect_URL() + "\">" + Down_Selected_Tab_Start + users + Down_Selected_Tab_End + "</a>");
                    }
                    else
                    {
                        Output.WriteLine("  " + Down_Selected_Tab_Start + users + Down_Selected_Tab_End);
                    }
                }
                else
                {
                    currentMode.Admin_Type = Admin_Type_Enum.Users;
                    Output.WriteLine("  <a href=\"" + currentMode.Redirect_URL() + "\">" + Down_Tab_Start + users + Down_Tab_End + "</a>");
                }

                // Write the restrictions tab
                if (mySobekType == Admin_Type_Enum.IP_Restrictions)
                {
                    Output.WriteLine("  " + Down_Selected_Tab_Start + restrictions + Down_Selected_Tab_End);
                }
                else
                {
                    currentMode.Admin_Type = Admin_Type_Enum.IP_Restrictions;
                    Output.WriteLine("  <a href=\"" + currentMode.Redirect_URL() + "\">" + Down_Tab_Start + restrictions + Down_Tab_End + "</a>");
                }

                // Write the url portals tab
                if (mySobekType == Admin_Type_Enum.URL_Portals)
                {
                    Output.WriteLine("  " + Down_Selected_Tab_Start + portals + Down_Selected_Tab_End);
                }
                else
                {
                    currentMode.Admin_Type = Admin_Type_Enum.URL_Portals;
                    Output.WriteLine("  <a href=\"" + currentMode.Redirect_URL() + "\">" + Down_Tab_Start + portals + Down_Tab_End + "</a>");
                }

                // Write the builder tab
                if (mySobekType == Admin_Type_Enum.Builder_Status)
                {
                    Output.WriteLine("  " + Down_Selected_Tab_Start + builder + Down_Selected_Tab_End);
                }
                else
                {
                    currentMode.Admin_Type = Admin_Type_Enum.Builder_Status;
                    Output.WriteLine("  <a href=\"" + currentMode.Redirect_URL() + "\">" + Down_Tab_Start + builder + Down_Tab_End + "</a>");
                }
            }

            currentMode.Admin_Type       = mySobekType;
            currentMode.My_Sobek_SubMode = submode;

            Output.WriteLine("");
            Output.WriteLine("</div>");
            Output.WriteLine();
        }