private UserMenu getBlogMenu(User user) { List <IMenu> menus = ServiceMap.GetMenuService(typeof(User)).GetList(user); foreach (IMenu x in menus) { if (x.RawUrl == null) { continue; } if (x.RawUrl.ToLower().IndexOf("blog/index") > 0) { return(x as UserMenu); } } return(null); }
private void createPersonalSite(User user) { // 将博客=>设为个人空间首页 UserMenu blogMenu = getBlogMenu(user); blogMenu.Url = "default"; ServiceMap.GetMenuService(typeof(User)).Update(blogMenu); // 修改路由default;default:{owner=admin,ownertype=user} updateRoute(user); // 修改主题 user.TemplateId = 31; user.update(); // done updateSiteDone(); // 重启网站 sys.Clear.ClearAll(); }
private void setService(MvcContext ctx) { this.appService = ServiceMap.GetUserAppService(this.owner.GetType()); this.menuService = ServiceMap.GetMenuService(this.owner.GetType()); }