Repository navigation
Expand file tree
/
Copy pathThemeController.cs
More file actions
61 lines (49 loc) · 1.47 KB
/
Copy pathThemeController.cs
File metadata and controls
61 lines (49 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System.Web.Mvc;
using SmartStore.Core;
using SmartStore.Core.Themes;
using SmartStore.Services.Themes;
using SmartStore.Web.Framework.Controllers;
using SmartStore.Web.Framework.Security;
using SmartStore.Web.Framework.Theming;
namespace SmartStore.Web.Controllers
{
[AdminAuthorize]
public partial class ThemeController : PublicControllerBase
{
#region Fields
private readonly IThemeRegistry _themeRegistry;
private readonly IThemeVariablesService _themeVarService;
private readonly IThemeContext _themeContext;
private readonly IStoreContext _storeContext;
#endregion
#region Constructors
public ThemeController(
IThemeRegistry themeRegistry,
IThemeVariablesService themeVarService,
IThemeContext themeContext,
IStoreContext storeContext)
{
this._themeRegistry = themeRegistry;
this._themeVarService = themeVarService;
this._themeContext = themeContext;
this._storeContext = storeContext;
}
#endregion
#region Methods
[ChildActionOnly]
public ActionResult ConfigureTheme(string theme, int storeId)
{
if (theme.HasValue())
{
_themeContext.SetRequestTheme(theme);
}
if (storeId > 0)
{
_storeContext.SetRequestStore(storeId);
}
var model = TempData["OverriddenThemeVars"] ?? _themeVarService.GetThemeVariables(theme, storeId);
return View(model);
}
#endregion
}
}