/
better-formats-defaults-admin-form.tpl.php
109 lines (103 loc) · 3.58 KB
/
better-formats-defaults-admin-form.tpl.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
98
99
100
101
102
103
104
105
106
107
108
109
<?php
/**
* @file
* Default theme implementation to configure Better Formats defaults admin page.
*
* Available variables:
* - $form_submit: Form submit button.
*
* Each $node_default_rows contains a row
*
* Each $data in $node_default_rows contains:
* - $data->role: Role name.
* - $data->format_select: Drop-down menu for setting format.
* - $data->weight_select: Drop-down menu for setting weights.
*/
?>
<?php
// Add table javascript
backdrop_add_tabledrag('node-format-defaults', 'order', 'sibling', 'better-formats-role-node-weight');
backdrop_add_tabledrag('comment-format-defaults', 'order', 'sibling', 'better-formats-role-comment-weight');
backdrop_add_tabledrag('block-format-defaults', 'order', 'sibling', 'better-formats-role-block-weight');
?>
<div class="description">
<?php print '<p><strong>' . t('Defaults only affect NEW content NOT existing content.') . '</strong></p>'; ?>
<?php print '<p><strong>' . t('Place roles in order of precedence by dragging more important roles to the top.') . '</strong></p>'; ?>
</div>
<fieldset>
<legend><strong><?php print t('Node defaults'); ?></strong></legend>
<table id="node-format-defaults">
<thead>
<tr>
<th><?php print t('Role'); ?></th>
<th><?php print t('Default format'); ?></th>
<th><?php print t('Weight'); ?></th>
</tr>
</thead>
<tbody>
<?php $row = 0; ?>
<?php foreach ($node_default_rows as $rid => $data): ?>
<tr class="draggable <?php print $row % 2 ? 'odd' : 'even'; ?>">
<td class=""><?php print $data->role; ?></td>
<td><?php print $data->format_select; ?></td>
<td><?php print $data->weight_select; ?></td>
</tr>
<?php $row++; ?>
<?php endforeach; ?>
</tbody>
</table>
</fieldset>
<fieldset>
<legend><strong><?php print t('Comment defaults'); ?></strong></legend>
<table id="comment-format-defaults">
<thead>
<tr>
<th><?php print t('Role'); ?></th>
<th><?php print t('Default format'); ?></th>
<th><?php print t('Weight'); ?></th>
</tr>
</thead>
<tbody>
<?php $row = 0; ?>
<?php foreach ($comment_default_rows as $rid => $data): ?>
<tr class="draggable <?php print $row % 2 ? 'odd' : 'even'; ?>">
<td class=""><?php print $data->role; ?></td>
<td><?php print $data->format_select; ?></td>
<td><?php print $data->weight_select; ?></td>
</tr>
<?php $row++; ?>
<?php endforeach; ?>
</tbody>
</table>
</fieldset>
<?php if ($_GET['q'] === 'admin/settings/filters/defaults'): ?>
<fieldset>
<legend><strong><?php print t('Block defaults'); ?></strong></legend>
<?php if (isset($block_default_rows)): ?>
<table id="block-format-defaults">
<thead>
<tr>
<th><?php print t('Role'); ?></th>
<th><?php print t('Default format'); ?></th>
<th><?php print t('Weight'); ?></th>
</tr>
</thead>
<tbody>
<?php $row = 0; ?>
<?php foreach ($block_default_rows as $rid => $data): ?>
<tr class="draggable <?php print $row % 2 ? 'odd' : 'even'; ?>">
<td class=""><?php print $data->role; ?></td>
<td><?php print $data->format_select; ?></td>
<td><?php print $data->weight_select; ?></td>
</tr>
<?php $row++; ?>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</fieldset>
<?php endif; ?>
<div class="description">
<?php print '<p>' . t('* Only formats that a role has permission to use are shown in the default format drop downs.') . '</p>'; ?>
</div>
<?php print $form_submit; ?>