示例#1
0
 public ShowAPageEventArgs(APage page)
     : base(page)
 {
 }
示例#2
0
        public static void Show(Core core, APage page)
        {
            core.Template.SetTemplate("GuestBook", "viewguestbook");

            if (core.Session.IsLoggedIn)
            {
                core.Template.Parse("CAN_COMMENT", "TRUE");
            }

            core.Template.Parse("PAGE_TITLE", string.Format(core.Prose.GetString("USERS_GUEST_BOOK"), page.Owner.DisplayNameOwnership));

            core.Display.DisplayComments(core.Template, page.AnApplication, page.AnApplication);
            core.Template.Parse("L_GUESTBOOK", page.AnApplication.DisplayNameOwnership + " Guest Book");
            core.Display.ParsePagination("COMMENT_PAGINATION", GuestBook.Uri(core, page.AnApplication), 10, page.AnApplication.Comments);

            List<string[]> breadCrumbParts = new List<string[]>();

            breadCrumbParts.Add(new string[] { "comments", core.Prose.GetString("GUEST_BOOK") });

            page.AnApplication.ParseBreadCrumbs(breadCrumbParts);
        }
示例#3
0
 public ShowAPageEventArgs(APage page, long itemId)
     : base(page, itemId)
 {
 }
示例#4
0
        public static void ShowPage(Core core, APage page)
        {
            if (core == null)
            {
                throw new NullCoreException();
            }

            core.Template.SetTemplate("viewapplication.html");
            page.Signature = PageSignature.viewapplication;

            long typeId = core.Functions.RequestLong("type", 0);
            long id = core.Functions.RequestLong("id", 0);

            if (core.Session.IsLoggedIn)
            {
                Primitive viewer = core.Session.LoggedInMember;

                if (typeId > 0)
                {
                    core.PrimitiveCache.LoadPrimitiveProfile(id, typeId);
                    viewer = core.PrimitiveCache[id, typeId];
                }

                if (page.AnApplication.ApplicationType == ApplicationType.Native)
                {
                    if (page.AnApplication.HasInstalled(core, viewer))
                    {
                        core.Template.Parse("U_UNINSTALL", core.Hyperlink.AppendSid(string.Format("{1}dashboard/applications?mode=uninstall&id={0}",
                            page.AnApplication.ApplicationId, viewer.AccountUriStub), true));
                    }
                    else
                    {
                        core.Template.Parse("U_INSTALL", core.Hyperlink.AppendSid(string.Format("{1}dashboard/applications?mode=install&id={0}",
                            page.AnApplication.ApplicationId, viewer.AccountUriStub), true));
                    }
                }

                if (page.AnApplication.ApplicationType == ApplicationType.OAuth)
                {
                    if (page.AnApplication.HasInstalled(core, viewer))
                    {
                        core.Template.Parse("U_REVOKE", core.Hyperlink.AppendSid(string.Format("{1}dashboard/applications?mode=revoke&id={0}",
                            page.AnApplication.ApplicationId, viewer.AccountUriStub), true));
                    }
                }

                if (core.Session.LoggedInMember.Id == page.AnApplication.CreatorId)
                {
                    core.Template.Parse("U_MANAGE", core.Hyperlink.AppendSid(page.AnApplication.AccountUriStub));
                }
            }

            User Creator = new User(core, page.AnApplication.CreatorId, UserLoadOptions.All);

            core.Template.Parse("APPLICATION_NAME", page.AnApplication.Title);
            core.Template.Parse("U_APPLICATION", page.AnApplication.Uri);
            core.Template.Parse("DESCRIPTION", page.AnApplication.Description);
            core.Template.Parse("CREATOR_DISPLAY_NAME", Creator.DisplayName);
            if (page.AnApplication.Thumbnail != null)
            {
                core.Template.Parse("I_THUMBNAIL", page.AnApplication.Thumbnail);
            }

            core.InvokeHooks(new HookEventArgs(core, AppPrimitives.Application, page.AnApplication));
        }