From 235ce5716edc2f7cbe80fdccf26eac7269587839 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Mon, 08 Jun 2026 04:38:18 +0000
Subject: [PATCH] =FavouritesManager.php and FavouritesRoutes.php fixes. Moving all logic to FavouritesManager.php. Still some left to do

---
 inc/utility/Image.php |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/inc/utility/Image.php b/inc/utility/Image.php
index 0626891..384a699 100644
--- a/inc/utility/Image.php
+++ b/inc/utility/Image.php
@@ -185,5 +185,18 @@
 	{
 		return (new Image)->formatImage($id, $start, $replace, $addLink, $postSlug);
 	}
-
+	public static function SVG(string $slug):string
+	{
+		$cache = Cache::for('svgs');
+		if (JVB_TESTING) {
+			$cache->flush();
+		}
+		return $cache->remember(
+			$slug,
+			function() use ($slug) {
+				$filename = JVB_CHILD_DIR.'/assets/icons/'.$slug.'.svg';
+				return file_exists($filename) ? file_get_contents($filename) : '';
+			}
+		);
+	}
 }

--
Gitblit v1.10.0