summaryrefslogtreecommitdiff
path: root/admin/schema_inc.php
blob: c9cd76c4f0ad3d80cf8a5b7887be41481d657b73 (plain)
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
<?php

$tables = [

'adodb_logsql' => "
	created T NOT null,
	sql0 C(250) NOTNULL,
	sql1 X NOTNULL,
	params X NOTNULL,
	tracer X NOTNULL,
	timer N(16.6) NOTNULL
",

'kernel_config' => "
	config_name C(40) PRIMARY,
	package C(100),
	config_value C(250)
",

'mail_notifications' => "
	event C(200),
	object C(200),
	email C(200)
",

'sessions' => "
	sesskey C(32) PRIMARY,
	expiry I NOTNULL,
	expireref C(64),
	session_data X not null
",

];

global $gBitInstaller;

foreach( array_keys( $tables ) AS $tableName ) {
	$gBitInstaller->registerSchemaTable( KERNEL_PKG_NAME, $tableName, $tables[$tableName], true );
}

$gBitInstaller->registerPackageInfo( KERNEL_PKG_NAME, [
	'description' => "This is the heart of the application. Without this --&gt; nothing.",
	'license' => '<a href="http://www.gnu.org/licenses/licenses.html#LGPL">LGPL</a>',
] );

// Default Preferences
$gBitInstaller->registerPreferences( KERNEL_PKG_NAME, [
	[ KERNEL_PKG_NAME, 'site_online_help'            , 'y' ],
	[ KERNEL_PKG_NAME, 'site_edit_help'              , 'y' ],
	[ KERNEL_PKG_NAME, 'site_form_help'              , 'y' ],
	[ KERNEL_PKG_NAME, 'site_short_date_format'      , '%d %b %Y' ],
	[ KERNEL_PKG_NAME, 'site_short_time_format'      , '%H:%M %Z' ],
	[ KERNEL_PKG_NAME, 'site_upload_dir'             , 'storage' ],
	[ KERNEL_PKG_NAME, 'site_closed_msg'             , 'Site is closed for maintainance; please come back later.' ],
	[ KERNEL_PKG_NAME, 'site_http_port'              , '80' ],
	[ KERNEL_PKG_NAME, 'site_http_prefix'            , '/' ],
	[ KERNEL_PKG_NAME, 'site_https_port'             , '443' ],
	[ KERNEL_PKG_NAME, 'site_https_prefix'           , '/' ],
	[ KERNEL_PKG_NAME, 'users_count_admin_pageviews' , 'y' ],
	[ KERNEL_PKG_NAME, 'site_display_utc'            , 'UTC' ],
	[ KERNEL_PKG_NAME, 'site_long_date_format'       , '%A %d of %B, %Y' ],
	[ KERNEL_PKG_NAME, 'site_long_time_format'       , '%H:%M:%S %Z' ],
	[ KERNEL_PKG_NAME, 'site_top_column'             , 'y' ],
	[ KERNEL_PKG_NAME, 'site_right_column'           , 'y' ],
	[ KERNEL_PKG_NAME, 'site_left_column'            , 'y' ],
	[ KERNEL_PKG_NAME, 'site_bottom_column'          , 'y' ],
	[ KERNEL_PKG_NAME, 'site_display_reltime'        , 'y' ],
	[ KERNEL_PKG_NAME, 'max_records'                 , '10' ],
	[ KERNEL_PKG_NAME, 'language'                    , 'en' ],
	[ KERNEL_PKG_NAME, 'site_sender_email'           , '' ],
	[ KERNEL_PKG_NAME, 'site_url_index'              , '' ],
] );

$moduleHash = [
	[
		'title' => null,
		'pos' => 5,
		'layout_area' => 't',
		'module_rsrc' => 'bitpackage:kernel/mod_site_title.tpl',
	],
	[
		'title' => null,
		'pos' => 10,
		'layout_area' => 't',
		'module_rsrc' => 'bitpackage:kernel/mod_top_menu.tpl',
	],
	[
		'title' => null,
		'pos' => 5,
		'layout_area' => 'r',
		'module_rsrc' => 'bitpackage:kernel/mod_package_menu.tpl',
	],
	[
		'title' => null,
		'pos' => 5,
		'layout_area' => 'b',
		'module_rsrc' => 'bitpackage:kernel/mod_bottom_bar.tpl',
	],
];
$gBitInstaller->registerModules( $moduleHash );

// ### Default UserPermissions
$gBitInstaller->registerUserPermissions( KERNEL_PKG_NAME, [
	[ 'p_admin'              , 'Can manage users groups and permissions and all aspects of site management' , 'admin' , KERNEL_PKG_NAME ],
	[ 'p_access_closed_site' , 'Can access site when closed'                                                , 'admin' , KERNEL_PKG_NAME ],
] );

// Package requirements
$gBitInstaller->registerRequirements( KERNEL_PKG_NAME, [
	'liberty'   => [ 'min' => '5.0.0' ],
	'users'     => [ 'min' => '5.0.0' ],
	'themes'    => [ 'min' => '5.0.0' ],
	'languages' => [ 'min' => '5.0.0' ],
] );