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
|
<?php
use Bitweaver\KernelTools;
require_once '../../kernel/includes/setup_inc.php';
include_once KERNEL_PKG_INCLUDE_PATH.'simple_form_functions_lib.php';
$gBitSystem->verifyPermission( 'p_admin' );
$commentSettings = [
// when this is enabled, we need to add a spam prevention method
"comments_auto_show_form" => [
'label' => 'Always show comment form',
'note' => 'Check this if you want to show the comment form automatically instead of the <em>Add Comment</em> button first.',
'page' => '',
],
"comments_reorganise_page_layout" => [
'label' => 'Position Comments at top of page',
'note' => 'When posting a comment, comments are moved to the top of the page. This can be very disorienting and is only recommended when your site uses comments extensively.',
'page' => '',
],
"comments_display_option_bar" => [
'label' => 'Display Comments option bar',
'note' => 'Display an option bar above comments to specify how they should be sorted and how they should be displayed. Useful if your site uses comments extensively.',
'page' => '',
],
"comments_ajax" => [
'label' => 'Use AJAX to Post Comments',
'note' => 'Comments are posted dynamically with javascript (js) - this requires a one time larger download of a js library, but then comments can be posted without page refresh.',
'page' => '',
],
// "comments_display_expanded" => [
// 'label' => 'Expand Comments',
// 'note' => 'When users first visit your site, comments can be hidden or displayed by default.',
// 'page' => '',
// ],
];
$gBitSmarty->assign( 'commentSettings', $commentSettings );
if( !empty( $_REQUEST['change_prefs'] ) ) {
foreach( array_keys( $commentSettings ) as $item ) {
simple_set_toggle( $item, LIBERTY_PKG_NAME );
}
$formValues = ['comments_edit_minutes', 'comments_per_page', 'comments_default_ordering', 'comments_default_display_mode' , 'comments_default_post_lines'];
foreach( $formValues as $item ) {
simple_set_value( $item, LIBERTY_PKG_NAME );
}
}
$gBitSystem->display( 'bitpackage:liberty/admin_comments.tpl', KernelTools::tra( 'Comment Settings' ) , [ 'display_mode' => 'admin' ]);
|