Esempio n. 1
0
        public ActionResult Disable(string themeId)
        {
            if (!Services.Authorizer.Authorize(Permissions.ApplyTheme, T("Couldn't disable the current theme")))
            {
                return(new HttpUnauthorizedResult());
            }

            if (_extensionManager.AvailableExtensions()
                .FirstOrDefault(extension => DefaultExtensionTypes.IsTheme(extension.ExtensionType) && extension.Id.Equals(themeId)) == null)
            {
                Services.Notifier.Error(T("Theme {0} was not found", themeId));
            }
            else
            {
                _themeService.DisableThemeFeatures(themeId);
            }

            return(RedirectToAction("Index"));
        }