From 8cf99604a3cd274dabfb661c9cbcd2ba7efba9d4 Mon Sep 17 00:00:00 2001 From: Balfear Date: Sun, 19 Nov 2023 15:52:44 +0300 Subject: [PATCH] Allow to read files from addon themes ThemePath function now read files from addon themes if file not exist in main theme. --- lib/Flux/Template.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/Flux/Template.php b/lib/Flux/Template.php index aa1837de..685659b2 100644 --- a/lib/Flux/Template.php +++ b/lib/Flux/Template.php @@ -588,6 +588,15 @@ public function themePath($path, $included = false) if (file_exists($chk)) { $uri = $path; } + } elseif (!file_exists($chk)) { + foreach (Flux::$addons as $_tmpAddon_key => $_tmpAddon) { + $chk = FLUX_ROOT .'/'. FLUX_ADDON_DIR .'/'. $_tmpAddon_key .'/'. preg_replace('/^('.$base.')/', '', $uri ); + if (file_exists($chk)) { + $path = sprintf('%s/%s/%s', FLUX_ADDON_DIR, $_tmpAddon_key, preg_replace('/^('.$base.')/', '', $uri )); + $uri = $path; + break; + } + } } return $uri . $frag;