feat: Atum template branding with shipped media assets

Replace CSS-based logo injection with proper Atum template param
enforcement. The plugin now sets logoBrandLarge, logoBrandSmall,
loginLogo, and favicon via #__template_styles params — both at
install time and enforced at runtime.

Media assets shipped with plugin:
- logo.png → sidebar brand (expanded) + login page logo
- favicon_256.png → sidebar brand (collapsed)
- favicon.svg → modern browser favicon (SVG preferred)
- favicon.ico → legacy browser fallback
- favicon_256.png → Apple/Android touch icon

Removed per-config media upload fields (admin_logo, login_logo,
custom_favicon) — images are now fixed in the plugin media folder.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-07 13:17:34 -05:00
parent 241fe08c63
commit be38ab4ad8
5 changed files with 184 additions and 103 deletions
+67
View File
@@ -124,6 +124,7 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface
{
$this->installLanguageOverrides();
$this->updateLoginSupportUrls();
$this->updateAtumBranding();
}
return true;
@@ -370,6 +371,72 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface
);
}
/**
* Set Atum admin template branding params at install time.
*
* @return void
*
* @since 02.00.00
*/
private function updateAtumBranding()
{
$mediaBase = 'media/plg_system_mokowaas/';
$expected = [
'logoBrandLarge' => $mediaBase . 'logo.png',
'logoBrandSmall' => $mediaBase . 'favicon_256.png',
'loginLogo' => $mediaBase . 'logo.png',
'logoBrandLargeAlt' => '',
'logoBrandSmallAlt' => '',
'loginLogoAlt' => '',
'emptyLogoBrandLargeAlt' => '1',
'emptyLogoBrandSmallAlt' => '1',
'emptyLoginLogoAlt' => '1',
];
$db = Factory::getDbo();
$query = $db->getQuery(true)
->select([$db->quoteName('id'), $db->quoteName('params')])
->from($db->quoteName('#__template_styles'))
->where($db->quoteName('template') . ' = '
. $db->quote('atum'))
->where($db->quoteName('client_id') . ' = 1');
$db->setQuery($query);
$styles = $db->loadObjectList();
if (empty($styles))
{
return;
}
foreach ($styles as $style)
{
$params = new \Joomla\Registry\Registry(
$style->params ?: '{}'
);
foreach ($expected as $key => $value)
{
$params->set($key, $value);
}
$update = $db->getQuery(true)
->update($db->quoteName('#__template_styles'))
->set($db->quoteName('params') . ' = '
. $db->quote($params->toString()))
->where($db->quoteName('id') . ' = '
. (int) $style->id);
$db->setQuery($update);
$db->execute();
}
Factory::getApplication()->enqueueMessage(
'Updated Atum template branding.', 'message'
);
}
/**
* Remove only MokoWaaS overrides from Joomla's global override files.
*