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.GetImgUrl()); block.Set("photo.ThumbUrl", photo.GetImgThumb()); block.Set("photo.Link", alink.ToAppData(photo)); 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.GetImgUrl()); fblock.Set("first.Link", alink.ToAppData(first)); fblock.Set("first.Width", first.Width); fblock.Set("first.Height", first.Height); fblock.Bind("first", first); fblock.Next(); } }
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.GetImgUrl()); echoAjaxOk(); }
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)); }
private void bindSectionShow(int sectionId, int imgcat, List <ContentPost> posts, ContentPost first) { set("sectionId", sectionId); set("addUrl", Link.To(new PostController().Add, sectionId) + "?categoryId=" + imgcat); set("listUrl", Link.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.GetImgUrl()); block.Set("photo.ThumbUrl", photo.GetImgThumb()); block.Set("photo.Link", Link.To(new 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.GetImgUrl()); fblock.Set("first.Link", Link.To(new PostController().EditImg, first.Id)); fblock.Set("first.Width", first.Width); fblock.Set("first.Height", first.Height); fblock.Next(); } }
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.GetImgUrl() ); block.Set( "photo.ThumbUrl", photo.GetImgThumb() ); block.Set( "photo.Link", alink.ToAppData( photo ) ); 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.GetImgUrl() ); fblock.Set( "first.Link", alink.ToAppData( first ) ); fblock.Set( "first.Width", first.Width ); fblock.Set( "first.Height", first.Height ); fblock.Bind( "first", first ); fblock.Next(); } }
private void bindSectionShow( int sectionId, int imgcat, List<ContentPost> posts, ContentPost first ) { set( "sectionId", sectionId ); set( "addUrl", Link.To( new PostController().Add, sectionId ) + "?categoryId=" + imgcat ); set( "listUrl", Link.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.GetImgUrl() ); block.Set( "photo.ThumbUrl", photo.GetImgThumb() ); block.Set( "photo.Link", Link.To( new 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.GetImgUrl() ); fblock.Set( "first.Link", Link.To( new PostController().EditImg, first.Id ) ); fblock.Set( "first.Width", first.Width ); fblock.Set( "first.Height", first.Height ); fblock.Next(); } }
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 ) ); }