コード例 #1
0
        public virtual void AddForumTokens(IList<Token> tokens, Forum forum, int languageId)
        {
            //TODO add a method for getting URL (use routing because it handles all SEO friendly URLs)
            var forumUrl = string.Format("{0}boards/forum/{1}/{2}", _webHelper.GetStoreLocation(false), forum.Id, forum.GetSeName(languageId));
            tokens.Add(new Token("Forums.ForumURL", forumUrl, true));
            tokens.Add(new Token("Forums.ForumName", forum.GetLocalized(x => x.Name, languageId)));

            //event notification
            _eventPublisher.EntityTokensAdded(forum, tokens);
        }
コード例 #2
0
 protected ForumRowModel PrepareForumRowModel(Forum forum)
 {
     var forumModel = new ForumRowModel
     {
         Id = forum.Id,
         Name = forum.GetLocalized(x => x.Name),
         SeName = forum.GetSeName(),
         Description = forum.GetLocalized(x => x.Description),
         NumTopics = forum.NumTopics,
         NumPosts = forum.NumPosts,
         LastPostId = forum.LastPostId,
     };
     return forumModel;
 }