@using Microsoft.AspNetCore.Components.Routing @using Oqtane.Models @using Oqtane.Services @using Oqtane.Modules @using Oqtane.Shared @using Oqtane.Client.Modules.Controls @inherits ModuleBase @inject IUriHelper UriHelper @inject IPageService PageService @inject IThemeService ThemeService
Cancel @functions { public override SecurityAccessLevelEnum SecurityAccessLevel { get { return SecurityAccessLevelEnum.Admin; } } Dictionary themes = new Dictionary(); Dictionary panelayouts = new Dictionary(); int PageId; string name; string path; string parentid; string order; string isnavigation; string themetype; string layouttype; string icon; string viewpermissions; string editpermissions; protected override async Task OnInitAsync() { List Themes = await ThemeService.GetThemesAsync(); foreach (Theme theme in Themes) { foreach (string themecontrol in theme.ThemeControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) { themes.Add(themecontrol, theme.Name + " - " + @Utilities.GetTypeNameClass(themecontrol)); } foreach (string panelayout in theme.PaneLayouts.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) { panelayouts.Add(panelayout, theme.Name + " - " + @Utilities.GetTypeNameClass(panelayout)); } } PageId = Int32.Parse(PageState.QueryString["id"]); Page p = PageState.Pages.Where(item => item.PageId == PageId).FirstOrDefault(); if (p != null) { name = p.Name; path = p.Path; order = p.Order.ToString(); isnavigation = p.IsNavigation.ToString(); themetype = p.ThemeType; layouttype = p.LayoutType; icon = p.Icon; viewpermissions = p.ViewPermissions; editpermissions = p.EditPermissions; } } private async Task DeletePage() { await PageService.DeletePageAsync(Int32.Parse(PageState.QueryString["id"])); UriHelper.NavigateTo(PageState.Alias); } }