public ActionResult Configure() { // load settings for a chosen store scope var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); var settings = _settingService.LoadSetting<ProfilerSettings>(storeScope); var storeDependingSettingHelper = new StoreDependingSettingHelper(ViewData); storeDependingSettingHelper.GetOverrideKeys(settings, settings, storeScope, _settingService); return View(settings); }
public ActionResult Configure() { var model = new PayUMeaStandardConfigurationModel(); int storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _services.WorkContext); var settings = _services.Settings.LoadSetting<PayUMeaStandardPaymentSettings>(storeScope); model.Copy(settings, true); var storeDependingSettingHelper = new StoreDependingSettingHelper(ViewData); storeDependingSettingHelper.GetOverrideKeys(settings, model, storeScope, _services.Settings); return View(model); }
public ActionResult Configure() { if (!HasPermission(false)) return AccessDeniedPartialView(); var model = new ConfigurationModel(); int storeScope = this.GetActiveStoreScopeConfiguration(_services.StoreService, _services.WorkContext); var settings = _services.Settings.LoadSetting<FacebookExternalAuthSettings>(storeScope); model.ClientKeyIdentifier = settings.ClientKeyIdentifier; model.ClientSecret = settings.ClientSecret; var storeDependingSettingHelper = new StoreDependingSettingHelper(ViewData); storeDependingSettingHelper.GetOverrideKeys(settings, model, storeScope, _services.Settings); return View(model); }
public ActionResult Configure() { //load settings for a chosen store scope var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); var googleAnalyticsSettings = _settingService.LoadSetting<GoogleAnalyticsSettings>(storeScope); var model = new ConfigurationModel(); model.GoogleId = googleAnalyticsSettings.GoogleId; model.TrackingScript = googleAnalyticsSettings.TrackingScript; model.EcommerceScript = googleAnalyticsSettings.EcommerceScript; model.EcommerceDetailScript = googleAnalyticsSettings.EcommerceDetailScript; model.ZoneId = googleAnalyticsSettings.WidgetZone; model.AvailableZones.Add(new SelectListItem() { Text = "<head> HTML tag", Value = "head_html_tag"}); model.AvailableZones.Add(new SelectListItem() { Text = "Before <body> end HTML tag", Value = "body_end_html_tag_before" }); var storeDependingSettingHelper = new StoreDependingSettingHelper(ViewData); storeDependingSettingHelper.GetOverrideKeys(googleAnalyticsSettings, model, storeScope, _settingService); return View(model); }
public virtual void OnActionExecuted(ActionExecutedContext filterContext) { var viewResult = filterContext.Result as ViewResultBase; if (viewResult != null) { var model = viewResult.Model; if (model == null) { // Nothing to override. E.g. insufficient permission. return; } var modelType = model.GetType(); var settingsHelper = new StoreDependingSettingHelper(filterContext.Controller.ViewData); if (IsRootedModel) { settingsHelper.CreateViewDataObject(_storeId); } foreach (var param in _settingParams) { var settingInstance = param.Instance; var modelInstance = model; if (IsRootedModel) { modelInstance = modelType.GetProperty(settingInstance.GetType().Name, BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase)?.GetValue(model); if (modelInstance == null) { continue; } } settingsHelper.GetOverrideKeys(settingInstance, modelInstance, _storeId, Services.Settings, !IsRootedModel); } } }
public virtual void OnActionExecuted(ActionExecutedContext filterContext) { var viewResult = filterContext.Result as ViewResultBase; if (viewResult != null) { var model = viewResult.Model; if (model == null) { // Nothing to override. E.g. insufficient permission. return; } var settingsHelper = new StoreDependingSettingHelper(filterContext.Controller.ViewData); foreach (var param in _settingParams) { settingsHelper.GetOverrideKeys(param.Instance, model, _storeId, Services.Settings); } } }
public ActionResult Configure() { //load settings for a chosen store scope var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext); var trustedShopsSealSettings = _settingService.LoadSetting<TrustedShopsSealSettings>(storeScope); var model = new ConfigurationModel(); model.TrustedShopsId = trustedShopsSealSettings.TrustedShopsId; model.IsTestMode = trustedShopsSealSettings.IsTestMode; model.ShopName = trustedShopsSealSettings.ShopName; model.ShopText = trustedShopsSealSettings.ShopText; model.WidgetZone = trustedShopsSealSettings.WidgetZone; model.AvailableZones.Add(new SelectListItem() { Text = "Before left side column", Value = "left_side_column_before" }); model.AvailableZones.Add(new SelectListItem() { Text = "After left side column", Value = "left_side_column_after" }); model.AvailableZones.Add(new SelectListItem() { Text = "Before right side column", Value = "right_side_column_before" }); model.AvailableZones.Add(new SelectListItem() { Text = "After right side column", Value = "right_side_column_after" }); model.AvailableZones.Add(new SelectListItem() { Text = "Homepage bottom", Value = "home_page_bottom" }); var storeDependingSettingHelper = new StoreDependingSettingHelper(ViewData); storeDependingSettingHelper.GetOverrideKeys(trustedShopsSealSettings, model, storeScope, _settingService); return View("SmartStore.Plugin.Widgets.TrustedShopsSeal.Views.TrustedShopsSeal.Configure", model); }