-
Notifications
You must be signed in to change notification settings - Fork 8
/
config-form.php
97 lines (97 loc) · 3.8 KB
/
config-form.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php $view = get_view(); ?>
<style type="text/css">
.hide-boxes {
text-align: center;
}
</style>
<div class="field">
<div class="two columns alpha">
<label for="collection_tree_parent_collection_id"><?php echo __('Override visibility restrictions by role'); ?></label>
</div>
<div class="inputs five columns omega">
<?php echo $view->formCheckbox('override[]', 'super', array(
'disableHidden' => true,
'checked' => in_array('super', $settings['override']),
)); ?> <?php echo __('Super'); ?><br>
<?php echo $view->formCheckbox('override[]', 'admin', array(
'disableHidden' => true,
'checked' => in_array('admin', $settings['override']),
)); ?> <?php echo __('Admin'); ?><br>
<?php echo $view->formCheckbox('override[]', 'researcher', array(
'disableHidden' => true,
'checked' => in_array('researcher', $settings['override']),
)); ?> <?php echo __('Researcher'); ?><br>
<?php echo $view->formCheckbox('override[]', 'contributor', array(
'disableHidden' => true,
'checked' => in_array('contributor', $settings['override']),
)); ?> <?php echo __('Contributor'); ?>
</div>
</div>
<table id="hide-elements-table">
<thead>
<tr>
<th class="hide-boxes" rowspan="2"><?php echo __('Element'); ?></th>
<th class="hide-boxes" colspan="4"><?php echo __('Hide on:'); ?></th>
</tr>
<tr>
<th class="hide-boxes"><?php echo __('Form'); ?></th>
<th class="hide-boxes"><?php echo __('Admin'); ?></th>
<th class="hide-boxes"><?php echo __('Public'); ?></th>
<th class="hide-boxes"><?php echo __('Search'); ?></th>
</tr>
</thead>
<tbody>
<?php
$current_element_set = null;
foreach ($elements as $element):
if ($element->set_name != $current_element_set):
$current_element_set = $element->set_name;
?>
<tr>
<th colspan="5">
<strong><?php echo __($current_element_set); ?></strong>
</th>
</tr>
<?php endif; ?>
<tr>
<td><?php echo __($element->name); ?></td>
<td class="hide-boxes">
<?php echo $view->formCheckbox(
"form[{$element->set_name}][{$element->name}]",
'1', array(
'disableHidden' => true,
'checked' => isset($settings['form'][$element->set_name][$element->name])
)
); ?>
</td>
<td class="hide-boxes">
<?php echo $view->formCheckbox(
"admin[{$element->set_name}][{$element->name}]",
'1', array(
'disableHidden' => true,
'checked' => isset($settings['admin'][$element->set_name][$element->name])
)
); ?>
</td>
<td class="hide-boxes">
<?php echo $view->formCheckbox(
"public[{$element->set_name}][{$element->name}]",
'1', array(
'disableHidden' => true,
'checked' => isset($settings['public'][$element->set_name][$element->name])
)
); ?>
</td>
<td class="hide-boxes">
<?php echo $view->formCheckbox(
"search[{$element->set_name}][{$element->id}]",
'1', array(
'disableHidden' => true,
'checked' => isset($settings['search'][$element->set_name][$element->id])
)
); ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>