From e9967fa22781d922ba4eb8fb44fe72d200ac4b14 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Mon, 10 Nov 2025 21:04:10 +0000
Subject: [PATCH] =IconsManager.php update
---
inc/managers/DashboardManager.php | 63 +++++++++++++++++--------------
1 files changed, 35 insertions(+), 28 deletions(-)
diff --git a/inc/managers/DashboardManager.php b/inc/managers/DashboardManager.php
index 276d3c1..10a8a4a 100644
--- a/inc/managers/DashboardManager.php
+++ b/inc/managers/DashboardManager.php
@@ -23,13 +23,12 @@
public function __construct()
{
$this->cache = CacheManager::for('dashboard', WEEK_IN_SECONDS);
- $this->cache->invalidate();
add_action('init', [$this, 'registerDashboard']);
if (!$this->isRegistered()) {
add_action('init', [$this, 'buildDashboard']);
}
$this->user = wp_get_current_user();
- $this->role = jvbUserRole();
+ $this->role = jvbUserRole($this->user->ID);
$this->userLink = (int)get_user_meta($this->user->ID, BASE.'link', true);
@@ -307,6 +306,12 @@
// Get current page/section
$page = $this->getCurrentPage();
+ $config = $this->getConfig($page);
+ if(!empty($config)) {
+ add_filter('jvbLoadingIcon', function() use ($config) {
+ return jvbIcon($config['icon']);
+ });
+ }
$integrationSlugs = array_map(function($name) {
return sanitize_title(str_replace('_', '-', $name));
}, array_keys(JVB()->getAvailableServices(false)));
@@ -316,13 +321,14 @@
// Pass along to the Integrations template handler which knows to check for subpages
$page = 'integrations';
}
-
- echo $this->cache->remember(
- $page,
- function() use ($page) {
- return $this->renderDashboard($page);
- }
- );
+ echo $this->renderDashboard($page);
+ //TODO: Reenable
+// echo $this->cache->remember(
+// $page,
+// function() use ($page) {
+// return $this->renderDashboard($page);
+// }
+// );
return '';
}
@@ -614,8 +620,8 @@
$title = ($checked == '') ? 'Toggle Dark Mode' : 'Toggle Light Mode';
echo '<label title="'.$title.'" id="theme-switch" class="toggle-switch" for="theme-switcher">
<input class="theme-switch row" id="theme-switcher" type="checkbox"'.$checked.' data-setting="theme" data-theme role="switch" name="dark-mode"><span class="slider">'.
- jvbIcon('light', ['title'=> 'Light Mode']).
- jvbIcon('dark', ['title'=>'Dark Mode']).
+ jvbIcon('sun-dim', ['title'=> 'Light Mode']).
+ jvbIcon('moon', ['title'=>'Dark Mode']).
'</span></label>';
?>
<p class="title">
@@ -630,7 +636,7 @@
}
}
if ($out == '') {
- $out =jvbIcon('home');
+ $out =jvbIcon('house');
}
?><?= $out ?>
</a>
@@ -659,7 +665,6 @@
<?php
$current_page = $this->getCurrentPage();
$pages = $this->getUserAllowedPages()?:[];
- error_log('PageS: '.print_r($pages, true));
echo '<ul>';
foreach ($pages as $page) {
@@ -712,7 +717,7 @@
echo '<p>Welcome back!</p>';
$pages = $this->getUserAllowedPages();
-
+ error_log('Pages: '.print_r($pages, true));
echo '<h2>What would you like to do today?</h2>';
@@ -722,7 +727,7 @@
continue;
}
$title = $this->getTitle($page);
- $url = sanitize_title($title);
+
$description = $this->getDescription($page);
$icon = $page;
if (!is_numeric($slug)) {
@@ -730,10 +735,12 @@
if (array_key_exists('icon', $config)) {
$icon = $config['icon'];
}
+ } else {
+ $slug = sanitize_title($page);
}
if ($title !== '') {
- echo '<li><p><a href="'.get_home_url(null, '/dash/'.$url.'/').'"
- data-page="'.$url.'" data-dash>'.jvbIcon($icon).ucwords($title).'</a></p></li>';
+ echo '<li><p><a href="'.get_home_url(null, '/dash/'.$slug.'/').'"
+ data-page="'.$slug.'" data-dash>'.jvbIcon($icon).ucwords($title).'</a></p></li>';
}
}
@@ -781,7 +788,7 @@
if ($content !== '') {
echo $content;
} else {
- jvbRenderSections($this->user->ID, 'user', jvbUserRole());
+ jvbRenderSections($this->user->ID, 'user', jvbUserRole());
}
}
@@ -851,16 +858,16 @@
<div class="approvals container">
<nav class="tabs row start" role="tablist">
<button type="button" class="tab active" data-tab="summary" role="tab" aria-selected="true">
- <h2><?= jvbIcon('all')?>All</h2>
+ <h2><?= jvbIcon('infinity')?>All</h2>
</button>
<button type="button" class="tab" data-tab="artists" role="tab" aria-selected="false">
- <h2><?= jvbIcon('artists')?>Artists</h2>
+ <h2><?= jvbIcon('users-three')?>Artists</h2>
</button>
<button type="button" class="tab" data-tab="terms" role="tab" aria-selected="false">
- <h2><?= jvbIcon('style')?>Terms</h2>
+ <h2><?= jvbIcon('hash')?>Terms</h2>
</button>
<button type="button" class="tab" data-tab="yours" role="tab" aria-selected="false">
- <h2><?= jvbIcon('artist')?>Yours</h2>
+ <h2><?= jvbIcon('user')?>Yours</h2>
</button>
</nav>
</div>
@@ -964,8 +971,8 @@
'vertical',
'TAB NAV:',
'',
- jvbIcon('down'),
- jvbIcon('right'))?>
+ jvbIcon('caret-double-down'),
+ jvbIcon('caret-double-right'))?>
</div>
<div class="items-container">
@@ -1024,18 +1031,18 @@
<template class="<?= $type ?>Row">
<tr>
<td>
- <?= jvbIcon('grab') ?>
+ <?= jvbIcon('dots-six-vertical') ?>
</td>
<td data-id="actions" class="col">
<?= jvbRenderToggleTextField(
'public',
'',
'',
- jvbIcon('show'),
- jvbIcon('hide'))
+ jvbIcon('eye'),
+ jvbIcon('eye-closed'))
?>
<button type="button" data-action="edit">
- <?= jvbIcon('edit') ?>
+ <?= jvbIcon('pencil-simple') ?>
</button>
</td>
<?php
--
Gitblit v1.10.0