Beispiel #1
0
        public static void bindListItem(IBlock block, ContentPost post, MvcContext ctx)
        {
            if (post.PageSection != null)
            {
                block.Set("post.SectionName", post.PageSection.Title);
                block.Set("post.SectionUrl", clink.toSection(post.PageSection.Id, ctx));
            }

            IPageAdminSection sectionController = BinderUtils.GetPageSectionAdmin(post, ctx, "AdminSectionShow");

            String typeIcon = sectionController.GetSectionIcon(post.SectionId);

            block.Set("post.ImgIcon", typeIcon);

            String att = post.Attachments > 0 ? "<img src=\"" + strUtil.Join(sys.Path.Img, "attachment.gif") + "\"/>" : "";

            block.Set("post.AttachmentIcon", att);

            block.Set("post.TitleCss", post.Style);

            block.Set("post.Title", strUtil.SubString(post.GetTitle(), 50));
            block.Set("post.Created", post.Created.ToString("yyyy-MM-dd HH:mm:ss"));
            block.Set("post.Hits", post.Hits);
            block.Set("post.Url", alink.ToAppData(post, ctx));

            if (post.Creator != null)
            {
                block.Set("post.Submitter", string.Format("<a href=\"{0}\" target=\"_blank\">{1}</a>", Link.ToMember(post.Creator), post.Creator.Name));
            }
            else
            {
                block.Set("post.Submitter", "");
            }
        }
Beispiel #2
0
        private void bindPickedList(IList serviceData, IBlock block)
        {
            for (int i = 1; i < serviceData.Count; i++)
            {
                ContentPost post = serviceData[i] as ContentPost;

                IPageAdminSection sectionController = BinderUtils.GetPageSectionAdmin(post, ctx, "AdminSectionShow");
                String            typeIcon          = sectionController.GetSectionIcon(post.SectionId);

                String attIcon = post.Attachments > 0 ? BinderUtils.iconAttachment : "";

                if (strUtil.HasText(post.TitleHome))
                {
                    block.Set("post.Title", post.TitleHome);
                }
                else
                {
                    block.Set("post.Title", post.Title);
                }


                block.Set("post.Url", alink.ToAppData(post, ctx));
                block.Set("post.DataIcon", typeIcon);
                block.Set("post.AttachmentIcon", attIcon);
                block.Set("post.Created", post.Created.ToShortDateString());
                block.Next();
            }
        }
Beispiel #3
0
        public static String getTypeIcon(IPageAdminSection sectionController, ContentPost post)
        {
            String typeIcon = sectionController.GetSectionIcon(post.SectionId);

            if (strUtil.HasText(typeIcon))
            {
                return(typeIcon);
            }

            if (post.TypeName == typeof(ContentVideo).FullName)
            {
                return(iconVideo);
            }
            if (post.TypeName == typeof(ContentImg).FullName)
            {
                return(iconPic);
            }
            if (post.TypeName == typeof(ContentPoll).FullName)
            {
                return(iconPoll);
            }
            if (post.HasImg())
            {
                return(iconPic);
            }

            return("");
        }
Beispiel #4
0
        public static String getTypeIcon( IPageAdminSection sectionController, ContentPost post ) {

            String typeIcon = sectionController.GetSectionIcon( post.SectionId );
            if (strUtil.HasText( typeIcon )) return typeIcon;

            if (post.TypeName == typeof( ContentVideo ).FullName) return iconVideo;
            if (post.TypeName == typeof( ContentImg ).FullName) return iconPic;
            if (post.TypeName == typeof( ContentPoll ).FullName) return iconPoll;
            if (post.HasImg()) return iconPic;

            return "";
        }