Ejemplo n.º 1
0
        public IActionResult Configure()
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageWidgets))
            {
                return(AccessDeniedView());
            }

            var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext);
            var homePageNewProductsSettings = _settingService.LoadSetting <HomePageNewProductsSettings>(storeScope);

            if (homePageNewProductsSettings == null)
            {
                throw new NullReferenceException(nameof(homePageNewProductsSettings));
            }

            var model = new ConfigurationModel()
            {
                ProductsCount = homePageNewProductsSettings.ProductsCount,
                // Not sure but the options may need to be localized to. For now they aren't.
                HomePageZones = HomePageZonesGenerator.GetSelectList(homePageNewProductsSettings.SelectedZone)
            };

            return(View(ConfigureViewPath, model));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets widget zones where this widget should be rendered
 /// </summary>
 /// <returns>Widget zones</returns>
 public IList <string> GetWidgetZones()
 {
     return(HomePageZonesGenerator.GetList());
 }