예제 #1
0
        public TopicAlertButtonModel(
            IGlassBase model,
            IRenderingContextService renderingService,
            IAuthenticatedUserContext userContext,
            IUserContentService <ISavedSearchSaveable, ISavedSearchDisplayable> savedSearchService,
            ITextTranslator textTranslator)
        {
            var parameters = renderingService.GetCurrentRenderingParameters <ITopic_Alert_Options>();

            if (IsAuthorPage(model))
            {
                parameters = SetupAuthorParameters(parameters);
            }

            IsAuthenticated = userContext.IsAuthenticated;
            SetAlertText    = textTranslator.Translate(DictionaryKeys.TopicSetAlertText);
            RemoveAlertText = textTranslator.Translate(DictionaryKeys.TopicRemoveAlertText);
            DisplayButton   = model != null && (!string.IsNullOrEmpty(parameters?.Related_Search) || Sitecore.Context.PageMode.IsExperienceEditor);
            if (DisplayButton)
            {
                AlertIsSet = savedSearchService.Exists(new SavedSearchDisplayModel
                {
                    Url          = parameters?.Related_Search ?? string.Empty,
                    AlertEnabled = true
                });
                TopicName  = GetTopicTitle(model);
                AlertTitle = !string.IsNullOrEmpty(parameters?.Search_Name) ? parameters.Search_Name : TopicName;
                AlertUrl   = parameters?.Related_Search;
            }
        }
예제 #2
0
 public UserContentController(
     IUserContentService userContentService,
     IOptions <AppSettings> appSettings,
     OperatingUser operatingUser)
 {
     _userContentService = userContentService;
     _appSettings        = appSettings.Value;
     _operatingUser      = operatingUser;
 }
예제 #3
0
 public UserService(
     DataContext context,
     IMapper mapper,
     IRoleService roleService,
     IUserTypeService userTypeService,
     IUserContentService userContentService)
 {
     _context            = context;
     _mapper             = mapper;
     _roleService        = roleService;
     _userTypeService    = userTypeService;
     _userContentService = userContentService;
 }
예제 #4
0
        public ArticleController(
            ICommonServices services,
            IArticleService articleService,
            IUserContentService userContentService,
            IUserService userService,
            IUserActivityService userActivityService,
            IWorkflowMessageService workflowMessageService,
            IAclService aclService,
            ISiteMappingService siteMappingService,
            ArticleCatalogSettings catalogSettings,
            LocalizationSettings localizationSettings,
            ILocalizationService localizationService,
            ArticleCatalogHelper helper, IArticleTagService articleTagService,
            IRecentlyViewedArticlesService recentlyViewedArticlesService,
            CaptchaSettings captchaSettings,
            IWebHelper webHelper,
            IWorkContext workContext
            )
        {
            this._services               = services;
            this._articleService         = articleService;
            this._userContentService     = userContentService;
            this._userService            = userService;
            this._userActivityService    = userActivityService;
            this._workflowMessageService = workflowMessageService;
            this._aclService             = aclService;
            this._siteMappingService     = siteMappingService;
            this._catalogSettings        = catalogSettings;
            this._localizationSettings   = localizationSettings;
            this._localizationService    = localizationService;
            this._helper                        = helper;
            this._articleTagService             = articleTagService;
            this._recentlyViewedArticlesService = recentlyViewedArticlesService;
            this._workContext                   = workContext;
            this._captchaSettings               = captchaSettings;
            this._webHelper                     = webHelper;

            T = NullLocalizer.Instance;
        }
예제 #5
0
        public SavedSearchesViewModel(
            ITextTranslator translator,
            IAuthenticatedUserContext userContext,
            ISignInViewModel signInViewModel,
            IUserContentService <ISavedSearchSaveable, ISavedSearchDisplayable> savedSearchService,
            ISitePublicationNameContext publicationNameContext)
        {
            PublicationNameContext = publicationNameContext;

            SignInViewModel = signInViewModel;

            SavedSearches         = savedSearchService.GetContent();
            IsAuthenticated       = userContext.IsAuthenticated;
            GeneralErrorText      = translator.Translate("SavedSearches.GeneralError");
            NullUserText          = translator.Translate("SavedSearches.NullUserError");
            RequestFailedText     = translator.Translate("SavedSearches.RequestFailedError");
            SourceText            = translator.Translate("SavedSearches.SourceText");
            TitleText             = translator.Translate("SavedSearches.TitleText");
            DateText              = translator.Translate("SavedSearches.DateText");
            EmailAlertText        = translator.Translate("SavedSearches.EmailAlertText");
            RemoveText            = translator.Translate("SavedSearches.RemoveText");
            ItemRemovedMessage    = translator.Translate("SavedSearches.ItemRemovedMessage");
            EmailAlertTooltipText = translator.Translate("IconTooltips.Email.EmailAlert");
        }
예제 #6
0
 public SavedSearchesController(IUserContentService <ISavedSearchSaveable, ISavedSearchDisplayable> savedSearchService)
 {
     _savedSearchService = savedSearchService;
 }
 public ForumApiController()
 {
     userContentService = UserContentContext.Current
                          .Instances[Forums.Instance].Service;
 }