feat: auto-install mokocassiopeia, set as default, lock template

Minor version bump to 02.01.01:
- Auto-install mokocassiopeia from GitHub if not present
- Lock and protect the template (cannot be disabled/uninstalled)
- Set mokocassiopeia as default site template

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-07 16:22:01 -05:00
parent 7fdfaac7fb
commit c81e409a57
4 changed files with 46 additions and 7 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "mokoconsulting-tech/mokowaas",
"description": "MokoWaaS Joomla component by Moko Consulting",
"type": "joomla-component",
"version": "02.00.03",
"version": "02.01.01",
"license": "GPL-3.0-or-later",
"authors": [
{
+2 -2
View File
@@ -16,7 +16,7 @@
DEFGROUP: Joomla.Plugin
INGROUP: MokoWaaS
REPO: https://github.com/mokoconsulting-tech/mokowaas
VERSION: 02.00.03
VERSION: 02.01.01
PATH: /src/mokowaas.xml
BRIEF: Plugin manifest for MokoWaaS system plugin
NOTE: Defines installation metadata, files, and configuration for Joomla
@@ -29,7 +29,7 @@
<license>GNU General Public License version 3 or later; see LICENSE.md</license>
<authorEmail>hello@mokoconsulting.tech</authorEmail>
<authorUrl>https://mokoconsulting.tech</authorUrl>
<version>02.00.03</version>
<version>02.01.01</version>
<description>This plugin rebrands the Joomla system interface with MokoWaaS identity. It applies language overrides and ensures consistent branding across the platform.</description>
<namespace path=".">Moko\Plugin\System\MokoWaaS</namespace>
<scriptfile>script.php</scriptfile>
+40 -1
View File
@@ -233,7 +233,7 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface
if ($template)
{
// Lock and protect
// Lock, protect, and set as default
$db->setQuery(
$db->getQuery(true)
->update($db->quoteName('#__extensions'))
@@ -245,6 +245,9 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface
);
$db->execute();
// Set as default site template
$this->setDefaultTemplate('mokocassiopeia', 0);
return;
}
@@ -302,6 +305,42 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface
}
}
/**
* Set a template as the default for a given client.
*
* @param string $template Template element name
* @param int $clientId 0 = site, 1 = admin
*
* @return void
*
* @since 02.01.01
*/
private function setDefaultTemplate($template, $clientId)
{
$db = Factory::getDbo();
// Unset all other defaults for this client
$db->setQuery(
$db->getQuery(true)
->update($db->quoteName('#__template_styles'))
->set($db->quoteName('home') . ' = 0')
->where($db->quoteName('client_id') . ' = ' . $clientId)
->where($db->quoteName('home') . ' = 1')
);
$db->execute();
// Set our template as default
$db->setQuery(
$db->getQuery(true)
->update($db->quoteName('#__template_styles'))
->set($db->quoteName('home') . ' = 1')
->where($db->quoteName('template') . ' = '
. $db->quote($template))
->where($db->quoteName('client_id') . ' = ' . $clientId)
);
$db->execute();
}
private const BLOCK_START = '; ===== BEGIN MokoWaaS Overrides (do not edit this block) =====';
/** Sentinel comment that marks the end of MokoWaaS overrides inside a Joomla override file. */
+3 -3
View File
@@ -16,7 +16,7 @@
DEFGROUP: Joomla.UpdateServer
INGROUP: MokoWaaS
REPO: https://github.com/mokoconsulting-tech/mokowaas
VERSION: 02.00.03
VERSION: 02.01.01
PATH: /updates.xml
BRIEF: Joomla update server XML feed for automatic plugin updates
NOTE: This file is automatically updated by GitHub Actions on each release
@@ -29,10 +29,10 @@
<type>plugin</type>
<folder>system</folder>
<client>site</client>
<version>02.00.03</version>
<version>02.01.01</version>
<infourl title="MokoWaaS">https://github.com/mokoconsulting-tech/mokowaas</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/mokoconsulting-tech/MokoWaaS/releases/download/02.00.03/MokoWaaS-02.00.03.zip</downloadurl>
<downloadurl type="full" format="zip">https://github.com/mokoconsulting-tech/MokoWaaS/releases/download/02.01.01/MokoWaaS-02.01.01.zip</downloadurl>
</downloads>
<maintainer>Moko Consulting</maintainer>
<maintainerurl>https://mokoconsulting.tech</maintainerurl>