Ejemplo n.º 1
0
        public MessageTokenProvider(ILanguageService languageService,
                                    ILocalizationService localizationService, IDateTimeHelper dateTimeHelper,
                                    IEmailAccountService emailAccountService, EmailAccountSettings emailAccountSettings,
                                    IWebHelper webHelper,
                                    IWorkContext workContext, IDownloadService downloadService,
                                    SiteInformationSettings siteInfoSettings, CompanyInformationSettings companyInfoSettings,
                                    ContactDataSettings contactDataSettings, BankConnectionSettings bankConnectionSettings,
                                    MessageTemplatesSettings templatesSettings, SiteSettings siteSettings,
                                    IEventPublisher eventPublisher)
        {
            this._languageService     = languageService;
            this._localizationService = localizationService;
            this._dateTimeHelper      = dateTimeHelper;
            this._emailAccountService = emailAccountService;
            this._webHelper           = webHelper;
            this._workContext         = workContext;
            this._downloadService     = downloadService;
            this._siteSettings        = siteSettings;

            this._siteInfoSettings     = siteInfoSettings;
            this._templatesSettings    = templatesSettings;
            this._emailAccountSettings = emailAccountSettings;
            this._eventPublisher       = eventPublisher;

            this._companyInfoSettings    = companyInfoSettings;
            this._contactDataSettings    = contactDataSettings;
            this._bankConnectionSettings = bankConnectionSettings;
        }
Ejemplo n.º 2
0
 public ProductController(
     SmartDbContext db,
     IWebHelper webHelper,
     IProductService productService,
     IProductTagService productTagService,
     IProductAttributeService productAttributeService,
     IRecentlyViewedProductsService recentlyViewedProductsService,
     IProductCompareService productCompareService,
     IAclService aclService,
     IStoreMappingService storeMappingService,
     ICatalogSearchService catalogSearchService,
     IMediaService mediaService,
     ICustomerService customerService,
     MediaSettings mediaSettings,
     CatalogSettings catalogSettings,
     CatalogHelper helper,
     IBreadcrumb breadcrumb,
     SeoSettings seoSettings,
     ContactDataSettings contactDataSettings,
     CaptchaSettings captchaSettings,
     LocalizationSettings localizationSettings,
     PrivacySettings privacySettings,
     Lazy <IUrlHelper> urlHelper,
     Lazy <IMessageFactory> messageFactory,
     Lazy <ProductUrlHelper> productUrlHelper,
     Lazy <IProductAttributeFormatter> productAttributeFormatter,
     Lazy <IProductAttributeMaterializer> productAttributeMaterializer)
 {
     _db                            = db;
     _webHelper                     = webHelper;
     _productService                = productService;
     _productTagService             = productTagService;
     _productAttributeService       = productAttributeService;
     _recentlyViewedProductsService = recentlyViewedProductsService;
     _productCompareService         = productCompareService;
     _aclService                    = aclService;
     _storeMappingService           = storeMappingService;
     _catalogSearchService          = catalogSearchService;
     _mediaService                  = mediaService;
     _customerService               = customerService;
     _mediaSettings                 = mediaSettings;
     _catalogSettings               = catalogSettings;
     _helper                        = helper;
     _breadcrumb                    = breadcrumb;
     _seoSettings                   = seoSettings;
     _contactDataSettings           = contactDataSettings;
     _captchaSettings               = captchaSettings;
     _localizationSettings          = localizationSettings;
     _privacySettings               = privacySettings;
     _urlHelper                     = urlHelper;
     _messageFactory                = messageFactory;
     _productUrlHelper              = productUrlHelper;
     _productAttributeFormatter     = productAttributeFormatter;
     _productAttributeMaterializer  = productAttributeMaterializer;
 }
 public WidgetsContactDataController(ISettingService settingService, ContactDataSettings contactDataSettings,
                                     IContactDataService widgetContactDataService, ILocalizationService localizationService,
                                     INotificationService notificationService, IPermissionService permissionService)
 {
     this._settingService           = settingService;
     this._contactDataSettings      = contactDataSettings;
     this._widgetContactDataService = widgetContactDataService;
     this._localizationService      = localizationService;
     this._notificationService      = notificationService;
     this._permissionService        = permissionService;
 }
Ejemplo n.º 4
0
 public DataImporter(
     ICommonServices services,
     ILifetimeScopeAccessor scopeAccessor,
     IImportProfileService importProfileService,
     ILanguageService languageService,
     IEmailAccountService emailAccountService,
     IMailService mailService,
     ContactDataSettings contactDataSettings,
     DataExchangeSettings dataExchangeSettings)
 {
     _services             = services;
     _scopeAccessor        = scopeAccessor;
     _importProfileService = importProfileService;
     _languageService      = languageService;
     _emailAccountService  = emailAccountService;
     _mailService          = mailService;
     _contactDataSettings  = contactDataSettings;
     _dataExchangeSettings = dataExchangeSettings;
 }
Ejemplo n.º 5
0
        //[LoadSetting(IsRootedModel = true)]
        public ActionResult GeneralCommon(int storeScope,
                                          StoreInformationSettings storeInformationSettings,
                                          SeoSettings seoSettings,
                                          DateTimeSettings dateTimeSettings,
                                          SecuritySettings securitySettings,
                                          CaptchaSettings captchaSettings,
                                          PdfSettings pdfSettings,
                                          LocalizationSettings localizationSettings,
                                          CompanyInformationSettings companySettings,
                                          ContactDataSettings contactDataSettings,
                                          BankConnectionSettings bankConnectionSettings,
                                          SocialSettings socialSettings,
                                          HomePageSettings homePageSettings)
        {
            // TODO: (mh) (core)
            // Set page timeout to 5 minutes.
            //Server.ScriptTimeout = 300;

            var model = new GeneralCommonSettingsModel();

            return(View(model));
        }
Ejemplo n.º 6
0
 public PrintableProductsModel()
 {
     MerchantCompanyInfo = new CompanyInformationSettings();
     MerchantContactData = new ContactDataSettings();
     Products            = new List <PrintableProductModel>();
 }
Ejemplo n.º 7
0
        public async Task <IActionResult> GeneralCommon(
            int storeScope,
            StoreInformationSettings storeInformationSettings,
            SeoSettings seoSettings,
            DateTimeSettings dateTimeSettings,
            SecuritySettings securitySettings,
            CaptchaSettings captchaSettings,
            PdfSettings pdfSettings,
            LocalizationSettings localizationSettings,
            CompanyInformationSettings companySettings,
            ContactDataSettings contactDataSettings,
            BankConnectionSettings bankConnectionSettings,
            SocialSettings socialSettings,
            HomePageSettings homePageSettings)
        {
            var model = new GeneralCommonSettingsModel();

            // Map entities to model.
            MiniMapper.Map(storeInformationSettings, model.StoreInformationSettings);
            MiniMapper.Map(seoSettings, model.SeoSettings);
            MiniMapper.Map(dateTimeSettings, model.DateTimeSettings);
            MiniMapper.Map(securitySettings, model.SecuritySettings);
            MiniMapper.Map(captchaSettings, model.CaptchaSettings);
            MiniMapper.Map(pdfSettings, model.PdfSettings);
            MiniMapper.Map(localizationSettings, model.LocalizationSettings);
            MiniMapper.Map(companySettings, model.CompanyInformationSettings);
            MiniMapper.Map(contactDataSettings, model.ContactDataSettings);
            MiniMapper.Map(bankConnectionSettings, model.BankConnectionSettings);
            MiniMapper.Map(socialSettings, model.SocialSettings);
            MiniMapper.Map(homePageSettings, model.HomepageSettings);

            #region SEO custom mapping

            // Fix for Disallows & Allows joined with comma in MiniMapper (we need NewLine).
            model.SeoSettings.ExtraRobotsDisallows = seoSettings.ExtraRobotsDisallows != null?string.Join(Environment.NewLine, seoSettings.ExtraRobotsDisallows) : string.Empty;

            model.SeoSettings.ExtraRobotsAllows = seoSettings.ExtraRobotsAllows != null?string.Join(Environment.NewLine, seoSettings.ExtraRobotsAllows) : string.Empty;

            model.SeoSettings.MetaTitle       = seoSettings.MetaTitle;
            model.SeoSettings.MetaDescription = seoSettings.MetaDescription;
            model.SeoSettings.MetaKeywords    = seoSettings.MetaKeywords;

            AddLocales(model.SeoSettings.Locales, (locale, languageId) =>
            {
                locale.MetaTitle       = seoSettings.GetLocalizedSetting(x => x.MetaTitle, languageId, storeScope, false, false);
                locale.MetaDescription = seoSettings.GetLocalizedSetting(x => x.MetaDescription, languageId, storeScope, false, false);
                locale.MetaKeywords    = seoSettings.GetLocalizedSetting(x => x.MetaKeywords, languageId, storeScope, false, false);
            });

            model.HomepageSettings.MetaTitle       = homePageSettings.MetaTitle;
            model.HomepageSettings.MetaDescription = homePageSettings.MetaDescription;
            model.HomepageSettings.MetaKeywords    = homePageSettings.MetaKeywords;

            AddLocales(model.HomepageSettings.Locales, (locale, languageId) =>
            {
                locale.MetaTitle       = homePageSettings.GetLocalizedSetting(x => x.MetaTitle, languageId, storeScope, false, false);
                locale.MetaDescription = homePageSettings.GetLocalizedSetting(x => x.MetaDescription, languageId, storeScope, false, false);
                locale.MetaKeywords    = homePageSettings.GetLocalizedSetting(x => x.MetaKeywords, languageId, storeScope, false, false);
            });

            #endregion

            await PrepareConfigurationModelAsync(model);

            return(View(model));
        }
Ejemplo n.º 8
0
        public async Task <IActionResult> GeneralCommon(
            GeneralCommonSettingsModel model,
            int storeScope,
            StoreInformationSettings storeInformationSettings,
            SeoSettings seoSettings,
            DateTimeSettings dateTimeSettings,
            SecuritySettings securitySettings,
            CaptchaSettings captchaSettings,
            PdfSettings pdfSettings,
            LocalizationSettings localizationSettings,
            CompanyInformationSettings companySettings,
            ContactDataSettings contactDataSettings,
            BankConnectionSettings bankConnectionSettings,
            SocialSettings socialSettings,
            HomePageSettings homePageSeoSettings)
        {
            if (!ModelState.IsValid)
            {
                await PrepareConfigurationModelAsync(model);

                return(View(model));
            }

            ModelState.Clear();

            // Necessary before mapping
            var resetUserSeoCharacterTable = seoSettings.SeoNameCharConversion != model.SeoSettings.SeoNameCharConversion;
            var clearSeoFriendlyUrls       = localizationSettings.SeoFriendlyUrlsForLanguagesEnabled != model.LocalizationSettings.SeoFriendlyUrlsForLanguagesEnabled;
            var prevPdfLogoId = pdfSettings.LogoPictureId;

            // Map model to entities
            MiniMapper.Map(model.StoreInformationSettings, storeInformationSettings);
            MiniMapper.Map(model.SeoSettings, seoSettings);
            MiniMapper.Map(model.DateTimeSettings, dateTimeSettings);
            MiniMapper.Map(model.SecuritySettings, securitySettings);
            MiniMapper.Map(model.CaptchaSettings, captchaSettings);
            MiniMapper.Map(model.PdfSettings, pdfSettings);
            MiniMapper.Map(model.LocalizationSettings, localizationSettings);
            MiniMapper.Map(model.CompanyInformationSettings, companySettings);
            MiniMapper.Map(model.ContactDataSettings, contactDataSettings);
            MiniMapper.Map(model.BankConnectionSettings, bankConnectionSettings);
            MiniMapper.Map(model.SocialSettings, socialSettings);
            MiniMapper.Map(model.HomepageSettings, homePageSeoSettings);

            #region POST mapping

            // Set CountryId explicitly else it can't be resetted.
            companySettings.CountryId = model.CompanyInformationSettings.CountryId ?? 0;

            //// (Un)track PDF logo id
            await _mediaTracker.Value.TrackAsync(pdfSettings, prevPdfLogoId, x => x.LogoPictureId);

            seoSettings.MetaTitle       = model.SeoSettings.MetaTitle;
            seoSettings.MetaDescription = model.SeoSettings.MetaDescription;
            seoSettings.MetaKeywords    = model.SeoSettings.MetaKeywords;

            foreach (var localized in model.SeoSettings.Locales)
            {
                await _localizedEntityService.ApplyLocalizedSettingAsync(seoSettings, x => x.MetaTitle, localized.MetaTitle, localized.LanguageId, storeScope);

                await _localizedEntityService.ApplyLocalizedSettingAsync(seoSettings, x => x.MetaDescription, localized.MetaDescription, localized.LanguageId, storeScope);

                await _localizedEntityService.ApplyLocalizedSettingAsync(seoSettings, x => x.MetaKeywords, localized.MetaKeywords, localized.LanguageId, storeScope);
            }

            homePageSeoSettings.MetaTitle       = model.HomepageSettings.MetaTitle;
            homePageSeoSettings.MetaDescription = model.HomepageSettings.MetaDescription;
            homePageSeoSettings.MetaKeywords    = model.HomepageSettings.MetaKeywords;

            foreach (var localized in model.HomepageSettings.Locales)
            {
                await _localizedEntityService.ApplyLocalizedSettingAsync(homePageSeoSettings, x => x.MetaTitle, localized.MetaTitle, localized.LanguageId, storeScope);

                await _localizedEntityService.ApplyLocalizedSettingAsync(homePageSeoSettings, x => x.MetaDescription, localized.MetaDescription, localized.LanguageId, storeScope);

                await _localizedEntityService.ApplyLocalizedSettingAsync(homePageSeoSettings, x => x.MetaKeywords, localized.MetaKeywords, localized.LanguageId, storeScope);
            }

            await _db.SaveChangesAsync();

            if (resetUserSeoCharacterTable)
            {
                SeoHelper.ResetUserSeoCharacterTable();
            }

            // TODO: (mh) (core) Do this right, if still needed.
            //if (clearSeoFriendlyUrls)
            //{
            //    LocalizedRoute.ClearSeoFriendlyUrlsCachedValue();
            //}

            #endregion

            // Does not contain any store specific settings.
            await Services.SettingFactory.SaveSettingsAsync(securitySettings);

            return(NotifyAndRedirect("GeneralCommon"));
        }
 public ContactDataService(ContactDataSettings contactDataSettings)
 {
     this._contactDataSettings = contactDataSettings;
 }