Merge pull request #7 from mitchelsellers/RenameSkinToTheme
Change Skin -> Theme
This commit is contained in:
		@ -6,7 +6,7 @@
 | 
			
		||||
@using Oqtane.Client.Modules.Controls
 | 
			
		||||
@inherits ModuleBase
 | 
			
		||||
@inject IUriHelper UriHelper
 | 
			
		||||
@inject ISkinService SkinService
 | 
			
		||||
@inject IThemeService ThemeService
 | 
			
		||||
@inject IModuleService ModuleService
 | 
			
		||||
@inject IPageModuleService PageModuleService
 | 
			
		||||
 | 
			
		||||
@ -80,12 +80,12 @@
 | 
			
		||||
    protected override async Task OnInitAsync()
 | 
			
		||||
    {
 | 
			
		||||
        title = ModuleState.Title;
 | 
			
		||||
        List<Skin> Skins = await SkinService.GetSkinsAsync();
 | 
			
		||||
        foreach (Skin skin in Skins)
 | 
			
		||||
        List<Theme> Themes = await ThemeService.GetThemesAsync();
 | 
			
		||||
        foreach (Theme theme in Themes)
 | 
			
		||||
        {
 | 
			
		||||
            foreach (string container in skin.ContainerControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
 | 
			
		||||
            foreach (string container in theme.ContainerControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
 | 
			
		||||
            {
 | 
			
		||||
                containers.Add(container, skin.Name + " - " + @Utilities.GetTypeNameClass(container));
 | 
			
		||||
                containers.Add(container, theme.Name + " - " + @Utilities.GetTypeNameClass(container));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        containertype = ModuleState.ContainerType;
 | 
			
		||||
 | 
			
		||||
@ -7,7 +7,7 @@
 | 
			
		||||
@inherits ModuleBase
 | 
			
		||||
@inject IUriHelper UriHelper
 | 
			
		||||
@inject IPageService PageService
 | 
			
		||||
@inject ISkinService  SkinService
 | 
			
		||||
@inject IThemeService  ThemeService
 | 
			
		||||
 | 
			
		||||
<table class="form-group">
 | 
			
		||||
    <tr>
 | 
			
		||||
@ -61,14 +61,14 @@
 | 
			
		||||
    </tr>
 | 
			
		||||
    <tr>
 | 
			
		||||
        <td>
 | 
			
		||||
            <label for="Name" class="control-label">Skin: </label>
 | 
			
		||||
            <label for="Name" class="control-label">Theme: </label>
 | 
			
		||||
        </td>
 | 
			
		||||
        <td>
 | 
			
		||||
            <select class="form-control" bind="@skintype">
 | 
			
		||||
                <option value=""><Select Skin></option>
 | 
			
		||||
                @foreach (KeyValuePair<string, string> skin in skins)
 | 
			
		||||
            <select class="form-control" bind="@themetype">
 | 
			
		||||
                <option value=""><Select Theme></option>
 | 
			
		||||
                @foreach (KeyValuePair<string, string> item in themes)
 | 
			
		||||
                {
 | 
			
		||||
                    <option value="@skin.Key">@skin.Value</option>
 | 
			
		||||
                    <option value="@item.Key">@item.Value</option>
 | 
			
		||||
                }
 | 
			
		||||
            </select>
 | 
			
		||||
        </td>
 | 
			
		||||
@ -118,7 +118,7 @@
 | 
			
		||||
@functions {
 | 
			
		||||
    public override SecurityAccessLevelEnum SecurityAccessLevel { get { return SecurityAccessLevelEnum.Admin; } }
 | 
			
		||||
 | 
			
		||||
    Dictionary<string, string> skins = new Dictionary<string, string>();
 | 
			
		||||
    Dictionary<string, string> themes = new Dictionary<string, string>();
 | 
			
		||||
    Dictionary<string, string> panelayouts = new Dictionary<string, string>();
 | 
			
		||||
 | 
			
		||||
    string name;
 | 
			
		||||
@ -126,7 +126,7 @@
 | 
			
		||||
    string parentid;
 | 
			
		||||
    string order = "";
 | 
			
		||||
    string isnavigation = "True";
 | 
			
		||||
    string skintype;
 | 
			
		||||
    string themetype;
 | 
			
		||||
    string layouttype = "";
 | 
			
		||||
    string icon = "";
 | 
			
		||||
    string viewpermissions = "All Users";
 | 
			
		||||
@ -134,16 +134,16 @@
 | 
			
		||||
 | 
			
		||||
    protected override async Task OnInitAsync()
 | 
			
		||||
    {
 | 
			
		||||
        List<Skin> Skins = await SkinService.GetSkinsAsync();
 | 
			
		||||
        foreach (Skin skin in Skins)
 | 
			
		||||
        List<Theme> Themes = await ThemeService.GetThemesAsync();
 | 
			
		||||
        foreach (Theme theme in Themes)
 | 
			
		||||
        {
 | 
			
		||||
            foreach (string skincontrol in skin.SkinControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
 | 
			
		||||
            foreach (string themecontrol in theme.ThemeControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
 | 
			
		||||
            {
 | 
			
		||||
                skins.Add(skincontrol, skin.Name + " - " + @Utilities.GetTypeNameClass(skincontrol));
 | 
			
		||||
                themes.Add(themecontrol, theme.Name + " - " + @Utilities.GetTypeNameClass(themecontrol));
 | 
			
		||||
            }
 | 
			
		||||
            foreach (string panelayout in skin.PaneLayouts.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
 | 
			
		||||
            foreach (string panelayout in theme.PaneLayouts.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
 | 
			
		||||
            {
 | 
			
		||||
                panelayouts.Add(panelayout, skin.Name + " - " + @Utilities.GetTypeNameClass(panelayout));
 | 
			
		||||
                panelayouts.Add(panelayout, theme.Name + " - " + @Utilities.GetTypeNameClass(panelayout));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
@ -164,7 +164,7 @@
 | 
			
		||||
        p.Path = path;
 | 
			
		||||
        p.Order = (order == null ? 1 : Int32.Parse(order));
 | 
			
		||||
        p.IsNavigation = (isnavigation == null ? true : Boolean.Parse(isnavigation));
 | 
			
		||||
        p.SkinType = skintype;
 | 
			
		||||
        p.ThemeType = themetype;
 | 
			
		||||
        p.LayoutType = (layouttype == null ? "" : layouttype);
 | 
			
		||||
        p.Icon = (icon == null ? "" : icon);
 | 
			
		||||
        Type type;
 | 
			
		||||
@ -174,7 +174,7 @@
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
            type = Type.GetType(skintype);
 | 
			
		||||
            type = Type.GetType(themetype);
 | 
			
		||||
        }
 | 
			
		||||
        System.Reflection.PropertyInfo property = type.GetProperty("Panes");
 | 
			
		||||
        p.Panes = (string)property.GetValue(Activator.CreateInstance(type), null);
 | 
			
		||||
 | 
			
		||||
@ -7,7 +7,7 @@
 | 
			
		||||
@inherits ModuleBase
 | 
			
		||||
@inject IUriHelper UriHelper
 | 
			
		||||
@inject IPageService PageService
 | 
			
		||||
@inject ISkinService  SkinService
 | 
			
		||||
@inject IThemeService  ThemeService
 | 
			
		||||
 | 
			
		||||
<table class="form-group">
 | 
			
		||||
    <tr>
 | 
			
		||||
@ -61,14 +61,14 @@
 | 
			
		||||
    </tr>
 | 
			
		||||
    <tr>
 | 
			
		||||
        <td>
 | 
			
		||||
            <label for="Name" class="control-label">Skin: </label>
 | 
			
		||||
            <label for="Name" class="control-label">Theme: </label>
 | 
			
		||||
        </td>
 | 
			
		||||
        <td>
 | 
			
		||||
            <select class="form-control" bind="@skintype">
 | 
			
		||||
                <option value=""><Select Skin></option>
 | 
			
		||||
                @foreach (KeyValuePair<string, string> skin in skins)
 | 
			
		||||
            <select class="form-control" bind="@themetype">
 | 
			
		||||
                <option value=""><Select Theme></option>
 | 
			
		||||
                @foreach (KeyValuePair<string, string> item in themes)
 | 
			
		||||
                {
 | 
			
		||||
                    <option value="@skin.Key">@skin.Value</option>
 | 
			
		||||
                    <option value="@item.Key">@item.Value</option>
 | 
			
		||||
                }
 | 
			
		||||
            </select>
 | 
			
		||||
        </td>
 | 
			
		||||
@ -118,7 +118,7 @@
 | 
			
		||||
@functions {
 | 
			
		||||
    public override SecurityAccessLevelEnum SecurityAccessLevel { get { return SecurityAccessLevelEnum.Admin; } }
 | 
			
		||||
 | 
			
		||||
    Dictionary<string, string> skins = new Dictionary<string, string>();
 | 
			
		||||
    Dictionary<string, string> themes = new Dictionary<string, string>();
 | 
			
		||||
    Dictionary<string, string> panelayouts = new Dictionary<string, string>();
 | 
			
		||||
 | 
			
		||||
    int PageId;
 | 
			
		||||
@ -127,7 +127,7 @@
 | 
			
		||||
    string parentid;
 | 
			
		||||
    string order;
 | 
			
		||||
    string isnavigation;
 | 
			
		||||
    string skintype;
 | 
			
		||||
    string themetype;
 | 
			
		||||
    string layouttype;
 | 
			
		||||
    string icon;
 | 
			
		||||
    string viewpermissions;
 | 
			
		||||
@ -135,16 +135,16 @@
 | 
			
		||||
 | 
			
		||||
    protected override async Task OnInitAsync()
 | 
			
		||||
    {
 | 
			
		||||
        List<Skin> Skins = await SkinService.GetSkinsAsync();
 | 
			
		||||
        foreach (Skin skin in Skins)
 | 
			
		||||
        List<Theme> Themes = await ThemeService.GetThemesAsync();
 | 
			
		||||
        foreach (Theme theme in Themes)
 | 
			
		||||
        {
 | 
			
		||||
            foreach (string skincontrol in skin.SkinControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
 | 
			
		||||
            foreach (string themecontrol in theme.ThemeControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
 | 
			
		||||
            {
 | 
			
		||||
                skins.Add(skincontrol, skin.Name + " - " + @Utilities.GetTypeNameClass(skincontrol));
 | 
			
		||||
                themes.Add(themecontrol, theme.Name + " - " + @Utilities.GetTypeNameClass(themecontrol));
 | 
			
		||||
            }
 | 
			
		||||
            foreach (string panelayout in skin.PaneLayouts.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
 | 
			
		||||
            foreach (string panelayout in theme.PaneLayouts.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
 | 
			
		||||
            {
 | 
			
		||||
                panelayouts.Add(panelayout, skin.Name + " - " + @Utilities.GetTypeNameClass(panelayout));
 | 
			
		||||
                panelayouts.Add(panelayout, theme.Name + " - " + @Utilities.GetTypeNameClass(panelayout));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -157,7 +157,7 @@
 | 
			
		||||
 | 
			
		||||
            order = p.Order.ToString();
 | 
			
		||||
            isnavigation = p.IsNavigation.ToString();
 | 
			
		||||
            skintype = p.SkinType;
 | 
			
		||||
            themetype = p.ThemeType;
 | 
			
		||||
            layouttype = p.LayoutType;
 | 
			
		||||
            icon = p.Icon;
 | 
			
		||||
            viewpermissions = p.ViewPermissions;
 | 
			
		||||
 | 
			
		||||
@ -7,7 +7,7 @@
 | 
			
		||||
@inherits ModuleBase
 | 
			
		||||
@inject IUriHelper UriHelper
 | 
			
		||||
@inject IPageService PageService
 | 
			
		||||
@inject ISkinService  SkinService
 | 
			
		||||
@inject IThemeService  ThemeService
 | 
			
		||||
 | 
			
		||||
<table class="form-group">
 | 
			
		||||
    <tr>
 | 
			
		||||
@ -61,14 +61,14 @@
 | 
			
		||||
    </tr>
 | 
			
		||||
    <tr>
 | 
			
		||||
        <td>
 | 
			
		||||
            <label for="Name" class="control-label">Skin: </label>
 | 
			
		||||
            <label for="Name" class="control-label">Theme: </label>
 | 
			
		||||
        </td>
 | 
			
		||||
        <td>
 | 
			
		||||
            <select class="form-control" bind="@skintype">
 | 
			
		||||
                <option value=""><Select Skin></option>
 | 
			
		||||
                @foreach (KeyValuePair<string, string> skin in skins)
 | 
			
		||||
            <select class="form-control" bind="@themetype">
 | 
			
		||||
                <option value=""><Select Theme></option>
 | 
			
		||||
                @foreach (KeyValuePair<string, string> item in themes)
 | 
			
		||||
                {
 | 
			
		||||
                    <option value="@skin.Key">@skin.Value</option>
 | 
			
		||||
                    <option value="@item.Key">@item.Value</option>
 | 
			
		||||
                }
 | 
			
		||||
            </select>
 | 
			
		||||
        </td>
 | 
			
		||||
@ -118,7 +118,7 @@
 | 
			
		||||
@functions {
 | 
			
		||||
    public override SecurityAccessLevelEnum SecurityAccessLevel { get { return SecurityAccessLevelEnum.Admin; } }
 | 
			
		||||
 | 
			
		||||
    Dictionary<string, string> skins = new Dictionary<string, string>();
 | 
			
		||||
    Dictionary<string, string> themes = new Dictionary<string, string>();
 | 
			
		||||
    Dictionary<string, string> panelayouts = new Dictionary<string, string>();
 | 
			
		||||
 | 
			
		||||
    int PageId;
 | 
			
		||||
@ -127,7 +127,7 @@
 | 
			
		||||
    string parentid;
 | 
			
		||||
    string order;
 | 
			
		||||
    string isnavigation;
 | 
			
		||||
    string skintype;
 | 
			
		||||
    string themetype;
 | 
			
		||||
    string layouttype;
 | 
			
		||||
    string icon;
 | 
			
		||||
    string viewpermissions;
 | 
			
		||||
@ -135,16 +135,16 @@
 | 
			
		||||
 | 
			
		||||
    protected override async Task OnInitAsync()
 | 
			
		||||
    {
 | 
			
		||||
        List<Skin> Skins = await SkinService.GetSkinsAsync();
 | 
			
		||||
        foreach (Skin skin in Skins)
 | 
			
		||||
        List<Theme> Themes = await ThemeService.GetThemesAsync();
 | 
			
		||||
        foreach (Theme theme in Themes)
 | 
			
		||||
        {
 | 
			
		||||
            foreach (string skincontrol in skin.SkinControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
 | 
			
		||||
            foreach (string themeControl in theme.ThemeControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
 | 
			
		||||
            {
 | 
			
		||||
                skins.Add(skincontrol, skin.Name + " - " + @Utilities.GetTypeNameClass(skincontrol));
 | 
			
		||||
                themes.Add(themeControl, theme.Name + " - " + @Utilities.GetTypeNameClass(themeControl));
 | 
			
		||||
            }
 | 
			
		||||
            foreach (string panelayout in skin.PaneLayouts.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
 | 
			
		||||
            foreach (string panelayout in theme.PaneLayouts.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
 | 
			
		||||
            {
 | 
			
		||||
                panelayouts.Add(panelayout, skin.Name + " - " + @Utilities.GetTypeNameClass(panelayout));
 | 
			
		||||
                panelayouts.Add(panelayout, theme.Name + " - " + @Utilities.GetTypeNameClass(panelayout));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -164,7 +164,7 @@
 | 
			
		||||
            }
 | 
			
		||||
            order = p.Order.ToString();
 | 
			
		||||
            isnavigation = p.IsNavigation.ToString();
 | 
			
		||||
            skintype = p.SkinType;
 | 
			
		||||
            themetype = p.ThemeType;
 | 
			
		||||
            layouttype = p.LayoutType;
 | 
			
		||||
            icon = p.Icon;
 | 
			
		||||
            viewpermissions = p.ViewPermissions;
 | 
			
		||||
@ -188,7 +188,7 @@
 | 
			
		||||
        p.Path = path;
 | 
			
		||||
        p.Order = (order == null ? 1 : Int32.Parse(order));
 | 
			
		||||
        p.IsNavigation = (isnavigation == null ? true : Boolean.Parse(isnavigation));
 | 
			
		||||
        p.SkinType = skintype;
 | 
			
		||||
        p.ThemeType = themetype;
 | 
			
		||||
        p.LayoutType = (layouttype == null ? "" : layouttype);
 | 
			
		||||
        p.Icon = (icon == null ? "" : icon);
 | 
			
		||||
        Type type;
 | 
			
		||||
@ -198,7 +198,7 @@
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
            type = Type.GetType(skintype);
 | 
			
		||||
            type = Type.GetType(themetype);
 | 
			
		||||
        }
 | 
			
		||||
        System.Reflection.PropertyInfo property = type.GetProperty("Panes");
 | 
			
		||||
        p.Panes = (string)property.GetValue(Activator.CreateInstance(type), null);
 | 
			
		||||
 | 
			
		||||
@ -1,12 +1,11 @@
 | 
			
		||||
@using Oqtane.Services
 | 
			
		||||
@using Oqtane.Models
 | 
			
		||||
@using Oqtane.Modules
 | 
			
		||||
@using Oqtane.Client.Modules.Controls
 | 
			
		||||
@inherits ModuleBase
 | 
			
		||||
 | 
			
		||||
@inject ISkinService SkinService
 | 
			
		||||
@inject IThemeService ThemeService
 | 
			
		||||
 | 
			
		||||
@if (Skins == null)
 | 
			
		||||
@if (Themes == null)
 | 
			
		||||
{
 | 
			
		||||
    <p><em>Loading...</em></p>
 | 
			
		||||
}
 | 
			
		||||
@ -19,10 +18,10 @@ else
 | 
			
		||||
            </tr>
 | 
			
		||||
        </thead>
 | 
			
		||||
        <tbody>
 | 
			
		||||
            @foreach (var Skin in Skins)
 | 
			
		||||
            @foreach (var theme in Themes)
 | 
			
		||||
            {
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>@Skin.Name</td>
 | 
			
		||||
                    <td>@theme.Name</td>
 | 
			
		||||
                </tr>
 | 
			
		||||
            }
 | 
			
		||||
        </tbody>
 | 
			
		||||
@ -32,10 +31,10 @@ else
 | 
			
		||||
@functions {
 | 
			
		||||
    public override SecurityAccessLevelEnum SecurityAccessLevel { get { return SecurityAccessLevelEnum.Host; } }
 | 
			
		||||
 | 
			
		||||
    List<Skin> Skins;
 | 
			
		||||
    List<Theme> Themes;
 | 
			
		||||
 | 
			
		||||
    protected override async Task OnInitAsync()
 | 
			
		||||
    {
 | 
			
		||||
        Skins = await SkinService.GetSkinsAsync();
 | 
			
		||||
        Themes = await ThemeService.GetThemesAsync();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -4,8 +4,8 @@ using System.Threading.Tasks;
 | 
			
		||||
 | 
			
		||||
namespace Oqtane.Services
 | 
			
		||||
{
 | 
			
		||||
    public interface ISkinService
 | 
			
		||||
    public interface IThemeService
 | 
			
		||||
    {
 | 
			
		||||
        Task<List<Skin>> GetSkinsAsync();
 | 
			
		||||
        Task<List<Theme>> GetThemesAsync();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -9,33 +9,33 @@ using System;
 | 
			
		||||
 | 
			
		||||
namespace Oqtane.Services
 | 
			
		||||
{
 | 
			
		||||
    public class SkinService : ServiceBase, ISkinService
 | 
			
		||||
    public class ThemeService : ServiceBase, IThemeService
 | 
			
		||||
    {
 | 
			
		||||
        private readonly HttpClient http;
 | 
			
		||||
        private readonly string apiurl;
 | 
			
		||||
 | 
			
		||||
        private List<Skin> skins;
 | 
			
		||||
        private List<Theme> themes;
 | 
			
		||||
 | 
			
		||||
        public SkinService(HttpClient http, IUriHelper urihelper)
 | 
			
		||||
        public ThemeService(HttpClient http, IUriHelper urihelper)
 | 
			
		||||
        {
 | 
			
		||||
            this.http = http;
 | 
			
		||||
            apiurl = CreateApiUrl(urihelper.GetAbsoluteUri(), "Skin");
 | 
			
		||||
            apiurl = CreateApiUrl(urihelper.GetAbsoluteUri(), "Theme");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public async Task<List<Skin>> GetSkinsAsync()
 | 
			
		||||
        public async Task<List<Theme>> GetThemesAsync()
 | 
			
		||||
        {
 | 
			
		||||
            if (skins == null)
 | 
			
		||||
            if (themes == null)
 | 
			
		||||
            {
 | 
			
		||||
                skins = await http.GetJsonAsync<List<Skin>>(apiurl);
 | 
			
		||||
                themes = await http.GetJsonAsync<List<Theme>>(apiurl);
 | 
			
		||||
 | 
			
		||||
                // get list of loaded assemblies
 | 
			
		||||
                Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
 | 
			
		||||
 | 
			
		||||
                foreach (Skin skin in skins)
 | 
			
		||||
                foreach (Theme theme in themes)
 | 
			
		||||
                {
 | 
			
		||||
                    if (skin.Dependencies != "")
 | 
			
		||||
                    if (theme.Dependencies != "")
 | 
			
		||||
                    {
 | 
			
		||||
                        foreach (string dependency in skin.Dependencies.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
 | 
			
		||||
                        foreach (string dependency in theme.Dependencies.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
 | 
			
		||||
                        {
 | 
			
		||||
                            string assemblyname = dependency.Replace(".dll", "");
 | 
			
		||||
                            if (assemblies.Where(item => item.FullName.StartsWith(assemblyname + ",")).FirstOrDefault() == null)
 | 
			
		||||
@ -46,15 +46,15 @@ namespace Oqtane.Services
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                    if (assemblies.Where(item => item.FullName.StartsWith(skin.AssemblyName + ",")).FirstOrDefault() == null)
 | 
			
		||||
                    if (assemblies.Where(item => item.FullName.StartsWith(theme.AssemblyName + ",")).FirstOrDefault() == null)
 | 
			
		||||
                    {
 | 
			
		||||
                        // download assembly from server and load
 | 
			
		||||
                        var bytes = await http.GetByteArrayAsync("_framework/_bin/" + skin.AssemblyName + ".dll");
 | 
			
		||||
                        var bytes = await http.GetByteArrayAsync("_framework/_bin/" + theme.AssemblyName + ".dll");
 | 
			
		||||
                        Assembly.Load(bytes);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            return skins.OrderBy(item => item.Name).ToList();
 | 
			
		||||
            return themes.OrderBy(item => item.Name).ToList();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -2,9 +2,9 @@
 | 
			
		||||
{
 | 
			
		||||
    public class Constants
 | 
			
		||||
    {
 | 
			
		||||
        public const string DefaultPage = "Oqtane.Client.Shared.Skin, Oqtane.Client";
 | 
			
		||||
        public const string DefaultPage = "Oqtane.Client.Shared.Theme, Oqtane.Client";
 | 
			
		||||
        public const string DefaultContainer = "Oqtane.Client.Shared.Container, Oqtane.Client";
 | 
			
		||||
        public const string DefaultAdminContainer = "Oqtane.Client.Skins.AdminContainer, Oqtane.Client";
 | 
			
		||||
        public const string DefaultAdminContainer = "Oqtane.Client.Themes.AdminContainer, Oqtane.Client";
 | 
			
		||||
        public const string DefaultSettingsControl = "Oqtane.Client.Modules.Admin.ModuleSettings.Index, Oqtane.Client";
 | 
			
		||||
        public const string PageManagementModule = "Oqtane.Client.Modules.Admin.Pages, Oqtane.Client";
 | 
			
		||||
        public const string DefaultControl = "Index";
 | 
			
		||||
 | 
			
		||||
@ -13,7 +13,7 @@
 | 
			
		||||
@inject IUserService UserService
 | 
			
		||||
@inject IModuleService ModuleService
 | 
			
		||||
@inject IModuleDefinitionService ModuleDefinitionService
 | 
			
		||||
@inject ISkinService SkinService
 | 
			
		||||
@inject IThemeService ThemeService
 | 
			
		||||
 | 
			
		||||
@DynamicComponent
 | 
			
		||||
 | 
			
		||||
@ -64,7 +64,7 @@
 | 
			
		||||
    private async Task Refresh()
 | 
			
		||||
    {
 | 
			
		||||
        List<ModuleDefinition> moduledefinitions = await ModuleDefinitionService.GetModuleDefinitionsAsync();
 | 
			
		||||
        List<Models.Skin> skins = await SkinService.GetSkinsAsync();
 | 
			
		||||
        List<Models.Theme> themes = await ThemeService.GetThemesAsync();
 | 
			
		||||
 | 
			
		||||
        bool reload = false;
 | 
			
		||||
        if (PageState == null)
 | 
			
		||||
 | 
			
		||||
@ -11,16 +11,16 @@
 | 
			
		||||
    {
 | 
			
		||||
        DynamicComponent = builder =>
 | 
			
		||||
        {
 | 
			
		||||
            Type skinType = Type.GetType(PageState.Page.SkinType);
 | 
			
		||||
            if (skinType != null)
 | 
			
		||||
            Type themeType = Type.GetType(PageState.Page.ThemeType);
 | 
			
		||||
            if (themeType != null)
 | 
			
		||||
            {
 | 
			
		||||
                builder.OpenComponent(0, skinType);
 | 
			
		||||
                builder.OpenComponent(0, themeType);
 | 
			
		||||
                builder.CloseComponent();
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
            // skin does not exist with type specified
 | 
			
		||||
        }
 | 
			
		||||
                // theme does not exist with type specified
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -1,8 +0,0 @@
 | 
			
		||||
namespace Oqtane.Skins
 | 
			
		||||
{
 | 
			
		||||
    public interface ISkinControl
 | 
			
		||||
    {
 | 
			
		||||
        string Name { get; }
 | 
			
		||||
        string Panes { get; } // if a skin has different panes, delimit them with ";"
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -30,7 +30,7 @@ namespace Oqtane.Client
 | 
			
		||||
        {
 | 
			
		||||
            // register singleton core services
 | 
			
		||||
            services.AddSingleton<IModuleDefinitionService, ModuleDefinitionService>();
 | 
			
		||||
            services.AddSingleton<ISkinService, SkinService>();
 | 
			
		||||
            services.AddSingleton<IThemeService, ThemeService>();
 | 
			
		||||
 | 
			
		||||
            // register scoped core services
 | 
			
		||||
            services.AddScoped<ITenantService, TenantService>();
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
@using Oqtane.Shared
 | 
			
		||||
@using Oqtane.Skins
 | 
			
		||||
@using Oqtane.Client.Skins.Controls
 | 
			
		||||
@using Oqtane.Themes
 | 
			
		||||
@using Oqtane.Client.Themes.Controls
 | 
			
		||||
@using Oqtane.Client.Shared
 | 
			
		||||
@inherits ContainerBase
 | 
			
		||||
<div id="modal" class="modal" style="display: block">
 | 
			
		||||
@ -2,7 +2,7 @@
 | 
			
		||||
using Oqtane.Shared;
 | 
			
		||||
using Oqtane.Models;
 | 
			
		||||
 | 
			
		||||
namespace Oqtane.Skins
 | 
			
		||||
namespace Oqtane.Themes
 | 
			
		||||
{
 | 
			
		||||
    public class ContainerBase : ComponentBase, IContainerControl
 | 
			
		||||
    {
 | 
			
		||||
@ -1,13 +1,13 @@
 | 
			
		||||
@using Microsoft.AspNetCore.Components.Routing
 | 
			
		||||
@using Oqtane.Services
 | 
			
		||||
@using Oqtane.Models
 | 
			
		||||
@using Oqtane.Skins
 | 
			
		||||
@using Oqtane.Themes
 | 
			
		||||
@using Oqtane.Shared
 | 
			
		||||
@inherits SkinObjectBase
 | 
			
		||||
@inherits ThemeObjectBase
 | 
			
		||||
@inject IUriHelper UriHelper
 | 
			
		||||
@inject IUserService UserService
 | 
			
		||||
@inject IModuleDefinitionService ModuleDefinitionService
 | 
			
		||||
@inject ISkinService SkinService
 | 
			
		||||
@inject IThemeService ThemeService
 | 
			
		||||
@inject IModuleService ModuleService
 | 
			
		||||
@inject IPageModuleService PageModuleService
 | 
			
		||||
 | 
			
		||||
@ -82,13 +82,14 @@
 | 
			
		||||
 | 
			
		||||
    protected override async Task OnInitAsync()
 | 
			
		||||
    {
 | 
			
		||||
        //TODO: Move this to shared component.  This is used in this control Add, Edit, and Delete controls as well
 | 
			
		||||
        moduledefinitions = await ModuleDefinitionService.GetModuleDefinitionsAsync();
 | 
			
		||||
        List<Skin> skins = await SkinService.GetSkinsAsync();
 | 
			
		||||
        foreach (Skin skin in skins)
 | 
			
		||||
        List<Theme> themes = await ThemeService.GetThemesAsync();
 | 
			
		||||
        foreach (Theme theme in themes)
 | 
			
		||||
        {
 | 
			
		||||
            foreach (string container in skin.ContainerControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
 | 
			
		||||
            foreach (string container in theme.ContainerControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
 | 
			
		||||
            {
 | 
			
		||||
                containers.Add(container, skin.Name + " - " + @Utilities.GetTypeNameClass(container));
 | 
			
		||||
                containers.Add(container, theme.Name + " - " + @Utilities.GetTypeNameClass(container));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        List<Module> modules = await ModuleService.GetModulesAsync(PageState.Site.SiteId, Constants.PageManagementModule);
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
@using Oqtane.Skins
 | 
			
		||||
@using Oqtane.Themes
 | 
			
		||||
@using Oqtane.Shared
 | 
			
		||||
@using Microsoft.JSInterop
 | 
			
		||||
@inherits SkinObjectBase
 | 
			
		||||
@inherits ThemeObjectBase
 | 
			
		||||
@inject IUriHelper UriHelper
 | 
			
		||||
@inject IJSRuntime jsRuntime
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
@using Oqtane.Skins
 | 
			
		||||
@inherits SkinObjectBase
 | 
			
		||||
@using Oqtane.Themes
 | 
			
		||||
@inherits ThemeObjectBase
 | 
			
		||||
 | 
			
		||||
<a href="@PageState.Uri.Scheme://@PageState.Uri.Authority"><img src="/Sites/@PageState.Site.SiteId/@PageState.Site.Logo" /></a>
 | 
			
		||||
 | 
			
		||||
@ -1,8 +1,8 @@
 | 
			
		||||
@using Microsoft.AspNetCore.Components.Routing
 | 
			
		||||
@using Oqtane.Skins
 | 
			
		||||
@using Oqtane.Themes
 | 
			
		||||
@using Oqtane.Services
 | 
			
		||||
@using Oqtane.Models;
 | 
			
		||||
@inherits SkinObjectBase
 | 
			
		||||
@inherits ThemeObjectBase
 | 
			
		||||
@inject IPageService PageService
 | 
			
		||||
@inject IUserService UserService
 | 
			
		||||
 | 
			
		||||
@ -1,9 +1,9 @@
 | 
			
		||||
@using Oqtane.Skins
 | 
			
		||||
@using Oqtane.Themes
 | 
			
		||||
@using Oqtane.Shared;
 | 
			
		||||
@using Microsoft.JSInterop
 | 
			
		||||
@inject IJSRuntime jsRuntime
 | 
			
		||||
 | 
			
		||||
@inherits SkinObjectBase
 | 
			
		||||
@inherits ThemeObjectBase
 | 
			
		||||
 | 
			
		||||
<button type="button" class="btn btn-primary" onclick="@SetMode">
 | 
			
		||||
    @displayMode
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
@using Oqtane.Skins
 | 
			
		||||
@using Oqtane.Themes
 | 
			
		||||
@using Oqtane.Services
 | 
			
		||||
@using Oqtane.Models
 | 
			
		||||
@inherits ContainerBase
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
@using Oqtane.Skins
 | 
			
		||||
@using Oqtane.Themes
 | 
			
		||||
@inherits ContainerBase
 | 
			
		||||
 | 
			
		||||
@ModuleState.Title
 | 
			
		||||
@ -1,11 +1,11 @@
 | 
			
		||||
@using Microsoft.AspNetCore.Components.Routing
 | 
			
		||||
@using Oqtane.Skins
 | 
			
		||||
@using Oqtane.Themes
 | 
			
		||||
@using Oqtane.Shared
 | 
			
		||||
@using Oqtane.Services;
 | 
			
		||||
@using Oqtane.Models;
 | 
			
		||||
@using Microsoft.JSInterop
 | 
			
		||||
@inject IJSRuntime jsRuntime
 | 
			
		||||
@inherits SkinObjectBase
 | 
			
		||||
@inherits ThemeObjectBase
 | 
			
		||||
 | 
			
		||||
<NavLink class="btn btn-primary" href="@url">@name</NavLink>
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
@using Oqtane.Skins
 | 
			
		||||
@using Oqtane.Client.Skins.Controls
 | 
			
		||||
@using Oqtane.Themes
 | 
			
		||||
@using Oqtane.Client.Themes.Controls
 | 
			
		||||
@using Oqtane.Client.Shared
 | 
			
		||||
@inherits ContainerBase
 | 
			
		||||
<div class="container">
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
namespace Oqtane.Skins
 | 
			
		||||
namespace Oqtane.Themes
 | 
			
		||||
{
 | 
			
		||||
    public interface IContainerControl
 | 
			
		||||
    {
 | 
			
		||||
@ -1,8 +1,8 @@
 | 
			
		||||
using System;
 | 
			
		||||
 | 
			
		||||
namespace Oqtane.Skins
 | 
			
		||||
namespace Oqtane.Themes
 | 
			
		||||
{
 | 
			
		||||
    public interface ISkin
 | 
			
		||||
    public interface ITheme
 | 
			
		||||
    {
 | 
			
		||||
        string Name { get; }
 | 
			
		||||
        string Version { get; }
 | 
			
		||||
							
								
								
									
										8
									
								
								Oqtane.Client/Themes/IThemeControl.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								Oqtane.Client/Themes/IThemeControl.cs
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,8 @@
 | 
			
		||||
namespace Oqtane.Themes
 | 
			
		||||
{
 | 
			
		||||
    public interface IThemeControl
 | 
			
		||||
    {
 | 
			
		||||
        string Name { get; }
 | 
			
		||||
        string Panes { get; } // if a theme has different panes, delimit them with ";"
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
@using Oqtane.Skins
 | 
			
		||||
@using Oqtane.Client.Skins.Controls
 | 
			
		||||
@using Oqtane.Themes
 | 
			
		||||
@using Oqtane.Client.Themes.Controls
 | 
			
		||||
@using Oqtane.Client.Shared
 | 
			
		||||
@inherits ContainerBase
 | 
			
		||||
<div class="container">
 | 
			
		||||
@ -1,8 +1,8 @@
 | 
			
		||||
namespace Oqtane.Skins.Skin2
 | 
			
		||||
namespace Oqtane.Themes.Theme1
 | 
			
		||||
{
 | 
			
		||||
    public class Skin : ISkin
 | 
			
		||||
    public class Theme : ITheme
 | 
			
		||||
    {
 | 
			
		||||
        public string Name { get { return "Skin2"; } }
 | 
			
		||||
        public string Name { get { return "Theme1"; } }
 | 
			
		||||
        public string Version { get { return "1.0.0"; } }
 | 
			
		||||
        public string Owner { get { return ""; } }
 | 
			
		||||
        public string Url { get { return ""; } }
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
@using Oqtane.Skins
 | 
			
		||||
@using Oqtane.Client.Skins.Controls
 | 
			
		||||
@using Oqtane.Themes
 | 
			
		||||
@using Oqtane.Client.Themes.Controls
 | 
			
		||||
@using Oqtane.Client.Shared
 | 
			
		||||
@inherits SkinBase
 | 
			
		||||
@inherits ThemeBase
 | 
			
		||||
 | 
			
		||||
<div class="sidebar">
 | 
			
		||||
    <div align="center"><Logo /></div>
 | 
			
		||||
@ -10,7 +10,7 @@
 | 
			
		||||
 | 
			
		||||
<div class="main">
 | 
			
		||||
    <div class="top-row px-4">
 | 
			
		||||
        <h1>@PageState.Page.Name - Skin1</h1> <div class="ml-md-auto"><Profile /> <Login /> <ControlPanel /></div>
 | 
			
		||||
        <h1>@PageState.Page.Name - Theme #1</h1> <div class="ml-md-auto"><Profile /> <Login /> <ControlPanel /></div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="container">
 | 
			
		||||
        <div class="row px-4">
 | 
			
		||||
@ -28,6 +28,6 @@
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
@functions {
 | 
			
		||||
    public override string Name { get { return "Skin1"; } }
 | 
			
		||||
    public override string Name { get { return "Theme1"; } }
 | 
			
		||||
    public override string Panes { get { return "Left;Right"; } }
 | 
			
		||||
}
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
@using Oqtane.Skins
 | 
			
		||||
@using Oqtane.Client.Skins.Controls
 | 
			
		||||
@using Oqtane.Themes
 | 
			
		||||
@using Oqtane.Client.Themes.Controls
 | 
			
		||||
@using Oqtane.Client.Shared
 | 
			
		||||
@inherits ContainerBase
 | 
			
		||||
<div class="container">
 | 
			
		||||
@ -1,8 +1,8 @@
 | 
			
		||||
namespace Oqtane.Skins.Skin3
 | 
			
		||||
namespace Oqtane.Themes.Theme2
 | 
			
		||||
{
 | 
			
		||||
    public class Skin : ISkin
 | 
			
		||||
    public class Theme : ITheme
 | 
			
		||||
    {
 | 
			
		||||
        public string Name { get { return "Skin3"; } }
 | 
			
		||||
        public string Name { get { return "Theme2"; } }
 | 
			
		||||
        public string Version { get { return "1.0.0"; } }
 | 
			
		||||
        public string Owner { get { return ""; } }
 | 
			
		||||
        public string Url { get { return ""; } }
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
@using Oqtane.Skins
 | 
			
		||||
@using Oqtane.Client.Skins.Controls
 | 
			
		||||
@using Oqtane.Themes
 | 
			
		||||
@using Oqtane.Client.Themes.Controls
 | 
			
		||||
@using Oqtane.Client.Shared
 | 
			
		||||
@inherits SkinBase
 | 
			
		||||
@inherits ThemeBase
 | 
			
		||||
 | 
			
		||||
<div class="sidebar">
 | 
			
		||||
    <div align="center"><Logo /></div>
 | 
			
		||||
@ -10,7 +10,7 @@
 | 
			
		||||
 | 
			
		||||
<div class="main">
 | 
			
		||||
    <div class="top-row px-4">
 | 
			
		||||
        <h1>@PageState.Page.Name - Skin2</h1> <div class="ml-md-auto"><Profile /> <Login /> <ControlPanel /></div>
 | 
			
		||||
        <h1>@PageState.Page.Name - Theme #2</h1> <div class="ml-md-auto"><Profile /> <Login /> <ControlPanel /></div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="container">
 | 
			
		||||
        <div class="row px-4">
 | 
			
		||||
@ -26,6 +26,6 @@
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
@functions {
 | 
			
		||||
    public override string Name { get { return "Skin2"; } }
 | 
			
		||||
    public override string Name { get { return "Theme2"; } }
 | 
			
		||||
    public override string Panes { get { return "Top;Bottom"; } }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
@using Oqtane.Skins
 | 
			
		||||
@using Oqtane.Themes
 | 
			
		||||
@using Oqtane.Client.Shared
 | 
			
		||||
@inherits SkinBase
 | 
			
		||||
@inherits ThemeBase
 | 
			
		||||
 | 
			
		||||
<div class="row px-4">
 | 
			
		||||
    <div class="col-sm">
 | 
			
		||||
@ -1,8 +1,8 @@
 | 
			
		||||
namespace Oqtane.Skins.Skin1
 | 
			
		||||
namespace Oqtane.Themes.Theme3
 | 
			
		||||
{
 | 
			
		||||
    public class Skin : ISkin
 | 
			
		||||
    public class Theme : ITheme
 | 
			
		||||
    {
 | 
			
		||||
        public string Name { get { return "Skin1"; } }
 | 
			
		||||
        public string Name { get { return "Theme3"; } }
 | 
			
		||||
        public string Version { get { return "1.0.0"; } }
 | 
			
		||||
        public string Owner { get { return ""; } }
 | 
			
		||||
        public string Url { get { return ""; } }
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
@using Oqtane.Skins
 | 
			
		||||
@using Oqtane.Client.Skins.Controls
 | 
			
		||||
@using Oqtane.Themes
 | 
			
		||||
@using Oqtane.Client.Themes.Controls
 | 
			
		||||
@using Oqtane.Client.Shared
 | 
			
		||||
@inherits SkinBase
 | 
			
		||||
@inherits ThemeBase
 | 
			
		||||
 | 
			
		||||
<div class="sidebar">
 | 
			
		||||
    <div align="center"><Logo /></div>
 | 
			
		||||
@ -10,7 +10,7 @@
 | 
			
		||||
 | 
			
		||||
<div class="main">
 | 
			
		||||
    <div class="top-row px-4">
 | 
			
		||||
        <h1>@PageState.Page.Name - Skin3</h1> <div class="ml-md-auto"><Profile /> <Login /> <ControlPanel /></div>
 | 
			
		||||
        <h1>@PageState.Page.Name - Theme #3</h1> <div class="ml-md-auto"><Profile /> <Login /> <ControlPanel /></div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="container">
 | 
			
		||||
        <PaneLayout />
 | 
			
		||||
@ -21,6 +21,6 @@
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
@functions {
 | 
			
		||||
    public override string Name { get { return "Skin3"; } }
 | 
			
		||||
    public override string Name { get { return "Theme3"; } }
 | 
			
		||||
    public override string Panes { get { return ""; } }
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
@using Oqtane.Skins
 | 
			
		||||
@using Oqtane.Themes
 | 
			
		||||
@using Oqtane.Client.Shared
 | 
			
		||||
@inherits SkinBase
 | 
			
		||||
@inherits ThemeBase
 | 
			
		||||
 | 
			
		||||
<div class="row px-4">
 | 
			
		||||
    <Pane Name="Top" />
 | 
			
		||||
@ -1,9 +1,9 @@
 | 
			
		||||
using Microsoft.AspNetCore.Components;
 | 
			
		||||
using Oqtane.Shared;
 | 
			
		||||
 | 
			
		||||
namespace Oqtane.Skins
 | 
			
		||||
namespace Oqtane.Themes
 | 
			
		||||
{
 | 
			
		||||
    public class SkinBase : ComponentBase, ISkinControl
 | 
			
		||||
    public class ThemeBase : ComponentBase, IThemeControl
 | 
			
		||||
    {
 | 
			
		||||
        [CascadingParameter]
 | 
			
		||||
        protected PageState PageState { get; set; }
 | 
			
		||||
@ -1,9 +1,9 @@
 | 
			
		||||
using Microsoft.AspNetCore.Components;
 | 
			
		||||
using Oqtane.Shared;
 | 
			
		||||
 | 
			
		||||
namespace Oqtane.Skins
 | 
			
		||||
namespace Oqtane.Themes
 | 
			
		||||
{
 | 
			
		||||
    public class SkinObjectBase : ComponentBase
 | 
			
		||||
    public class ThemeObjectBase : ComponentBase
 | 
			
		||||
    {
 | 
			
		||||
        [CascadingParameter]
 | 
			
		||||
        protected PageState PageState { get; set; }
 | 
			
		||||
@ -6,20 +6,20 @@ using Oqtane.Models;
 | 
			
		||||
namespace Oqtane.Controllers
 | 
			
		||||
{
 | 
			
		||||
    [Route("{site}/api/[controller]")]
 | 
			
		||||
    public class SkinController : Controller
 | 
			
		||||
    public class ThemeController : Controller
 | 
			
		||||
    {
 | 
			
		||||
        private readonly ISkinRepository skins;
 | 
			
		||||
        private readonly IThemeRepository themes;
 | 
			
		||||
 | 
			
		||||
        public SkinController(ISkinRepository Skins)
 | 
			
		||||
        public ThemeController(IThemeRepository Themes)
 | 
			
		||||
        {
 | 
			
		||||
            skins = Skins;
 | 
			
		||||
            themes = Themes;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // GET: api/<controller>
 | 
			
		||||
        [HttpGet]
 | 
			
		||||
        public IEnumerable<Skin> Get()
 | 
			
		||||
        public IEnumerable<Theme> Get()
 | 
			
		||||
        {
 | 
			
		||||
            return skins.GetSkins();
 | 
			
		||||
            return themes.GetThemes();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -3,8 +3,8 @@ using Oqtane.Models;
 | 
			
		||||
 | 
			
		||||
namespace Oqtane.Repository
 | 
			
		||||
{
 | 
			
		||||
    public interface ISkinRepository
 | 
			
		||||
    public interface IThemeRepository
 | 
			
		||||
    {
 | 
			
		||||
        IEnumerable<Skin> GetSkins();
 | 
			
		||||
        IEnumerable<Theme> GetThemes();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -1,123 +0,0 @@
 | 
			
		||||
using Microsoft.EntityFrameworkCore;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using Oqtane.Models;
 | 
			
		||||
using System.Reflection;
 | 
			
		||||
using System;
 | 
			
		||||
using Oqtane.Skins;
 | 
			
		||||
 | 
			
		||||
namespace Oqtane.Repository
 | 
			
		||||
{
 | 
			
		||||
    public class SkinRepository : ISkinRepository
 | 
			
		||||
    {
 | 
			
		||||
        private readonly List<Skin> skins;
 | 
			
		||||
 | 
			
		||||
        public SkinRepository()
 | 
			
		||||
        {
 | 
			
		||||
            skins = LoadSkins();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private List<Skin> LoadSkins()
 | 
			
		||||
        {
 | 
			
		||||
            List<Skin> skins = new List<Skin>();
 | 
			
		||||
 | 
			
		||||
            // iterate through Oqtane skin assemblies
 | 
			
		||||
            foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
 | 
			
		||||
            {
 | 
			
		||||
                if (assembly.FullName.StartsWith("Oqtane.Client") || assembly.FullName.StartsWith("Oqtane.Skin."))
 | 
			
		||||
                {
 | 
			
		||||
                    skins = LoadSkinsFromAssembly(skins, assembly);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return skins;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private List<Skin> LoadSkinsFromAssembly(List<Skin> skins, Assembly assembly)
 | 
			
		||||
        {
 | 
			
		||||
            Skin skin;
 | 
			
		||||
            Type[] skincontroltypes = assembly.GetTypes().Where(item => item.GetInterfaces().Contains(typeof(ISkinControl))).ToArray();
 | 
			
		||||
            foreach (Type skincontroltype in skincontroltypes)
 | 
			
		||||
            {
 | 
			
		||||
                if (skincontroltype.Name != "SkinBase")
 | 
			
		||||
                {
 | 
			
		||||
                    string[] typename = skincontroltype.AssemblyQualifiedName.Split(',').Select(item => item.Trim()).ToList().ToArray();
 | 
			
		||||
                    string[] segments = typename[0].Split('.');
 | 
			
		||||
                    Array.Resize(ref segments, segments.Length - 1);
 | 
			
		||||
                    string Namespace = string.Join(".", segments);
 | 
			
		||||
 | 
			
		||||
                    int index = skins.FindIndex(item => item.SkinName == Namespace);
 | 
			
		||||
                    if (index == -1)
 | 
			
		||||
                    {
 | 
			
		||||
                        /// determine if this skin implements ISkin
 | 
			
		||||
                        Type skintype = assembly.GetTypes()
 | 
			
		||||
                            .Where(item => item.Namespace.StartsWith(Namespace))
 | 
			
		||||
                            .Where(item => item.GetInterfaces().Contains(typeof(ISkin))).FirstOrDefault();
 | 
			
		||||
                        if (skintype != null)
 | 
			
		||||
                        {
 | 
			
		||||
                            var skinobject = Activator.CreateInstance(skintype);
 | 
			
		||||
                            skin = new Skin
 | 
			
		||||
                            {
 | 
			
		||||
                                SkinName = Namespace,
 | 
			
		||||
                                Name = (string)skintype.GetProperty("Name").GetValue(skinobject),
 | 
			
		||||
                                Version = (string)skintype.GetProperty("Version").GetValue(skinobject),
 | 
			
		||||
                                Owner = (string)skintype.GetProperty("Owner").GetValue(skinobject),
 | 
			
		||||
                                Url = (string)skintype.GetProperty("Url").GetValue(skinobject),
 | 
			
		||||
                                Contact = (string)skintype.GetProperty("Contact").GetValue(skinobject),
 | 
			
		||||
                                License = (string)skintype.GetProperty("License").GetValue(skinobject),
 | 
			
		||||
                                Dependencies = (string)skintype.GetProperty("Dependencies").GetValue(skinobject),
 | 
			
		||||
                                SkinControls = "",
 | 
			
		||||
                                PaneLayouts = "",
 | 
			
		||||
                                ContainerControls = "",
 | 
			
		||||
                                AssemblyName = assembly.FullName.Split(",")[0]
 | 
			
		||||
                            };
 | 
			
		||||
                        }
 | 
			
		||||
                        else
 | 
			
		||||
                        {
 | 
			
		||||
                            skin = new Skin
 | 
			
		||||
                            {
 | 
			
		||||
                                SkinName = Namespace,
 | 
			
		||||
                                Name = skincontroltype.Name,
 | 
			
		||||
                                Version = new Version(1, 0, 0).ToString(),
 | 
			
		||||
                                Owner = "",
 | 
			
		||||
                                Url = "",
 | 
			
		||||
                                Contact = "",
 | 
			
		||||
                                License = "",
 | 
			
		||||
                                Dependencies = "",
 | 
			
		||||
                                SkinControls = "",
 | 
			
		||||
                                PaneLayouts = "",
 | 
			
		||||
                                ContainerControls = "",
 | 
			
		||||
                                AssemblyName = assembly.FullName.Split(",")[0]
 | 
			
		||||
                            };
 | 
			
		||||
                        }
 | 
			
		||||
                        skins.Add(skin);
 | 
			
		||||
                        index = skins.FindIndex(item => item.SkinName == Namespace);
 | 
			
		||||
                    }
 | 
			
		||||
                    skin = skins[index];
 | 
			
		||||
                    // layouts and skins
 | 
			
		||||
                    if (skincontroltype.FullName.EndsWith("Layout"))
 | 
			
		||||
                    {
 | 
			
		||||
                        skin.PaneLayouts += (skincontroltype.FullName + ", " + typename[1] + ";");
 | 
			
		||||
                    }
 | 
			
		||||
                    else
 | 
			
		||||
                    {
 | 
			
		||||
                        skin.SkinControls += (skincontroltype.FullName + ", " + typename[1] + ";");
 | 
			
		||||
                    }
 | 
			
		||||
                    // containers
 | 
			
		||||
                    Type[] containertypes = assembly.GetTypes().Where(item => item.Namespace.StartsWith(Namespace)).Where(item => item.GetInterfaces().Contains(typeof(IContainerControl))).ToArray();
 | 
			
		||||
                    foreach (Type containertype in containertypes)
 | 
			
		||||
                    {
 | 
			
		||||
                        skin.ContainerControls += (containertype.FullName + ", " + typename[1] + ";");
 | 
			
		||||
                    }
 | 
			
		||||
                    skins[index] = skin;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            return skins;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public IEnumerable<Skin> GetSkins()
 | 
			
		||||
        {
 | 
			
		||||
            return skins;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										124
									
								
								Oqtane.Server/Repository/ThemeRepository.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										124
									
								
								Oqtane.Server/Repository/ThemeRepository.cs
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,124 @@
 | 
			
		||||
using Microsoft.EntityFrameworkCore;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using Oqtane.Models;
 | 
			
		||||
using System.Reflection;
 | 
			
		||||
using System;
 | 
			
		||||
using Oqtane.Themes;
 | 
			
		||||
 | 
			
		||||
namespace Oqtane.Repository
 | 
			
		||||
{
 | 
			
		||||
    public class ThemeRepository : IThemeRepository
 | 
			
		||||
    {
 | 
			
		||||
        private readonly List<Theme> themes;
 | 
			
		||||
 | 
			
		||||
        public ThemeRepository()
 | 
			
		||||
        {
 | 
			
		||||
            themes = LoadThemes();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private List<Theme> LoadThemes()
 | 
			
		||||
        {
 | 
			
		||||
            List<Theme> themes = new List<Theme>();
 | 
			
		||||
 | 
			
		||||
            // iterate through Oqtane theme assemblies
 | 
			
		||||
            // TODO: Remove restriction on assembly
 | 
			
		||||
            foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
 | 
			
		||||
            {
 | 
			
		||||
                if (assembly.FullName.StartsWith("Oqtane.Client") || assembly.FullName.StartsWith("Oqtane.Theme."))
 | 
			
		||||
                {
 | 
			
		||||
                    themes = LoadThemesFromAssembly(themes, assembly);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return themes;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private List<Theme> LoadThemesFromAssembly(List<Theme> themes, Assembly assembly)
 | 
			
		||||
        {
 | 
			
		||||
            Theme theme;
 | 
			
		||||
            Type[] themeControlTypes = assembly.GetTypes().Where(item => item.GetInterfaces().Contains(typeof(IThemeControl))).ToArray();
 | 
			
		||||
            foreach (Type themeControlType in themeControlTypes)
 | 
			
		||||
            {
 | 
			
		||||
                if (themeControlType.Name != "ThemeBase")
 | 
			
		||||
                {
 | 
			
		||||
                    string[] typename = themeControlType.AssemblyQualifiedName.Split(',').Select(item => item.Trim()).ToList().ToArray();
 | 
			
		||||
                    string[] segments = typename[0].Split('.');
 | 
			
		||||
                    Array.Resize(ref segments, segments.Length - 1);
 | 
			
		||||
                    string Namespace = string.Join(".", segments);
 | 
			
		||||
 | 
			
		||||
                    int index = themes.FindIndex(item => item.ThemeName == Namespace);
 | 
			
		||||
                    if (index == -1)
 | 
			
		||||
                    {
 | 
			
		||||
                        /// determine if this theme implements ITheme
 | 
			
		||||
                        Type themeType = assembly.GetTypes()
 | 
			
		||||
                            .Where(item => item.Namespace.StartsWith(Namespace))
 | 
			
		||||
                            .Where(item => item.GetInterfaces().Contains(typeof(ITheme))).FirstOrDefault();
 | 
			
		||||
                        if (themeType != null)
 | 
			
		||||
                        {
 | 
			
		||||
                            var themeObject = Activator.CreateInstance(themeType);
 | 
			
		||||
                            theme = new Theme
 | 
			
		||||
                            {
 | 
			
		||||
                                ThemeName = Namespace,
 | 
			
		||||
                                Name = (string)themeType.GetProperty("Name").GetValue(themeObject),
 | 
			
		||||
                                Version = (string)themeType.GetProperty("Version").GetValue(themeObject),
 | 
			
		||||
                                Owner = (string)themeType.GetProperty("Owner").GetValue(themeObject),
 | 
			
		||||
                                Url = (string)themeType.GetProperty("Url").GetValue(themeObject),
 | 
			
		||||
                                Contact = (string)themeType.GetProperty("Contact").GetValue(themeObject),
 | 
			
		||||
                                License = (string)themeType.GetProperty("License").GetValue(themeObject),
 | 
			
		||||
                                Dependencies = (string)themeType.GetProperty("Dependencies").GetValue(themeObject),
 | 
			
		||||
                                ThemeControls = "",
 | 
			
		||||
                                PaneLayouts = "",
 | 
			
		||||
                                ContainerControls = "",
 | 
			
		||||
                                AssemblyName = assembly.FullName.Split(",")[0]
 | 
			
		||||
                            };
 | 
			
		||||
                        }
 | 
			
		||||
                        else
 | 
			
		||||
                        {
 | 
			
		||||
                            theme = new Theme
 | 
			
		||||
                            {
 | 
			
		||||
                                ThemeName = Namespace,
 | 
			
		||||
                                Name = themeControlType.Name,
 | 
			
		||||
                                Version = new Version(1, 0, 0).ToString(),
 | 
			
		||||
                                Owner = "",
 | 
			
		||||
                                Url = "",
 | 
			
		||||
                                Contact = "",
 | 
			
		||||
                                License = "",
 | 
			
		||||
                                Dependencies = "",
 | 
			
		||||
                                ThemeControls = "",
 | 
			
		||||
                                PaneLayouts = "",
 | 
			
		||||
                                ContainerControls = "",
 | 
			
		||||
                                AssemblyName = assembly.FullName.Split(",")[0]
 | 
			
		||||
                            };
 | 
			
		||||
                        }
 | 
			
		||||
                        themes.Add(theme);
 | 
			
		||||
                        index = themes.FindIndex(item => item.ThemeName == Namespace);
 | 
			
		||||
                    }
 | 
			
		||||
                    theme = themes[index];
 | 
			
		||||
                    // layouts and themes
 | 
			
		||||
                    if (themeControlType.FullName.EndsWith("Layout"))
 | 
			
		||||
                    {
 | 
			
		||||
                        theme.PaneLayouts += (themeControlType.FullName + ", " + typename[1] + ";");
 | 
			
		||||
                    }
 | 
			
		||||
                    else
 | 
			
		||||
                    {
 | 
			
		||||
                        theme.ThemeControls += (themeControlType.FullName + ", " + typename[1] + ";");
 | 
			
		||||
                    }
 | 
			
		||||
                    // containers
 | 
			
		||||
                    Type[] containertypes = assembly.GetTypes().Where(item => item.Namespace.StartsWith(Namespace)).Where(item => item.GetInterfaces().Contains(typeof(IContainerControl))).ToArray();
 | 
			
		||||
                    foreach (Type containertype in containertypes)
 | 
			
		||||
                    {
 | 
			
		||||
                        theme.ContainerControls += (containertype.FullName + ", " + typename[1] + ";");
 | 
			
		||||
                    }
 | 
			
		||||
                    themes[index] = theme;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            return themes;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public IEnumerable<Theme> GetThemes()
 | 
			
		||||
        {
 | 
			
		||||
            return themes;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -32,7 +32,7 @@ CREATE TABLE [dbo].[Page](
 | 
			
		||||
	[SiteId] [int] NOT NULL,
 | 
			
		||||
	[Path] [nvarchar](50) NOT NULL,
 | 
			
		||||
	[Name] [nvarchar](50) NOT NULL,
 | 
			
		||||
	[SkinType] [nvarchar](200) NULL,
 | 
			
		||||
	[ThemeType] [nvarchar](200) NULL,
 | 
			
		||||
	[Icon] [nvarchar](50) NOT NULL,
 | 
			
		||||
	[Panes] [nvarchar](50) NOT NULL,
 | 
			
		||||
	[ViewPermissions] [nvarchar](500) NOT NULL,
 | 
			
		||||
@ -167,38 +167,38 @@ GO
 | 
			
		||||
 | 
			
		||||
SET IDENTITY_INSERT [dbo].[Page] ON 
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [SkinType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType]) 
 | 
			
		||||
VALUES (1, 1, N'Page1', N'', N'Oqtane.Client.Skins.Skin1.Skin1, Oqtane.Client', N'oi-home', N'Left;Right', N'All Users', N'Administrators', NULL, 1, 1, N'')
 | 
			
		||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [ThemeType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType]) 
 | 
			
		||||
VALUES (1, 1, N'Page1', N'', N'Oqtane.Client.Themes.Theme1.Theme1, Oqtane.Client', N'oi-home', N'Left;Right', N'All Users', N'Administrators', NULL, 1, 1, N'')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [SkinType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType]) 
 | 
			
		||||
VALUES (2, 1, N'Page2', N'page2', N'Oqtane.Client.Skins.Skin2.Skin2, Oqtane.Client', N'oi-plus', N'Top;Bottom', N'Administrators;Editors;', N'Administrators', NULL, 3, 1, N'')
 | 
			
		||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [ThemeType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType]) 
 | 
			
		||||
VALUES (2, 1, N'Page2', N'page2', N'Oqtane.Client.Themes.Theme2.Theme2, Oqtane.Client', N'oi-plus', N'Top;Bottom', N'Administrators;Editors;', N'Administrators', NULL, 3, 1, N'')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [SkinType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType]) 
 | 
			
		||||
VALUES (3, 1, N'Page3', N'page3', N'Oqtane.Client.Skins.Skin3.Skin3, Oqtane.Client', N'oi-list-rich', N'Left;Right', N'All Users', N'Administrators', NULL, 3, 1, N'Oqtane.Client.Skins.Skin3.HorizontalLayout, Oqtane.Client')
 | 
			
		||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [ThemeType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType]) 
 | 
			
		||||
VALUES (3, 1, N'Page3', N'page3', N'Oqtane.Client.Themes.Theme3.Theme3, Oqtane.Client', N'oi-list-rich', N'Left;Right', N'All Users', N'Administrators', NULL, 3, 1, N'Oqtane.Client.Themes.Theme3.HorizontalLayout, Oqtane.Client')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [SkinType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType]) 
 | 
			
		||||
VALUES (4, 1, N'Admin', N'admin', N'Oqtane.Client.Skins.Skin2.Skin2, Oqtane.Client', N'oi-home', N'Top;Bottom', N'Administrators', N'Administrators', NULL, 7, 1, N'')
 | 
			
		||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [ThemeType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType]) 
 | 
			
		||||
VALUES (4, 1, N'Admin', N'admin', N'Oqtane.Client.Themes.Theme2.Theme2, Oqtane.Client', N'oi-home', N'Top;Bottom', N'Administrators', N'Administrators', NULL, 7, 1, N'')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [SkinType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType]) 
 | 
			
		||||
VALUES (5, 1, N'Page Management', N'admin/pages', N'Oqtane.Client.Skins.Skin2.Skin2, Oqtane.Client', N'', N'Top;Bottom', N'Administrators', N'Administrators', 4, 1, 1, N'')
 | 
			
		||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [ThemeType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType]) 
 | 
			
		||||
VALUES (5, 1, N'Page Management', N'admin/pages', N'Oqtane.Client.Themes.Theme2.Theme2, Oqtane.Client', N'', N'Top;Bottom', N'Administrators', N'Administrators', 4, 1, 1, N'')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [SkinType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType]) 
 | 
			
		||||
VALUES (6, 1, N'Login', N'login', N'Oqtane.Client.Skins.Skin2.Skin2, Oqtane.Client', N'', N'Top;Bottom', N'All Users', N'Administrators', NULL, 1, 0, N'')
 | 
			
		||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [ThemeType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType]) 
 | 
			
		||||
VALUES (6, 1, N'Login', N'login', N'Oqtane.Client.Themes.Theme2.Theme2, Oqtane.Client', N'', N'Top;Bottom', N'All Users', N'Administrators', NULL, 1, 0, N'')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [SkinType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType]) 
 | 
			
		||||
VALUES (7, 1, N'Register', N'register', N'Oqtane.Client.Skins.Skin2.Skin2, Oqtane.Client', N'', N'Top;Bottom', N'All Users', N'Administrators', NULL, 1, 0, N'')
 | 
			
		||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [ThemeType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType]) 
 | 
			
		||||
VALUES (7, 1, N'Register', N'register', N'Oqtane.Client.Themes.Theme2.Theme2, Oqtane.Client', N'', N'Top;Bottom', N'All Users', N'Administrators', NULL, 1, 0, N'')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [SkinType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType]) 
 | 
			
		||||
VALUES (8, 1, N'Site Management', N'admin/sites', N'Oqtane.Client.Skins.Skin2.Skin2, Oqtane.Client', N'', N'Top;Bottom', N'Administrators', N'Administrators', 4, 0, 1, N'')
 | 
			
		||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [ThemeType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType]) 
 | 
			
		||||
VALUES (8, 1, N'Site Management', N'admin/sites', N'Oqtane.Client.Themes.Theme2.Theme2, Oqtane.Client', N'', N'Top;Bottom', N'Administrators', N'Administrators', 4, 0, 1, N'')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [SkinType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType]) 
 | 
			
		||||
VALUES (9, 1, N'User Management', N'admin/users', N'Oqtane.Client.Skins.Skin2.Skin2, Oqtane.Client', N'', N'Top;Bottom', N'Administrators', N'Administrators', 4, 2, 1, N'')
 | 
			
		||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [ThemeType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType]) 
 | 
			
		||||
VALUES (9, 1, N'User Management', N'admin/users', N'Oqtane.Client.Themes.Theme2.Theme2, Oqtane.Client', N'', N'Top;Bottom', N'Administrators', N'Administrators', 4, 2, 1, N'')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [SkinType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType]) 
 | 
			
		||||
VALUES (10, 1, N'Module Management', N'admin/modules', N'Oqtane.Client.Skins.Skin2.Skin2, Oqtane.Client', N'', N'Top;Bottom', N'Administrators', N'Administrators', 4, 3, 1, N'')
 | 
			
		||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [ThemeType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType]) 
 | 
			
		||||
VALUES (10, 1, N'Module Management', N'admin/modules', N'Oqtane.Client.Themes.Theme2.Theme2, Oqtane.Client', N'', N'Top;Bottom', N'Administrators', N'Administrators', 4, 3, 1, N'')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [SkinType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType]) 
 | 
			
		||||
VALUES (11, 1, N'Skin Management', N'admin/skins', N'Oqtane.Client.Skins.Skin2.Skin2, Oqtane.Client', N'', N'Top;Bottom', N'Administrators', N'Administrators', 4, 4, 1, N'')
 | 
			
		||||
INSERT [dbo].[Page] ([PageId], [SiteId], [Name], [Path], [ThemeType], [Icon], [Panes], [ViewPermissions], [EditPermissions], [ParentId], [Order], [IsNavigation], [LayoutType]) 
 | 
			
		||||
VALUES (11, 1, N'Theme Management', N'admin/themes', N'Oqtane.Client.Themes.Theme2.Theme2, Oqtane.Client', N'', N'Top;Bottom', N'Administrators', N'Administrators', 4, 4, 1, N'')
 | 
			
		||||
GO
 | 
			
		||||
SET IDENTITY_INSERT [dbo].[Page] OFF 
 | 
			
		||||
GO
 | 
			
		||||
@ -248,7 +248,7 @@ INSERT [dbo].[Module] ([ModuleId], [SiteId], [ModuleDefinitionName], [ViewPermis
 | 
			
		||||
VALUES (14, 1, N'Oqtane.Client.Modules.Admin.ModuleDefinitions, Oqtane.Client', N'Administrators', N'Administrators')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[Module] ([ModuleId], [SiteId], [ModuleDefinitionName], [ViewPermissions], [EditPermissions]) 
 | 
			
		||||
VALUES (15, 1, N'Oqtane.Client.Modules.Admin.Skins, Oqtane.Client', N'Administrators', N'Administrators')
 | 
			
		||||
VALUES (15, 1, N'Oqtane.Client.Modules.Admin.Themes, Oqtane.Client', N'Administrators', N'Administrators')
 | 
			
		||||
GO
 | 
			
		||||
SET IDENTITY_INSERT [dbo].[Module] OFF 
 | 
			
		||||
GO
 | 
			
		||||
@ -256,49 +256,49 @@ GO
 | 
			
		||||
SET IDENTITY_INSERT [dbo].[PageModule] ON 
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType]) 
 | 
			
		||||
VALUES (1, 1, 1, N'Weather', N'Right', 0, N'Oqtane.Client.Skins.Skin1.Container1, Oqtane.Client')
 | 
			
		||||
VALUES (1, 1, 1, N'Weather', N'Right', 0, N'Oqtane.Client.Themes.Theme1.Container1, Oqtane.Client')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType]) 
 | 
			
		||||
VALUES (2, 1, 2, N'Counter', N'Left', 1, N'Oqtane.Client.Skins.Skin1.Container1, Oqtane.Client')
 | 
			
		||||
VALUES (2, 1, 2, N'Counter', N'Left', 1, N'Oqtane.Client.Themes.Theme1.Container1, Oqtane.Client')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType]) 
 | 
			
		||||
VALUES (3, 1, 3, N'Text', N'Left', 0, N'Oqtane.Client.Skins.Skin1.Container1, Oqtane.Client')
 | 
			
		||||
VALUES (3, 1, 3, N'Text', N'Left', 0, N'Oqtane.Client.Themes.Theme1.Container1, Oqtane.Client')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType]) 
 | 
			
		||||
VALUES (4, 2, 4, N'Weather', N'Top', 0, N'Oqtane.Client.Skins.Skin2.Container2, Oqtane.Client')
 | 
			
		||||
VALUES (4, 2, 4, N'Weather', N'Top', 0, N'Oqtane.Client.Themes.Theme2.Container2, Oqtane.Client')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType]) 
 | 
			
		||||
VALUES (5, 2, 5, N'Text', N'Top', 1, N'Oqtane.Client.Skins.Skin1.Container1, Oqtane.Client')
 | 
			
		||||
VALUES (5, 2, 5, N'Text', N'Top', 1, N'Oqtane.Client.Themes.Theme1.Container1, Oqtane.Client')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType]) 
 | 
			
		||||
VALUES (6, 3, 6, N'Text', N'Left', 0, N'Oqtane.Client.Skins.Skin1.Container1, Oqtane.Client')
 | 
			
		||||
VALUES (6, 3, 6, N'Text', N'Left', 0, N'Oqtane.Client.Themes.Theme1.Container1, Oqtane.Client')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType]) 
 | 
			
		||||
VALUES (7, 3, 7, N'Text', N'Right', 0, N'Oqtane.Client.Skins.Skin1.Container1, Oqtane.Client')
 | 
			
		||||
VALUES (7, 3, 7, N'Text', N'Right', 0, N'Oqtane.Client.Themes.Theme1.Container1, Oqtane.Client')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType]) 
 | 
			
		||||
VALUES (8, 5, 8, N'Page Management', N'Top', 0, N'Oqtane.Client.Skins.Skin2.Container2, Oqtane.Client')
 | 
			
		||||
VALUES (8, 5, 8, N'Page Management', N'Top', 0, N'Oqtane.Client.Themes.Theme2.Container2, Oqtane.Client')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType]) 
 | 
			
		||||
VALUES (9, 6, 9, N'Login', N'Top', 0, N'Oqtane.Client.Skins.Skin2.Container2, Oqtane.Client')
 | 
			
		||||
VALUES (9, 6, 9, N'Login', N'Top', 0, N'Oqtane.Client.Themes.Theme2.Container2, Oqtane.Client')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType]) 
 | 
			
		||||
VALUES (10, 7, 10, N'Register', N'Top', 0, N'Oqtane.Client.Skins.Skin2.Container2, Oqtane.Client')
 | 
			
		||||
VALUES (10, 7, 10, N'Register', N'Top', 0, N'Oqtane.Client.Themes.Theme2.Container2, Oqtane.Client')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType]) 
 | 
			
		||||
VALUES (11, 4, 11, N'Administration', N'Top', 0, N'Oqtane.Client.Skins.Skin2.Container2, Oqtane.Client')
 | 
			
		||||
VALUES (11, 4, 11, N'Administration', N'Top', 0, N'Oqtane.Client.Themes.Theme2.Container2, Oqtane.Client')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType]) 
 | 
			
		||||
VALUES (12, 8, 12, N'Site Management', N'Top', 0, N'Oqtane.Client.Skins.Skin2.Container2, Oqtane.Client')
 | 
			
		||||
VALUES (12, 8, 12, N'Site Management', N'Top', 0, N'Oqtane.Client.Themes.Theme2.Container2, Oqtane.Client')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType]) 
 | 
			
		||||
VALUES (13, 9, 13, N'User Management', N'Top', 0, N'Oqtane.Client.Skins.Skin2.Container2, Oqtane.Client')
 | 
			
		||||
VALUES (13, 9, 13, N'User Management', N'Top', 0, N'Oqtane.Client.Themes.Theme2.Container2, Oqtane.Client')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType]) 
 | 
			
		||||
VALUES (14, 10, 14, N'Module Management', N'Top', 0, N'Oqtane.Client.Skins.Skin2.Container2, Oqtane.Client')
 | 
			
		||||
VALUES (14, 10, 14, N'Module Management', N'Top', 0, N'Oqtane.Client.Themes.Theme2.Container2, Oqtane.Client')
 | 
			
		||||
GO
 | 
			
		||||
INSERT [dbo].[PageModule] ([PageModuleId], [PageId], [ModuleId], [Title], [Pane], [Order], [ContainerType]) 
 | 
			
		||||
VALUES (15, 11, 15, N'Skin Management', N'Top', 0, N'Oqtane.Client.Skins.Skin2.Container2, Oqtane.Client')
 | 
			
		||||
VALUES (15, 11, 15, N'Theme Management', N'Top', 0, N'Oqtane.Client.Themes.Theme2.Container2, Oqtane.Client')
 | 
			
		||||
GO
 | 
			
		||||
SET IDENTITY_INSERT [dbo].[PageModule] OFF 
 | 
			
		||||
GO
 | 
			
		||||
 | 
			
		||||
@ -59,7 +59,7 @@ namespace Oqtane.Server
 | 
			
		||||
 | 
			
		||||
            // register singleton core services
 | 
			
		||||
            services.AddScoped<IModuleDefinitionService, ModuleDefinitionService>();
 | 
			
		||||
            services.AddScoped<ISkinService, SkinService>();
 | 
			
		||||
            services.AddScoped<IThemeService, ThemeService>();
 | 
			
		||||
 | 
			
		||||
            // register scoped core services
 | 
			
		||||
            services.AddScoped<ITenantService, TenantService>();
 | 
			
		||||
@ -107,7 +107,7 @@ namespace Oqtane.Server
 | 
			
		||||
 | 
			
		||||
            // register singleton scoped core services
 | 
			
		||||
            services.AddSingleton<IModuleDefinitionRepository, ModuleDefinitionRepository>();
 | 
			
		||||
            services.AddSingleton<ISkinRepository, SkinRepository>();
 | 
			
		||||
            services.AddSingleton<IThemeRepository, ThemeRepository>();
 | 
			
		||||
 | 
			
		||||
            // register transient scoped core services
 | 
			
		||||
            services.AddTransient<ITenantRepository, TenantRepository>();
 | 
			
		||||
@ -207,7 +207,7 @@ namespace Oqtane.Server
 | 
			
		||||
 | 
			
		||||
            // register singleton scoped core services
 | 
			
		||||
            services.AddSingleton<IModuleDefinitionRepository, ModuleDefinitionRepository>();
 | 
			
		||||
            services.AddSingleton<ISkinRepository, SkinRepository>();
 | 
			
		||||
            services.AddSingleton<IThemeRepository, ThemeRepository>();
 | 
			
		||||
 | 
			
		||||
            // register transient scoped core services
 | 
			
		||||
            services.AddTransient<ITenantRepository, TenantRepository>();
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,7 @@ namespace Oqtane.Models
 | 
			
		||||
        public string Name { get; set; }
 | 
			
		||||
        public string Path { get; set; }
 | 
			
		||||
        public int Order { get; set; }
 | 
			
		||||
        public string SkinType { get; set; }
 | 
			
		||||
        public string ThemeType { get; set; }
 | 
			
		||||
        public string LayoutType { get; set; }
 | 
			
		||||
        public string Icon { get; set; }
 | 
			
		||||
        public string Panes { get; set; }
 | 
			
		||||
 | 
			
		||||
@ -1,8 +1,8 @@
 | 
			
		||||
namespace Oqtane.Models
 | 
			
		||||
{
 | 
			
		||||
    public class Skin
 | 
			
		||||
    public class Theme
 | 
			
		||||
    {
 | 
			
		||||
        public string SkinName { get; set; }
 | 
			
		||||
        public string ThemeName { get; set; }
 | 
			
		||||
        public string Name { get; set; }
 | 
			
		||||
        public string Version { get; set; }
 | 
			
		||||
        public string Owner { get; set; }
 | 
			
		||||
@ -10,7 +10,7 @@
 | 
			
		||||
        public string Contact { get; set; }
 | 
			
		||||
        public string License { get; set; }
 | 
			
		||||
        public string Dependencies { get; set; }
 | 
			
		||||
        public string SkinControls { get; set; }
 | 
			
		||||
        public string ThemeControls { get; set; }
 | 
			
		||||
        public string PaneLayouts { get; set; }
 | 
			
		||||
        public string ContainerControls { get; set; }
 | 
			
		||||
        public string AssemblyName { get; set; }
 | 
			
		||||
		Reference in New Issue
	
	Block a user