FindHome() public method

public FindHome ( System.Guid siteID ) : ContentPage
siteID System.Guid
return ContentPage
Esempio n. 1
0
        public static ContentPage GetPage(string sCurrentPage)
        {
            ContentPage pageContents = null;

            using (ContentPageHelper pageHelper = new ContentPageHelper()) {
                if (SecurityData.IsAdmin || SecurityData.IsSiteEditor) {
                    if (sCurrentPage.Length <= 1 || sCurrentPage == SiteData.DefaultDirectoryFilename) {
                        pageContents = pageHelper.FindHome(SiteData.CurrentSiteID);
                    } else {
                        pageContents = pageHelper.FindByFilename(SiteData.CurrentSiteID, sCurrentPage);
                    }
                } else {
                    if (sCurrentPage.Length <= 1 || sCurrentPage == SiteData.DefaultDirectoryFilename) {
                        pageContents = pageHelper.FindHome(SiteData.CurrentSiteID, true);
                    } else {
                        pageContents = pageHelper.GetLatestContentByURL(SiteData.CurrentSiteID, true, sCurrentPage);
                    }
                }
            }

            return pageContents;
        }
Esempio n. 2
0
        public static ContentPage GetCurrentLivePage()
        {
            ContentPage pageContents = null;

            using (ContentPageHelper pageHelper = new ContentPageHelper()) {
                bool IsPageTemplate = false;
                string sCurrentPage = SiteData.CurrentScriptName;
                string sScrubbedURL = SiteData.AlternateCurrentScriptName;

                if (sScrubbedURL.ToLower() != sCurrentPage.ToLower()) {
                    sCurrentPage = sScrubbedURL;
                }

                if (SecurityData.IsAdmin || SecurityData.IsSiteEditor) {
                    if (sCurrentPage.Length <= 1 || sCurrentPage == SiteData.DefaultDirectoryFilename) {
                        pageContents = pageHelper.FindHome(SiteData.CurrentSiteID);
                    } else {
                        pageContents = pageHelper.FindByFilename(SiteData.CurrentSiteID, sCurrentPage);
                    }
                } else {
                    if (sCurrentPage.Length <= 1 || sCurrentPage == SiteData.DefaultDirectoryFilename) {
                        pageContents = pageHelper.FindHome(SiteData.CurrentSiteID, true);
                    } else {
                        pageContents = pageHelper.GetLatestContentByURL(SiteData.CurrentSiteID, true, sCurrentPage);
                    }
                }

                if (pageContents == null && SiteData.IsPageReal) {
                    IsPageTemplate = true;
                }

                if ((SiteData.IsPageSampler || IsPageTemplate || !IsWebView) && pageContents == null) {
                    pageContents = ContentPageHelper.GetSamplerView();
                }

                if (IsPageTemplate) {
                    pageContents.TemplateFile = sCurrentPage;
                }
            }

            return pageContents;
        }