greenwich - Declare theme. Use the new bootstrap3.css
authorTim Otten <totten@civicrm.org>
Mon, 14 Sep 2020 07:21:38 +0000 (00:21 -0700)
committerTim Otten <totten@civicrm.org>
Thu, 17 Sep 2020 02:54:06 +0000 (19:54 -0700)
ext/greenwich/greenwich.php

index 3d2905f0583811876eaaaab5387438bbdb6a3553..14c312e0a2483ea0ce7a90cdd51ce6e6b1b06b95 100644 (file)
@@ -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;
+  }
 }