From 07c0c047c51425a78f9265b2e1da1d58b300aed2 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 14 Sep 2020 00:21:38 -0700 Subject: [PATCH] greenwich - Declare theme. Use the new bootstrap3.css --- ext/greenwich/greenwich.php | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/ext/greenwich/greenwich.php b/ext/greenwich/greenwich.php index 3d2905f058..14c312e0a2 100644 --- a/ext/greenwich/greenwich.php +++ b/ext/greenwich/greenwich.php @@ -33,8 +33,29 @@ function greenwich_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { } /** - * Implements hook_civicrm_thems(). + * Implements hook_civicrm_themes(). */ function greenwich_civicrm_themes(&$themes) { - _greenwich_civix_civicrm_themes($themes); + // _greenwich_civix_civicrm_themes($themes); + $themes['greenwich'] = [ + 'ext' => 'civicrm', + 'title' => 'Greenwich', + 'help' => ts('CiviCRM 4.x look-and-feel'), + ]; +} + +/** + * Implements hook_civicrm_alterBundle(). + */ +function greenwich_civicrm_alterBundle(CRM_Core_Resources_Bundle $bundle) { + $theme = Civi::service('themes')->getActiveThemeKey(); + switch ($theme . ':' . $bundle->name) { + case 'greenwich:bootstrap3': + $bundle->clear(); + $bundle->addStyleFile('greenwich', 'dist/bootstrap3.css'); + $bundle->addScriptFile('greenwich', 'extern/bootstrap3/assets/javascripts/bootstrap.min.js', [ + 'translate' => FALSE, + ]); + break; + } } -- 2.25.1