Skip to content

Commit

Permalink
Merge pull request #31633 from ufundo/standalone-allow-dark-mode
Browse files Browse the repository at this point in the history
Enable Riverlea extension (*not* theme) + dark mode on new Standalone installs
  • Loading branch information
colemanw authored Dec 19, 2024
2 parents 35abd0e + b61a3be commit 8c386bf
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions setup/plugins/init/StandaloneRiverlea.civi-setup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
/**
* @file
*
* Enable Riverlea by default on Standalone installs.
* - this does not *select* a Riverlea theme but removes one step for doing so
* - we set dark_mode setting to inherit instead of always light (which is the default for other CMS)
*
*/

if (!defined('CIVI_SETUP')) {
exit("Installation plugins must only be loaded by the installer.\n");
}

\Civi\Setup::dispatcher()
->addListener('civi.setup.init', function (\Civi\Setup\Event\InitEvent $e) {
$model = $e->getModel();
if ($model->cms !== 'Standalone') {
return;
}
\Civi\Setup::log()->info(sprintf('[%s] Handle %s', basename(__FILE__), 'init'));

$e->getModel()->extensions[] = 'riverlea';
$e->getModel()->settings['riverlea_dark_mode_frontend'] = 'inherit';
$e->getModel()->settings['riverlea_dark_mode_backend'] = 'inherit';
});

0 comments on commit 8c386bf

Please sign in to comment.