add page list to manager so we can inject pages into the layout view

This commit is contained in:
RaidMax
2018-08-03 17:10:20 -05:00
parent 9d00d5a16a
commit d0be08629d
9 changed files with 80 additions and 5 deletions

View File

@ -9,6 +9,7 @@ using SharedLibraryCore.Database;
using SharedLibraryCore.Database.Models;
using SharedLibraryCore.Interfaces;
using SharedLibraryCore.Objects;
using WebfrontCore.ViewModels;
namespace WebfrontCore.Controllers
{
@ -19,7 +20,7 @@ namespace WebfrontCore.Controllers
protected bool Authorized { get; set; }
protected SharedLibraryCore.Localization.Index Localization { get; private set; }
protected EFClient Client { get; private set; }
private static byte[] LocalHost = { 127, 0, 0, 1 };
private static readonly byte[] LocalHost = { 127, 0, 0, 1 };
private static string SocialLink;
private static string SocialTitle;
@ -89,6 +90,14 @@ namespace WebfrontCore.Controllers
ViewBag.SocialLink = SocialLink ?? "";
ViewBag.SocialTitle = SocialTitle;
// grab the pages from plugins
ViewBag.Pages = Manager.GetPageList().Pages
.Select(page => new Page
{
Name = page.Key,
Location = page.Value
}).ToList();
base.OnActionExecuting(context);
}
}