Ejemplo n.º 1
0
        private void bindTopImg(ContentPost img)
        {
            IBlock imgBlock = getBlock("img");

            if (img != null)
            {
                imgBlock.Set("ipost.ImgUrl", img.GetImgThumb());
                imgBlock.Set("ipost.TitleCss", img.Style);
                imgBlock.Set("ipost.TitleFull", img.Title);

                if (strUtil.HasText(img.TitleHome))
                {
                    imgBlock.Set("ipost.Title", img.TitleHome);
                }
                else
                {
                    imgBlock.Set("ipost.Title", img.Title);
                }

                String content = strUtil.HasText(img.Summary) ? img.Summary : strUtil.ParseHtml(img.Content, 50);
                imgBlock.Set("ipost.Content", content);
                imgBlock.Set("ipost.Width", img.Width);
                imgBlock.Set("ipost.Height", img.Height);

                imgBlock.Set("ipost.EditLink", to(new Common.PostController().EditImg, img.Id));
                imgBlock.Next();
            }
        }
Ejemplo n.º 2
0
        private void bindTopImg(ContentPost img)
        {
            IBlock imgBlock = getBlock("img");

            if (img != null)
            {
                imgBlock.Set("ipost.ImgUrl", img.GetImgThumb());
                imgBlock.Set("ipost.TitleCss", img.Style);
                imgBlock.Set("ipost.TitleFull", img.Title);

                if (strUtil.HasText(img.TitleHome))
                {
                    imgBlock.Set("ipost.Title", img.TitleHome);
                }
                else
                {
                    imgBlock.Set("ipost.Title", img.Title);
                }

                String content = strUtil.HasText(img.Summary) ? img.Summary : strUtil.ParseHtml(img.Content, 50);
                imgBlock.Set("ipost.Content", content);
                imgBlock.Set("ipost.Width", img.Width);
                imgBlock.Set("ipost.Height", img.Height);

                imgBlock.Set("ipost.Url", alink.ToAppData(img, ctx));


                imgBlock.Next();
            }
        }
Ejemplo n.º 3
0
        private void bindSectionShow(long sectionId, int postcat, int imgcat, List <ContentPost> posts, ContentPost img)
        {
            set("postAddUrl", to(new Common.PostController().Add, sectionId) + "?categoryId=" + postcat);
            set("postListUrl", to(new ListController().AdminList, sectionId) + "?categoryId=" + postcat);

            set("imgAddUrl", to(new Common.PostController().Add, sectionId) + "?categoryId=" + imgcat);
            set("imgListUrl", to(new ListController().AdminList, sectionId) + "?categoryId=" + imgcat);


            IBlock block = getBlock("list");

            foreach (ContentPost post in posts)
            {
                block.Set("post.TitleCss", post.Style);
                block.Set("post.TitleFull", post.Title);

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


                block.Set("post.Url", to(new Common.PostController().Edit, post.Id));
                block.Set("post.Created", post.Created.ToShortTimeString());
                block.Next();
            }

            IBlock imgBlock = getBlock("img");

            if (img != null)
            {
                imgBlock.Set("ipost.ImgUrl", img.GetImgThumb());
                imgBlock.Set("ipost.TitleCss", img.Style);
                imgBlock.Set("ipost.TitleFull", img.Title);

                if (strUtil.HasText(img.TitleHome))
                {
                    imgBlock.Set("ipost.Title", img.TitleHome);
                }
                else
                {
                    imgBlock.Set("ipost.Title", img.Title);
                }


                String content = strUtil.HasText(img.Summary) ? img.Summary : strUtil.ParseHtml(img.Content, 50);
                imgBlock.Set("ipost.Content", content);
                imgBlock.Set("ipost.Width", img.Width);
                imgBlock.Set("ipost.Height", img.Height);

                imgBlock.Set("ipost.EditLink", to(new Common.PostController().EditImg, img.Id));
                imgBlock.Next();
            }
        }
Ejemplo n.º 4
0
        private void bindSectionShow(List <ContentPost> posts, ContentPost img)
        {
            IBlock block = getBlock("list");

            foreach (ContentPost post in posts)
            {
                BinderUtils.bindPostSingle(block, post, ctx);

                block.Next();
            }

            IBlock imgBlock = getBlock("img");

            if (img != null)
            {
                imgBlock.Set("ipost.TitleCss", img.Style);
                imgBlock.Set("ipost.TitleFull", img.Title);

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

                if (img.ImgLink.StartsWith("/") || img.ImgLink.StartsWith("http://"))
                {
                    imgBlock.Set("ipost.ImgUrl", img.ImgLink);
                }
                else
                {
                    imgBlock.Set("ipost.ImgUrl", img.GetImgThumb());
                }
                String content = strUtil.HasText(img.Summary) ? img.Summary : strUtil.ParseHtml(img.Content, 50);
                imgBlock.Set("ipost.Content", content);

                int width  = img.Width <= 0 ? 120 : img.Width;
                int height = img.Height <= 0 ? 90 : img.Height;

                imgBlock.Set("ipost.Width", width);
                imgBlock.Set("ipost.Height", height);

                imgBlock.Set("ipost.Url", alink.ToAppData(img, ctx));

                imgBlock.Bind("ipost", img);

                imgBlock.Next();
            }
        }
Ejemplo n.º 5
0
        private void bindEditInfo(ContentPost post)
        {
            if (post.PageSection == null)
            {
                return;
            }

            set("post.DeleteUrl", to(Delete, post.Id));

            set("post.Author", post.Author);
            set("post.Title", post.Title);
            set("post.TitleHome", strUtil.EncodeTextarea(post.TitleHome));

            set("post.Width", post.Width);
            set("post.Height", post.Height);

            editor("Content", strUtil.Edit(post.Content), "250px");

            set("post.Created", post.Created);
            set("post.Hits", post.Hits);
            set("post.OrderId", post.OrderId);

            set("post.RedirectUrl", post.RedirectUrl);
            set("post.MetaKeywords", post.MetaKeywords);
            set("post.MetaDescription", post.MetaDescription);


            set("post.Summary", post.Summary);
            set("post.SourceLink", post.SourceLink);
            set("post.Style", post.Style);

            set("post.ImgLink", post.GetImgUrl());
            set("post.ImgThumbLink", post.GetImgThumb());
            set("post.ImgDeleteLink", to(DeletePostPic, post.Id));


            set("post.TagList", post.Tag.TextString);
            String val = AccessStatusUtil.GetRadioList(post.AccessStatus);

            set("post.AccessStatus", val);
            set("post.IsCloseComment", Html.CheckBox("IsCloseComment", lang("closeComment"), "1", cvt.ToBool(post.CommentCondition)));

            radioList("PickStatus", PickStatus.GetPickStatus(), post.PickStatus.ToString());


            set("attachmentAdminLink", to(new AttachmentController().AdminList, post.Id));
        }
Ejemplo n.º 6
0
        private void bindSectionShow( long sectionId, int postcat, int imgcat, List<ContentPost> posts, ContentPost img ) {

            set( "postAddUrl", to( new Common.PostController().Add, sectionId ) + "?categoryId=" + postcat );
            set( "postListUrl", to( new ListController().AdminList, sectionId ) + "?categoryId=" + postcat );

            set( "imgAddUrl", to( new Common.PostController().Add, sectionId ) + "?categoryId=" + imgcat );
            set( "imgListUrl", to( new ListController().AdminList, sectionId ) + "?categoryId=" + imgcat );


            IBlock block = getBlock( "list" );
            foreach (ContentPost post in posts) {

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

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


                block.Set( "post.Url", to( new Common.PostController().Edit, post.Id ) );
                block.Set( "post.Created", post.Created.ToShortTimeString() );
                block.Next();
            }

            IBlock imgBlock = getBlock( "img" );
            if (img != null) {
                imgBlock.Set( "ipost.ImgUrl", img.GetImgThumb() );
                imgBlock.Set( "ipost.TitleCss", img.Style );
                imgBlock.Set( "ipost.TitleFull", img.Title );

                if (strUtil.HasText( img.TitleHome ))
                    imgBlock.Set( "ipost.Title", img.TitleHome );
                else
                    imgBlock.Set( "ipost.Title", img.Title );


                String content = strUtil.HasText( img.Summary ) ? img.Summary : strUtil.ParseHtml( img.Content, 50 );
                imgBlock.Set( "ipost.Content", content );
                imgBlock.Set( "ipost.Width", img.Width );
                imgBlock.Set( "ipost.Height", img.Height );

                imgBlock.Set( "ipost.EditLink", to( new Common.PostController().EditImg, img.Id ) );
                imgBlock.Next();
            }
        }
Ejemplo n.º 7
0
        private void bindSectionShow( List<ContentPost> posts, ContentPost img )
        {
            IBlock block = getBlock( "list" );
            foreach (ContentPost post in posts) {

                BinderUtils.bindPostSingle( block, post );

                block.Next();
            }

            IBlock imgBlock = getBlock( "img" );
            if (img != null) {

                imgBlock.Set( "ipost.TitleCss", img.Style );
                imgBlock.Set( "ipost.TitleFull", img.Title );

                if (strUtil.HasText( img.TitleHome ))
                    block.Set( "ipost.Title", img.TitleHome );
                else
                    block.Set( "ipost.Title", img.Title );

                if (img.ImgLink.StartsWith( "/" ) || img.ImgLink.StartsWith( "http://" ))
                    imgBlock.Set( "ipost.ImgUrl", img.ImgLink );
                else
                    imgBlock.Set( "ipost.ImgUrl", img.GetImgThumb() );
                String content = strUtil.HasText( img.Summary ) ? img.Summary : strUtil.ParseHtml( img.Content, 50 );
                imgBlock.Set( "ipost.Content", content );

                int width = img.Width <= 0 ? 120 : img.Width;
                int height = img.Height <= 0 ? 90 : img.Height;

                imgBlock.Set( "ipost.Width", width );
                imgBlock.Set( "ipost.Height", height );

                imgBlock.Set( "ipost.Url", alink.ToAppData( img ) );

                imgBlock.Bind( "ipost", img );

                imgBlock.Next();
            }
        }
Ejemplo n.º 8
0
        private void bindTopImg( ContentPost img ) {
            IBlock imgBlock = getBlock( "img" );
            if (img != null) {
                imgBlock.Set( "ipost.ImgUrl", img.GetImgThumb() );
                imgBlock.Set( "ipost.TitleCss", img.Style );
                imgBlock.Set( "ipost.TitleFull", img.Title );

                if (strUtil.HasText( img.TitleHome ))
                    imgBlock.Set( "ipost.Title", img.TitleHome );
                else
                    imgBlock.Set( "ipost.Title", img.Title );

                String content = strUtil.HasText( img.Summary ) ? img.Summary : strUtil.ParseHtml( img.Content, 100 );
                imgBlock.Set( "ipost.Content", content );
                imgBlock.Set( "ipost.Width", img.Width );
                imgBlock.Set( "ipost.Height", img.Height );

                imgBlock.Set( "ipost.Url", alink.ToAppData( img, ctx ) );


                imgBlock.Next();
            }
        }
Ejemplo n.º 9
0
        private void bindEditInfo( ContentPost post )
        {
            if (post.PageSection == null) return;

            set( "post.DeleteUrl", to( Delete, post.Id ) );

            set( "post.Author", post.Author );
            set( "post.Title", post.Title );
            set( "post.TitleHome", strUtil.EncodeTextarea( post.TitleHome ) );

            set( "post.Width", post.Width );
            set( "post.Height", post.Height );

            editor( "Content", strUtil.Edit( post.Content ), "250px" );

            set( "post.Created", post.Created );
            set( "post.Hits", post.Hits );
            set( "post.OrderId", post.OrderId );

            set( "post.RedirectUrl", post.RedirectUrl );
            set( "post.MetaKeywords", post.MetaKeywords );
            set( "post.MetaDescription", post.MetaDescription );

            set( "post.Summary", post.Summary );
            set( "post.SourceLink", post.SourceLink );
            set( "post.Style", post.Style );

            set( "post.ImgLink", post.GetImgUrl() );
            set( "post.ImgThumbLink", post.GetImgThumb() );
            set( "post.ImgDeleteLink", to( DeletePostPic, post.Id ) );

            set( "post.TagList", post.Tag.TextString );
            String val = AccessStatusUtil.GetRadioList( post.AccessStatus );
            set( "post.AccessStatus", val );
            set( "post.IsCloseComment", Html.CheckBox( "IsCloseComment", lang( "closeComment" ), "1", cvt.ToBool( post.CommentCondition ) ) );

            radioList( "PickStatus", PickStatus.GetPickStatus(), post.PickStatus.ToString() );

            set( "attachmentAdminLink", to( new AttachmentController().AdminList, post.Id ) );
        }
Ejemplo n.º 10
0
        private void bindTopImg( ContentPost img )
        {
            IBlock imgBlock = getBlock( "img" );
            if (img != null) {
                imgBlock.Set( "ipost.ImgUrl", img.GetImgThumb() );
                imgBlock.Set( "ipost.TitleCss", img.Style );
                imgBlock.Set( "ipost.TitleFull", img.Title );

                if (strUtil.HasText( img.TitleHome ))
                    imgBlock.Set( "ipost.Title", img.TitleHome );
                else
                    imgBlock.Set( "ipost.Title", img.Title );

                String content = strUtil.HasText( img.Summary ) ? img.Summary : strUtil.ParseHtml( img.Content, 50 );
                imgBlock.Set( "ipost.Content", content );
                imgBlock.Set( "ipost.Width", img.Width );
                imgBlock.Set( "ipost.Height", img.Height );

                imgBlock.Set( "ipost.EditLink", to( new Common.PostController().EditImg, img.Id ) );
                imgBlock.Next();
            }
        }