Beispiel #1
0
        private void bindSectionShow(int sectionId, List <ContentPost> posts, ContentPost first)
        {
            set("sectionId", sectionId);
            IBlock block = getBlock("nav");

            int i = 1;

            foreach (ContentPost photo in posts)
            {
                block.Set("photo.Number", i);
                block.Set("photo.ImgUrl", photo.GetImgOriginal());
                block.Set("photo.ThumbUrl", photo.GetImgThumb());
                block.Set("photo.Link", alink.ToAppData(photo, ctx));

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

                block.Bind("photo", photo);

                block.Next();
                i++;
            }

            IBlock fblock = getBlock("first");

            if (first != null)
            {
                if (strUtil.HasText(first.TitleHome))
                {
                    fblock.Set("first.Title", first.TitleHome);
                }
                else
                {
                    fblock.Set("first.Title", first.Title);
                }


                fblock.Set("first.ImgUrl", first.GetImgOriginal());
                fblock.Set("first.Link", alink.ToAppData(first, ctx));


                fblock.Set("first.Width", first.Width);
                fblock.Set("first.Height", first.Height);
                fblock.Bind("first", first);
                fblock.Next();
            }
        }
Beispiel #2
0
        public void DeletePostPic(int id)
        {
            ContentPost post = postService.GetById(id, ctx.owner.Id);

            if (post == null)
            {
                echoText("data not found");
                return;
            }

            wojilu.Drawing.Img.DeleteImgAndThumb(post.GetImgOriginal());
            echoAjaxOk();
        }
        private void bindSectionShow(long sectionId, int imgcat, List <ContentPost> posts, ContentPost first)
        {
            set("sectionId", sectionId);
            set("addUrl", to(new Common.PostController().Add, sectionId) + "?categoryId=" + imgcat);
            set("listUrl", to(new ListController().AdminList, sectionId) + "?categoryId=" + imgcat);

            IBlock block = getBlock("nav");

            int i = 1;

            foreach (ContentPost photo in posts)
            {
                block.Set("photo.Number", i);

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

                block.Set("photo.ImgUrl", photo.GetImgOriginal());
                block.Set("photo.ThumbUrl", photo.GetImgThumb());
                block.Set("photo.Link", to(new Common.PostController().EditImg, photo.Id));
                block.Next();
                i++;
            }

            IBlock fblock = getBlock("first");

            if (first != null)
            {
                fblock.Set("first.Title", strUtil.SubString(first.Title, 20));
                fblock.Set("first.ImgUrl", first.GetImgOriginal());
                fblock.Set("first.Link", to(new Common.PostController().EditImg, first.Id));

                fblock.Set("first.Width", first.Width);
                fblock.Set("first.Height", first.Height);
                fblock.Next();
            }
        }
        private void bindSectionShow( long sectionId, List<ContentPost> posts, ContentPost first ) {
            set( "sectionId", sectionId );
            IBlock block = getBlock( "nav" );

            int i = 1;
            foreach (ContentPost photo in posts) {
                block.Set( "photo.Number", i );
                block.Set( "photo.ImgUrl", photo.GetImgOriginal() );
                block.Set( "photo.ThumbUrl", photo.GetImgThumb() );
                block.Set( "photo.Link", alink.ToAppData( photo, ctx ) );

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

                block.Bind( "photo", photo );

                block.Next();
                i++;
            }

            IBlock fblock = getBlock( "first" );
            if (first != null) {

                if (strUtil.HasText( first.TitleHome ))
                    fblock.Set( "first.Title", first.TitleHome );
                else
                    fblock.Set( "first.Title", first.Title );


                fblock.Set( "first.ImgUrl", first.GetImgOriginal() );
                fblock.Set( "first.Link", alink.ToAppData( first, ctx ) );


                fblock.Set( "first.Width", first.Width );
                fblock.Set( "first.Height", first.Height );
                fblock.Bind( "first", first );
                fblock.Next();
            }


        }
Beispiel #5
0
        private void bindEditInfo(ContentPost post)
        {
            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);

            set("Content", post.Content);

            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.GetImgOriginal());
            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));
        }
        private void bindSectionShow( long sectionId, int imgcat, List<ContentPost> posts, ContentPost first ) {

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

            IBlock block = getBlock( "nav" );

            int i = 1;
            foreach (ContentPost photo in posts) {
                block.Set( "photo.Number", i );

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

                block.Set( "photo.ImgUrl", photo.GetImgOriginal() );
                block.Set( "photo.ThumbUrl", photo.GetImgThumb() );
                block.Set( "photo.Link", to( new Common.PostController().EditImg, photo.Id ) );
                block.Next();
                i++;
            }

            IBlock fblock = getBlock( "first" );
            if (first != null) {

                fblock.Set( "first.Title", strUtil.SubString( first.Title, 20 ) );
                fblock.Set( "first.ImgUrl", first.GetImgOriginal() );
                fblock.Set( "first.Link", to( new Common.PostController().EditImg, first.Id ) );

                fblock.Set( "first.Width", first.Width );
                fblock.Set( "first.Height", first.Height );
                fblock.Next();
            }

        }
        private void bindEditInfo( ContentPost post ) {

            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 );

            set( "Content", post.Content );

            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.GetImgOriginal() );
            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 ) );
        }