Skip to content

Commit

Permalink
enable Riverlea extension+dark mode by default on Standalone installs
Browse files Browse the repository at this point in the history
  • Loading branch information
ufundo committed Dec 19, 2024
1 parent 33946c8 commit b61a3be
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 b61a3be

Please sign in to comment.