-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbean.api.php
77 lines (70 loc) · 1.65 KB
/
bean.api.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
69
70
71
72
73
74
75
76
77
<?php
/**
* Implements hook_bean_types_api_info().
*
* Tell the bean module that you are implemented a plugin and
* which version of the API are you using.
*
* THIS IS REQUIRED
*/
function hook_bean_types_api_info() {
return array(
'api' => 4,
);
}
/**
* Implements hook_bean_types().
*
* Beans uses plugins to define the block types.
* All plugin files must be registered in the .info file.
*/
function hook_bean_types() {
$plugins = array();
$plugins['plugin_key'] = array(
'label' => t('Title'),
'description' => t('Description'),
// This is optional. Set it to TRUE if you do not want the plugin to be
// displayed in the UI.
'abstract' => FALSE,
'handler' => array(
'class' => 'ClassName',
'parent' => 'bean',
// This should be pointing to the path of your custom bean plugin module.
'path' => backdrop_get_path('module', 'example_bean') . '/plugins',
// Class files should be named accordingly in order to support
// autoloading procedures.
'file' => 'ClassName.class.php',
),
);
return $plugins;
}
/**
* Implements hook_bean_access().
*
* Access callback for beans
*
* @param $bean
* The fully loaded bean object
* @param $op
* The access type of view, edit, delete, create
* @param $account
* The user account
*
* @return boolean
* True if access is allowed, FALSE if not.
*/
function hook_bean_access($bean, $op, $account) {
return TRUE;
}
/**
* Implements hook_bean_submit().
*
* React to the bean form submit.
*/
function hook_bean_form_submit($form, $form_state) {
}
/**
* Implements hook_bean_cache_clear().
*/
function hook_bean_cache_clear() {
}