-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfancy_features.module
executable file
·37 lines (33 loc) · 1.1 KB
/
fancy_features.module
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
<?php
/**
* @file
* Main file of Fancy Features module.
*/
/**
* Implements hook_inline_entity_form_table_fields_alter().
*/
function fancy_features_inline_entity_form_table_fields_alter(&$fields, $context) {
// Remove title and type columns for our custom entity types.
if ($context['parent_entity_type'] == 'node' && ($context['entity_type'] == 'fancy_section' || $context['entity_type'] == 'fancy_content')) {
unset($fields['title']);
unset($fields['type']);
}
}
/**
* Implements hook_field_widget_form_alter().
*/
function fancy_features_field_widget_form_alter(&$element, &$form_state, $context) {
// Add some CSS to the inline entity form widget.
if ($context['instance']['widget']['type'] == 'inline_entity_form' && $context['field']['settings']['target_type'] == 'fancy_section') {
drupal_add_css(drupal_get_path('module', 'fancy_features') . '/css/fancy-features.css');
}
}
/**
* Implements hook_admin_paths_alter().
*/
function fancy_features_admin_paths_alter(&$paths) {
// Disable overlay in admin section.
if (module_exists('overlay')) {
$paths['admin/*'] = FALSE;
}
}