• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Business.SiteSettings类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中mojoPortal.Business.SiteSettings的典型用法代码示例。如果您正苦于以下问题:C# SiteSettings类的具体用法?C# SiteSettings怎么用?C# SiteSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SiteSettings类属于mojoPortal.Business命名空间,在下文中一共展示了SiteSettings类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetCountOfState

        public static int GetCountOfState(
            SiteSettings siteSettings,
            PersonalizationScope scope,
            PersonalizationStateQuery query)
        {
            int result = 0;

            if (siteSettings != null)
            {
                Guid userGuid = Guid.Empty;
                if ((query.UsernameToMatch != null) && (query.UsernameToMatch.Length > 0))
                {
                    SiteUser siteUser = new SiteUser(siteSettings, query.UsernameToMatch);
                    if (siteUser.UserId > 0)
                    {
                        userGuid = siteUser.UserGuid;
                    }

                }

                bool allUsersScope = (scope == PersonalizationScope.Shared);
                result = SitePersonalization.GetCountOfState(
                    siteSettings.SiteId,
                    query.PathToMatch,
                    allUsersScope,
                    userGuid,
                    query.UserInactiveSinceDate);

            }

            return result;
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:32,代码来源:PersonalizationHelper.cs


示例2: BindList

        private void BindList()
        {
            if (siteSettings == null) { siteSettings = CacheHelper.GetCurrentSiteSettings(); }
            //why is this null here, its declared
            if (chkAllowedRoles == null)
            {
                chkAllowedRoles = new CheckBoxList();
                if (this.Controls.Count == 0) { this.Controls.Add(chkAllowedRoles); }
            }

            chkAllowedRoles.Items.Clear();

            ListItem allItem = new ListItem();
            allItem.Text = Resource.RolesAllUsersRole;
            allItem.Value = "All Users";
            chkAllowedRoles.Items.Add(allItem);

            using (IDataReader reader = Role.GetSiteRoles(siteSettings.SiteId))
            {
                while (reader.Read())
                {
                    ListItem listItem = new ListItem();
                    listItem.Text = reader["DisplayName"].ToString();
                    listItem.Value = reader["RoleName"].ToString();

                    if ((selectedRoles.LastIndexOf(listItem.Value + ";") > -1))
                    {
                        listItem.Selected = true;
                    }

                    chkAllowedRoles.Items.Add(listItem);

                }
            }
        }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:35,代码来源:AllowedRolesSetting.ascx.cs


示例3: LoadSettings

        private void LoadSettings()
        {
            siteSettings = CacheHelper.GetCurrentSiteSettings();

            if (WebUser.IsAdminOrContentAdmin || WebUser.IsInRoles(siteSettings.RolesThatCanDeleteFilesInEditor) || SiteUtils.UserIsSiteEditor())
            {
                canAccess = true;
            }
        }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:9,代码来源:FileManagerAltDialog.aspx.cs


示例4: GetFileSystem

        public override IFileSystem GetFileSystem(IFileSystemPermission permission)
        {
            siteSettings = CacheHelper.GetCurrentSiteSettings();
            //IFileSystemPermission p = GetFileSystemPermission();
            if (permission == null) { return null; }
            if (string.IsNullOrEmpty(permission.VirtualRoot)) { return null; }

            return DiskFileSystem.GetFileSystem(permission);
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:9,代码来源:DiskFileSystemProvider.cs


示例5: ProcessRequest

        public void ProcessRequest(HttpContext context)
        {
            siteSettings = CacheHelper.GetCurrentSiteSettings();
            if (siteSettings == null)
            {

                return;
            }
            RenderJsonList(context);
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:10,代码来源:CKeditorStyles.ashx.cs


示例6: DeleteSiteContent

        public override void DeleteSiteContent(int siteId)
        {
            SiteSettings siteSettings = new SiteSettings(siteId);
            CommerceReport.DeleteBySite(siteSettings.SiteGuid);
            FileAttachment.DeleteBySite(siteSettings.SiteGuid);
            EmailSendLog.DeleteBySite(siteSettings.SiteGuid);
            EmailTemplate.DeleteBySite(siteSettings.SiteGuid);
            ContentHistory.DeleteBySite(siteSettings.SiteGuid);
            ContentWorkflow.DeleteBySite(siteSettings.SiteGuid);

            ContentMetaRespository metaRepository = new ContentMetaRespository();
            metaRepository.DeleteBySite(siteSettings.SiteGuid);
        }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:13,代码来源:CoreDataSitePreDeleteHandler.cs


示例7: ProcessRequest

        public void ProcessRequest(HttpContext context)
        {
            siteSettings = CacheHelper.GetCurrentSiteSettings();
            if (siteSettings == null)
            {
                //TODO: should we return some xml with an error message?
                return;
            }

            imagebaseUrl = WebUtils.GetSiteRoot() + "/Data/Sites/" + siteSettings.SiteId.ToString(CultureInfo.InvariantCulture) +"/htmltemplateimages/";

            RenderXml(context);
        }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:13,代码来源:HtmlTemplates.ashx.cs


示例8: LoadSettings

        private void LoadSettings(HttpContext context)
        {
            rpxToken = context.Request.Params.Get("token");

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

            //if (siteSettings.SiteRoot.Length > 0)
            //{
            //    siteRoot = siteSettings.SiteRoot;
            //}
            //else
            //{
                siteRoot = SiteUtils.GetNavigationSiteRoot();
            //}
        }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:16,代码来源:RpxPluginResponseHandler.ashx.cs


示例9: LoadPersonalizationBlobs

        public static void LoadPersonalizationBlobs(
            SiteSettings siteSettings,
            WebPartManager webPartManager,
            string path,
            string userName,
            ref byte[] sharedDataBlob,
            ref byte[] userDataBlob)
        {
            if (siteSettings != null)
            {
                if ((userName != null) && (userName.Length > 0))
                {
                    SiteUser siteUser = new SiteUser(siteSettings, userName);
                    Guid userID = Guid.Empty;
                    if (siteUser.UserId > 0)
                    {
                        userID = siteUser.UserGuid;
                    }

                    if (userID != Guid.Empty)
                    {
                        userDataBlob = SitePersonalization.GetPersonalizationBlob(
                            siteSettings.SiteId,
                            path,
                            userID);

                        siteUser.UpdateLastActivityTime();

                        sharedDataBlob = SitePersonalization.GetPersonalizationBlobAllUsers(
                            siteSettings.SiteId,
                            path);

                    }
                }
                else
                {
                    //TODO: tracking/personalization for unauthenticated users?

                    sharedDataBlob = SitePersonalization.GetPersonalizationBlobAllUsers(
                            siteSettings.SiteId,
                            path);

                }

            }
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:46,代码来源:PersonalizationHelper.cs


示例10: LoadSettings

        private void LoadSettings(HttpContext context)
        {
            siteSettings = CacheHelper.GetCurrentSiteSettings();
            if (siteSettings == null) { return; }

            pageId = WebUtils.ParseInt32FromQueryString("pageid", true, pageId);
            moduleId = WebUtils.ParseInt32FromQueryString("mid", true, moduleId);

            if (moduleId == -1) { return; }
            if (pageId == -1) { return; }

            galleryPage = new PageSettings(siteSettings.SiteId, pageId);
            if (galleryPage.PageId == -1) { return; }

            galleryModule = new Module(moduleId, pageId);
            if (galleryModule.ModuleId == -1) { return; }

            if ((!WebUser.IsInRoles(galleryPage.AuthorizedRoles)) && (!WebUser.IsInRoles(galleryModule.ViewRoles))) { return; }

            siteRoot = WebUtils.GetSiteRoot();

            //thumbnailBaseUrl = siteRoot + "/Data/Sites/" + siteSettings.SiteId.ToInvariantString()
            //    + "/GalleryImages/" + moduleId.ToInvariantString() + "/Thumbnails/";

            //fullSizeBaseUrl = siteRoot + "/Data/Sites/" + siteSettings.SiteId.ToInvariantString()
            //    + "/GalleryImages/" + moduleId.ToInvariantString() + "/WebImages/";

            string baseUrl;
            if (WebConfigSettings.ImageGalleryUseMediaFolder)
            {
                baseUrl = siteRoot + "/Data/Sites/" + siteSettings.SiteId.ToInvariantString() + "/media/GalleryImages/" + moduleId.ToInvariantString() + "/";
            }
            else
            {
                baseUrl = siteRoot + "/Data/Sites/" + siteSettings.SiteId.ToInvariantString() + "/GalleryImages/" + moduleId.ToInvariantString() + "/";
            }

            thumbnailBaseUrl = baseUrl + "Thumbnails/";

            fullSizeBaseUrl = baseUrl + "WebImages/";

            gallery = new Gallery(moduleId);

            canRender = true;
        }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:45,代码来源:GalleryDataService.ashx.cs


示例11: LoadAndValidateForumObjects

        private bool LoadAndValidateForumObjects()
        {
            siteSettings = CacheHelper.GetCurrentSiteSettings();
            if(siteSettings == null)
            {
                //log.Info("SiteSettings was null");
                return false;
            }
            currentPage = CacheHelper.GetPage(pageId);
            if (
                (currentPage.PageId != pageId)
                || (currentPage.SiteId != siteSettings.SiteId)
                )
            {
                log.Info("request rejected - pageid did not match");
                return false;
            }

            thread = new ForumThread(threadId, postId);

            if (thread.ModuleId != moduleId)
            {
                log.Info("thread module id did not match");
                return false;
            }
            forum = new Forum(thread.ForumId);

            module = GetModule(thread.ModuleId);
            if (module == null)
            {
                log.Info("module not found in page modules");
                return false;
            }
            config = new ForumConfiguration(ModuleSettings.GetModuleSettings(module.ModuleId));
            if(thread.PostUserId > -1)
            {
                postUser = new SiteUser(siteSettings, thread.PostUserId);
            }

            return UserCanModerate();
        }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:41,代码来源:Mod.ashx.cs


示例12: Page_Load

        // TODO: add link for site mail when authenticated
        // set to use top 30 here, link to OnlineMembers.aspx
        // for page able list of online members
        //
        protected void Page_Load(object sender, EventArgs e)
        {
            siteSettings = CacheHelper.GetCurrentSiteSettings();

            if (siteSettings == null) { this.Visible = false; return; }

            siteRoot = SiteUtils.GetNavigationSiteRoot();

            switch (siteSettings.AvatarSystem)
            {
                case "gravatar":
                    allowGravatars = true;
                    disableAvatars = false;
                    break;

                case "internal":
                    allowGravatars = false;
                    disableAvatars = false;
                    break;

                case "none":
                default:
                    allowGravatars = false;
                    disableAvatars = true;
                    break;

            }

            toolTipPrefix = Resource.OnlineMemberListProfileLinkPrefix;

            isAdmin = WebUser.IsAdmin;

            //if (Context.Request.IsAuthenticated)
            //{
            //    isAuthenticated = true;
            //}

            siteMailEnabled = WebConfigSettings.UseSiteMailFeature;

            PopulateControls();
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:45,代码来源:OnlineMemberListControl.ascx.cs


示例13: InstallContent

        public void InstallContent(Module module, string configInfo)
        {
            HtmlContent htmlContent = new HtmlContent();
            htmlContent.ModuleId = module.ModuleId;
            if (configInfo.StartsWith("~/"))
            {
                if (File.Exists(HostingEnvironment.MapPath(configInfo)))
                {
                    htmlContent.Body = File.ReadAllText(HostingEnvironment.MapPath(configInfo), Encoding.UTF8);
                }
            }
            else
            {
                htmlContent.Body = ResourceHelper.GetMessageTemplate(CultureInfo.CurrentUICulture, configInfo);
            }

            htmlContent.ModuleGuid = module.ModuleGuid;

            SiteSettings siteSettings = new SiteSettings(module.SiteId);
            SiteUser adminUser = null;
            if (siteSettings.UseEmailForLogin)
            {
                adminUser = new SiteUser(siteSettings, "[email protected]");
                if (adminUser.UserId == -1) { adminUser = null; }
            }
            else
            {
                adminUser = new SiteUser(siteSettings, "admin");
                if (adminUser.UserId == -1) { adminUser = null; }
            }

            if (adminUser != null)
            {
                htmlContent.UserGuid = adminUser.UserGuid;
                htmlContent.LastModUserGuid = adminUser.UserGuid;
            }

            HtmlRepository repository = new HtmlRepository();
            repository.Save(htmlContent);
        }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:40,代码来源:HtmlContentInstaller.cs


示例14: Render

        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            if (HttpContext.Current == null) { return; }

            siteSettings = CacheHelper.GetCurrentSiteSettings();

            if (siteSettings == null) { return; }
            if (siteSettings.Slogan.Length == 0) { return; }

            if (topMarkup.Length > 0)
            {
                writer.Write(topMarkup);
            }

            writer.Write(HttpUtility.HtmlAttributeEncode(siteSettings.Slogan));
            //base.Render(writer);

            if (bottomMarkup.Length > 0)
            {
                writer.Write(bottomMarkup);
            }
        }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:22,代码来源:SiteSlogan.cs


示例15: ProcessRequest

        public void ProcessRequest(HttpContext context)
        {
            siteSettings = CacheHelper.GetCurrentSiteSettings();
            if (siteSettings == null)
            {

                return;
            }

            templateGuid = WebUtils.ParseGuidFromQueryString("g", templateGuid);
            if (templateGuid != Guid.Empty) { templateGuidString = templateGuid.ToString(); }

            if (templateGuid != Guid.Empty)
            {
                RenderTemplate(context);

            }
            else
            {
                RenderJsonList(context);

            }
        }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:23,代码来源:TinyMceTemplates.ashx.cs


示例16: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            isSiteEditor = SiteUtils.UserIsSiteEditor();

            if ((!isSiteEditor)&&(!WebUser.IsAdminOrContentAdmin))
            {
                SiteUtils.RedirectToAccessDeniedPage(this);
                return;
            }

            siteSettings = CacheHelper.GetCurrentSiteSettings();

            if (Request.Params.Get("helpkey") != null)
            {
                helpKey = Request.Params.Get("helpkey");
            }

            PopulateLabels();

            if (!IsPostBack)
            {
                PopulateControls();
            }
        }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:24,代码来源:HelpEdit.aspx.cs


示例17: EnsureRolesAndAdminUser

        public static void EnsureRolesAndAdminUser(SiteSettings site)
        {
            SiteUser adminUser = EnsureAdminUser(site);

            if (!Role.Exists(site.SiteId, "Admins"))
            {
                Role adminRole = new Role();
                adminRole.RoleName = "Admins";
                adminRole.SiteId = site.SiteId;
                adminRole.SiteGuid = site.SiteGuid;
                adminRole.Save();
                adminRole.RoleName = "Administrators";
                adminRole.Save();

                Role.AddUser(adminRole.RoleId, adminUser.UserId, adminRole.RoleGuid, adminUser.UserGuid);

            }

            if (!Role.Exists(site.SiteId, "Role Admins"))
            {
                Role roleAdminRole = new Role();
                roleAdminRole.RoleName = "Role Admins";
                roleAdminRole.SiteId = site.SiteId;
                roleAdminRole.SiteGuid = site.SiteGuid;
                roleAdminRole.Save();
                roleAdminRole.RoleName = "Role Administrators";
                roleAdminRole.Save();
            }

            if (!Role.Exists(site.SiteId, "Content Administrators"))
            {
                Role contentAdminRole = new Role();
                contentAdminRole.RoleName = "Content Administrators";
                contentAdminRole.SiteId = site.SiteId;
                contentAdminRole.SiteGuid = site.SiteGuid;
                contentAdminRole.Save();
            }

            if (!Role.Exists(site.SiteId, "Authenticated Users"))
            {
                Role authenticatedUserRole = new Role();
                authenticatedUserRole.RoleName = "Authenticated Users";
                authenticatedUserRole.SiteId = site.SiteId;
                authenticatedUserRole.SiteGuid = site.SiteGuid;
                authenticatedUserRole.Save();
            }

            if (!Role.Exists(site.SiteId, "Content Publishers"))
            {
                Role contentPublisherRole = new Role();
                contentPublisherRole.RoleName = "Content Publishers";
                contentPublisherRole.SiteId = site.SiteId;
                contentPublisherRole.SiteGuid = site.SiteGuid;
                contentPublisherRole.Save();
            }

            if (!Role.Exists(site.SiteId, "Content Authors"))
            {
                Role contentAuthorRole = new Role();
                contentAuthorRole.RoleName = "Content Authors";
                contentAuthorRole.SiteId = site.SiteId;
                contentAuthorRole.SiteGuid = site.SiteGuid;
                contentAuthorRole.Save();
            }

            if (!Role.Exists(site.SiteId, "Newsletter Administrators"))
            {
                Role newsletterAdminRole = new Role();
                newsletterAdminRole.RoleName = "Newsletter Administrators";
                newsletterAdminRole.SiteId = site.SiteId;
                newsletterAdminRole.SiteGuid = site.SiteGuid;
                newsletterAdminRole.Save();
            }
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:74,代码来源:mojoSetup.cs


示例18: EnsureFolderGalleryFolder

        public static void EnsureFolderGalleryFolder(SiteSettings siteSettings)
        {
            if (HttpContext.Current == null) return;

            string path = "~/Data/Sites/" + siteSettings.SiteId.ToString(CultureInfo.InvariantCulture)
                + "/FolderGalleries/";

            if (!Directory.Exists(HttpContext.Current.Server.MapPath(path)))
            {
                Directory.CreateDirectory(HttpContext.Current.Server.MapPath(path));
            }
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:12,代码来源:mojoSetup.cs


示例19: CreateRequiredRolesAndAdminUser

        public static void CreateRequiredRolesAndAdminUser(SiteSettings site)
        {
            Role adminRole = new Role();
            adminRole.RoleName = "Admins";
            adminRole.SiteId = site.SiteId;
            adminRole.SiteGuid = site.SiteGuid;
            adminRole.Save();
            adminRole.RoleName = "Administrators";
            adminRole.Save();

            Role roleAdminRole = new Role();
            roleAdminRole.RoleName = "Role Admins";
            roleAdminRole.SiteId = site.SiteId;
            roleAdminRole.SiteGuid = site.SiteGuid;
            roleAdminRole.Save();
            roleAdminRole.RoleName = "Role Administrators";
            roleAdminRole.Save();

            Role contentAdminRole = new Role();
            contentAdminRole.RoleName = "Content Administrators";
            contentAdminRole.SiteId = site.SiteId;
            contentAdminRole.SiteGuid = site.SiteGuid;
            contentAdminRole.Save();

            Role authenticatedUserRole = new Role();
            authenticatedUserRole.RoleName = "Authenticated Users";
            authenticatedUserRole.SiteId = site.SiteId;
            authenticatedUserRole.SiteGuid = site.SiteGuid;
            authenticatedUserRole.Save();

            Role contentPublisherRole = new Role();
            contentPublisherRole.RoleName = "Content Publishers";
            contentPublisherRole.SiteId = site.SiteId;
            contentPublisherRole.SiteGuid = site.SiteGuid;
            contentPublisherRole.Save();

            Role contentAuthorRole = new Role();
            contentAuthorRole.RoleName = "Content Authors";
            contentAuthorRole.SiteId = site.SiteId;
            contentAuthorRole.SiteGuid = site.SiteGuid;
            contentAuthorRole.Save();

            Role newsletterAdminRole = new Role();
            newsletterAdminRole.RoleName = "Newsletter Administrators";
            newsletterAdminRole.SiteId = site.SiteId;
            newsletterAdminRole.SiteGuid = site.SiteGuid;
            newsletterAdminRole.Save();

            // if using related sites mode there is a problem if we already have user [email protected]
            // and we create another one in the child site with the same email and login so we need to make it different
            // we could just skip creating this user since in related sites mode all users come from the first site
            // but then if the config were changed to not related sites mode there would be no admin user
            // so in related sites mode we create one only as a backup in case settings are changed later
            int countOfSites = SiteSettings.SiteCount();
            string siteDifferentiator = string.Empty;
            if (
                (countOfSites >= 1)
                && (WebConfigSettings.UseRelatedSiteMode)
                )
            {
                if (site.SiteId > 1)
                {
                    siteDifferentiator = site.SiteId.ToInvariantString();
                }
            }

            mojoMembershipProvider membership = Membership.Provider as mojoMembershipProvider;
            bool overridRelatedSiteMode = true;
            SiteUser adminUser = new SiteUser(site, overridRelatedSiteMode);
            adminUser.Email = "admin" + siteDifferentiator + "@admin.com";
            adminUser.Name = "Admin";
            adminUser.LoginName = "admin" + siteDifferentiator;
            adminUser.Password = "admin";

            if (membership != null)
            {
                adminUser.Password = membership.EncodePassword(site, adminUser, "admin");
            }

            adminUser.PasswordQuestion = "What is your user name?";
            adminUser.PasswordAnswer = "admin";
            adminUser.Save();

            Role.AddUser(adminRole.RoleId, adminUser.UserId, adminRole.RoleGuid, adminUser.UserGuid);
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:85,代码来源:mojoSetup.cs


示例20: CreatePage

        public static void CreatePage(SiteSettings siteSettings, ContentPage contentPage, PageSettings parentPage)
        {
            PageSettings pageSettings = new PageSettings();
            pageSettings.PageGuid = Guid.NewGuid();

            if (parentPage != null)
            {
                pageSettings.ParentGuid = parentPage.PageGuid;
                pageSettings.ParentId = parentPage.PageId;
            }

            pageSettings.SiteId = siteSettings.SiteId;
            pageSettings.SiteGuid = siteSettings.SiteGuid;
            pageSettings.AuthorizedRoles = contentPage.VisibleToRoles;
            pageSettings.EditRoles = contentPage.EditRoles;
            pageSettings.DraftEditOnlyRoles = contentPage.DraftEditRoles;
            pageSettings.CreateChildPageRoles = contentPage.CreateChildPageRoles;
            pageSettings.MenuImage = contentPage.MenuImage;
            pageSettings.PageMetaKeyWords = contentPage.PageMetaKeyWords;
            pageSettings.PageMetaDescription = contentPage.PageMetaDescription;

            CultureInfo uiCulture = Thread.CurrentThread.CurrentUICulture;
            if (WebConfigSettings.UseCultureOverride)
            {
                uiCulture = SiteUtils.GetDefaultUICulture(siteSettings.SiteId);
            }

            if (contentPage.ResourceFile.Length > 0)
            {
                pageSettings.PageName = ResourceHelper.GetResourceString(contentPage.ResourceFile, contentPage.Name, uiCulture, false);
                if (contentPage.Title.Length > 0)
                {
                    pageSettings.PageTitle = ResourceHelper.GetResourceString(contentPage.ResourceFile, contentPage.Title, uiCulture, false);
                }
            }
            else
            {
                pageSettings.PageName = contentPage.Name;
                pageSettings.PageTitle = contentPage.Title;
            }

            pageSettings.PageOrder = contentPage.PageOrder;
            pageSettings.Url = contentPage.Url;
            pageSettings.RequireSsl = contentPage.RequireSsl;
            pageSettings.ShowBreadcrumbs = contentPage.ShowBreadcrumbs;

            pageSettings.BodyCssClass = contentPage.BodyCssClass;
            pageSettings.MenuCssClass = contentPage.MenuCssClass;
            pageSettings.IncludeInMenu = contentPage.IncludeInMenu;
            pageSettings.IsClickable = contentPage.IsClickable;
            pageSettings.IncludeInSiteMap = contentPage.IncludeInSiteMap;
            pageSettings.IncludeInChildSiteMap = contentPage.IncludeInChildPagesSiteMap;
            pageSettings.AllowBrowserCache = contentPage.AllowBrowserCaching;
            pageSettings.ShowChildPageBreadcrumbs = contentPage.ShowChildPageBreadcrumbs;
            pageSettings.ShowHomeCrumb = contentPage.ShowHomeCrumb;
            pageSettings.ShowChildPageMenu = contentPage.ShowChildPagesSiteMap;
            pageSettings.HideAfterLogin = contentPage.HideFromAuthenticated;
            pageSettings.EnableComments = contentPage.EnableComments;

            pageSettings.Save();

            if (!FriendlyUrl.Exists(siteSettings.SiteId, pageSettings.Url))
            {
                if (!WebPageInfo.IsPhysicalWebPage(pageSettings.Url))
                {
                    FriendlyUrl friendlyUrl = new FriendlyUrl();
                    friendlyUrl.SiteId = siteSettings.SiteId;
                    friendlyUrl.SiteGuid = siteSettings.SiteGuid;
                    friendlyUrl.PageGuid = pageSettings.PageGuid;
                    friendlyUrl.Url = pageSettings.Url.Replace("~/", string.Empty);
                    friendlyUrl.RealUrl = "~/Default.aspx?pageid=" + pageSettings.PageId.ToInvariantString();
                    friendlyUrl.Save();
                }
            }

            foreach (ContentPageItem pageItem in contentPage.PageItems)
            {

                // tni-20130624: moduleGuidxxxx handling
                Guid moduleGuid2Use = Guid.Empty;
                bool updateModule = false;

                Module findModule = null;

                if (pageItem.ModuleGuidToPublish != Guid.Empty)
                {
                    Module existingModule = new Module(pageItem.ModuleGuidToPublish);
                    if (existingModule.ModuleGuid == pageItem.ModuleGuidToPublish && existingModule.SiteId == siteSettings.SiteId)
                    {
                        Module.Publish(pageSettings.PageGuid, existingModule.ModuleGuid, existingModule.ModuleId, pageSettings.PageId,
                            pageItem.Location, pageItem.SortOrder, DateTime.UtcNow, DateTime.MinValue);

                        // tni: I assume there's nothing else to do now so let's go to the next content...
                        continue;
                    }
                }
                else if (pageItem.ModuleGuid != Guid.Empty)
                {
                    findModule = new Module(pageItem.ModuleGuid);
                    if (findModule.ModuleGuid == Guid.Empty)
//.........这里部分代码省略.........
开发者ID:joedavis01,项目名称:mojoportal,代码行数:101,代码来源:mojoSetup.cs



注:本文中的mojoPortal.Business.SiteSettings类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Business.SiteUser类代码示例发布时间:2022-05-26
下一篇:
C# Business.Module类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap