예제 #1
0
        protected void BeginMusicianPage()
        {
            musicianSlug = core.Http["mn"];

            try
            {
                primitive = new Musician(core, musicianSlug);
            }
            catch (InvalidMusicianException)
            {
                core.Functions.Generate404();
                return;
            }

            // We do not have customised domains for musician
            if (/*string.IsNullOrEmpty(mus.Domain) ||*/ Hyperlink.Domain == core.Http.Domain)
            {
                core.PagePath = core.PagePath.Substring(Musician.Key.Length + 1 + 6);
            }
            if (core.PagePath.Trim(new char[] { '/' }) == "")
            {
                core.PagePath = Musician.Homepage;
            }
            if (core.PagePath.Trim(new char[] { '/' }) == "")
            {
                core.PagePath = "/profile";
            }

            if (loggedInMember != null)
            {
                if (loggedInMember.UserInfo.ShowCustomStyles)
                {
                    template.Parse("USER_STYLE_SHEET", string.Format("music/{0}.css", primitive.Key));
                }
            }
            else
            {
                template.Parse("USER_STYLE_SHEET", string.Format("music/{0}.css", primitive.Key));
            }

            if (!core.PagePath.StartsWith("/account", StringComparison.Ordinal))
            {
                BoxSocial.Internals.Application.LoadApplications(core, AppPrimitives.Musician, core.PagePath, BoxSocial.Internals.Application.GetApplications(core, primitive));

                core.FootHooks += new Core.HookHandler(core_FootHooks);
                HookEventArgs e = new HookEventArgs(core, AppPrimitives.Musician, primitive);
                core.InvokeHeadHooks(e);
                core.InvokePrimitiveHeadHooks(e);
                core.InvokeFootHooks(e);
            }

            PageTitle = primitive.DisplayName;
        }
예제 #2
0
        /// <summary>
        /// Hook showing gallery items on a network profile.
        /// </summary>
        /// <param name="e">Hook event arguments</param>
        public void ShowNetworkGallery(HookEventArgs e)
        {
            Network theNetwork = (Network)e.Owner;

            Template template = new Template(Assembly.GetExecutingAssembly(), "viewprofilegallery");
            template.Medium = core.Template.Medium;
            template.SetProse(core.Prose);

            Gallery gallery = new Gallery(e.core, theNetwork);

            List<GalleryItem> galleryItems = gallery.GetItems(e.core, 1, 6, 0);

            template.Parse("PHOTOS", theNetwork.GalleryItems.ToString());

            foreach (GalleryItem galleryItem in galleryItems)
            {
                VariableCollection galleryVariableCollection = template.CreateChild("photo_list");

                galleryVariableCollection.Parse("TITLE", galleryItem.ItemTitle);
                galleryVariableCollection.Parse("PHOTO_URI", Gallery.BuildPhotoUri(core, theNetwork, galleryItem.Path));

                string thumbUri = string.Format("/network/{0}/images/_tiny/{1}",
                    theNetwork.NetworkNetwork, galleryItem.Path);
                galleryVariableCollection.Parse("THUMBNAIL", thumbUri);
            }

            template.Parse("U_NETWORK_GALLERY", Gallery.BuildGalleryUri(core, theNetwork));

            e.core.AddMainPanel(template);
        }
예제 #3
0
 void core_PostHooks(HookEventArgs e)
 {
     if (e.PageType == AppPrimitives.Member)
     {
         PostContent(e);
     }
 }
예제 #4
0
        void ShowGroups(HookEventArgs e)
        {
            Template template = new Template(Assembly.GetExecutingAssembly(), "todaygrouppanel");
            template.Medium = core.Template.Medium;
            template.SetProse(core.Prose);

            List<UserGroup> groups = UserGroup.GetUserGroups(e.core, e.core.Session.LoggedInMember, 1, 4);

            foreach (UserGroup group in groups)
            {
                VariableCollection groupVariableCollection = template.CreateChild("groups_list");

                groupVariableCollection.Parse("TITLE", group.DisplayName);
                groupVariableCollection.Parse("MEMBERS", core.Functions.LargeIntegerToString(group.Members));
                groupVariableCollection.Parse("U_GROUP", group.Uri);
                groupVariableCollection.Parse("ICON", group.Icon);
                groupVariableCollection.Parse("TILE", group.Tile);
                groupVariableCollection.Parse("SQUARE", group.Square);
            }

            e.core.AddSidePanel(template);
        }
예제 #5
0
        void PostContent(HookEventArgs e)
        {
            Template template = GetPostTemplate(e.core, e.Owner);
            if (template != null)
            {
                VariableCollection javaScriptVariableCollection = core.Template.CreateChild("javascript_list");
                javaScriptVariableCollection.Parse("URI", @"/scripts/jquery.sceditor.bbcode.min.js");

                VariableCollection styleSheetVariableCollection = core.Template.CreateChild("style_sheet_list");
                styleSheetVariableCollection.Parse("URI", @"/styles/jquery.sceditor.theme.default.min.css");

                core.Template.Parse("OWNER_STUB", e.Owner.UriStubAbsolute);
                e.core.AddPostPanel(e.core.Prose.GetString("BLOG"), template);
            }
        }
예제 #6
0
 void core_PageHooks(HookEventArgs e)
 {
     if (e.PageType == AppPrimitives.Group)
     {
         ShowGroupNews(e);
     }
 }
예제 #7
0
 void core_FootHooks(HookEventArgs e)
 {
 }
예제 #8
0
파일: Core.cs 프로젝트: smithydll/boxsocial
 void Core_FootHooks(HookEventArgs eventArgs)
 {
 }
예제 #9
0
파일: Core.cs 프로젝트: smithydll/boxsocial
 void Core_Hooks(HookEventArgs eventArgs)
 {
 }
예제 #10
0
파일: Core.cs 프로젝트: smithydll/boxsocial
 public void InvokePostHooks(HookEventArgs eventArgs)
 {
     PostHooks(eventArgs);
 }
예제 #11
0
파일: Core.cs 프로젝트: smithydll/boxsocial
 public void InvokePrimitiveHeadHooks(HookEventArgs eventArgs)
 {
     PrimitiveHeadHooks(eventArgs);
 }
예제 #12
0
파일: Core.cs 프로젝트: smithydll/boxsocial
 public void InvokeHooks(HookEventArgs eventArgs)
 {
     PageHooks(eventArgs);
 }
예제 #13
0
파일: Core.cs 프로젝트: smithydll/boxsocial
 public void InvokeHeadHooks(HookEventArgs eventArgs)
 {
     HeadHooks(eventArgs);
 }
예제 #14
0
파일: Core.cs 프로젝트: smithydll/boxsocial
 public void InvokeFootHooks(HookEventArgs eventArgs)
 {
     FootHooks(eventArgs);
 }
예제 #15
0
        public void ShowGroupForum(HookEventArgs e)
        {
            Template template = new Template(Assembly.GetExecutingAssembly(), "viewprofileforum");
            template.Medium = core.Template.Medium;
            template.SetProse(core.Prose);

            Forum forum = new Forum(core, (UserGroup)e.Owner);
            template.Parse("U_FORUM", forum.Uri);

            List<ForumTopic> recentTopics = forum.GetTopicsFlat(0, 10);

            // PostId, TopicPost
            Dictionary<long, TopicPost> topicLastPosts;

            topicLastPosts = TopicPost.GetTopicLastPosts(core, recentTopics);

            template.Parse("TOPICS", recentTopics.Count.ToString());

            foreach (ForumTopic topic in recentTopics)
            {
                core.LoadUserProfile(topic.PosterId);
            }

            foreach (ForumTopic topic in recentTopics)
            {
                VariableCollection topicVariableCollection = template.CreateChild("topic_list");

                topicVariableCollection.Parse("TITLE", topic.Title);
                topicVariableCollection.Parse("URI", topic.Uri);
                topicVariableCollection.Parse("VIEWS", topic.Views.ToString());
                topicVariableCollection.Parse("REPLIES", topic.Posts.ToString());
                topicVariableCollection.Parse("DATE", core.Tz.DateTimeToString(topic.GetCreatedDate(core.Tz)));
                topicVariableCollection.Parse("USERNAME", core.PrimitiveCache[topic.PosterId].DisplayName);
                topicVariableCollection.Parse("U_POSTER", core.PrimitiveCache[topic.PosterId].Uri);

                if (topicLastPosts.ContainsKey(topic.LastPostId))
                {
                    topicVariableCollection.Parse("LAST_POST_URI", topicLastPosts[topic.LastPostId].Uri);
                    topicVariableCollection.Parse("LAST_POST_TITLE", topicLastPosts[topic.LastPostId].Title);
                    core.Display.ParseBbcode(topicVariableCollection, "LAST_POST", string.Format("[iurl={0}]{1}[/iurl]\n{2}",
                        topicLastPosts[topic.LastPostId].Uri, Functions.TrimStringToWord(topicLastPosts[topic.LastPostId].Title, 20), core.Tz.DateTimeToString(topicLastPosts[topic.LastPostId].GetCreatedDate(core.Tz))));
                }
                else
                {
                    topicVariableCollection.Parse("LAST_POST", "No posts");
                }

                switch (topic.Status)
                {
                    case TopicStates.Normal:
                        if (topic.IsRead)
                        {
                            if (topic.IsLocked)
                            {
                                topicVariableCollection.Parse("IS_NORMAL_READ_LOCKED", "TRUE");
                            }
                            else
                            {
                                topicVariableCollection.Parse("IS_NORMAL_READ_UNLOCKED", "TRUE");
                            }
                        }
                        else
                        {
                            if (topic.IsLocked)
                            {
                                topicVariableCollection.Parse("IS_NORMAL_UNREAD_LOCKED", "TRUE");
                            }
                            else
                            {
                                topicVariableCollection.Parse("IS_NORMAL_UNREAD_UNLOCKED", "TRUE");
                            }
                        }
                        break;
                    case TopicStates.Sticky:
                        if (topic.IsRead)
                        {
                            if (topic.IsLocked)
                            {
                                topicVariableCollection.Parse("IS_STICKY_READ_LOCKED", "TRUE");
                            }
                            else
                            {
                                topicVariableCollection.Parse("IS_STICKY_READ_UNLOCKED", "TRUE");
                            }
                        }
                        else
                        {
                            if (topic.IsLocked)
                            {
                                topicVariableCollection.Parse("IS_STICKY_UNREAD_LOCKED", "TRUE");
                            }
                            else
                            {
                                topicVariableCollection.Parse("IS_STICKY_UNREAD_UNLOCKED", "TRUE");
                            }
                        }

                        break;
                    case TopicStates.Announcement:
                    case TopicStates.Global:
                        if (topic.IsRead)
                        {
                            if (topic.IsLocked)
                            {
                                topicVariableCollection.Parse("IS_ANNOUNCEMENT_READ_LOCKED", "TRUE");
                            }
                            else
                            {
                                topicVariableCollection.Parse("IS_ANNOUNCEMENT_READ_UNLOCKED", "TRUE");
                            }
                        }
                        else
                        {
                            if (topic.IsLocked)
                            {
                                topicVariableCollection.Parse("IS_ANNOUNCEMENT_UNREAD_LOCKED", "TRUE");
                            }
                            else
                            {
                                topicVariableCollection.Parse("IS_ANNOUNCEMENT_UNREAD_UNLOCKED", "TRUE");
                            }
                        }

                        break;
                }
            }

            e.core.AddMainPanel(template);
        }
예제 #16
0
파일: Core.cs 프로젝트: smithydll/boxsocial
 void Core_PostHooks(HookEventArgs e)
 {
 }
예제 #17
0
        public void ShowGroupNews(HookEventArgs e)
        {
            Template template = new Template(Assembly.GetExecutingAssembly(), "viewprofilenews");
            template.Medium = core.Template.Medium;
            template.SetProse(core.Prose);

            if (e.Owner is UserGroup)
            {
                News news = new News(e.core, (UserGroup)e.Owner);

                List<Article> articles = news.GetArticles(1, 5);

                foreach (Article article in articles)
                {
                    VariableCollection articleVariableCollection = template.CreateChild("news_list");

                    articleVariableCollection.Parse("TITLE", article.ArticleSubject);
                }
            }

            e.core.AddSidePanel(template);
        }
예제 #18
0
파일: Core.cs 프로젝트: smithydll/boxsocial
 void Core_PrimitiveHeadHooks(HookEventArgs eventArgs)
 {
 }
예제 #19
0
        public void ShowMemberGroups(HookEventArgs e)
        {
            User profileOwner = (User)e.Owner;
            Template template = new Template(Assembly.GetExecutingAssembly(), "viewprofilegroups");
            template.Medium = core.Template.Medium;
            template.SetProse(core.Prose);

            List<UserGroup> groups = UserGroup.GetUserGroups(e.core, profileOwner, 1, 4);
            if (groups.Count > 0)
            {
                template.Parse("HAS_GROUPS", "TRUE");
            }

            foreach(UserGroup group in groups)
            {
                VariableCollection groupVariableCollection = template.CreateChild("groups_list");

                groupVariableCollection.Parse("TITLE", group.DisplayName);
                groupVariableCollection.Parse("U_GROUP", group.Uri);
                groupVariableCollection.Parse("ICON", group.Icon);
                groupVariableCollection.Parse("TILE", group.Tile);
                groupVariableCollection.Parse("SQUARE", group.Square);
            }

            e.core.AddSidePanel(template);
        }
예제 #20
0
        protected void BeginProfile()
        {
            profileUserName = core.Http["un"];

            try
            {
                long userId = core.PrimitiveCache.LoadUserProfile(profileUserName);
                primitive = core.PrimitiveCache[userId];
            }
            catch
            {
                core.Functions.Generate404();
                return;
            }

            if (core.PagePath.StartsWith("/memberpage.aspx", StringComparison.Ordinal))
            {
                core.PagePath = core.PagePath.Substring(20 + User.UserName.Length + 1 + 5);
            }
            else
            {
                if (string.IsNullOrEmpty(User.Domain) || Hyperlink.Domain == core.Http.Domain)
                {
                    core.PagePath = core.PagePath.Substring(User.UserName.Length + 1 + 5);
                }
                if (core.PagePath.ToLower().StartsWith("/" + User.UserName.ToLower(), StringComparison.Ordinal))
                {
                    core.PagePath = core.PagePath.Substring(User.UserName.Length + 1);
                }
                if (core.PagePath.Trim(new char[] { '/' }) == "")
                {
                    core.PagePath = User.UserInfo.ProfileHomepage;
                }
            }

            BoxSocial.Internals.Application.LoadApplications(core, AppPrimitives.Member, core.PagePath, BoxSocial.Internals.Application.GetApplications(Core, User));

            HookEventArgs e = new HookEventArgs(core, AppPrimitives.Member, User);
            core.InvokeHeadHooks(e);
            core.InvokePrimitiveHeadHooks(e);

            PageTitle = User.DisplayName;

            if (!string.IsNullOrEmpty(User.UserInfo.AnalyticsCode))
            {
                template.Parse("ANALYTICS_CODE", User.UserInfo.AnalyticsCode);
            }

            if (User.UserInfo.AllowMonetisation && !string.IsNullOrEmpty(User.UserInfo.AdsenseCode))
            {
                template.Parse("ADSENSE_CODE", User.UserInfo.AdsenseCode);
            }

            if (loggedInMember != null)
            {
                if (loggedInMember.UserInfo.ShowCustomStyles)
                {
                    template.Parse("USER_STYLE_SHEET", string.Format("user/{0}.css", User.UserName));
                }
            }
            else
            {
                template.Parse("USER_STYLE_SHEET", string.Format("user/{0}.css", User.UserName));
            }
            template.Parse("USER_NAME", User.UserName);
            template.Parse("USER_DISPLAY_NAME", User.DisplayName);
            template.Parse("USER_DISPLAY_NAME_OWNERSHIP", User.DisplayNameOwnership);

            /*if (!string.IsNullOrEmpty(User.UserDomain))
            {
                template.Parse("U_HOME", User.ProfileUri);
            }*/

            if (loggedInMember != null)
            {
                if (loggedInMember.UserId == User.UserId)
                {
                    template.Parse("OWNER", "TRUE");
                    template.Parse("SELF", "TRUE");
                }
                else
                {
                    template.Parse("OWNER", "FALSE");
                    template.Parse("SELF", "FALSE");
                }
            }
            else
            {
                template.Parse("OWNER", "FALSE");
                template.Parse("SELF", "FALSE");
            }

            template.Parse("USER_ID", User.Id.ToString());
            template.Parse("USER_TYPE_ID", User.TypeId.ToString());

            core.Template.Parse("PRIMITIVE_DISPLAY_NAME", Owner.DisplayName);
            core.Template.Parse("PRIMITIVE_THUMB", Owner.Thumbnail);
            core.Template.Parse("PRIMITIVE_ICON", Owner.Icon);
            core.Template.Parse("PRIMITIVE_TILE", Owner.Tile);
            core.Template.Parse("PRIMITIVE_SQUARE", Owner.Square);
            core.Template.Parse("PRIMITIVE_COVER_PHOTO", Owner.CoverPhoto);
            core.Template.Parse("PRIMITIVE_MOBILE_COVER_PHOTO", Owner.MobileCoverPhoto);
        }
예제 #21
0
 void core_PageHooks(HookEventArgs e)
 {
     if (e.PageType == AppPrimitives.None)
     {
         if (e.core.PagePath.ToLower() == "/default.aspx")
         {
             ShowGroups(e);
         }
     }
     if (e.PageType == AppPrimitives.Member)
     {
         ShowMemberGroups(e);
     }
 }
예제 #22
0
        void core_FootHooks(HookEventArgs e)
        {
            if (e.PageType == AppPrimitives.Group)
            {
                Template template = new Template(Assembly.GetExecutingAssembly(), "group_footer");
                template.Medium = core.Template.Medium;
                template.SetProse(core.Prose);

                if (e.Owner.Type == "GROUP")
                {
                    if (core.Session.IsLoggedIn && ((UserGroup)e.Owner).IsGroupOperator(core.Session.LoggedInMember.ItemKey))
                    {
                        template.Parse("U_GROUP_ACCOUNT", core.Hyperlink.AppendSid(e.Owner.AccountUriStub));
                    }
                }

                e.core.AddFootPanel(template);
            }
        }
예제 #23
0
 /// <summary>
 /// Hook interface for any application hooks provided by a page.
 /// </summary>
 /// <param name="eventArgs">An EventArgs that contains the event data</param>
 void core_PageHooks(HookEventArgs eventArgs)
 {
 }
예제 #24
0
        protected void BeginGroupPage()
        {
            groupSlug = core.Http["gn"];

            try
            {
                primitive = new UserGroup(core, groupSlug);
            }
            catch (InvalidGroupException)
            {
                core.Functions.Generate404();
                return;
            }

            if (string.IsNullOrEmpty(Group.Domain) || Hyperlink.Domain == core.Http.Domain)
            {
                core.PagePath = core.PagePath.Substring(Group.Slug.Length + 1 + 6);
            }
            if (core.PagePath.Trim(new char[] { '/' }) == string.Empty)
            {
                core.PagePath = Group.GroupInfo.GroupHomepage;
            }
            if (core.PagePath.Trim(new char[] { '/' }) == string.Empty)
            {
                core.PagePath = "/profile";
            }

            if (core.Session.IsLoggedIn && Group.IsGroupMemberBanned(core.Session.LoggedInMember.ItemKey))
            {
                core.Functions.Generate403();
                return;
            }

            if (Group.GroupType == "PRIVATE" && (!core.Session.IsLoggedIn || !Group.IsGroupMember(core.Session.LoggedInMember.ItemKey)))
            {
                core.Functions.Generate403();
                return;
            }

            if (loggedInMember != null)
            {
                if (loggedInMember.UserInfo.ShowCustomStyles)
                {
                    template.Parse("USER_STYLE_SHEET", string.Format("group/{0}.css", Group.Key));
                }
            }
            else
            {
                template.Parse("USER_STYLE_SHEET", string.Format("group/{0}.css", Group.Key));
            }

            if (!string.IsNullOrEmpty(Group.Domain))
            {
                template.Parse("U_HOME", Group.Uri);
            }

            if (core.LoggedInMemberId > 0 && (!Group.IsGroupMember(core.Session.LoggedInMember.ItemKey)))
            {
                template.Parse("U_JOIN", Group.JoinUri);
            }

            template.Parse("U_REGISTER", core.Hyperlink.BuildRegisterUri(Group.Id));

            if (!core.PagePath.StartsWith("/account", StringComparison.Ordinal))
            {
                BoxSocial.Internals.Application.LoadApplications(core, AppPrimitives.Group, core.PagePath, BoxSocial.Internals.Application.GetApplications(core, Group));

                core.FootHooks += new Core.HookHandler(core_FootHooks);
                HookEventArgs e = new HookEventArgs(core, AppPrimitives.Group, Group);
                core.InvokeHeadHooks(e);
                core.InvokePrimitiveHeadHooks(e);
                core.InvokeFootHooks(e);
            }

            PageTitle = Group.DisplayName;

            core.Template.Parse("PRIMITIVE_THUMB", Owner.Thumbnail);
            core.Template.Parse("PRIMITIVE_ICON", Owner.Icon);
            core.Template.Parse("PRIMITIVE_TILE", Owner.Tile);
            core.Template.Parse("PRIMITIVE_SQUARE", Owner.Square);
            core.Template.Parse("PRIMITIVE_COVER_PHOTO", Owner.CoverPhoto);
            core.Template.Parse("PRIMITIVE_MOBILE_COVER_PHOTO", Owner.MobileCoverPhoto);
        }
예제 #25
0
        /// <summary>
        /// Hook showing gallery items on a group profile.
        /// </summary>
        /// <param name="e">Hook event arguments</param>
        public void ShowGroupGallery(HookEventArgs e)
        {
            UserGroup thisGroup = (UserGroup)e.Owner;

            if (!(!thisGroup.IsGroupMember(e.core.LoggedInMemberItemKey) && thisGroup.GroupType == "CLOSED"))
            {
                Template template = new Template(Assembly.GetExecutingAssembly(), "viewprofilegallery");
                template.Medium = core.Template.Medium;
                template.SetProse(core.Prose);

                // show recent photographs in the gallery
                Gallery gallery = new Gallery(e.core, thisGroup);

                List<GalleryItem> galleryItems = gallery.GetItems(e.core, 1, 6, 0);

                template.Parse("PHOTOS", thisGroup.GalleryItems.ToString());

                foreach (GalleryItem galleryItem in galleryItems)
                {
                    VariableCollection galleryVariableCollection = template.CreateChild("photo_list");

                    galleryVariableCollection.Parse("TITLE", galleryItem.ItemTitle);
                    galleryVariableCollection.Parse("PHOTO_URI", galleryItem.Uri);

                    galleryVariableCollection.Parse("THUMBNAIL", galleryItem.ThumbnailUri);
                }

                template.Parse("U_GROUP_GALLERY", Gallery.BuildGalleryUri(core, thisGroup));

                e.core.AddMainPanel(template);
            }
        }
예제 #26
0
 void core_HeadHooks(HookEventArgs e)
 {
 }
예제 #27
0
 /// <summary>
 /// Hook interface for any application hooks provided by a page.
 /// </summary>
 /// <param name="e">An EventArgs that contains the event data</param>
 void core_PageHooks(HookEventArgs e)
 {
     if (e.PageType == AppPrimitives.Group)
     {
         ShowGroupGallery(e);
     }
     if (e.PageType == AppPrimitives.Network)
     {
         ShowNetworkGallery(e);
     }
 }
예제 #28
0
        void core_PrimitiveHeadHooks(HookEventArgs e)
        {
            if (e.PageType == AppPrimitives.Group)
            {
                core.Template.Parse("TAB_LIST", "TRUE");
                Template template = new Template(Assembly.GetExecutingAssembly(), "header_navigation_tabs");
                template.Medium = core.Template.Medium;
                template.SetProse(core.Prose);

                List<NagivationTab> tabs = NagivationTab.GetTabs(core, e.Owner);

                {
                    VariableCollection tabVariableCollection = template.CreateChild("tab_list");

                    tabVariableCollection.Parse("TITLE", "Home");
                    tabVariableCollection.Parse("U_TAB", e.Owner.Uri);
                }

                foreach (NagivationTab tab in tabs)
                {
                    VariableCollection tabVariableCollection = template.CreateChild("tab_list");

                    tabVariableCollection.Parse("TITLE", tab.Page.Title);
                    tabVariableCollection.Parse("U_TAB", tab.Page.Uri);
                }

                if (tabs.Count > 0)
                {
                    e.core.AddPrimitiveHeadPanel(template);
                }
            }
        }
예제 #29
0
        void PostContent(HookEventArgs e)
        {
            VariableCollection styleSheetVariableCollection = core.Template.CreateChild("javascript_list");
            styleSheetVariableCollection.Parse("URI", @"/scripts/load-image.min.js");
            styleSheetVariableCollection = core.Template.CreateChild("javascript_list");
            styleSheetVariableCollection.Parse("URI", @"/scripts/canvas-to-blob.min.js");

            styleSheetVariableCollection = core.Template.CreateChild("javascript_list");
            styleSheetVariableCollection.Parse("URI", @"/scripts/jquery.iframe-transport.js");
            styleSheetVariableCollection = core.Template.CreateChild("javascript_list");
            styleSheetVariableCollection.Parse("URI", @"/scripts/jquery.fileupload.js");
            styleSheetVariableCollection = core.Template.CreateChild("javascript_list");
            styleSheetVariableCollection.Parse("URI", @"/scripts/jquery.fileupload-process.js");
            styleSheetVariableCollection = core.Template.CreateChild("javascript_list");
            styleSheetVariableCollection.Parse("URI", @"/scripts/jquery.fileupload-image.js");

            if (e.core.IsMobile)
            {
                return;
            }

            Template template = new Template(Assembly.GetExecutingAssembly(), "postphoto");
            template.Medium = core.Template.Medium;
            template.SetProse(core.Prose);

            string formSubmitUri = core.Hyperlink.AppendSid(e.Owner.AccountUriStub, true);
            template.Parse("U_ACCOUNT", formSubmitUri);
            template.Parse("S_ACCOUNT", formSubmitUri);

            template.Parse("USER_DISPLAY_NAME", e.Owner.DisplayName);

            CheckBox publishToFeedCheckBox = new CheckBox("publish-feed");
            publishToFeedCheckBox.IsChecked = true;

            CheckBox highQualityCheckBox = new CheckBox("high-quality");
            highQualityCheckBox.IsChecked = false;

            core.Display.ParseLicensingBox(template, "S_GALLERY_LICENSE", 0);

            template.Parse("S_PUBLISH_FEED", publishToFeedCheckBox);
            template.Parse("S_HIGH_QUALITY", highQualityCheckBox);

            core.Display.ParseClassification(template, "S_PHOTO_CLASSIFICATION", Classifications.Everyone);

            PermissionGroupSelectBox permissionSelectBox = new PermissionGroupSelectBox(core, "permissions", e.Owner.ItemKey);
            HiddenField aclModeField = new HiddenField("aclmode");
            aclModeField.Value = "simple";

            template.Parse("S_PERMISSIONS", permissionSelectBox);
            template.Parse("S_ACLMODE", aclModeField);

            //GallerySettings settings = new GallerySettings(core, e.Owner);
            Gallery rootGallery = new Gallery(core, e.Owner);
            List<Gallery> galleries = rootGallery.GetGalleries();

            SelectBox galleriesSelectBox = new SelectBox("gallery-id");

            foreach (Gallery gallery in galleries)
            {
                galleriesSelectBox.Add(new SelectBoxItem(gallery.Id.ToString(), gallery.GalleryTitle));
            }

            template.Parse("S_GALLERIES", galleriesSelectBox);

            /* Title TextBox */
            TextBox galleryTitleTextBox = new TextBox("gallery-title");
            galleryTitleTextBox.MaxLength = 127;

            template.Parse("S_GALLERY_TITLE", galleryTitleTextBox);

            CheckBoxArray shareCheckBoxArray = new CheckBoxArray("share-radio");
            shareCheckBoxArray.Layout = Layout.Horizontal;
            CheckBox twitterSyndicateCheckBox = null;
            CheckBox tumblrSyndicateCheckBox = null;
            CheckBox facebookSyndicateCheckBox = null;

            if (e.Owner is User)
            {
                User user = (User)e.Owner;

                if (user.UserInfo.TwitterAuthenticated)
                {
                    twitterSyndicateCheckBox = new CheckBox("photo-share-twitter");
                    twitterSyndicateCheckBox.Caption = "Twitter";
                    twitterSyndicateCheckBox.Icon = "https://g.twimg.com/twitter-bird-16x16.png";
                    twitterSyndicateCheckBox.IsChecked = user.UserInfo.TwitterSyndicate;
                    twitterSyndicateCheckBox.Width.Length = 0;

                    shareCheckBoxArray.Add(twitterSyndicateCheckBox);
                }

                if (user.UserInfo.TumblrAuthenticated)
                {
                    tumblrSyndicateCheckBox = new CheckBox("photo-share-tumblr");
                    tumblrSyndicateCheckBox.Caption = "Tumblr";
                    tumblrSyndicateCheckBox.Icon = "https://platform.tumblr.com/v1/share_4.png";
                    tumblrSyndicateCheckBox.IsChecked = user.UserInfo.TumblrSyndicate;
                    tumblrSyndicateCheckBox.Width.Length = 0;

                    shareCheckBoxArray.Add(tumblrSyndicateCheckBox);
                }

                if (user.UserInfo.FacebookAuthenticated)
                {
                    facebookSyndicateCheckBox = new CheckBox("photo-share-facebook");
                    facebookSyndicateCheckBox.Caption = "Facebook";
                    facebookSyndicateCheckBox.Icon = "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yU/r/fWK1wxX-qQn.png";
                    facebookSyndicateCheckBox.IsChecked = user.UserInfo.FacebookSyndicate;
                    facebookSyndicateCheckBox.Width.Length = 0;

                    shareCheckBoxArray.Add(facebookSyndicateCheckBox);
                }

            }

            if (shareCheckBoxArray.Count > 0)
            {
                template.Parse("S_SHARE", "TRUE");
            }
            if (twitterSyndicateCheckBox != null)
            {
                template.Parse("S_SHARE_TWITTER", twitterSyndicateCheckBox);
            }
            if (tumblrSyndicateCheckBox != null)
            {
                template.Parse("S_SHARE_TUMBLR", tumblrSyndicateCheckBox);
            }
            if (facebookSyndicateCheckBox != null)
            {
                template.Parse("S_SHARE_FACEBOOK", facebookSyndicateCheckBox);
            }

            e.core.AddPostPanel(e.core.Prose.GetString("PHOTO"), template);
        }
예제 #30
0
        void core_FootHooks(HookEventArgs e)
        {
            if (e.PageType == AppPrimitives.Musician)
            {
                Template template = new Template(Assembly.GetExecutingAssembly(), "music_footer");
                template.Medium = core.Template.Medium;
                template.SetProse(core.Prose);

                if (e.Owner.Type == "MUSIC")
                {
                    if (((Musician)e.Owner).IsMusicianMember(core.Session.LoggedInMember.ItemKey))
                    {
                        template.Parse("U_MUSICIAN_ACCOUNT", core.Hyperlink.AppendSid(e.Owner.AccountUriStub));
                    }
                }

                e.core.AddFootPanel(template);
            }
        }