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
|
<?php
// $Header$
$formBit = [
'pretty_urls' => [
'label' => 'Use Pretty URLs',
'note' => 'In addition to making the URL easier to read and remember it enhances search engine results. Using this feature requires Apache <a href="http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html">mod_rewrite</a> support in the web server (usually installed by default), Depending on the Web server configuration, it may be necessary to modify the default .htaccess files when using this feature.',
'page' => 'PrettyUrls',
],
'pretty_urls_extended' => [
'label' => 'Use Extended Pretty URLs',
'note' => 'In addition to making the URL easier to read and remember it enhances search engine results. Using this feature requires Apache <a href="http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html">mod_rewrite</a> support in the web server (usually installed by default), This extended version adds a /view tag to the URLs to make them unambigious for rewrites. It will be necessary to modify the default .htaccess files when using this feature.',
'page' => 'FeaturePrettyUrlsExtended',
],
];
$gBitSmarty->assign( 'formBit',$formBit );
$formHelp = [
'site_edit_help' => [
'label' => 'Input Help',
'note' => 'Displays <strong>extensive</strong> (about 50kb) help regarding the syntax of available format plugins (e.g., Tikiwiki and HTML), and of available Data Plugins (e.g., attachment, include, table of contents). Explanations and examples are shown near any suitable entry form.',
'page' => '',
],
'site_form_help' => [
'label' => 'Help Notes',
'note' => 'Show inline help notes in forms such as the one you are reading now.',
'page' => '',
],
'site_help_popup' => [
'label' => 'Popup for Help Notes',
'note' => 'This will place a clickable icon after form elements for the extended help information.',
'page' => '',
],
'site_online_help' => [
'label' => 'Online Help Links',
'note' => 'Display links to relevant online help pages found on www.bitweaver.org.',
'page' => '',
],
];
$gBitSmarty->assign( 'formHelp',$formHelp );
$extendedHeader = [
'site_header_extended_nav' => [
'label' => 'Enable Header Navigation',
'note' => 'This feature will add a number of useful links to the <head> section. These will help improve accessibility on this site.',
'type' => 'checkbox',
],
'site_header_help' => [
'label' => 'Help Link',
'note' => 'Enter the URL of where you want the help link to point to.',
'type' => 'text',
],
'site_header_index' => [
'label' => 'Site Index',
'note' => 'This URL should point to a site index of your website.',
'type' => 'text',
],
'site_header_contents' => [
'label' => 'Site Contents',
'note' => 'This URL should point to a site map of your website.',
'type' => 'text',
],
'site_header_copyright' => [
'label' => 'Site Copyright',
'note' => 'This link should point to a page with copyright information.',
'type' => 'text',
],
'site_header_glossary' => [
'label' => 'Site Glossary',
'note' => 'This link should point to a page with a glossary of terms.',
'type' => 'text',
],
];
$gBitSmarty->assign( 'extendedHeader',$extendedHeader );
$formMisc = [
'site_direct_pagination' => [
'label' => 'Use direct pagination links',
'note' => 'Use direct pagination links instead of the small pagination box. Links are cleverly generated depending on the number of pages available.',
],
'site_output_obzip' => [
'label' => 'Use gzipped output',
'note' => 'Send gzip compressed data via PHP\'s output compression to browsers that support it. This feature will reduce download times and bandwidth consumption. Use it only if your server has no such mechanism enabled already (e.g., Apache\'s output compression).',
],
// want to remove this setting. we use addHit() which is clever
'users_count_admin_pageviews' => [
'label' => 'Count admin pageviews',
'note' => '',
],
];
$gBitSmarty->assign( 'formMisc',$formMisc );
if( !empty( $_REQUEST['change_prefs'] ) ) {
$featureToggles = array_merge( $formBit, $formHelp, $formMisc, $extendedHeader );
foreach( $featureToggles as $item => $info ) {
if( empty( $info['type'] ) || $info['type'] == 'checkbox' ) {
simple_set_toggle( $item, KERNEL_PKG_NAME );
} elseif( $info['type'] == 'text' ) {
simple_set_value( $item, KERNEL_PKG_NAME );
}
}
$simpleValues = [
"max_records",
"site_url_index",
];
foreach( $simpleValues as $svitem ) {
simple_set_value( $svitem, KERNEL_PKG_NAME );
}
simple_set_toggle( 'site_display_reltime', KERNEL_PKG_NAME );
// Special handling for tied fields: bit_index and site_url_index
if (!empty($_REQUEST["site_url_index"]) && $_REQUEST["bit_index"] == 'users_custom_home') {
$_REQUEST["bit_index"] = $_REQUEST["site_url_index"];
}
$refValue = [
"site_long_date_format",
"site_long_time_format",
"site_short_date_format",
"site_short_time_format",
"site_long_datetime_format",
"site_short_datetime_format",
"bit_index",
];
foreach( $refValue as $britem ) {
byref_set_value( $britem, "", KERNEL_PKG_NAME );
}
}
if ( defined( 'ROLE_MODEL' ) ) {
$gBitSmarty->assign( "role_model", true );
}
$gBitSystem->setHelpInfo('Features','Settings','Help with the features settings');
|