From 4e6f14c3baac604a4a943c6cc94f110d03caf635 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sun, 19 Apr 2026 17:51:02 -0500 Subject: [PATCH] Bridge: install from release, copy user files + params after. Bump 03.10.12 1. Download & install MokoOnyx from Gitea release 2. Copy user files (custom themes, user.css/js) to MokoOnyx 3. Migrate template styles with params Fallback: if download fails, copy user files only (MokoOnyx must be installed manually) Co-Authored-By: Claude Opus 4.6 (1M context) --- README.md | 4 +- src/helper/bridge.php | 85 ++++++++++++++++++++++++++++++++--------- src/joomla.asset.json | 2 +- src/templateDetails.xml | 6 +-- updates.xml | 26 ++++++------- 5 files changed, 87 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 15f97be..9c845f5 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,13 @@ INGROUP: MokoCassiopeia.Documentation REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoCassiopeia FILE: ./README.md - VERSION: 03.10.11 + VERSION: 03.10.12 BRIEF: Documentation for MokoCassiopeia template --> # MokoCassiopeia → MokoOnyx -> **This template is being renamed to MokoOnyx.** Version 03.10.11 is the bridge release that automatically migrates your settings. After updating, MokoOnyx will be your active template and MokoCassiopeia can be safely uninstalled. +> **This template is being renamed to MokoOnyx.** Version 03.10.12 is the bridge release that automatically migrates your settings. After updating, MokoOnyx will be your active template and MokoCassiopeia can be safely uninstalled. **A Modern, Lightweight Joomla Template Based on Cassiopeia** diff --git a/src/helper/bridge.php b/src/helper/bridge.php index 998e036..43a168a 100644 --- a/src/helper/bridge.php +++ b/src/helper/bridge.php @@ -46,27 +46,23 @@ class MokoBridgeMigration return true; } - // 1. Download MokoOnyx ZIP + // 1. Try downloading and installing MokoOnyx from Gitea release + $installed = false; $zipPath = self::downloadRelease(); - if (!$zipPath) { - $app->enqueueMessage( - 'MokoOnyx migration: could not download the MokoOnyx template package. ' - . 'Please install MokoOnyx manually from ' - . 'Gitea Releases.', - 'warning' - ); - return false; + if ($zipPath) { + $installed = self::installPackage($zipPath); + @unlink($zipPath); } - // 2. Install MokoOnyx via Joomla's installer - $installed = self::installPackage($zipPath); - - // Clean up downloaded ZIP - @unlink($zipPath); + // 2. Fallback: copy from MokoCassiopeia and rename + if (!$installed) { + self::log('Bridge: download/install failed, falling back to file copy'); + $installed = self::copyAndRename(); + } if (!$installed) { $app->enqueueMessage( - 'MokoOnyx migration: installation failed. ' + 'MokoOnyx migration: automatic installation failed. ' . 'Please install MokoOnyx manually from ' . 'Gitea Releases.', 'warning' @@ -74,10 +70,13 @@ class MokoBridgeMigration return false; } - // 3. Migrate template styles + // 3. Copy user files (custom themes, user.css, user.js) + self::copyAndRename(); + + // 4. Migrate template styles and params self::migrateStyles(); - // 4. Notify admin + // 5. Notify admin self::notifyUser($app); self::log('Bridge migration completed successfully.'); @@ -245,6 +244,58 @@ class MokoBridgeMigration self::log('Migrated ' . count($oldStyles) . ' template style(s).'); } + /** + * Copy user-specific files from MokoCassiopeia to MokoOnyx. + * Only copies custom themes, user.css, and user.js — not the full template. + * MokoOnyx must already be installed (via download or manual). + */ + private static function copyAndRename(): bool + { + $oldMedia = JPATH_ROOT . '/media/templates/site/' . self::OLD_NAME; + $newMedia = JPATH_ROOT . '/media/templates/site/' . self::NEW_NAME; + + if (!is_dir($newMedia)) { + self::log('Bridge: MokoOnyx media dir not found — cannot copy user files', 'warning'); + return false; + } + + $copied = 0; + + // Copy custom theme palettes + $userFiles = [ + 'css/theme/light.custom.css', + 'css/theme/dark.custom.css', + 'css/theme/light.custom.min.css', + 'css/theme/dark.custom.min.css', + 'css/user.css', + 'css/user.min.css', + 'js/user.js', + 'js/user.min.js', + ]; + + foreach ($userFiles as $relPath) { + $srcFile = $oldMedia . '/' . $relPath; + $dstFile = $newMedia . '/' . $relPath; + if (is_file($srcFile) && !is_file($dstFile)) { + $dstDir = dirname($dstFile); + if (!is_dir($dstDir)) { + mkdir($dstDir, 0755, true); + } + copy($srcFile, $dstFile); + $copied++; + } + } + + // Copy favicon directory + $faviconSrc = JPATH_ROOT . '/images/favicons'; + if (is_dir($faviconSrc)) { + self::log('Bridge: favicons already at images/favicons — shared between templates'); + } + + self::log("Bridge: copied {$copied} user file(s) to MokoOnyx"); + return true; + } + private static function notifyUser($app): void { $app->enqueueMessage( diff --git a/src/joomla.asset.json b/src/joomla.asset.json index d7e96fd..fbe1607 100644 --- a/src/joomla.asset.json +++ b/src/joomla.asset.json @@ -17,7 +17,7 @@ "defgroup": "Joomla.Template.Site", "ingroup": "MokoCassiopeia.Template.Assets", "path": "./media/templates/site/mokocassiopeia/joomla.asset.json", - "version": "03.10.11", + "version": "03.10.12", "brief": "Joomla asset registry for MokoCassiopeia" } }, diff --git a/src/templateDetails.xml b/src/templateDetails.xml index cb7e4a9..4fef7f3 100644 --- a/src/templateDetails.xml +++ b/src/templateDetails.xml @@ -39,13 +39,13 @@ MokoCassiopeia - 03.10.11 + 03.10.12 script.php - 2026-04-15 + 2026-04-19 Jonathan Miller || Moko Consulting hello@mokoconsulting.tech (C)GNU General Public License Version 3 - 2026 Moko Consulting - Version 03.10.11 License Joomla PHP

MokoCassiopeia Template Description

MokoCassiopeia continues Joomla's tradition of space-themed default templates— building on the legacy of Solarflare (Joomla 1.0), Milkyway (Joomla 1.5), and Protostar (Joomla 3.0).

This template is a customized fork of the Cassiopeia template introduced in Joomla 4, preserving its modern, accessible, and mobile-first foundation while introducing new stylistic enhancements and structural refinements specifically tailored for use by Moko Consulting.

Custom Colour Themes

Starter palette files are included with the template. To create a custom colour scheme, copy templates/mokocassiopeia/templates/light.custom.css to media/templates/site/mokocassiopeia/css/theme/light.custom.css, or templates/mokocassiopeia/templates/dark.custom.css to media/templates/site/mokocassiopeia/css/theme/dark.custom.css. Customise the CSS variables to match your brand, then activate your palette in System → Site Templates → MokoCassiopeia → Theme tab by selecting "Custom" for the Light or Dark Mode Palette. A full variable reference is available in the CSS Variables tab in template options.

Custom CSS & JavaScript

For site-specific styles and scripts that should survive template updates, create the following files:

  • media/templates/site/mokocassiopeia/css/user.css — loaded on every page for custom CSS overrides.
  • media/templates/site/mokocassiopeia/js/user.js — loaded on every page for custom JavaScript.

These files are gitignored and will not be overwritten by template updates.

Code Attribution

This template is based on the original Cassiopeia template developed by the Joomla! Project and released under the GNU General Public License.

Modifications and enhancements have been made by Moko Consulting in accordance with open-source licensing standards.

It includes integration with Bootstrap TOC, an open-source table of contents generator by A. Feld, licensed under the MIT License.

All third-party libraries and assets remain the property of their respective authors and are credited within their source files where applicable.

]]>
+ Version 03.10.12 License Joomla PHP

MokoCassiopeia Template Description

MokoCassiopeia continues Joomla's tradition of space-themed default templates— building on the legacy of Solarflare (Joomla 1.0), Milkyway (Joomla 1.5), and Protostar (Joomla 3.0).

This template is a customized fork of the Cassiopeia template introduced in Joomla 4, preserving its modern, accessible, and mobile-first foundation while introducing new stylistic enhancements and structural refinements specifically tailored for use by Moko Consulting.

Custom Colour Themes

Starter palette files are included with the template. To create a custom colour scheme, copy templates/mokocassiopeia/templates/light.custom.css to media/templates/site/mokocassiopeia/css/theme/light.custom.css, or templates/mokocassiopeia/templates/dark.custom.css to media/templates/site/mokocassiopeia/css/theme/dark.custom.css. Customise the CSS variables to match your brand, then activate your palette in System → Site Templates → MokoCassiopeia → Theme tab by selecting "Custom" for the Light or Dark Mode Palette. A full variable reference is available in the CSS Variables tab in template options.

Custom CSS & JavaScript

For site-specific styles and scripts that should survive template updates, create the following files:

  • media/templates/site/mokocassiopeia/css/user.css — loaded on every page for custom CSS overrides.
  • media/templates/site/mokocassiopeia/js/user.js — loaded on every page for custom JavaScript.

These files are gitignored and will not be overwritten by template updates.

Code Attribution

This template is based on the original Cassiopeia template developed by the Joomla! Project and released under the GNU General Public License.

Modifications and enhancements have been made by Moko Consulting in accordance with open-source licensing standards.

It includes integration with Bootstrap TOC, an open-source table of contents generator by A. Feld, licensed under the MIT License.

All third-party libraries and assets remain the property of their respective authors and are credited within their source files where applicable.

]]>
1 component.php diff --git a/updates.xml b/updates.xml index 38420c3..ef50d31 100644 --- a/updates.xml +++ b/updates.xml @@ -1,7 +1,7 @@ @@ -13,11 +13,11 @@ mokocassiopeia template site - 03.10.11 + 03.10.12 2026-04-19 https://git.mokoconsulting.tech/MokoConsulting/MokoCassiopeia/releases/tag/development - https://git.mokoconsulting.tech/MokoConsulting/MokoCassiopeia/releases/download/development/mokocassiopeia-03.10.11-dev.zip + https://git.mokoconsulting.tech/MokoConsulting/MokoCassiopeia/releases/download/development/mokocassiopeia-03.10.12-dev.zip 1e34ddbe6a28114100fcb1bb995b9a7b4ccbec8468a7a1f73022440f4ac3ddfc development @@ -34,11 +34,11 @@ mokocassiopeia template site - 03.10.11 + 03.10.12 2026-04-19 https://git.mokoconsulting.tech/MokoConsulting/MokoCassiopeia/releases/tag/alpha - https://git.mokoconsulting.tech/MokoConsulting/MokoCassiopeia/releases/download/v03/mokocassiopeia-03.10.11.zip + https://git.mokoconsulting.tech/MokoConsulting/MokoCassiopeia/releases/download/v03/mokocassiopeia-03.10.12.zip fac226ed62e79a01dd01b6184e832a4e8c927c7b7a5ac18cc645332cd87af33d alpha @@ -55,11 +55,11 @@ mokocassiopeia template site - 03.10.11 + 03.10.12 2026-04-19 https://git.mokoconsulting.tech/MokoConsulting/MokoCassiopeia/releases/tag/beta - https://git.mokoconsulting.tech/MokoConsulting/MokoCassiopeia/releases/download/v03/mokocassiopeia-03.10.11.zip + https://git.mokoconsulting.tech/MokoConsulting/MokoCassiopeia/releases/download/v03/mokocassiopeia-03.10.12.zip fac226ed62e79a01dd01b6184e832a4e8c927c7b7a5ac18cc645332cd87af33d beta @@ -76,12 +76,12 @@ mokocassiopeia template site - 03.10.11 + 03.10.12 2026-04-19 https://git.mokoconsulting.tech/MokoConsulting/MokoCassiopeia/releases/tag/release-candidate - https://git.mokoconsulting.tech/MokoConsulting/MokoCassiopeia/releases/download/v03/mokocassiopeia-03.10.11.zip - https://github.com/mokoconsulting-tech/MokoCassiopeia/releases/download/v03/mokocassiopeia-03.10.11.zip + https://git.mokoconsulting.tech/MokoConsulting/MokoCassiopeia/releases/download/v03/mokocassiopeia-03.10.12.zip + https://github.com/mokoconsulting-tech/MokoCassiopeia/releases/download/v03/mokocassiopeia-03.10.12.zip fac226ed62e79a01dd01b6184e832a4e8c927c7b7a5ac18cc645332cd87af33d rc @@ -98,12 +98,12 @@ mokocassiopeia template site - 03.10.11 + 03.10.12 2026-04-19 https://git.mokoconsulting.tech/MokoConsulting/MokoCassiopeia/releases/tag/v03 - https://git.mokoconsulting.tech/MokoConsulting/MokoCassiopeia/releases/download/v03/mokocassiopeia-03.10.11.zip - https://github.com/mokoconsulting-tech/MokoCassiopeia/releases/download/v03/mokocassiopeia-03.10.11.zip + https://git.mokoconsulting.tech/MokoConsulting/MokoCassiopeia/releases/download/v03/mokocassiopeia-03.10.12.zip + https://github.com/mokoconsulting-tech/MokoCassiopeia/releases/download/v03/mokocassiopeia-03.10.12.zip fac226ed62e79a01dd01b6184e832a4e8c927c7b7a5ac18cc645332cd87af33d stable