From 4089ba01e0881c89a72332e13bc3a80b6bddec2a Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Mon, 29 Jun 2026 22:15:55 +0000
Subject: [PATCH] =DashboardManager overhaul. A bit easier to modify the output of pages. Still have to get the account pages to work as expected, as well as verify the integrations and others are working - but registrar/content pages work as expected. Also fixed up the table generation in CRUD.js and CRUDSkeleton.php
---
inc/managers/DashboardManager.php | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/inc/managers/DashboardManager.php b/inc/managers/DashboardManager.php
index 73be522..e8fb17c 100644
--- a/inc/managers/DashboardManager.php
+++ b/inc/managers/DashboardManager.php
@@ -218,7 +218,7 @@
$page = $this->getCurrentPageTitle();
// Check if page exists in allowed pages
$allowedPages = $this->getUserAllowedPages();
-
+ error_log('Allowed pages: '.print_r($allowedPages, true));
if (!in_array($page, $allowedPages)) {
error_log("User not allowed to access page: {$page}");
$this->redirectToDashboard();
@@ -865,6 +865,7 @@
public function renderIndex(string $content, string $page):string
{
+ jvbDump($page);
if ($page !== '' && $page !== 'dash') {
return $content;
}
@@ -1322,12 +1323,14 @@
}
if (!$user || !$this->userHasDashboardAccess($user)) {
+ error_log('No Dashboard Access');
return [];
}
$pages = $this->cache->get($userID);
+ $pages = false;
if ($pages === false || JVB_TESTING) {
if (user_can($userID, 'manage_options')) {
// Admin gets all pages as flat array
@@ -1340,6 +1343,7 @@
$pages = $this->getAllDashboardPages();
$canSkip = user_can($userID, 'skip_moderation');
+ jvbDump($pages, 'All Pages');
foreach($pages as $key => $slug) {
//Default to Remove pages
$remove = true;
@@ -1435,6 +1439,7 @@
}
}
break;
+ case 'Account':
case 'dash':
case 'Referrals':
case 'favourites':
--
Gitblit v1.10.0