Esempio n. 1
0
 public AppController()
     : base()
 {
     userAppService = new UserAppService();
     menuService = new UserMenuService();
     logService = new UserLogService();
 }
Esempio n. 2
0
 public TopNavController()
 {
     userAppService = new UserAppService();
     msgService = new MessageService();
     menuService = new SiteMenuService();
     currencyService = new CurrencyService();
 }
Esempio n. 3
0
 public SpaceLayoutController()
 {
     skinService = new SkinService();
     userAppService = new UserAppService();
     visitorService = new VisitorService();
     menuService = new UserMenuService();
     siteSkinService = new SiteSkinService();
 }
Esempio n. 4
0
 public CmsInstallerBase() {
     installerService = new AppInstallerService();
     appService = new UserAppService();
     menuService = new UserMenuService();
     sectionService = new ContentSectionService();
     tplService = new ContentCustomTemplateService();
     postService = new ContentPostService();
 }
        public UserHomeInstaller() {
            sectionService = new ContentSectionService();
            appService = new UserAppService();
            menuService = new UserMenuService();
            appinfoService = new AppInstallerService();

            lbl = lang.getByApp( typeof( ContentApp ) );
        }
Esempio n. 6
0
        public UserProfileController()
        {
            userService = new UserService();
            userAppService = new UserAppService();
            appinfoService = new AppInstallerService();

            userTagService = new UserTagService();
            currencyService = new CurrencyService();
        }
Esempio n. 7
0
        public Boolean IsAppRunning( MvcContext ctx )
        {
            UserAppService userAppService = new UserAppService();
            IMemberApp app = userAppService.GetByApp( (IApp)ctx.app.obj );

            if (app == null || app.IsStop == 1) {
                return false;
            }

            return true;
        }
Esempio n. 8
0
        public WeiboRegisterController()
        {
            userService = new UserService();
            confirmService = new UserConfirmService();
            inviteService = new InviteService();
            loginService = new LoginService();
            friendService = new FriendService();

            appService = new UserAppService();
            menuService = new UserMenuService();
        }
Esempio n. 9
0
        public Boolean IsAppRunning( MvcContext ctx )
        {
            UserAppService userAppService = new UserAppService();
            IMemberApp app = userAppService.GetByApp( (IApp)ctx.app.obj );

            if (app == null || app.IsStop == 1) {

                ctx.utils.endMsg( lang.get( "exAppNotFound" ), HttpStatus.NotFound_404 );
                return false;
            }

            return true;
        }
Esempio n. 10
0
        public RegisterController()
        {
            userService = new UserService();
            confirmService = new UserConfirmService();
            confirmEmail = new ConfirmEmail();
            loginService = new LoginService();

            appService = new UserAppService();
            menuService = new UserMenuService();

            inviteService = new InviteService();

            HidePermission( typeof( SecurityController ) );
        }
Esempio n. 11
0
 public MyLinkController()
 {
     userAppService = new UserAppService();
 }
Esempio n. 12
0
        public virtual RssChannel getRssByApp(long appId, int count) {

            List<BlogPost> newListAll = null;

            if (appId > 0)
                newListAll = this.GetNewBlog( appId, count );
            else
                newListAll = this.GetNewListAll( count );

            BlogApp app = BlogApp.findById( appId );
            User user = User.findById( app.OwnerId );
            IMemberApp uapp = new UserAppService().GetByApp( app );

            RssChannel channel = new RssChannel();
            channel.Title = uapp.Name + " -- " + user.Name + "'s blog";
            channel.Link = Link.ToMember( user );

            foreach (BlogPost post in newListAll) {

                RssItem rssItem = new RssItem();
                rssItem.Title = post.Title;
                rssItem.Description = post.Content;
                rssItem.Category = post.Category.Name;
                rssItem.PubDate = post.Created;
                rssItem.Author = post.Creator.Name;

                rssItem["CreatorLink"] = channel.Link;
                rssItem["CreatorFace"] = post.Creator.PicSmall;
                rssItem.Link = alink.ToAppData( post );

                channel.RssItems.Add( rssItem );
            }


            return channel;
        }
Esempio n. 13
0
        private static void addUserAppAndMenus( User user, MvcContext ctx )
        {
            if (strUtil.IsNullOrEmpty( config.Instance.Site.UserInitApp )) return;

            IMemberAppService appService = new UserAppService();
            IMenuService menuService = new UserMenuService();

            List<String> menus = new List<string>();

            String[] arr = config.Instance.Site.UserInitApp.Split( ',' );
            foreach (String app in arr) {
                if (strUtil.IsNullOrEmpty( app )) continue;
                menus.Add( app.Trim() );
            }

            if (menus.Contains( "home" )) {
                new UserHomeInstaller().Install( ctx, user, wojilu.lang.get( "homepage" ), wojilu.Common.AppBase.AccessStatus.Public );
            }

            if (menus.Contains( "blog" )) {
                IMemberApp blogApp = appService.Add( user, "博客", 2 );
                // 添加菜单:此处需要明确传入MemberType,否则将会使用ctx.Owner,也就是Site的值,导致bug
                String blogUrl = UrlConverter.clearUrl( alink.ToUserAppFull( blogApp ), ctx, typeof( User ).FullName, user.Url );
                menuService.AddMenuByApp( blogApp, blogApp.Name, "", blogUrl );
            }

            if (menus.Contains( "photo" )) {
                IMemberApp photoApp = appService.Add( user, "相册", 3 );
                String photoUrl = UrlConverter.clearUrl( alink.ToUserAppFull( photoApp ), ctx, typeof( User ).FullName, user.Url );
                menuService.AddMenuByApp( photoApp, photoApp.Name, "", photoUrl );
            }

            if (menus.Contains( "microblog" )) {
                IMenu menu = getMenu( user, "微博", alink.ToUserMicroblog( user ), ctx );
                menuService.Insert( menu, user, user );
            }

            //if (menus.Contains( "share" )) {
            //    IMenu menu = getMenu( user, "转帖", lnkToUser( new Users.ShareController().Index ), ctx );
            //    menuService.Insert( menu, user, user );
            //}

            if (menus.Contains( "friend" )) {
                IMenu menu = getMenu( user, "好友", lnkToUser( user, new Users.FriendController().FriendList ), ctx );
                menuService.Insert( menu, user, user );
            }

            if (menus.Contains( "visitor" )) {
                IMenu menu = getMenu( user, "访客", lnkToUser( user, new Users.VisitorController().Index ), ctx );
                menuService.Insert( menu, user, user );
            }

            if (menus.Contains( "forumpost" )) {
                IMenu menu = getMenu( user, "论坛帖子", lnkToUser( user, new Users.ForumController().Topic ), ctx );
                menuService.Insert( menu, user, user );
            }

            if (menus.Contains( "about" )) {
                IMenu menu = getMenu( user, "关于我", lnkToUser( user, new Users.ProfileController().Main ), ctx );
                menuService.Insert( menu, user, user );
            }

            if (menus.Contains( "feedback" )) {
                IMenu menu = getMenu( user, "留言", lnkToUser( user, new Users.FeedbackController().List ), ctx );
                menuService.Insert( menu, user, user );
            }
        }