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
|
<?php
$tables = array(
'fisheye_gallery' => "
gallery_id I4 PRIMARY,
content_id I4,
rows_per_page I4,
cols_per_page I4,
thumbnail_size C(32),
preview_content_id I4,
image_comment C(1)
",
'fisheye_gallery_image_map' => "
gallery_content_id I4 NOTNULL,
item_content_id I4 NOTNULL,
item_position F
",
'fisheye_image' => "
image_id I4 PRIMARY,
content_id I4 NOTNULL,
photo_date I8,
width I4,
height I4
",
'fisheye_exif_data' => "
content_id I4 NOTNULL,
exif_name C(250) NOTNULL,
exif_value_short C(250),
exif_value_long X
CONSTRAINT ', CONSTRAINT `fisheye_exif_content_ref` FOREIGN KEY (`content_id`) REFERENCES `".BIT_DB_PREFIX."liberty_content` (`content_id`)'
",
'liberty_thumbnail_queue' => "
content_id I4 PRIMARY,
queue_date I8 NOTNULL,
begin_date I8,
end_date I8,
resize_original integer
"
);
global $gBitInstaller;
foreach( array_keys( $tables ) AS $tableName ) {
$gBitInstaller->registerSchemaTable( FISHEYE_PKG_NAME, $tableName, $tables[$tableName] );
}
$indices = array (
'fisheye_gallery_id_idx' => array( 'table' => 'fisheye_gallery', 'cols' => 'gallery_id', 'opts' => NULL ),
'fisheye_gallery_content_idx' => array( 'table' => 'fisheye_gallery', 'cols' => 'content_id', 'opts' => array( 'UNIQUE' ) ),
'fisheye_image_id_idx' => array( 'table' => 'fisheye_image', 'cols' => 'image_id', 'opts' => NULL ),
'fisheye_image_content_idx' => array( 'table' => 'fisheye_image', 'cols' => 'content_id', 'opts' => array( 'UNIQUE' ) ),
);
$gBitInstaller->registerSchemaIndexes( FISHEYE_PKG_NAME, $indices );
$gBitInstaller->registerPackageInfo( FISHEYE_PKG_NAME, array(
'description' => "FishEye is a package for creating image galleries",
'license' => '<a href="http://www.gnu.org/licenses/licenses.html#LGPL">LGPL</a>'
) );
// ### Sequences
$sequences = array (
'fisheye_gallery_id_seq' => array( 'start' => 1 ),
'fisheye_image_id_seq' => array( 'start' => 1 )
);
$gBitInstaller->registerSchemaSequences( FISHEYE_PKG_NAME, $sequences );
// ### Default Preferences
$gBitInstaller->registerPreferences( FISHEYE_PKG_NAME, array(
array( FISHEYE_PKG_NAME, 'fisheye_list_title','y'),
array( FISHEYE_PKG_NAME, 'fisheye_list_created','y'),
array( FISHEYE_PKG_NAME, 'fisheye_list_user','y'),
array( FISHEYE_PKG_NAME, 'fisheye_list_hits','y'),
array( FISHEYE_PKG_NAME, 'fisheye_list_thumbnail','y'),
array( FISHEYE_PKG_NAME, 'fisheye_list_thumbnail_size','small'),
array( FISHEYE_PKG_NAME, 'fisheye_gallery_list_title','y'),
array( FISHEYE_PKG_NAME, 'fisheye_gallery_list_description','y'),
array( FISHEYE_PKG_NAME, 'fisheye_gallery_list_image_titles','y'),
array( FISHEYE_PKG_NAME, 'fisheye_gallery_default_rows_per_page','5'),
array( FISHEYE_PKG_NAME, 'fisheye_gallery_default_cols_per_page','3'),
array( FISHEYE_PKG_NAME, 'fisheye_gallery_default_thumbnail_size','small'),
array( FISHEYE_PKG_NAME, 'fisheye_image_list_title','y'),
array( FISHEYE_PKG_NAME, 'fisheye_image_list_description','y'),
array( FISHEYE_PKG_NAME, 'fisheye_image_default_thumbnail_size','medium'),
array( FISHEYE_PKG_NAME, 'fisheye_menu_text','Image Galleries'),
// more intuitive if we can see all galleries we can upload images to
array( FISHEYE_PKG_NAME, 'fisheye_show_public_on_upload','y'),
array( FISHEYE_PKG_NAME, 'fisheye_show_all_to_admins','y'),
) );
// ### Default User Permissions
$gBitInstaller->registerUserPermissions( FISHEYE_PKG_NAME, array(
array('p_fisheye_view', 'Can view image galleries', 'basic', FISHEYE_PKG_NAME),
array('p_fisheye_create', 'Can create an image gallery', 'registered', FISHEYE_PKG_NAME),
array('p_fisheye_edit', 'Can edit image gallery', 'registered', FISHEYE_PKG_NAME),
array('p_fisheye_upload', 'Can upload images to gallery', 'registered', FISHEYE_PKG_NAME),
array('p_fisheye_admin', 'Can admin image galleries', 'editors', FISHEYE_PKG_NAME),
array('p_fisheye_upload_nonimages', 'Can upload non_image files', 'editors', FISHEYE_PKG_NAME),
array('p_fisheye_change_thumb_size', 'Can set the thumbnail size for a gallery', 'editors', FISHEYE_PKG_NAME),
array('p_fisheye_create_public_gal', 'Can create public galleries any user can load images into', 'editors', FISHEYE_PKG_NAME),
) );
?>
|