Ejemplo n.º 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);
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 6
0
 public AlbumController()
 {
     base.HideLayout(typeof(Photo.LayoutController));
     albumService = new PhotoAlbumService();
     postService  = new PhotoPostService();
 }
Ejemplo n.º 7
0
 public WaterfallInstaller()
 {
     postService = new PhotoPostService();
 }
Ejemplo n.º 8
0
 public PostController()
 {
     postService = new PhotoPostService();
 }
Ejemplo n.º 9
0
 public SysPhotoService() {
     pickedService = new PickedService();
     postService = new PhotoPostService();
 }
Ejemplo n.º 10
0
 public SysPhotoService()
 {
     pickedService = new PickedService();
     postService   = new PhotoPostService();
 }
Ejemplo n.º 11
0
 public SkinController() {
     postService = new PhotoPostService();
 }
Ejemplo n.º 12
0
 public MicroblogSaveController()
 {
     microblogService = new MicroblogService();
     postService      = new PhotoPostService();
 }
Ejemplo n.º 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 );
 }