public static MvcHtmlString NavigatePanels(this HtmlHelper helper)
        {
            SiteMapDataSource dataSource = new SiteMapDataSource();
            SiteMapProvider provider = dataSource.Provider;
            StringBuilder builder = new StringBuilder();

            builder.Append("[\n");

            if (provider.RootNode != null)
            {
                int panelCount = 0;
                foreach (SiteMapNode node in provider.RootNode.ChildNodes)
                {
                    foreach (string role in node.Roles)
                    {
                        if ((role == "*") || Roles.IsUserInRole(role))
                        {
                            AppendPanel(builder, node);
                            builder.Append(",\n");
                            panelCount++;
                            break;
                        }
                    }
                }
                if (panelCount != 0)
                {
                    builder.Length -= 2;
                }
                else
                {
                    builder.Append("{title:'请重新登录',lines:false,rootVisible:true,root:{text:'请重新登录', href:'Account/Login', leaf:true}}");
                }
            }
            else
            {
                builder.Append("{title:'登录系统',lines:false,rootVisible:true,root:{text:'登录系统', href:'Account/Login', leaf:true}}");
            }

            builder.Append("]");

            return MvcHtmlString.Create(builder.ToString());
        }
        public static SiteMapDataSource GetSiteMapDataSource(string role)
        {
            string url = String.Empty;

            if (role.Equals("Admin"))

                url = "~/Admin/AdminHomePage.aspx";

            else if (role.Equals("User"))

                url = "~/User/UserHomePage.aspx";

            XmlSiteMapProvider xmlSiteMap = new XmlSiteMapProvider();

            System.Collections.Specialized.NameValueCollection myCollection = new System.Collections.Specialized.NameValueCollection(1);

            myCollection.Add("siteMapFile", "Web.sitemap");

            xmlSiteMap.Initialize("provider", myCollection);

            xmlSiteMap.BuildSiteMap();

            SiteMapDataSource siteMap = new SiteMapDataSource();

            siteMap.StartingNodeUrl = url;

            /* This will not show the starting node and hence giving it

            * the horizontal cool look :)

            * */

            siteMap.ShowStartingNode = false;

            return siteMap;
        }
		public SiteMapDataSourceView (SiteMapDataSource owner, string viewName, SiteMapNodeCollection collection)
		: base (owner, viewName)
		{
			this.collection = collection;
		}
Exemple #4
0
 public SiteMapDataSourceView(SiteMapDataSource owner, string name, SiteMapNodeCollection collection) : base(owner, name)
 {
     this._owner      = owner;
     this._collection = collection;
 }
        private void ShowChildPageMap()
        {
            if (!Visible) { return; }

            SiteSettings siteSettings = CacheHelper.GetCurrentSiteSettings();
            if (siteSettings == null) return;

            siteMapDataSource
                = (SiteMapDataSource)this.Page.Master.FindControl("ChildPageSiteMapData");

            if (siteMapDataSource == null) return;

            siteMapDataSource.SiteMapProvider
                    = "mojosite"
                    + siteSettings.SiteId.ToInvariantString();

            if (WebConfigSettings.DisableViewStateOnSiteMapDataSource)
            {
                siteMapDataSource.EnableViewState = false;
            }

            //SiteMapNode node
            //    = siteMapDataSource.Provider.FindSiteMapNode(Request.RawUrl);
            //if (node != null)
            //{
            //    siteMapDataSource.StartingNodeUrl = Request.RawUrl;
            //}

            SiteMapNode node
                = siteMapDataSource.Provider.FindSiteMapNode(currentPage.Url);
            if (node != null)
            {
                siteMapDataSource.StartingNodeUrl = node.Url;
            }
            else
            {
                node = siteMapDataSource.Provider.FindSiteMapNode(Request.RawUrl);
                if (node != null)
                {
                    siteMapDataSource.StartingNodeUrl = Request.RawUrl;
                }
            }

            #if NET35

            SiteMap1.MenuItemDataBound += new MenuEventHandler(SiteMap_MenuItemDataBound);
            SiteMap1.Orientation = Orientation.Vertical;

            SiteMap1.PathSeparator = '|';
            SiteMap1.MaximumDynamicDisplayLevels = maximumDynamicDisplayLevels;

            SiteMap1.DataSourceID = siteMapDataSource.ID;
            SiteMap1.DataBind();

            #else
            SiteMap1.Visible = false;
            SiteMap2.Visible = true;

            //SiteMap2.SkinID = menuSkinID;
            SiteMap2.PathSeparator = '|';

            SiteMap2.CollapseImageToolTip = Resource.TreeMenuCollapseTooltip;
            SiteMap2.ExpandImageToolTip = Resource.TreeMenuExpandTooltip;

            SiteMap2.TreeNodeDataBound += new TreeNodeEventHandler(SiteMap2_TreeNodeDataBound);
            SiteMap2.DataSourceID = siteMapDataSource.ID;
            SiteMap2.DataBind();

            #endif
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (HttpContext.Current == null) { return; }

            siteSettings = CacheHelper.GetCurrentSiteSettings();

            SkinBaseUrl = SiteUtils.GetSkinBaseUrl(Page);

            isMobileDevice = SiteUtils.IsMobileDevice();

            if (Page is CmsPage)
            {
                isCmsPage = true;
                currentPage = CacheHelper.GetCurrentPage();
            }

            if (siteSettings == null) { return; }

            siteMapDataSource = (SiteMapDataSource)this.FindControl("SiteMapData");
            if(siteMapDataSource == null){ return;}

            siteMapDataSource.SiteMapProvider
                    = "mojosite" + siteSettings.SiteId.ToInvariantString();

            try {
                rootNode = siteMapDataSource.Provider.RootNode;
            }
            catch(HttpException) {
                return;
            }

            Control c = this.FindControl("StyleSheetCombiner");
            if ((c != null) && (c is StyleSheetCombiner))
            {
                StyleSheetCombiner style = c as StyleSheetCombiner;
                useArtisteer3 = style.UseArtisteer3;
                hideEmptyAlt1 = style.HideEmptyAlt1;
                hideEmptyAlt2 = style.HideEmptyAlt2;
            }

            if (!useArtisteer3)
            {
                Control l = this.FindControl("LayoutDisplaySettings1");
                if ((l != null) && (l is LayoutDisplaySettings))
                {
                    LayoutDisplaySettings layoutSettings = l as LayoutDisplaySettings;
                    leftSideNoRightSideCss = layoutSettings.LeftSideNoRightSideCss;
                    rightSideNoLeftSideCss = layoutSettings.RightSideNoLeftSideCss;
                    leftAndRightNoCenterCss = layoutSettings.LeftAndRightNoCenterCss;
                    leftOnlyCss = layoutSettings.LeftOnlyCss;
                    rightOnlyCss = layoutSettings.RightOnlyCss;
                    centerNoLeftSideCss = layoutSettings.CenterNoLeftSideCss;
                    centerNoRightSideCss = layoutSettings.CenterNoRightSideCss;
                    centerNoLeftOrRightSideCss = layoutSettings.CenterNoLeftOrRightSideCss;
                    centerWithLeftAndRightSideCss = layoutSettings.CenterWithLeftAndRightSideCss;
                    emptyCenterCss = layoutSettings.EmptyCenterCss;
                    hideEmptyCenterIfOnlySidesHaveContent = layoutSettings.HideEmptyCenterIfOnlySidesHaveContent;

                }
            }

            SetupLayout();
        }
        private void PopulatePageList(Collection<DictionaryEntry> deCollection)
        {
            siteMapDataSource = (SiteMapDataSource)this.Page.Master.FindControl("SiteMapData");

            siteMapDataSource.SiteMapProvider
                    = "mojosite" + siteSettings.SiteId.ToString(CultureInfo.InvariantCulture);

            SiteMapNode siteMapNode = siteMapDataSource.Provider.RootNode;

            PopulatePageDictionary(deCollection, siteMapNode, string.Empty);
        }
        private void PopulatePageList()
        {
            if (!divParentPage.Visible) { return; }

            siteMapDataSource = (SiteMapDataSource)this.Page.Master.FindControl("SiteMapData");

            siteMapDataSource.SiteMapProvider
                    = "mojosite" + siteSettings.SiteId.ToInvariantString();

            SiteMapNode siteMapNode = siteMapDataSource.Provider.RootNode;

            PopulateListControl(ddPages, siteMapNode, string.Empty);
        }
        private void RenderPages(HttpContext context)
        {
            serverName = WebUtils.GetHostName();
            string serverPort = context.Request.ServerVariables["SERVER_PORT"];
            if ((serverPort != "80") && (serverPort != "443"))
            {
                serverName += ":" + serverPort;
            }

            SiteMapDataSource siteMapDataSource = new SiteMapDataSource();

            siteMapDataSource.SiteMapProvider = "mojosite" + siteSettings.SiteId.ToInvariantString();

            SiteMapNode siteMapNode = siteMapDataSource.Provider.RootNode;

            RenderSiteMapNodes(context, siteMapNode, string.Empty);
        }
 public SiteMapDataSourceView(SiteMapDataSource owner, string name, System.Web.SiteMapNodeCollection collection) : base(default(System.Web.UI.IDataSource), default(string))
 {
 }
 public SiteMapDesignerDataSourceView(SiteMapDataSourceDesigner owner, string viewName) : base(owner, viewName)
 {
     this._owner = owner;
     this._siteMapDataSource = (SiteMapDataSource) this._owner.Component;
 }
Exemple #12
0
        private void PopulateMenu()
        {
            resolveFullUrlsForMenuItemProtocolDifferences = WebConfigSettings.ResolveFullUrlsForMenuItemProtocolDifferences;
            if (resolveFullUrlsForMenuItemProtocolDifferences)
            {
                secureSiteRoot = WebUtils.GetSecureSiteRoot();
                insecureSiteRoot = secureSiteRoot.Replace("https", "http");
            }

            isSecureRequest = SiteUtils.IsSecureRequest();

            if (Page is mojoBasePage)
            {
                mojoBasePage basePage = Page as mojoBasePage;
                enableUnclickableLinks = basePage.StyleCombiner.EnableNonClickablePageLinks;
                useMenuTooltipForCustomCss = basePage.StyleCombiner.UseMenuTooltipForCustomCss;
            }

            isMobileSkin = SiteUtils.UseMobileSkin();

            pageMapDataSource = (SiteMapDataSource)this.Page.Master.FindControl(siteMapDataSource);

            if (pageMapDataSource == null) { return; }

            pageMapDataSource.SiteMapProvider = "mojosite" + siteSettings.SiteId.ToInvariantString();
            if (WebConfigSettings.DisableViewStateOnSiteMapDataSource)
            {
                pageMapDataSource.EnableViewState = false;
            }

            if (startingNodeOffset > 0)
            {
                currentPageDepth = SiteUtils.GetCurrentPageDepth(pageMapDataSource.Provider.RootNode);

                if (currentPageDepth >= startingNodeOffset)
                {
                    startingNodeOffset -= 1;
                }

            }

            if ((isSubMenu) && (SiteUtils.TopPageHasChildren(pageMapDataSource.Provider.RootNode, startingNodeOffset)))
            {
                currentPage = CacheHelper.GetCurrentPage();
                bool showMenu = true;

                if (siteSettings == null)
                {
                    showMenu = false;
                    log.Error("tried to get siteSettings in Page_Load of PageeMenu.ascx but it came back null");
                }

                if (currentPage == null)
                {
                    showMenu = false;
                    log.Error("tried to get currentPage in Page_Load of PageeMenu.ascx but it came back null");
                }

                if (
                    (siteSettings != null)
                    && (currentPage != null)
                    && (startingNodeUrl.Length == 0)
                    && (siteSettings.AllowHideMenuOnPages)
                    )
                {
                    if (currentPage.HideMainMenu)
                    {
                        showMenu = false;
                    }
                }
                if (showMenu)
                {
                    // isAdmin = WebUser.IsAdmin;
                    // isContentAdmin = WebUser.IsContentAdmin;
                    if (useFlexMenu)
                    {
                        RenderFlexMenu();
                    }
                    else if (useTreeView)
                    {
                        RenderTreeView();
                    }
                    else
                    {
                        RenderMenu();
                    }
                }
                else
                {
                    this.Visible = false;
                }
            }
            else if (!isSubMenu)
            {
                // isAdmin = WebUser.IsAdmin;
                // isContentAdmin = WebUser.IsContentAdmin;
                if (useFlexMenu)
                {
                    RenderFlexMenu();
                }
                else if (useTreeView)
                {
                    RenderTreeView();
                }
                else
                {
                    RenderMenu();
                }
            }
            else
            {
                this.Visible = false;
                this.EnableViewState = false;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (HttpContext.Current == null) return;

            EnableViewState = false;

            siteSettings = CacheHelper.GetCurrentSiteSettings();
            if (siteSettings == null) return;

            currentPage = CacheHelper.GetCurrentPage();
            if (currentPage == null) { return; }

            siteMapDataSource = (SiteMapDataSource)this.Page.Master.FindControl("SiteMapData");
            if (siteMapDataSource == null) return;

            siteMapDataSource.SiteMapProvider
                = "mojosite" + siteSettings.SiteId.ToInvariantString();

            if (WebConfigSettings.DisableViewStateOnSiteMapDataSource)
            {
                siteMapDataSource.EnableViewState = false;
            }

            isAdmin = WebUser.IsAdmin;
            if (!isAdmin) { isContentAdmin = WebUser.IsContentAdmin; }
            if ((!isAdmin) && (!isContentAdmin)) { isSiteEditor = SiteUtils.UserIsSiteEditor(); }

            //siteRoot = siteSettings.SiteRoot;
            siteRoot = SiteUtils.GetNavigationSiteRoot();

            if (Page is mojoBasePage)
            {
                mojoBasePage basePage = Page as mojoBasePage;
                enableUnclickableLinks = basePage.StyleCombiner.EnableNonClickablePageLinks;
            }

            DoRendering();
        }
 public SiteMapDataSourceView (SiteMapDataSource owner, string name, System.Web.SiteMapNodeCollection collection) : base (default(System.Web.UI.IDataSource), default(string))
 {
 }
Exemple #15
0
        public static void PropagateCurrentPagePermissionsToAllChildPages()
        {
            SiteSettings siteSettings = CacheHelper.GetCurrentSiteSettings();
            if (siteSettings == null) { return; }

            SiteMapDataSource siteMapDataSource = new SiteMapDataSource();

            siteMapDataSource.SiteMapProvider = "mojosite" + siteSettings.SiteId.ToInvariantString();

            mojoSiteMapNode currentPageNode = GetCurrentPageSiteMapNode(siteMapDataSource.Provider.RootNode);

            foreach (SiteMapNode childNode in currentPageNode.GetAllNodes())
            {
                if (!(childNode is mojoSiteMapNode)) { continue; }

                mojoSiteMapNode node = childNode as mojoSiteMapNode;
                PageSettings p = new PageSettings(node.PageGuid);
                p.AuthorizedRoles = currentPageNode.ViewRoles;
                p.EditRoles = currentPageNode.EditRoles;
                p.CreateChildPageRoles = currentPageNode.CreateChildPageRoles;
                p.DraftEditOnlyRoles = currentPageNode.DraftEditRoles;
                p.CreateChildDraftRoles = currentPageNode.CreateChildDraftPageRoles;
                p.Save();

            }

            CacheHelper.ResetSiteMapCache(siteSettings.SiteId);
        }
 public override void Initialize(IComponent component)
 {
     ControlDesigner.VerifyInitializeArgument(component, typeof(System.Web.UI.WebControls.SiteMapDataSource));
     base.Initialize(component);
     this._siteMapDataSource = (System.Web.UI.WebControls.SiteMapDataSource) component;
 }
        private void PopulateControls()
        {
            bool hideMenu = siteSettings.AllowHideMenuOnPages && currentPage.HideMainMenu;
            if (showPages && !hideMenu)
            {
                if (useFlexMenu)
                {
                    FlexMenu menu = new FlexMenu();
                    menu.SkinID = menuSkinID;
                    menu.EnableTheming = true;
                    menu.IsMobileSkin = isMobileSkin;
                    this.menuPlaceHolder.Controls.Add(menu);
                }
                else
                {

                    siteMapDataSource = (SiteMapDataSource)this.Page.Master.FindControl(dataSourceId);
                    if (siteMapDataSource == null) return;

                    siteMapDataSource.SiteMapProvider = "mojosite" + siteSettings.SiteId.ToInvariantString();
                    if (WebConfigSettings.DisableViewStateOnSiteMapDataSource)
                    {
                        siteMapDataSource.EnableViewState = false;
                    }

                    if (this.useTreeView)
                    {
                        RenderTreeView();
                    }
                    else
                    {
                        RenderMenu();
                    }
                }

            }
        }
Exemple #18
0
 public SiteMapDataSourceView(SiteMapDataSource owner, string viewName, SiteMapNodeCollection collection)
     : base(owner, viewName)
 {
     this.collection = collection;
 }
        private bool IsHomePage(int pageId)
        {
            SiteMapDataSource siteMapDataSource = new SiteMapDataSource();
            siteMapDataSource.SiteMapProvider = "mojosite" + siteSettings.SiteId.ToInvariantString();

            SiteMapNode rootNode = siteMapDataSource.Provider.RootNode;
            //first child node of root is home page
            mojoSiteMapNode homePage = rootNode.ChildNodes[0] as mojoSiteMapNode;

            if ((homePage != null) && (homePage.PageId == pageId)) { return true; }

            return false;
        }
Exemple #20
0
        private void GenerateSiteMap(HttpContext context)
        {
            //secureSiteRoot = SiteUtils.GetSecureNavigationSiteRoot();
            //insecureSiteRoot = SiteUtils.GetNavigationSiteRoot();
            insecureSiteRoot = WebUtils.GetInSecureSiteRoot();
            if (SiteUtils.SslIsAvailable())
            {
                secureSiteRoot = insecureSiteRoot.Replace("http://", "https://");
            }
            else
            {
                secureSiteRoot = insecureSiteRoot;
            }

            //secureSiteRoot = WebUtils.GetSecureSiteRoot();
            //insecureSiteRoot = secureSiteRoot.Replace("https", "http");

            Page page = new Page();
            page.AppRelativeVirtualPath = context.Request.AppRelativeCurrentExecutionFilePath;

            context.Response.Expires = -1;
            context.Response.ContentType = "application/xml";
            Encoding encoding = new UTF8Encoding();
            context.Response.ContentEncoding = encoding;

            using (XmlTextWriter xmlTextWriter = new XmlTextWriter(context.Response.OutputStream, encoding))
            {
                xmlTextWriter.Formatting = Formatting.Indented;

                xmlTextWriter.WriteStartDocument();

                xmlTextWriter.WriteStartElement("urlset");
                xmlTextWriter.WriteStartAttribute("xmlns");
                xmlTextWriter.WriteValue("http://www.sitemaps.org/schemas/sitemap/0.9");
                xmlTextWriter.WriteEndAttribute();

                siteSettings = CacheHelper.GetCurrentSiteSettings();
                //string siteRoot;
                //if (WebConfigSettings.UseFoldersInsteadOfHostnamesForMultipleSites)
                //{
                //    siteRoot = WebUtils.GetSiteRoot();
                //}
                //else
                //{
                //    siteRoot = SiteUtils.GetNavigationSiteRoot();
                //}

                SiteMapDataSource siteMapDataSource = new SiteMapDataSource();

                siteMapDataSource.SiteMapProvider
                        = "mojosite" + siteSettings.SiteId.ToString(CultureInfo.InvariantCulture);

                SiteMapNode siteMapNode = siteMapDataSource.Provider.RootNode;
                ArrayList alreadyAddedUrls = new ArrayList();

                RenderNodesToSiteMap(
                    context,
                    page,
                    xmlTextWriter,
                    alreadyAddedUrls,
                    siteMapNode);

                xmlTextWriter.WriteEndElement(); //urlset

                //end of document
                xmlTextWriter.WriteEndDocument();

            }
        }
        private bool IsValidParentPage(PageSettings page, PageSettings requestedParent)
        {
            // new parent cannot be a descendant of page

            SiteMapDataSource siteMapDataSource = new SiteMapDataSource();
            siteMapDataSource.SiteMapProvider = "mojosite" + siteSettings.SiteId.ToInvariantString();

            SiteMapNode rootNode = siteMapDataSource.Provider.RootNode;

            mojoSiteMapNode currentPageNode = SiteUtils.GetSiteMapNodeForPage(rootNode, page);

            if (currentPageNode != null)
            {
                SiteMapNodeCollection descendantNodes = currentPageNode.GetAllNodes();
                foreach (SiteMapNode node in descendantNodes)
                {
                    mojoSiteMapNode mojoNode = node as mojoSiteMapNode;
                    if (mojoNode.PageId == requestedParent.PageId) { return false; }
                }
            }
            else
            {
                throw new MetaWeblogException("11", "Could not validate parent page from site map.");
            }

            return true;
        }
        private void PopulatePageArray()
        {
            siteMapDataSource = (SiteMapDataSource)this.Page.Master.FindControl("SiteMapData");

            siteMapDataSource.SiteMapProvider
                    = "mojosite" + siteSettings.SiteId.ToString(CultureInfo.InvariantCulture);

            SiteMapNode siteMapNode = siteMapDataSource.Provider.RootNode;
            mojoSiteMapProvider.PopulateArrayList(sitePages, siteMapNode);
        }
Exemple #23
0
        /// <summary>
        /// this is a rather heavy method and should only be used judiciously becuase it must 
        /// recurse through the entire site map to determin if the user has any permission to create pages
        /// </summary>
        /// <returns></returns>
        public static bool UserHasAnyCreatePagePermissions(SiteSettings siteSettings)
        {
            if (siteSettings == null) { return false; }

            if (WebUser.IsInRoles(siteSettings.RolesThatCanCreateRootPages)) { return true; }

            SiteMapDataSource siteMapDataSource = new SiteMapDataSource();

            siteMapDataSource.SiteMapProvider = "mojosite" + siteSettings.SiteId.ToInvariantString();

            SiteMapNode siteMapNode = siteMapDataSource.Provider.RootNode;

            return CanCreatePages(siteMapNode);
        }
		public SiteMapDataSourceView GetDataSourceView (SiteMapDataSource owner, string viewName)
		{
			return new SiteMapDataSourceView (owner, viewName, this);
		}
 public SiteMapDataSourceView(SiteMapDataSource owner, string name, SiteMapNode node) : base(owner, name) {
     _owner = owner;
     _collection = new SiteMapNodeCollection(node);
 }
Exemple #26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if ((SiteUtils.SslIsAvailable()) && ((WebConfigSettings.UseSslForSiteMap)||(siteSettings.UseSslOnAllPages)))
            {
                SiteUtils.ForceSsl();
            }
            else
            {
                SiteUtils.ClearSsl();
            }

            Title = SiteUtils.FormatPageTitle(siteSettings, Resource.SiteMapLink);
            heading.Text = Resource.SiteMapLink;

            //this page has no content other than nav
            SiteUtils.AddNoIndexFollowMeta(Page);

            resolveFullUrlsForMenuItemProtocolDifferences = WebConfigSettings.ResolveFullUrlsForMenuItemProtocolDifferences;
            if (resolveFullUrlsForMenuItemProtocolDifferences)
            {
                secureSiteRoot = WebUtils.GetSecureSiteRoot();
                insecureSiteRoot = secureSiteRoot.Replace("https", "http");
            }

            isSecureRequest = SiteUtils.IsSecureRequest();
            isMobileSkin = SiteUtils.UseMobileSkin();
            isAdmin = WebUser.IsAdmin;
            if (!isAdmin) { isContentAdmin = WebUser.IsContentAdmin; }
            if ((!isAdmin) && (!isContentAdmin)) { isSiteEditor = SiteUtils.UserIsSiteEditor(); }

            useMenuTooltipForCustomCss = StyleCombiner.UseMenuTooltipForCustomCss;

            MetaDescription = string.Format(CultureInfo.InvariantCulture,
                Resource.MetaDescriptionSiteMapFormat, siteSettings.SiteName);

            siteMapDataSource = (SiteMapDataSource)this.Page.Master.FindControl("SiteMapData");

            siteMapDataSource.SiteMapProvider = "mojosite" + siteSettings.SiteId.ToInvariantString();

            if (Request.Params["startnode"] != null)
            {
                string startNode = Server.UrlDecode(Request.Params["startnode"]);
                SiteMapNode node
                    = siteMapDataSource.Provider.FindSiteMapNode(startNode);
                if (node != null)
                {
                    siteMapDataSource.StartingNodeUrl = startNode;
                }
            }

            useImagesInSiteMap = WebConfigSettings.UsePageImagesInSiteMap;

            AddClassToBody("sitemappage");

            RenderSiteMap();
        }
 public SiteMapDataSourceView(SiteMapDataSource owner, string name, SiteMapNodeCollection collection) : base(owner, name) {
     _owner = owner;
     _collection = collection;
 }
		public SiteMapDataSourceView (SiteMapDataSource owner, string viewName, SiteMapNode node)
		: this (owner, viewName, new SiteMapNodeCollection (node))
		{
		}
 /// <summary>
 /// Get SiteMapNodes to be used for Cross Reference UI
 /// </summary>
 /// <param name="dataSource">Site map DataSource</param>
 /// <returns>SiteMap Node Collection</returns>
 public static SiteMapNodeCollection GetSiteMapNodesForCrossReferences(SiteMapDataSource dataSource)
 {
     return System.Web.SiteMap.CurrentNode.ChildNodes;
 }
Exemple #30
0
 public SiteMapDataSourceView(SiteMapDataSource owner, string name, SiteMapNode node) : base(owner, name)
 {
     this._owner      = owner;
     this._collection = new SiteMapNodeCollection(node);
 }
Exemple #31
0
 public SiteMapDataSourceView(SiteMapDataSource owner, string viewName, SiteMapNode node)
     : this(owner, viewName, new SiteMapNodeCollection(node))
 {
 }
 public override void Initialize(IComponent component)
 {
     ControlDesigner.VerifyInitializeArgument(component, typeof(System.Web.UI.WebControls.SiteMapDataSource));
     base.Initialize(component);
     this._siteMapDataSource = (System.Web.UI.WebControls.SiteMapDataSource)component;
 }
Exemple #33
0
        private void LoadSettings()
        {
            siteSettings = CacheHelper.GetCurrentSiteSettings();

            isAdmin = WebUser.IsAdmin;
            if (!isAdmin) { isContentAdmin = WebUser.IsContentAdmin; }
            if ((!isAdmin) && (!isContentAdmin)) { isSiteEditor = SiteUtils.UserIsSiteEditor(); }

            resolveFullUrlsForMenuItemProtocolDifferences = WebConfigSettings.ResolveFullUrlsForMenuItemProtocolDifferences;
            if (resolveFullUrlsForMenuItemProtocolDifferences)
            {
                secureSiteRoot = WebUtils.GetSecureSiteRoot();
                insecureSiteRoot = WebUtils.GetInSecureSiteRoot();
            }

            isSecureRequest = SiteUtils.IsSecureRequest();

            siteMapDataSource = new SiteMapDataSource();
            siteMapDataSource.SiteMapProvider = "mojosite" + siteSettings.SiteId.ToInvariantString();

            rootNode = siteMapDataSource.Provider.RootNode;
            currentNode = SiteUtils.GetCurrentPageSiteMapNode(rootNode);
            startingNode = rootNode;

            if (startingNodePageId > -1)
            {
                startingNode = SiteUtils.GetSiteMapNodeForPage(rootNode, startingNodePageId);
            }
            else if (startingNodeOffset > -1)
            {
                startingNode = SiteUtils.GetOffsetNode(currentNode, startingNodeOffset);
            }
            //else if (isSubMenu)
            //{
            //    startingNode = SiteUtils.GetTopLevelParentNode(currentNode);
            //}
        }