Jake Vanderwerf
2025-11-25 2a2303d1dccc120dd7aa5f6b6ade0f89e0064850
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');