-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathbic.php
More file actions
84 lines (72 loc) · 2.03 KB
/
bic.php
File metadata and controls
84 lines (72 loc) · 2.03 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
declare(strict_types = 1);
// phpcs:disable PSR1.Files.SideEffects
require_once 'bic.civix.php';
// phpcs:enable
use CRM_Bic_ExtensionUtil as E;
use Symfony\Component\DependencyInjection\ContainerBuilder;
function _bic_composer_autoload(): void {
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
require_once __DIR__ . '/vendor/autoload.php';
}
}
/**
* Implements hook_civicrm_container().
*
* @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_container/
*/
function bic_civicrm_container(ContainerBuilder $container) {
_bic_composer_autoload();
if (class_exists('\Civi\Bic\ContainerSpecs')) {
$container->addCompilerPass(new \Civi\Bic\ContainerSpecs());
}
}
/**
* Implements hook_civicrm_config().
*/
function bic_civicrm_config(&$config) {
_bic_composer_autoload();
_bic_civix_civicrm_config($config);
}
/**
* Implements hook_civicrm_install().
*/
function bic_civicrm_install() {
_bic_civix_civicrm_install();
}
/**
* Implements hook_civicrm_enable().
*/
function bic_civicrm_enable() {
_bic_civix_civicrm_enable();
}
/**
* Implements hook_civicrm_alterAPIPersmissions().
*
* Set permissions for runner/engine API call
*/
function bic_civicrm_alterAPIPermissions($entity, $action, &$params, &$permissions) {
// TODO: adjust to correct permission
$permissions['bic']['getfromiban'] = ['access CiviCRM'];
$permissions['bic']['findbyiban'] = ['access AJAX API'];
// Public reference data, no authentication needed. #93
$permissions['bic']['get'] = [];
}
/**
* Implements hook_civicrm_navigationMenu().
*
* Inject the 'civicrm/bicList' item unter the 'Search' top menu, unless it's already in there...
*
*/
function bic_civicrm_navigationMenu(&$menu) {
_bic_civix_insert_navigation_menu($menu, 'Search', [
'label' => E::ts('Find Banks', ['domain' => 'org.project60.bic']),
'name' => 'BankLists',
'url' => 'civicrm/bicList',
'permission' => 'access CiviContribute',
'operator' => NULL,
'separator' => 2,
'active' => 1,
]);
_bic_civix_navigationMenu($menu);
}