Add MokoWaaSBrand Joomla system plugin files
Co-authored-by: jmiller-moko <230051081+jmiller-moko@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,22 @@
|
||||
; -----------------------------------------------------------------------------
|
||||
; Copyright (C) 2025 Moko Consulting <hello@mokoconsulting.tech>
|
||||
; 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."
|
||||
@@ -0,0 +1,19 @@
|
||||
; -----------------------------------------------------------------------------
|
||||
; Copyright (C) 2025 Moko Consulting <hello@mokoconsulting.tech>
|
||||
; 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."
|
||||
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2025 Moko Consulting <hello@mokoconsulting.tech>
|
||||
*
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright (C) 2025 Moko Consulting <hello@mokoconsulting.tech>
|
||||
|
||||
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.xml
|
||||
BRIEF: Plugin manifest for MokoWaaS-Brand system plugin
|
||||
NOTE: Defines installation metadata, files, and configuration for Joomla
|
||||
-->
|
||||
<extension type="plugin" group="system" method="upgrade">
|
||||
<name>PLG_SYSTEM_MOKOWAASBRAND</name>
|
||||
<author>Moko Consulting</author>
|
||||
<creationDate>2025-12-11</creationDate>
|
||||
<copyright>Copyright (C) 2025 Moko Consulting. All rights reserved.</copyright>
|
||||
<license>GNU General Public License version 3 or later; see LICENSE.md</license>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
<authorUrl>https://mokoconsulting.tech</authorUrl>
|
||||
<version>01.03.00</version>
|
||||
<description>PLG_SYSTEM_MOKOWAASBRAND_XML_DESCRIPTION</description>
|
||||
<namespace path="src">Moko\Plugin\System\MokoWaaSBrand</namespace>
|
||||
|
||||
<files>
|
||||
<filename plugin="mokowaasbrand">mokowaasbrand.php</filename>
|
||||
<folder>services</folder>
|
||||
<folder>language</folder>
|
||||
</files>
|
||||
|
||||
<languages folder="language">
|
||||
<language tag="en-GB">en-GB/plg_system_mokowaasbrand.ini</language>
|
||||
<language tag="en-GB">en-GB/plg_system_mokowaasbrand.sys.ini</language>
|
||||
</languages>
|
||||
|
||||
<administration>
|
||||
<files folder="administrator">
|
||||
<folder>language</folder>
|
||||
</files>
|
||||
</administration>
|
||||
|
||||
<config>
|
||||
<fields name="params">
|
||||
<fieldset name="basic">
|
||||
<field
|
||||
name="enable_branding"
|
||||
type="radio"
|
||||
label="PLG_SYSTEM_MOKOWAASBRAND_ENABLE_BRANDING_LABEL"
|
||||
description="PLG_SYSTEM_MOKOWAASBRAND_ENABLE_BRANDING_DESC"
|
||||
default="1"
|
||||
class="btn-group btn-group-yesno"
|
||||
>
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</config>
|
||||
</extension>
|
||||
@@ -0,0 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2025 Moko Consulting <hello@mokoconsulting.tech>
|
||||
*
|
||||
* 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;
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user