From 0afb2c0046b55c123eafb4ab9ee77efa68d12463 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sat, 06 Jun 2026 17:15:31 +0000
Subject: [PATCH] =Starting the Favourites.js setup, converting previous Northeh stuff to new Registrar, fixing up Square.php integration to match
---
inc/managers/DashboardManager.php | 44 ++++++++++++++++++++++++++++++--------------
1 files changed, 30 insertions(+), 14 deletions(-)
diff --git a/inc/managers/DashboardManager.php b/inc/managers/DashboardManager.php
index 062c1bf..395e6c2 100644
--- a/inc/managers/DashboardManager.php
+++ b/inc/managers/DashboardManager.php
@@ -25,9 +25,13 @@
public function __construct()
{
- $this->cache = Cache::for('dashboard', WEEK_IN_SECONDS)->connect('user');
+ $this->cache = Cache::for('dashboard', WEEK_IN_SECONDS)->connect('user')->user();
+ if (JVB_TESTING) {
+ $this->cache->flush();
+ }
+
add_action('init', [$this, 'registerDashboard']);
- $this->cache->flush();
+
$this->user = wp_get_current_user();
$this->role = jvbUserRole($this->user->ID);
$this->userLink = (int)get_user_meta($this->user->ID, BASE.'profile_link', true);
@@ -41,11 +45,12 @@
jvb_register_do_once('buildDashboard', [$this, 'activate']);
- add_filter('the_seo_framework_sitemap_exclude_ids', [$this, 'excludeDashboard'], 10, 1);
+ add_filter('the_seo_framework_sitemap_exclude_ids', [$this, 'excludeDashboard'], 8, 1);
}
- public function excludeDashboard(array $ids):array {
- $cached = $this->cache->remember(
+ public function excludeDashboard(array $IDs):array {
+ $this->cache->flush();
+ $exclude = $this->cache->remember(
'dashboardIDs',
function() {
return get_posts([
@@ -54,7 +59,11 @@
'fields' => 'ids',
]);
});
- return array_merge($ids, $cached);
+ if (!empty($exclude)) {
+ $IDs = array_merge($IDs, $exclude);
+ }
+
+ return $IDs;
}
/**
@@ -379,7 +388,7 @@
}
protected function renderDashboard(string $page):string
{
- ob_start();
+// ob_start();
jvbInlineStyles('nav');
jvbInlineStyles('dash');
jvbInlineStyles('forms');
@@ -395,7 +404,8 @@
);
$this->renderFooter();
- return ob_get_clean();
+// return ob_get_clean();
+return '';
// $integrationSlugs = array_map(function($name) {
// return sanitize_title(str_replace('_', '-', $name));
// }, array_keys(JVB()->getAvailableServices(false)));
@@ -677,7 +687,10 @@
if (function_exists($function)) {
echo $function([],'');
} else {
- echo JVB()->blocks()->render_core_site_logo([],'');
+ echo render_block( [
+ 'blockName' => 'core/site-logo',
+ 'attrs' => [],
+ ]);
}
?>
@@ -701,9 +714,9 @@
<?php
$menu = new Navigation('sidebar');
- $menuClasses = ['col', 'a-start', 'nowrap'];
+ $menuClasses = ['left'];
$itemClasses = ['col'];
- $menu->addClass('col a-start')->hasToggle()->defaultMenuClasses($menuClasses);
+ $menu->addClass('sidebar left')->hasToggle()->defaultMenuClasses($menuClasses);
$menu->defaultItemClasses($itemClasses);
$pages = $this->getUserAllowedPages()?:[];
//Dashboard
@@ -754,8 +767,11 @@
$itemMenu = $item->submenu($slug);
foreach ($taxonomies as $s) {
$taxRegistrar = Registrar::getInstance($s);
- $itemMenu->addItem($taxRegistrar->getPlural(), $taxRegistrar->getIcon())
+ if ($taxRegistrar) {
+ $itemMenu->addItem($taxRegistrar->getPlural(), $taxRegistrar->getIcon())
->url($this->baseURL.'/'.$s);
+ }
+
}
}
}
@@ -999,7 +1015,7 @@
{
?>
<div class="approvals container">
- <nav class="tabs row start" role="tablist">
+ <nav class="tabs row left" role="tablist">
<button type="button" class="tab active" data-tab="summary" role="tab" aria-selected="true">
<?= jvbDashIcon('infinity')?>All
</button>
@@ -1071,7 +1087,7 @@
}
ob_start();
?>
- <nav class="tabs row start" role="tablist">
+ <nav class="tabs row left" role="tablist">
<?php
$i=1;
$content = Registrar::getRegistered('post');
--
Gitblit v1.10.0