fix: address PR review issues and add configurable slide transitions

Fix CSS injection on heroHeight with regex validation, add missing
language keys to .sys.ini files, fix plugin manifest languages folder
attribute and display name, narrow catch to \Exception with logging,
add error handling to pkg_script auto-enable, fix mobile CSS for
color/gradient modes, add SPDX headers, remove dead code, and update
stale file path headers.

Add configurable transition type for image slideshow: crossfade, slide,
fade-to-black, and zoom (Ken Burns).

Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan Miller
2026-06-04 06:46:47 -05:00
parent 902321de47
commit 601cf77170
13 changed files with 220 additions and 45 deletions
+27 -11
View File
@@ -16,7 +16,7 @@ use Joomla\CMS\Installer\InstallerAdapter;
class Pkg_MokoJoomHeroInstallerScript
{
/**
* Called after install/update.
* Called after install/update — only enables the system plugin on fresh install.
*
* @param string $type Action type
* @param InstallerAdapter $parent Installer adapter
@@ -26,18 +26,34 @@ class Pkg_MokoJoomHeroInstallerScript
public function postflight(string $type, InstallerAdapter $parent): void
{
if ($type === 'install') {
$db = Factory::getDbo();
try {
$db = Factory::getDbo();
// Enable the system plugin automatically on fresh install
$query = $db->getQuery(true)
->update($db->quoteName('#__extensions'))
->set($db->quoteName('enabled') . ' = 1')
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
->where($db->quoteName('folder') . ' = ' . $db->quote('system'))
->where($db->quoteName('element') . ' = ' . $db->quote('mokojoomhero'));
// Enable the system plugin automatically on fresh install
$query = $db->getQuery(true)
->update($db->quoteName('#__extensions'))
->set($db->quoteName('enabled') . ' = 1')
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
->where($db->quoteName('folder') . ' = ' . $db->quote('system'))
->where($db->quoteName('element') . ' = ' . $db->quote('mokojoomhero'));
$db->setQuery($query);
$db->execute();
$db->setQuery($query);
$db->execute();
if ($db->getAffectedRows() === 0) {
Factory::getApplication()->enqueueMessage(
'MokoJoomHero: The system plugin could not be auto-enabled. '
. 'Please enable it manually in Extensions &rarr; Plugins.',
'warning'
);
}
} catch (\Exception $e) {
Factory::getApplication()->enqueueMessage(
'MokoJoomHero: Failed to auto-enable system plugin: ' . $e->getMessage()
. ' — Please enable it manually in Extensions &rarr; Plugins.',
'warning'
);
}
}
}
}