fix: remove theme preview tab and test page #4

Merged
jmiller merged 64 commits from dev into main 2026-04-23 20:18:43 +00:00
2 changed files with 29 additions and 3 deletions
Showing only changes of commit 4423294272 - Show all commits

View File

@@ -97,8 +97,8 @@ if ($params_favicon_source) {
} }
} }
} }
$faviconOutputDir = JPATH_ROOT . '/images/favicons'; $faviconOutputDir = JPATH_ROOT . '/media/templates/site/' . $this->template . '/images/favicons';
$faviconUrlBase = Uri::root(true) . '/images/favicons'; $faviconUrlBase = Uri::root(true) . '/media/templates/site/' . $this->template . '/images/favicons';
if (MokoFaviconHelper::generate($faviconSourceAbs, $faviconOutputDir)) { if (MokoFaviconHelper::generate($faviconSourceAbs, $faviconOutputDir)) {
$faviconHeadTags = MokoFaviconHelper::getHeadTags($faviconUrlBase); $faviconHeadTags = MokoFaviconHelper::getHeadTags($faviconUrlBase);

View File

@@ -100,14 +100,40 @@ class Tpl_MokoonyxInstallerScript implements InstallerScriptInterface
/** /**
* Delete the favicon stamp file so favicons and site.webmanifest * Delete the favicon stamp file so favicons and site.webmanifest
* are regenerated on the next page load after install/update. * are regenerated on the next page load after install/update.
* Also removes the old /images/favicons/ location.
*/ */
private function clearFaviconStamp(): void private function clearFaviconStamp(): void
{ {
$stampFile = JPATH_ROOT . '/images/favicons/.favicon_generated'; // Clear new location stamp
$stampFile = JPATH_ROOT . '/media/templates/site/' . self::NEW_NAME . '/images/favicons/.favicon_generated';
if (is_file($stampFile)) { if (is_file($stampFile)) {
@unlink($stampFile); @unlink($stampFile);
$this->logMessage('Cleared favicon stamp — will regenerate on next page load.'); $this->logMessage('Cleared favicon stamp — will regenerate on next page load.');
} }
// Remove old /images/favicons/ directory from previous versions
$oldDir = JPATH_ROOT . '/images/favicons';
if (is_dir($oldDir)) {
$files = glob($oldDir . '/*');
if ($files) {
foreach ($files as $file) {
@unlink($file);
}
}
@unlink($oldDir . '/.favicon_generated');
@rmdir($oldDir);
$this->logMessage('Removed old favicon directory: images/favicons/');
}
// Remove any favicon files left in the site root
$rootFavicons = ['favicon.ico', 'favicon.png', 'apple-touch-icon.png', 'site.webmanifest'];
foreach ($rootFavicons as $file) {
$path = JPATH_ROOT . '/' . $file;
if (is_file($path)) {
@unlink($path);
$this->logMessage('Removed root favicon: ' . $file);
}
}
} }
/** /**