Beispiel #1
0
        private static String getPreNextHtml(MvcContext ctx, PhotoPost post, IPhotoPostService postService)
        {
            PhotoPost prev = postService.GetPre(post);
            PhotoPost next = postService.GetNext(post);

            String prenext;

            if (prev == null && next == null)
            {
                prenext = "";
            }
            else if (prev == null)
            {
                prenext = "<a href=\"" + alink.ToAppData(next) + "\">" + alang(ctx, "nextPhoto") + "</a> ";
            }
            else if (next == null)
            {
                prenext = "<a href=\"" + alink.ToAppData(prev) + "\">" + alang(ctx, "prevPhoto") + "</a> ";
            }
            else
            {
                prenext = "<a href=\"" + alink.ToAppData(prev) + "\">" + alang(ctx, "prevPhoto") + "</a> | <a href=\"" + alink.ToAppData(next) + "\">" + alang(ctx, "nextPhoto") + "</a>";
            }
            return(prenext);
        }
Beispiel #2
0
        public static Post Fill( PhotoPost post, MvcContext ctx, IPhotoPostService postService ) {

            Post p = new Post();

            p.Title = post.Title;
            p.Description = post.Description;
            p.ImgUrl = post.ImgUrl;
            p.ImgMediumUrl = post.ImgMediumUrl;
            p.ImgThumbUrl = post.ImgThumbUrl;

            p.Creator = post.Creator.Name;
            p.Created = post.Created.ToShortDateString();
            p.Hits = post.Hits;

            if (post.PhotoAlbum == null || post.PhotoAlbum.Id == 0) 
                p.Album = alang( ctx, "defaultAlbum" );
            else
                p.Album = post.PhotoAlbum.Name;


            p.AlbumLink = ctx.link.To( new PhotoController().Album, post.PhotoAlbum.Id );

            String lnk = string.Format( " | <a href=\"{0}\">{1}《{2}》</a> ", p.AlbumLink, alang( ctx, "returnAlbum" ), p.Album );

            p.AlbumAndLink = lnk;// strUtil.HasText( p.Album ) ? lnk : "";

            p.Tags = post.Tag.List.Count > 0 ? "tag:" + post.Tag.HtmlString : "";
            String prevnext = getPreNextHtml( ctx, post, postService );
            String nextLink = getNextLink( ctx, post, postService );

            p.PrevNext = prevnext;
            p.NextLink = nextLink;

            return p;
        }
Beispiel #3
0
        private static String getNextLink(MvcContext ctx, PhotoPost post, IPhotoPostService postService)
        {
            PhotoPost next = postService.GetNext(post);

            if (next == null)
            {
                PhotoPost first = postService.GetFirst(post);
                return(alink.ToAppData(first));
            }
            return(alink.ToAppData(next));
        }
Beispiel #4
0
        private static String getPreNextHtml( MvcContext ctx, PhotoPost post, IPhotoPostService postService ) {

            PhotoPost prev = postService.GetPre( post );
            PhotoPost next = postService.GetNext( post );

            String prenext;
            if (prev == null && next == null)
                prenext = "";
            else if (prev == null)
                prenext = "<a href=\"" + alink.ToAppData( next ) + "\">" + alang( ctx, "nextPhoto" ) + "</a> ";
            else if (next == null)
                prenext = "<a href=\"" + alink.ToAppData( prev ) + "\">" + alang( ctx, "prevPhoto" ) + "</a> ";
            else
                prenext = "<a href=\"" + alink.ToAppData( prev ) + "\">" + alang( ctx, "prevPhoto" ) + "</a> | <a href=\"" + alink.ToAppData( next ) + "\">" + alang( ctx, "nextPhoto" ) + "</a>";
            return prenext;
        }
Beispiel #5
0
        public static Post Fill(PhotoPost post, MvcContext ctx, IPhotoPostService postService)
        {
            Post p = new Post();

            p.Title        = post.Title;
            p.Description  = post.Description;
            p.ImgUrl       = post.ImgUrl;
            p.ImgMediumUrl = post.ImgMediumUrl;
            p.ImgThumbUrl  = post.ImgThumbUrl;

            p.Creator = post.Creator.Name;
            p.Created = post.Created.ToShortDateString();
            p.Hits    = post.Hits;

            if (post.PhotoAlbum == null || post.PhotoAlbum.Id == 0)
            {
                p.Album = alang(ctx, "defaultAlbum");
            }
            else
            {
                p.Album = post.PhotoAlbum.Name;
            }


            p.AlbumLink = ctx.link.To(new PhotoController().Album, post.PhotoAlbum.Id);

            String lnk = string.Format(" | <a href=\"{0}\">{1}《{2}》</a> ", p.AlbumLink, alang(ctx, "returnAlbum"), p.Album);

            p.AlbumAndLink = lnk;// strUtil.HasText( p.Album ) ? lnk : "";

            p.Tags = post.Tag.List.Count > 0 ? "tag:" + post.Tag.HtmlString : "";
            String prevnext = getPreNextHtml(ctx, post, postService);
            String nextLink = getNextLink(ctx, post, postService);

            p.PrevNext = prevnext;
            p.NextLink = nextLink;

            return(p);
        }
Beispiel #6
0
 public AlbumController()
 {
     base.HideLayout(typeof(Photo.LayoutController));
     albumService = new PhotoAlbumService();
     postService  = new PhotoPostService();
 }
Beispiel #7
0
 public WaterfallInstaller()
 {
     postService = new PhotoPostService();
 }
Beispiel #8
0
 public PostController()
 {
     postService = new PhotoPostService();
 }
 public SysPhotoService() {
     pickedService = new PickedService();
     postService = new PhotoPostService();
 }
Beispiel #10
0
 public SysPhotoService()
 {
     pickedService = new PickedService();
     postService   = new PhotoPostService();
 }
 public SkinController() {
     postService = new PhotoPostService();
 }
Beispiel #12
0
 public MicroblogSaveController()
 {
     microblogService = new MicroblogService();
     postService      = new PhotoPostService();
 }
Beispiel #13
0
 private static String getNextLink( MvcContext ctx, PhotoPost post, IPhotoPostService postService )
 {
     PhotoPost next = postService.GetNext( post );
     if (next == null) {
         PhotoPost first = postService.GetFirst( post );
         return alink.ToAppData( first );
     }
     return alink.ToAppData( next );
 }