-
Notifications
You must be signed in to change notification settings - Fork 0
/
finsburypark.php
executable file
·68 lines (61 loc) · 1.76 KB
/
finsburypark.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
require_once 'finsburypark.civix.php';
use CRM_Finsburypark_ExtensionUtil as E;
/**
* Implements hook_civicrm_config().
*
* @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_config/
*/
function finsburypark_civicrm_config(&$config) {
_finsburypark_civix_civicrm_config($config);
}
/**
* Implements hook_civicrm_alterBundle(). Add Bootstrap.
*/
function finsburypark_civicrm_alterBundle(CRM_Core_Resources_Bundle $bundle) {
$theme = Civi::service('themes')->getActiveThemeKey();
if ($theme !== 'finsburypark') {
return;
}
switch ($theme . ':' . $bundle->name) {
case 'finsburypark:bootstrap3':
$bundle->clear();
$bundle->addStyleFile('finsburypark', 'css/bootstrap3.css');
$bundle->addScriptFile('finsburypark', 'js/bootstrap.min.js', [
'translate' => FALSE,
]);
$bundle->addScriptFile('finsburypark', 'js/noConflict.js', [
'translate' => FALSE,
]);
break;
}
if ($bundle->name == 'coreStyles') {
$bundle->filter(function($snippet) {
if ($snippet['name'] == 'civicrm:css/civicrm.css') {
$snippet['weight'] = 290;
return $snippet;
}
elseif (($snippet['name'] == 'civicrm:css/custom.css') or (strpos($snippet['name'], 'custom.css') !== false)) {
$snippet['weight'] = 300;
return $snippet;
}
return TRUE;
});
}
}
/**
* Implements hook_civicrm_install().
*
* @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_install
*/
function finsburypark_civicrm_install() {
_finsburypark_civix_civicrm_install();
}
/**
* Implements hook_civicrm_enable().
*
* @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_enable
*/
function finsburypark_civicrm_enable() {
_finsburypark_civix_civicrm_enable();
}