-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig_form.php
More file actions
436 lines (377 loc) · 16.5 KB
/
config_form.php
File metadata and controls
436 lines (377 loc) · 16.5 KB
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
<?php
$view = get_view();
echo js_tag('vendor/tinymce/tinymce.min');
echo js_tag('tabs');
?>
<script type="text/javascript">
jQuery(document).ready(function () {
Omeka.Tabs.initialize();
Omeka.wysiwyg({
selector: '.html-editor'
});
});
</script>
<style type = "text/css">
.boxes, .boxes-left {
vertical-align: middle;
}
.boxes {
text-align: center;
}
.field select {
margin-bottom: 0;
}
</style>
<p><?php echo flash(); ?></p>
<ul id="section-nav" class="navigation tabs">
<li><a href="#tab1"><?php echo __('Database Backup'); ?></a></li>
<li><a href="#tab2"><?php echo __('Cookie Bar'); ?></a></li>
<li><a href="#tab3"><?php echo __('Edit Link'); ?></a></li>
<li><a href="#tab4"><?php echo __('Limit Visibility'); ?></a></li>
<li><a href="#tab5"><?php echo __('Site Maintenance'); ?></a></li>
<li><a href="#tab6"><?php echo __('Plugins'); ?></a></li>
<li><a href="#tab7"><?php echo __('Sessions'); ?></a></li>
<li><a href="#tab8"><?php echo __('Tags'); ?></a></li>
<li><a href="#tab9"><?php echo __('Translations'); ?></a></li>
<li><a href="#tab10"><?php echo __('User Manual'); ?></a></li>
</ul>
<div id="tab1" style="border: 1px solid #d8d8d8; padding: 15px 15px;">
<h2><?php echo __('Database Backup') ?></h2>
<div class="field">
<div class="two columns alpha">
<label><?php echo __('Ignore Sessions')?></label>
</div>
<div class="inputs five columns omega">
<p class="explanation"><?php echo __('If checked, the backup will ignore the data contained in Sessions table.'); ?></p>
<?php echo $view->formCheckbox('admin_tools_backup_sessions_ignore', get_option('admin_tools_backup_sessions_ignore'), null, array('1', '0')); ?>
</div>
</div>
<div class="field">
<div class="two columns alpha">
<label><?php echo __('Compress Backup')?></label>
</div>
<div class="inputs five columns omega">
<p class="explanation"><?php echo __('If checked, the backup SQL file will be compressed (format: GZip).'); ?></p>
<?php echo $view->formCheckbox('admin_tools_backup_compress', get_option('admin_tools_backup_compress'), null, array('1', '0')); ?>
</div>
</div>
<div class="field">
<div class="two columns alpha">
<label><?php echo __('Download Backup')?></label>
</div>
<div class="inputs five columns omega">
<p class="explanation"><?php echo __('If checked, the backup SQL file will be downloadable (by default, it sits in the Omeka\'s files directory).'); ?></p>
<?php echo $view->formCheckbox('admin_tools_backup_download', get_option('admin_tools_backup_download'), null, array('1', '0')); ?>
</div>
</div>
<div class="field">
<div class="two columns alpha">
<?php echo $view->formLabel('admin_tools_backup_memory', __('Temporarily Allocated Memory')); ?>
</div>
<div class="inputs five columns omega">
<p class="explanation">
<?php echo __('The plugin will try to stream the backup file in small chunks, in order not to overload the system available memory. In case of persistent error caused by the size of the backup file, the following amount of memory (MB) can be temporarily allocated for the backup operation.'); ?>
</p>
<?php echo $view->formText('admin_tools_backup_memory', get_option('admin_tools_backup_memory')); ?>
</div>
</div>
<div> </div>
</div>
<div id="tab2" style="border: 1px solid #d8d8d8; padding: 15px 15px;">
<h2><?php echo __('Cookie Bar'); ?></h2>
<div class="field">
<div class="two columns alpha">
<?php echo $view->formLabel('admin_tools_cookiebar_active', __('Active')); ?>
</div>
<div class="inputs five columns omega">
<p class="explanation">
<?php echo __('If checked, a cookie bar with a warning will be shown to all visitors not logged in.'); ?>
</p>
<?php echo $view->formCheckbox('admin_tools_cookiebar_active', get_option('admin_tools_cookiebar_active'), null, array('1', '0')); ?>
</div>
</div>
<div class="field">
<div class="two columns alpha">
<?php echo $view->formLabel('admin_tools_cookiebar_all_users', __('Extend To All Users')); ?>
</div>
<div class="inputs five columns omega">
<p class="explanation">
<?php echo __('If checked, the cookie bar will be shown to all Public interface users.'); ?>
</p>
<?php echo $view->formCheckbox('admin_tools_cookiebar_all_users', get_option('admin_tools_cookiebar_all_users'), null, array('1', '0')); ?>
</div>
</div>
<div class="field">
<div class="two columns alpha">
<?php echo $view->formLabel('admin_tools_cookiebar_text', __('Text')); ?>
</div>
<div class="inputs five columns omega">
<p class="explanation">
<?php echo __('The text to be shown in the cookie bar.'); ?>
</p>
<?php echo $view->formText('admin_tools_cookiebar_text', get_option('admin_tools_cookiebar_text')); ?>
</div>
</div>
<div class="field">
<div class="two columns alpha">
<?php echo $view->formLabel('admin_tools_cookiebar_position', __('Position')); ?>
</div>
<div class="inputs five columns omega">
<p class="explanation">
<?php echo __('The position of the cookie bar.'); ?>
</p>
<?php echo $view->formSelect('admin_tools_cookiebar_position', get_option('admin_tools_cookiebar_position'), null, array('top' => __('Top of page'), 'bottom' => __('Bottom of page'))); ?>
</div>
</div>
<div class="field">
<div class="two columns alpha">
<?php echo $view->formLabel('admin_tools_cookiebar_policy_url', __('Privacy Policy URL')); ?>
</div>
<div class="inputs five columns omega">
<p class="explanation">
<?php echo __('The URL of the Privacy Policy document for the website; if empty, no link will be shown.'); ?>
</p>
<?php echo $view->formText('admin_tools_cookiebar_policy_url', get_option('admin_tools_cookiebar_policy_url')); ?>
</div>
</div>
<div> </div>
</div>
<div id="tab3" style="border: 1px solid #d8d8d8; padding: 15px 15px;">
<h2><?php echo __('Edit Link') ?></h2>
<div class="field">
<div class="two columns alpha">
<label><?php echo __('Content Types')?></label>
</div>
<div class="inputs five columns omega">
<p class="explanation"><?php echo __('Content types for which a link will be added to the public UI for quick editing (only when user is logged in).'); ?></p>
<?php
$contentTypes = array('Items', 'Collections', 'Exhibits', 'Files', 'Simple Pages');
$publicEditLinkTypes = array();
// retrieve configuration
if (get_option('admin_tools_public_edit_link_types') <> '') {
$publicEditLinkTypes = unserialize(get_option('admin_tools_public_edit_link_types'));
}
foreach ($contentTypes as $contentType) {
if ($contentType != 'Exhibits' || (bool)(plugin_is_active('ExhibitBuilder'))) {
echo '<label>' . $view->formCheckbox('admin_tools_public_edit_link_types[]', $contentType, array('checked'=> (!empty($contentTypes) ? in_array($contentType, $publicEditLinkTypes) : false) ? 'checked' : '')) . __($contentType) . '</label>';
}
}
?>
</div>
</div>
<div class="field">
<div class="two columns alpha">
<label><?php echo __('Open in New Tab')?></label>
</div>
<div class="inputs five columns omega">
<p class="explanation"><?php echo __('If checked, opens editing page in new tab (recommended).'); ?></p>
<?php echo $view->formCheckbox('admin_tools_public_edit_link_blank', get_option('admin_tools_public_edit_link_blank'), null, array('1', '0')); ?>
</div>
</div>
<div> </div>
</div>
<div id="tab4" style="border: 1px solid #d8d8d8; padding: 15px 15px;">
<h2><?php echo __('Limit Visibility') ?></h2>
<div class="field">
<div class="two columns alpha">
<label><?php echo __('Limited Roles')?></label>
</div>
<div class="inputs five columns omega">
<p class="explanation"><?php echo __('Roles allowed to see only their own records (in Admin mode). Please note that Super User\'s role cannot be limited.'); ?></p>
<table id="facets_elements-table">
<thead>
<tr>
<th class="boxes"><?php echo __('Role'); ?></th>
<th class="boxes"><?php echo __('Item'); ?></th>
<th class="boxes"><?php echo __('Collection'); ?></th>
<th class="boxes"><?php echo __('Exhibit'); ?></th>
</tr>
</thead>
<tbody>
<?php
// retrieve roles
$userRoles = get_user_roles();
unset($userRoles['super']);
$limitedRolesItems = array();
$limitedRolesCollections = array();
$limitedRolesExhibits = array();
// retrieve configuration
if (get_option('admin_tools_limit_visibility_to_own_items_roles') <> '') {
$limitedRolesItems = unserialize(get_option('admin_tools_limit_visibility_to_own_items_roles'));
}
if (get_option('admin_tools_limit_visibility_to_own_collections_roles') <> '') {
$limitedRolesCollections = unserialize(get_option('admin_tools_limit_visibility_to_own_collections_roles'));
}
if (get_option('admin_tools_limit_visibility_to_own_exhibits_roles') <> '') {
$limitedRolesExhibits = unserialize(get_option('admin_tools_limit_visibility_to_own_exhibits_roles'));
}
// display table content
foreach ($userRoles as $role=>$label) {
echo '<tr>';
echo '<td class="boxes-left">' . __($label) . '</td>';
echo '<td class="boxes">' . $view->formCheckbox('admin_tools_limit_visibility_to_own_items_roles[]', $role, array('checked'=> (!empty($limitedRolesItems) ? in_array($role, $limitedRolesItems) : false) ? 'checked' : '')) . '</td>';
echo '<td class="boxes">' . $view->formCheckbox('admin_tools_limit_visibility_to_own_collections_roles[]', $role, array('checked'=> (!empty($limitedRolesCollections) ? in_array($role, $limitedRolesCollections) : false) ? 'checked' : '')) . '</td>';
echo '<td class="boxes">' . ((bool)(plugin_is_active('ExhibitBuilder')) ? $view->formCheckbox('admin_tools_limit_visibility_to_own_exhibits_roles[]', $role, array('checked'=> (!empty($limitedRolesExhibits) ? in_array($role, $limitedRolesExhibits) : false) ? 'checked' : '')) : 'n/a') . '</td>';
echo '</tr>';
}
?>
</tbody>
</table>
</div>
</div>
<div> </div>
</div>
<div id="tab5" style="border: 1px solid #d8d8d8; padding: 15px 15px;">
<h2><?php echo __('Site Maintenance') ?></h2>
<div class="field">
<div class="two columns alpha">
<?php echo $view->formLabel('admin_tools_maintenance_title', __('Title')); ?>
</div>
<div class='inputs five columns omega'>
<p class="explanation">
<?php echo __('The title of the message to display to visitors when the site is in maintenance mode.'); ?>
</p>
<?php echo $view->formText('admin_tools_maintenance_title', get_option('admin_tools_maintenance_title')); ?>
</div>
</div>
<div class="field">
<div class="two columns alpha">
<?php echo $view->formLabel('admin_tools_maintenance_message', __('Message')); ?>
</div>
<div class='inputs five columns omega'>
<p class="explanation">
<?php echo __('The message to display to visitors when the site is in maintenance mode.'); ?>
</p>
<?php echo $view->formTextarea(
'admin_tools_maintenance_message',
get_option('admin_tools_maintenance_message'),
array(
'rows' => 5,
'cols' => 60,
'class' => array('textinput', 'html-editor'),
)
); ?>
</div>
</div>
<div class="field">
<div class="two columns alpha">
<?php echo $view->formLabel('admin_tools_maintenance_scope_extended', __('Extend Scope')); ?>
</div>
<div class="inputs five columns omega">
<p class="explanation">
<?php echo __('If checked, site will not be accessible even to logged-in users (excluding Super User and Admin roles).'); ?>
</p>
<?php echo $view->formCheckbox('admin_tools_maintenance_scope_extended', get_option('admin_tools_maintenance_scope_extended'), null, array('1', '0')); ?>
</div>
</div>
<div> </div>
</div>
<div id="tab6" style="border: 1px solid #d8d8d8; padding: 15px 15px;">
<h2><?php echo __('Plugins') ?></h2>
<div class="field">
<div class="two columns alpha">
<label><?php echo __('Show Buttons')?></label>
</div>
<div class="inputs five columns omega">
<p class="explanation"><?php echo __('If checked, buttons to activate or deactivate all Plugins will be shown in the Plugins Browse page.'); ?></p>
<?php echo $view->formCheckbox('admin_tools_plugins_btns', get_option('admin_tools_plugins_btns'), null, array('1', '0')); ?>
</div>
</div>
<div> </div>
</div>
<div id="tab7" style="border: 1px solid #d8d8d8; padding: 15px 15px;">
<h2><?php echo __('Sessions') ?></h2>
<p class="explanation" style="margin-bottom: 2em"><?php echo __('Note: in the case of a very large number of records in the Sessions table, the plugin page could take some extra time to load.'); ?></p>
<div class="field">
<div class="two columns alpha">
<label><?php echo __('Show Stats')?></label>
</div>
<div class="inputs five columns omega">
<p class="explanation"><?php echo __('If checked, the amount of actual records in the Session table will be shown, together with the size of the table.'); ?></p>
<?php echo $view->formCheckbox('admin_tools_sessions_count', get_option('admin_tools_sessions_count'), null, array('1', '0')); ?>
</div>
</div>
<div class="field">
<div class="two columns alpha">
<label><?php echo __('Show Graph')?></label>
</div>
<div class="inputs five columns omega">
<p class="explanation"><?php echo __('If checked, a graph showing the sessions total per day will be shown.'); ?></p>
<?php echo $view->formCheckbox('admin_tools_sessions_graph', get_option('admin_tools_sessions_graph'), null, array('1', '0')); ?>
</div>
</div>
<div> </div>
</div>
<div id="tab8" style="border: 1px solid #d8d8d8; padding: 15px 15px;">
<h2><?php echo __('Tags') ?></h2>
<div class="field">
<div class="two columns alpha">
<label><?php echo __('Add Search Option')?></label>
</div>
<div class="inputs five columns omega">
<p class="explanation"><?php echo __('If checked, an extra "With Tags/Without Tags" option will be added to the Items Advanced Search page.'); ?></p>
<?php echo $view->formCheckbox('admin_tools_has_tags', get_option('admin_tools_has_tags'), null, array('1', '0')); ?>
</div>
</div>
<div> </div>
</div>
<div id="tab9" style="border: 1px solid #d8d8d8; padding: 15px 15px;">
<h2><?php echo __('Translations') ?></h2>
<div class="field">
<div class="two columns alpha">
<label><?php echo __('Add Theme Translations')?></label>
</div>
<div class="inputs five columns omega">
<p class="explanation"><?php echo __('If checked, all translation files located in the "Languages" folder of the Public Theme will be used as well.'); ?></p>
<?php echo $view->formCheckbox('admin_tools_translations_theme', get_option('admin_tools_translations_theme'), null, array('1', '0')); ?>
</div>
</div>
<div> </div>
</div>
<div id="tab10" style="border: 1px solid #d8d8d8; padding: 15px 15px;">
<h2><?php echo __('User Manual'); ?></h2>
<div class="field">
<div class="two columns alpha">
<?php echo $view->formLabel('admin_tools_usermanual_url', __('URL')); ?>
</div>
<div class="inputs five columns omega">
<p class="explanation">
<?php echo __('The URL of the user manual to be made available to logged-in users.'); ?>
</p>
<?php echo $view->formText('admin_tools_usermanual_url', get_option('admin_tools_usermanual_url')); ?>
</div>
</div>
<div class="field">
<div class="two columns alpha">
<?php echo $view->formLabel('admin_tools_usermanual_label', __('Label')); ?>
</div>
<div class="inputs five columns omega">
<p class="explanation">
<?php echo __('The label to be shown to logged-in users.'); ?>
</p>
<?php echo $view->formText('admin_tools_usermanual_label', get_option('admin_tools_usermanual_label')); ?>
</div>
</div>
<div class="field">
<div class="two columns alpha">
<?php echo $view->formLabel('admin_tools_usermanual_label', __('Link Position')); ?>
</div>
<div class="inputs five columns omega">
<p class="explanation">
<?php echo __('Choose where the user manual link should be displayed.'); ?>
</p>
<?php
$positions = array('Sidebar', 'Topbar', 'Footer');
$usermanualLinkPositions = array();
// retrieve configuration
if (get_option('admin_tools_usermanual_link_positions') <> '') {
$usermanualLinkPositions = unserialize(get_option('admin_tools_usermanual_link_positions'));
}
foreach ($positions as $position) {
echo '<label>' . $view->formCheckbox('admin_tools_usermanual_link_positions[]', $position, array('checked'=> (!empty($usermanualLinkPositions) ? in_array($position, $usermanualLinkPositions) : false) ? 'checked' : '')) . __($position) . '</label>';
}
?>
</div>
</div>
<div> </div>
</div>