From 2a2303d1dccc120dd7aa5f6b6ade0f89e0064850 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 25 Nov 2025 07:42:23 +0000
Subject: [PATCH] =Feed block mostly good! Referrals look good to go. Ready for Madi and Heidi to approve
---
inc/managers/DashboardManager.php | 34 +++-------------------------------
1 files changed, 3 insertions(+), 31 deletions(-)
diff --git a/inc/managers/DashboardManager.php b/inc/managers/DashboardManager.php
index a7e6790..69e485e 100644
--- a/inc/managers/DashboardManager.php
+++ b/inc/managers/DashboardManager.php
@@ -175,10 +175,10 @@
if ($page === '' || $page === 'dash') {
return;
}
-
+ $page = $this->getCurrentPageTitle();
// Check if page exists in allowed pages
$allowedPages = $this->getUserAllowedPages();
- if (!array_key_exists($page, $allowedPages)) {
+ if (!in_array($page, $allowedPages)) {
error_log("User not allowed to access page: {$page}");
$this->redirectToDashboard();
return;
@@ -197,14 +197,13 @@
if ($page === 'dash') {
continue;
}
+ $slug = $this->getSlug($slug, $page);
$existing = get_page_by_path($slug, OBJECT, BASE.'dash');
if ($existing) {
continue;
}
$title = $page;
- $slug = $this->getSlug($slug, $page);
-
$ID = wp_insert_post(array(
'post_title' => $title,
'post_name' => $slug,
@@ -484,34 +483,7 @@
return;
}
- wp_enqueue_script('jvb-loading');
wp_enqueue_script('jvb-form');
-
- // Consolidate all dashboard settings
- wp_localize_script('jvb-loading', 'dashboardSettings', array(
- 'loadingMessages' => array(
- 'default' => 'Loading...',
- 'error' => 'Failed to load page'
- ),
- 'strings' => array(
- 'deleteConfirm' => 'Are you sure you want to delete this item?',
- 'bulkDeleteConfirm' => 'Are you sure you want to delete these items?',
- 'deleteSuccess' => 'Item(s) deleted successfully',
- 'deleteError' => 'Error deleting item(s)',
- 'saveSuccess' => 'Changes saved successfully',
- 'saveError' => 'Error saving changes',
- 'loadError' => 'Error loading content'
- ),
- 'currentUser' => array(
- 'id' => $this->user->ID,
- 'name' => $this->user->display_name,
- 'role' => array_values($this->user->roles)[0] ?? '',
- 'type' => str_replace(BASE, '', array_values($this->user->roles)[0]),
- 'city' => '', // Add if needed,
- 'artistID' => $this->userLink,
- )
- ));
-
wp_enqueue_script('jvb-selector');
wp_enqueue_script('jvb-uploader');
wp_enqueue_script('jvb-content');
--
Gitblit v1.10.0