feat: add submenu icons via FA6 CSS injection and sync menu icons on install
Generic: Repo Health / Scripts governance (push) Has been cancelled
Generic: Repo Health / Repository health (push) Has been cancelled
Generic: Repo Health / Report Issues (push) Has been cancelled
Generic: Repo Health / Site Health (push) Has been cancelled
Generic: Repo Health / Access control (push) Has been cancelled
Universal: Auto Version Bump / Version Bump (push) Has been cancelled

- Inject Font Awesome 6 icons for Dashboard, Backups, and Profiles submenu
  items via MokoJoomBackupComponent::boot() using WebAssetManager
- Add syncMenuIcons() to installer script to set img column in #__menu
  on both install and update (Joomla doesn't refresh icons on upgrade)
- Add encryptionPassword property to SteppedSession for stepped backup
  encryption support
This commit is contained in:
Jonathan Miller
2026-06-07 08:58:52 -05:00
parent 3ee620eca1
commit 6e18c77670
3 changed files with 65 additions and 0 deletions
+38
View File
@@ -203,12 +203,50 @@ class Pkg_MokoJoomBackupInstallerScript
}
}
// Sync submenu icons in #__menu (Joomla doesn't update icons on upgrades)
$this->syncMenuIcons();
// Warn if no license key configured (skip on uninstall)
if ($type !== 'uninstall') {
$this->warnMissingLicenseKey();
}
}
private function syncMenuIcons(): void
{
$iconMap = [
'view=dashboard' => 'class:home',
'view=backups' => 'class:database',
'view=profiles' => 'class:cog',
];
try {
$db = Factory::getDbo();
foreach ($iconMap as $linkFragment => $icon) {
$query = $db->getQuery(true)
->update($db->quoteName('#__menu'))
->set($db->quoteName('img') . ' = ' . $db->quote($icon))
->where($db->quoteName('client_id') . ' = 1')
->where($db->quoteName('link') . ' LIKE ' . $db->quote('%com_mokojoombackup%' . $linkFragment . '%'));
$db->setQuery($query);
$db->execute();
}
// Set top-level component menu icon
$query = $db->getQuery(true)
->update($db->quoteName('#__menu'))
->set($db->quoteName('img') . ' = ' . $db->quote('class:archive'))
->where($db->quoteName('client_id') . ' = 1')
->where($db->quoteName('link') . ' LIKE ' . $db->quote('index.php?option=com_mokojoombackup'))
->where($db->quoteName('level') . ' = 1');
$db->setQuery($query);
$db->execute();
} catch (\Throwable $e) {
// Non-critical
}
}
/**
* Restore the download key to the (possibly new) update site record.
*/