-
-
Notifications
You must be signed in to change notification settings - Fork 823
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31633 from ufundo/standalone-allow-dark-mode
Enable Riverlea extension (*not* theme) + dark mode on new Standalone installs
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | ||
}); |