-
Notifications
You must be signed in to change notification settings - Fork 1
/
views_ef_fieldset.module
60 lines (54 loc) · 1.56 KB
/
views_ef_fieldset.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
/**
* @file
* Main module file.
*/
/**
* Implements hook_views_api().
*/
function views_ef_fieldset_views_api() {
return array(
'api' => 3.0,
);
}
/**
* Implements hook_form_FORM_ID_alter().
*/
function views_ef_fieldset_form_views_exposed_form_alter(&$form, &$form_state, $form_id) {
if (isset($form_state['display'])) {
if (isset($form_state['display']->display_options['views_ef_fieldset'])) {
$options = $form_state['display']->display_options['views_ef_fieldset'];
if ($options['enabled']) {
if (is_array($options['options']['sort'])) {
$form['#attached']['css'] = array(
backdrop_get_path('module', 'views_ef_fieldset') . '/css/views_ef_fieldset.css',
);
$viewsEFFieldsetData = new ViewsEFFieldsetData($options['options']['sort'], $form);
$form['filters']['children'] = $viewsEFFieldsetData->treeToFAPI();
$form['#info']['views_ef_fieldset']['value'] = 'filters';
}
}
}
}
}
/**
* Implements hook_theme().
*/
function views_ef_fieldset_theme() {
return array(
'views_ef_fieldset_reorder_form' => array(
'render element' => 'form',
'file' => 'views_ef_fieldset.theme.inc',
),
);
}
/**
* Implements hook_autoload_info().
*/
function views_ef_fieldset_autoload_info() {
return array(
'ArrayDataItemIterator' => 'includes/ArrayDataItemIterator.php',
'ViewsEFFieldsetData' => 'includes/ViewsEFFieldsetData.php',
'views_ef_fieldset_display_extender_plugin' => 'views/views_ef_fieldset_display_extender_plugin.inc',
);
}