diff --git a/src/index.html b/src/index.html new file mode 100644 index 00000000..71695153 --- /dev/null +++ b/src/index.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/language/en-GB/index.html b/src/language/en-GB/index.html new file mode 100644 index 00000000..71695153 --- /dev/null +++ b/src/language/en-GB/index.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/language/en-GB/plg_system_mokowaasbrand.ini b/src/language/en-GB/plg_system_mokowaasbrand.ini new file mode 100644 index 00000000..0b26cd26 --- /dev/null +++ b/src/language/en-GB/plg_system_mokowaasbrand.ini @@ -0,0 +1,22 @@ +; ----------------------------------------------------------------------------- +; Copyright (C) 2025 Moko Consulting +; This file is part of a Moko Consulting project. +; SPDX-License-Identifier: GPL-3.0-or-later +; REPO: https://github.com/mokoconsulting-tech/mokowaasbrand +; ----------------------------------------------------------------------------- +; FILE INFORMATION +; Defgroup: Joomla Language +; Ingroup: MokoWaaS-Brand +; Version: 01.03.00 +; File: plg_system_mokowaasbrand.ini +; Path: /src/language/en-GB/plg_system_mokowaasbrand.ini +; Brief: English language strings for MokoWaaS-Brand system plugin +; Notes: Contains translatable strings for plugin functionality +; Variables: (none) +; ----------------------------------------------------------------------------- + +PLG_SYSTEM_MOKOWAASBRAND="System - MokoWaaS Brand" +PLG_SYSTEM_MOKOWAASBRAND_XML_DESCRIPTION="This plugin rebrands the Joomla system interface with MokoWaaS identity. It applies language overrides and ensures consistent branding across the platform." + +PLG_SYSTEM_MOKOWAASBRAND_ENABLE_BRANDING_LABEL="Enable Branding" +PLG_SYSTEM_MOKOWAASBRAND_ENABLE_BRANDING_DESC="Enable or disable the MokoWaaS branding across the system." diff --git a/src/language/en-GB/plg_system_mokowaasbrand.sys.ini b/src/language/en-GB/plg_system_mokowaasbrand.sys.ini new file mode 100644 index 00000000..016e5368 --- /dev/null +++ b/src/language/en-GB/plg_system_mokowaasbrand.sys.ini @@ -0,0 +1,19 @@ +; ----------------------------------------------------------------------------- +; Copyright (C) 2025 Moko Consulting +; This file is part of a Moko Consulting project. +; SPDX-License-Identifier: GPL-3.0-or-later +; REPO: https://github.com/mokoconsulting-tech/mokowaasbrand +; ----------------------------------------------------------------------------- +; FILE INFORMATION +; Defgroup: Joomla Language +; Ingroup: MokoWaaS-Brand +; Version: 01.03.00 +; File: plg_system_mokowaasbrand.sys.ini +; Path: /src/language/en-GB/plg_system_mokowaasbrand.sys.ini +; Brief: System language strings for MokoWaaS-Brand plugin installation +; Notes: Contains strings used during plugin installation and management +; Variables: (none) +; ----------------------------------------------------------------------------- + +PLG_SYSTEM_MOKOWAASBRAND="System - MokoWaaS Brand" +PLG_SYSTEM_MOKOWAASBRAND_XML_DESCRIPTION="This plugin rebrands the Joomla system interface with MokoWaaS identity. It applies language overrides and ensures consistent branding across the platform." diff --git a/src/mokowaasbrand.php b/src/mokowaasbrand.php new file mode 100644 index 00000000..f5152496 --- /dev/null +++ b/src/mokowaasbrand.php @@ -0,0 +1,119 @@ + + * + * This file is part of a Moko Consulting project. + * + * SPDX-LICENSE-IDENTIFIER: GPL-3.0-or-later + * + * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License (./LICENSE.md). + * + * FILE INFORMATION + * DEFGROUP: Joomla.Plugin + * INGROUP: MokoWaaS-Brand + * REPO: https://github.com/mokoconsulting-tech/mokowaasbrand + * VERSION: 01.03.00 + * PATH: /src/mokowaasbrand.php + * BRIEF: Main plugin file for MokoWaaS-Brand system plugin + * NOTE: Handles Joomla system events for rebranding functionality + */ + +defined('_JEXEC') or die; + +use Joomla\CMS\Plugin\CMSPlugin; +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; + +/** + * MokoWaaS Brand System Plugin + * + * This plugin rebrands the Joomla system interface with MokoWaaS identity. + * It applies language overrides and ensures consistent branding across the platform. + * + * @since 01.03.00 + */ +class PlgSystemMokoWaaSBrand extends CMSPlugin +{ + /** + * Load the language file on instantiation. + * + * @var boolean + * @since 01.03.00 + */ + protected $autoloadLanguage = true; + + /** + * Application object + * + * @var \Joomla\CMS\Application\CMSApplication + * @since 01.03.00 + */ + protected $app; + + /** + * Event triggered after the framework has loaded and the application initialise method has been called. + * + * @return void + * + * @since 01.03.00 + */ + public function onAfterInitialise() + { + if (!$this->params->get('enable_branding', 1)) + { + return; + } + + $this->loadLanguageOverrides(); + } + + /** + * Event triggered after the route has been determined. + * + * @return void + * + * @since 01.03.00 + */ + public function onAfterRoute() + { + if (!$this->params->get('enable_branding', 1)) + { + return; + } + + // Apply additional branding logic if needed + } + + /** + * Load language overrides for MokoWaaS branding. + * + * @return void + * + * @since 01.03.00 + */ + protected function loadLanguageOverrides() + { + $lang = Factory::getLanguage(); + $tag = $lang->getTag(); + + // Load language overrides from the plugin's language folder + if ($this->app->isClient('administrator')) + { + $overridePath = JPATH_ADMINISTRATOR . '/language/overrides/' . $tag . '.override.ini'; + } + else + { + $overridePath = JPATH_SITE . '/language/overrides/' . $tag . '.override.ini'; + } + + // Load overrides if the file exists + if (file_exists($overridePath)) + { + $lang->load('', JPATH_BASE, $tag, true); + } + } +} diff --git a/src/mokowaasbrand.xml b/src/mokowaasbrand.xml new file mode 100644 index 00000000..1f018552 --- /dev/null +++ b/src/mokowaasbrand.xml @@ -0,0 +1,70 @@ + + + + PLG_SYSTEM_MOKOWAASBRAND + Moko Consulting + 2025-12-11 + Copyright (C) 2025 Moko Consulting. All rights reserved. + GNU General Public License version 3 or later; see LICENSE.md + hello@mokoconsulting.tech + https://mokoconsulting.tech + 01.03.00 + PLG_SYSTEM_MOKOWAASBRAND_XML_DESCRIPTION + Moko\Plugin\System\MokoWaaSBrand + + + mokowaasbrand.php + services + language + + + + en-GB/plg_system_mokowaasbrand.ini + en-GB/plg_system_mokowaasbrand.sys.ini + + + + + language + + + + + +
+ + + + +
+
+
+
diff --git a/src/services/index.html b/src/services/index.html new file mode 100644 index 00000000..71695153 --- /dev/null +++ b/src/services/index.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/services/provider.php b/src/services/provider.php new file mode 100644 index 00000000..b876d4f6 --- /dev/null +++ b/src/services/provider.php @@ -0,0 +1,59 @@ + + * + * This file is part of a Moko Consulting project. + * + * SPDX-LICENSE-IDENTIFIER: GPL-3.0-or-later + * + * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License (./LICENSE.md). + * + * FILE INFORMATION + * DEFGROUP: Joomla.Plugin + * INGROUP: MokoWaaS-Brand + * REPO: https://github.com/mokoconsulting-tech/mokowaasbrand + * VERSION: 01.03.00 + * PATH: /src/services/provider.php + * BRIEF: Service provider for dependency injection in Joomla 5.x + * NOTE: Registers the plugin with Joomla's DI container + */ + +defined('_JEXEC') or die; + +use Joomla\CMS\Extension\PluginInterface; +use Joomla\CMS\Factory; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use Joomla\Event\DispatcherInterface; + +return new class () implements ServiceProviderInterface { + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * + * @since 01.03.00 + */ + public function register(Container $container) + { + $container->set( + PluginInterface::class, + function (Container $container) { + $plugin = new PlgSystemMokoWaaSBrand( + $container->get(DispatcherInterface::class), + (array) PluginHelper::getPlugin('system', 'mokowaasbrand') + ); + $plugin->setApplication(Factory::getApplication()); + + return $plugin; + } + ); + } +};