-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathviews_mediatable.admin.inc
91 lines (86 loc) · 2.19 KB
/
views_mediatable.admin.inc
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
/**
* @file
* This is where all of the form settings are kept for the Views display type.
*/
/**
* Theme the form for the table style plugin.
*/
function theme_views_mediatable_style_plugin_table($variables) {
$form = $variables['form'];
$output = drupal_render($form['description_markup']);
$header = array(
t('Field'),
t('Column'),
t('Align'),
t('Separator'),
array(
'data' => t('Sortable'),
'align' => 'center',
),
array(
'data' => t('Default order'),
'align' => 'center',
),
array(
'data' => t('Default sort'),
'align' => 'center',
),
array(
'data' => t('Hide empty column'),
'align' => 'center',
),
array(
'data' => t('MediaTable Options'),
'align' => 'center',
),
);
$rows = array();
foreach (element_children($form['columns']) as $id) {
$row = array();
$row[] = drupal_render($form['info'][$id]['name']);
$row[] = drupal_render($form['columns'][$id]);
$row[] = drupal_render($form['info'][$id]['align']);
$row[] = drupal_render($form['info'][$id]['separator']);
if (!empty($form['info'][$id]['sortable'])) {
$row[] = array(
'data' => drupal_render($form['info'][$id]['sortable']),
'align' => 'center',
);
$row[] = array(
'data' => drupal_render($form['info'][$id]['default_sort_order']),
'align' => 'center',
);
$row[] = array(
'data' => drupal_render($form['default'][$id]),
'align' => 'center',
);
}
else {
$row[] = '';
$row[] = '';
$row[] = '';
}
$row[] = array(
'data' => drupal_render($form['info'][$id]['empty_column']),
'align' => 'center',
);
$row[] = array(
'data' => drupal_render($form['info'][$id]['responsive']),
'align' => 'center',
);
$rows[] = $row;
}
// Add the special 'None' row.
$rows[] = array(
t('None'), '', '', '', '', '',
array(
'align' => 'center',
'data' => drupal_render($form['default'][-1]),
), '', '');
$output .= theme('table', array('header' => $header, 'rows' => $rows));
$output .= drupal_render_children($form);
return $output;
}
tput;
}