forked from drupal-media/entity_browser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entity_browser.api.php
77 lines (68 loc) · 2.31 KB
/
entity_browser.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
/**
* @file
* Hooks related to entity browser and it's plugins.
*/
/**
* @addtogroup hooks
* @{
*/
/**
* Alter the information provided in \Drupal\entity_browser\Annotation\EntityBrowserDisplay.
*
* @param array $displays
* The array of display plugins, keyed on the machine-readable name.
*/
function hook_entity_browser_display_info_alter(array &$displays) {
$displays['modal_display']['label'] = t('Superb fancy stuff!');
}
/**
* Alter the information provided in \Drupal\entity_browser\Annotation\EntityBrowserWidget.
*
* @param array $widgets
* The array of widget plugins, keyed on the machine-readable name.
*/
function hook_entity_browser_widget_info_alter(array &$widgets) {
$widgets['view_widget']['label'] = t('Views FTW!');
}
/**
* Alter the information provided in \Drupal\entity_browser\Annotation\SelectionDisplay.
*
* @param array $selection_displays
* The array of selection display plugins, keyed on the machine-readable name.
*/
function hook_entity_browser_selection_display_info_alter(array &$selection_displays) {
$selection_displays['no_selection']['label'] = t('Nothing!');
}
/**
* Alter the information provided in \Drupal\entity_browser\Annotation\EntityBrowserWidgetSelector.
*
* @param array $widget_selectors
* The array of widget selector plugins, keyed on the machine-readable name.
*/
function hook_entity_browser_widget_selector_info_alter(array &$widget_selectors) {
$widgets['tab_selector']['label'] = t('Tabs are for winners');
}
/**
* Alter the information provided in \Drupal\entity_browser\Annotation\EntityBrowserFieldWidgetDisplay.
*
* @param array $field_displays
* The array of field widget display plugins, keyed on the machine-readable
* name.
*/
function hook_entity_browser_field_widget_display_info_alter(array &$field_displays) {
$field_displays['rendered_entity']['label'] = t('Entity render system FTW');
}
/**
* Alter the information provided in \Drupal\entity_browser\Annotation\EntityBrowserWidgetValidation.
*
* @param array $validation_plugins
* The array of widget validation plugins, keyed on the machine-readable
* name.
*/
function hook_entity_browser_widget_validation_info_alter(array &$validation_plugins) {
$field_displays['not_null']['label'] = t('Not null fabulous validator');
}
/**
* @} End of "addtogroup hooks".
*/