-
Notifications
You must be signed in to change notification settings - Fork 5
/
config_form.php
191 lines (175 loc) · 8.02 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<script type='text/javascript'>
<?php include('config_form.js'); ?>
</script>
<?php $view = get_view(); ?>
<div class="field">
<div class="three columns alpha">
<label for="commenting_threaded"><?php echo __("Use Threaded Comments?"); ?></label>
</div>
<div class="inputs four columns omega">
<p class="explanation"><?php echo __("If checked, replies will be displayed indented below the comment."); ?></p>
<div class="input-block">
<?php echo $view->formCheckbox('commenting_threaded', null,
array('checked' => (bool) get_option('commenting_threaded') ? 'checked' : '')
); ?>
</div>
</div>
</div>
<div class='field'>
<div class="three columns alpha">
<label for="commenting_comments_label"><?php echo __("Text for comments label"); ?></label>
</div>
<div class='inputs four columns omega'>
<p class='explanation'><?php echo __("A label instead of 'Comments' to use. Leave empty to use 'Comments'."); ?></p>
<div class='input-block'>
<?php echo $view->formText('commenting_comments_label', get_option('commenting_comments_label')); ?>
</div>
</div>
</div>
<div class="field">
<div class="three columns alpha">
<label for="commenting_allow_public"><?php echo __("Allow public commenting?"); ?></label>
</div>
<div class="inputs four columns omega">
<p class="explanation"><?php echo __("Allows everyone, including non-registered users to comment. Using this without Akismet is strongly discouraged."); ?></p>
<div class="input-block">
<?php echo $view->formCheckbox('commenting_allow_public', null,
array('checked' => (bool) get_option('commenting_allow_public') ? 'checked' : '')
); ?>
</div>
</div>
</div>
<div class='field' id='commenting-moderate-public'>
<div class="three columns alpha">
<label for="commenting_require_public_moderation"><?php echo __("Require moderation for all public comments?"); ?></label>
</div>
<div class='inputs four columns omega'>
<p class='explanation'><?php echo __("If unchecked, comments will appear immediately."); ?></p>
<div class="input-block">
<?php echo $view->formCheckbox('commenting_require_public_moderation', null,
array('checked' => (bool) get_option('commenting_require_public_moderation') ? 'checked' : '')
); ?>
</div>
</div>
</div>
<fieldset class="field" id='moderate-options'>
<legend class="three columns alpha"><?php echo __("User roles that can moderate comments"); ?></legend>
<div class="inputs four columns omega">
<p class="explanation"><?php echo __("The user roles that are allowed to moderate comments."); ?></p>
<div class="input-block">
<?php
$moderateRoles = unserialize(get_option('commenting_moderate_roles'));
$userRoles = get_user_roles();
unset($userRoles['super']);
foreach($userRoles as $role=>$label) {
echo '<label>';
echo $view->formCheckbox('commenting_moderate_roles[]', $role,
array('checked' => in_array($role, $moderateRoles) ? 'checked' : '')
);
echo $label;
echo '</label>';
}
?>
</div>
</div>
</fieldset>
<div id='non-public-options'>
<fieldset class="field">
<legend class="three columns alpha"><?php echo __("User roles that can comment"); ?></legend>
<div class="inputs four columns omega">
<p class="explanation"><?php echo __("Select the roles that can leave comments"); ?></p>
<div class="input-block">
<?php
$commentRoles = unserialize(get_option('commenting_comment_roles'));
foreach($userRoles as $role=>$label) {
echo '<label>';
echo $view->formCheckbox('commenting_comment_roles[]', $role,
array('checked' => in_array($role, $commentRoles) ? 'checked' : '')
);
echo $label;
echo '</label>';
}
?>
</div>
</div>
</fieldset>
<fieldset class="field">
<legend class="three columns alpha"><?php echo __("User roles that require moderation before publishing."); ?></legend>
<div class="inputs four columns omega">
<p class="explanation"><?php echo __("If the role is allowed to moderate comments, that will override the setting here."); ?></p>
<div class="input-block">
<?php
$reqAppCommentRoles = unserialize(get_option('commenting_reqapp_comment_roles'));
foreach($userRoles as $role=>$label) {
echo '<label>';
echo $view->formCheckbox('commenting_reqapp_comment_roles[]', $role,
array('checked' => in_array($role, $reqAppCommentRoles) ? 'checked' : '')
);
echo $label;
echo '</label>';
}
?>
</div>
</div>
</fieldset>
<div class="field">
<div class="three columns alpha">
<label for="commenting_allow_public_view"><?php echo __("Allow public to view comments?"); ?></label>
</div>
<div class="inputs four columns omega">
<div class="input-block">
<?php echo $view->formCheckbox('commenting_allow_public_view', null,
array('checked' => (bool) get_option('commenting_allow_public_view') ? 'checked' : '')
); ?>
</div>
</div>
</div>
</div>
<fieldset class="field view-options">
<legend class="three columns alpha"><?php echo __("User roles that can view comments"); ?></legend>
<div class="inputs four columns omega">
<div class="input-block">
<?php
$viewRoles = unserialize(get_option('commenting_view_roles'));
if(!$viewRoles) {
$viewRoles = array();
}
foreach($userRoles as $role=>$label) {
echo '<label>';
echo $view->formCheckbox('commenting_view_roles[]', $role,
array('checked' => in_array($role, $viewRoles) ? 'checked' : '')
);
echo $label;
echo '</label>';
}
?>
</div>
</div>
</fieldset>
<?php if(!Omeka_Captcha::isConfigured()): ?>
<p class="flash alert"><?php echo __("You have not entered your %s API keys under %s. We recommend adding these keys, or the commenting form will be vulnerable to spam.", '<a href="http://recaptcha.net/">reCAPTCHA</a>', "<a href='" . url('settings/edit-security#recaptcha_public_key') . "'>" . __('security settings') . "</a>");?></p>
<?php endif; ?>
<div class="field">
<div class="three columns alpha">
<label for="commenting_wpapi_key"><?php echo __("WordPress API key for Akismet"); ?></label>
</div>
<div class="inputs four columns omega">
<p class="explanation"></p>
<div class="input-block">
<?php echo $view->formText('commenting_wpapi_key', get_option('commenting_wpapi_key'),
array('size' => 45)
);?>
</div>
</div>
</div>
<div class="field">
<div class="three columns alpha">
<label for="new_comment_notification_recipients"><?php echo __('New Comment Notification Emails'); ?></label>
</div>
<div class="inputs four columns omega">
<p class="explanation"><?php echo __('An email message will be sent to each address here whenever a new comment is contributed (one email per line). Leave blank if you do not want anyone to be alerted of comments by email.'); ?></p>
<div class="input-block">
<?php echo $view->formTextarea('new_comment_notification_recipients', get_option('new_comment_notification_recipients'), array('rows' => 5)); ?>
</div>
</div>
</div>