Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass menubar_color as a param. Simplify cache mechanics. #8

Merged
merged 1 commit into from
Apr 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions CRM/Admin/Form/Preferences/Display.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ public function postProcess() {

$this->postProcessCommon();

\Civi::service('asset_builder')->clear();

// If "Configure CKEditor" button was clicked
if (!empty($this->_params['ckeditor_config'])) {
// Suppress the "Saved" status message and redirect to the CKEditor Config page
Expand Down
6 changes: 4 additions & 2 deletions CRM/Core/Resources.php
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,9 @@ public function coreResourceList($region) {
$items[] = 'bower_components/smartmenus/dist/jquery.smartmenus.min.js';
$items[] = 'bower_components/smartmenus/dist/addons/keyboard/jquery.smartmenus.keyboard.min.js';
$items[] = 'js/crm.menubar.js';
$items[] = Civi::service('asset_builder')->getUrl('crm-menubar.css');
$items[] = Civi::service('asset_builder')->getUrl('crm-menubar.css', [
'color' => Civi::settings()->get('menubar_color'),
]);
$items[] = [
'menubar' => [
'position' => $position,
Expand Down Expand Up @@ -844,7 +846,7 @@ public static function renderMenubarStylesheet(GenericHookEvent $e) {
foreach ($items as $item) {
$e->content .= file_get_contents(self::singleton()->getPath('civicrm', $item));
}
$color = Civi::settings()->get('menubar_color');
$color = $e->params['color'];
if (!CRM_Utils_Rule::color($color)) {
$color = Civi::settings()->getDefault('menubar_color');
}
Expand Down