From 317c4e900a5944f92b3ca59f4e245bd56e067c5f Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Tue, 26 May 2026 12:00:58 -0500 Subject: [PATCH] feat: redirect admin Help menu to configured support URL Replaces hardcoded help.joomla.org and docs.joomla.org links in the Atum template header with the WaaS support URL from plugin config. Uses JS injection in onBeforeCompileHead. Authored-by: Moko Consulting Co-Authored-By: Claude Opus 4.6 (1M context) --- CHANGELOG.md | 1 + .../Extension/MokoWaaS.php | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb097dbc..f5160823 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Alias offline bypass: aliases with offline=No override Joomla's global offline setting, allowing access via alias domain while main site is down - Block non-master users from viewing or editing MokoWaaS plugin settings - Master user bypasses ALL tenant restrictions (install from URL, global config, sysinfo, installer, templates) +- Admin Help menu redirected to configured support URL (replaces help.joomla.org) ### Fixed - Install API endpoint: extract ZIP to temp directory before passing to Joomla Installer (was passing ZIP path directly) diff --git a/src/packages/plg_system_mokowaas/Extension/MokoWaaS.php b/src/packages/plg_system_mokowaas/Extension/MokoWaaS.php index eb5f2c3b..3a2a6fbb 100644 --- a/src/packages/plg_system_mokowaas/Extension/MokoWaaS.php +++ b/src/packages/plg_system_mokowaas/Extension/MokoWaaS.php @@ -936,6 +936,7 @@ class MokoWaaS extends CMSPlugin } $this->injectFavicon($doc); + $this->redirectHelpMenu($doc); // Hide MokoWaaS from plugin list for non-master users if (!$this->isMasterUser()) @@ -975,6 +976,32 @@ class MokoWaaS extends CMSPlugin "); } + /** + * Redirect the admin Help menu link to the configured support URL. + * + * Joomla's Atum template hardcodes the Help link to help.joomla.org. + * This replaces it with the WaaS support URL via JS injection. + * + * @param \Joomla\CMS\Document\HtmlDocument $doc Document object + * + * @return void + * + * @since 02.10.00 + */ + protected function redirectHelpMenu($doc) + { + $supportUrl = $this->params->get('support_url', 'https://mokoconsulting.tech'); + + $doc->addScriptDeclaration(" + document.addEventListener('DOMContentLoaded', function() { + document.querySelectorAll('a[href*=\"help.joomla.org\"], a[href*=\"docs.joomla.org\"]').forEach(function(link) { + link.href = " . json_encode($supportUrl) . "; + link.target = '_blank'; + }); + }); + "); + } + /** * Protect the plugin from being disabled or uninstalled by non-master users. * Does NOT self-heal (no lock) — master users can still disable if needed.