|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* @file |
|
5
|
|
|
* Hooks related to entity browser and it's plugins. |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
/** |
|
9
|
|
|
* @addtogroup hooks |
|
10
|
|
|
* @{ |
|
11
|
|
|
*/ |
|
12
|
|
|
|
|
13
|
|
|
/** |
|
14
|
|
|
* Alter the information provided in \Drupal\entity_browser\Annotation\EntityBrowserDisplay. |
|
15
|
|
|
* |
|
16
|
|
|
* @param array $displays |
|
17
|
|
|
* The array of display plugins, keyed on the machine-readable name. |
|
18
|
|
|
*/ |
|
19
|
|
|
function hook_entity_browser_display_info_alter(array &$displays) { |
|
20
|
|
|
$displays['modal_display']['label'] = t('Superb fancy stuff!'); |
|
21
|
|
|
} |
|
22
|
|
|
|
|
23
|
|
|
/** |
|
24
|
|
|
* Alter the information provided in \Drupal\entity_browser\Annotation\EntityBrowserWidget. |
|
25
|
|
|
* |
|
26
|
|
|
* @param array $widgets |
|
27
|
|
|
* The array of widget plugins, keyed on the machine-readable name. |
|
28
|
|
|
*/ |
|
29
|
|
|
function hook_entity_browser_widget_info_alter(array &$widgets) { |
|
30
|
|
|
$widgets['view_widget']['label'] = t('Views FTW!'); |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* Alter the information provided in \Drupal\entity_browser\Annotation\SelectionDisplay. |
|
35
|
|
|
* |
|
36
|
|
|
* @param array $selection_displays |
|
37
|
|
|
* The array of selection display plugins, keyed on the machine-readable name. |
|
38
|
|
|
*/ |
|
39
|
|
|
function hook_entity_browser_selection_display_info_alter(array &$selection_displays) { |
|
40
|
|
|
$selection_displays['no_selection']['label'] = t('Nothing!'); |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* Alter the information provided in \Drupal\entity_browser\Annotation\EntityBrowserWidgetSelector. |
|
45
|
|
|
* |
|
46
|
|
|
* @param array $widget_selectors |
|
47
|
|
|
* The array of widget selector plugins, keyed on the machine-readable name. |
|
48
|
|
|
*/ |
|
49
|
|
|
function hook_entity_browser_widget_selector_info_alter(array &$widget_selectors) { |
|
|
|
|
|
|
50
|
|
|
$widgets['tab_selector']['label'] = t('Tabs are for winners'); |
|
|
|
|
|
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* Alter the information provided in \Drupal\entity_browser\Annotation\EntityBrowserFieldWidgetDisplay. |
|
55
|
|
|
* |
|
56
|
|
|
* @param array $field_displays |
|
57
|
|
|
* The array of field widget display plugins, keyed on the machine-readable |
|
58
|
|
|
* name. |
|
59
|
|
|
*/ |
|
60
|
|
|
function hook_entity_browser_field_widget_display_info_alter(array &$field_displays) { |
|
61
|
|
|
$field_displays['rendered_entity']['label'] = t('Entity render system FTW'); |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* Alter the information provided in \Drupal\entity_browser\Annotation\EntityBrowserWidgetValidation. |
|
66
|
|
|
* |
|
67
|
|
|
* @param array $validation_plugins |
|
68
|
|
|
* The array of widget validation plugins, keyed on the machine-readable |
|
69
|
|
|
* name. |
|
70
|
|
|
*/ |
|
71
|
|
|
function hook_entity_browser_widget_validation_info_alter(array &$validation_plugins) { |
|
|
|
|
|
|
72
|
|
|
$field_displays['not_null']['label'] = t('Not null fabulous validator'); |
|
|
|
|
|
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
/** |
|
76
|
|
|
* @} End of "addtogroup hooks". |
|
77
|
|
|
*/ |
|
78
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.