1 |
rodolico |
1 |
<?php
|
|
|
2 |
global $DATABASE_DEFINITION;
|
59 |
rodolico |
3 |
$DATABASE_DEFINITION['file'] = array(
|
|
|
4 |
'table name' => 'file',
|
|
|
5 |
'key field' => 'file_id',
|
1 |
rodolico |
6 |
'display columns' => array('Name','Added','Type','Description'),
|
59 |
rodolico |
7 |
'display query' => 'select file_id,mime_type Type, name Name,added_date Added,description Description from file join file_mime_type using (file_mime_type_id)',
|
1 |
rodolico |
8 |
'field info' => array(
|
|
|
9 |
/* date record was deleted/supserceded */
|
|
|
10 |
'removed_date' => array('display name' => 'removed_date' , 'type' => 'date'),
|
59 |
rodolico |
11 |
'file_id' => array('display name' => 'file_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
|
|
|
12 |
/* either contents of text file or ::filename:: to be a link to a file on the disk */
|
1 |
rodolico |
13 |
'content' => array('display name' => 'content' , 'type' => 'text'),
|
|
|
14 |
'name' => array('display name' => 'name' , 'type' => 'string' , 'width' => 64),
|
|
|
15 |
/* date record was added */
|
|
|
16 |
'added_date' => array('display name' => 'added_date' , 'type' => 'date'),
|
59 |
rodolico |
17 |
'file_mime_type_id' => array('display name' => 'file_mime_type_id' , 'type' => 'lookup', 'table' => 'file_mime_type', 'keyfield' => 'file_mime_type_id', 'display_field' => 'mime_type'),
|
|
|
18 |
/* A brief (or long) description of this file */
|
1 |
rodolico |
19 |
'description' => array('display name' => 'description' , 'type' => 'text')
|
|
|
20 |
)
|
|
|
21 |
);
|
59 |
rodolico |
22 |
$DATABASE_DEFINITION['file_link'] = array(
|
|
|
23 |
'table name' => 'file_link',
|
|
|
24 |
'key field' => 'file_link_id',
|
|
|
25 |
'display columns' => array('site','file_link_id','owner_type','file_id','site_id','owner_id'),
|
|
|
26 |
'display query' => 'select site,file_link_id,owner_type,file_id,site_id,owner_id from file_link',
|
1 |
rodolico |
27 |
'field info' => array(
|
|
|
28 |
'site' => array('display name' => 'site' , 'type' => 'or'),
|
59 |
rodolico |
29 |
'file_link_id' => array('display name' => 'file_link_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
|
1 |
rodolico |
30 |
'owner_type' => array('display name' => 'owner_type' , 'default' => 'd', 'type' => 'string'),
|
59 |
rodolico |
31 |
'file_id' => array('display name' => 'file_id' , 'type' => 'lookup', 'table' => 'file', 'keyfield' => 'file_id', 'display_field' => 'name'),
|
1 |
rodolico |
32 |
'site_id' => array('display name' => 'site_id' , 'type' => 'or'),
|
|
|
33 |
'owner_id' => array('display name' => 'owner_id' , 'required' => true , 'type' => 'int')
|
|
|
34 |
)
|
|
|
35 |
);
|
59 |
rodolico |
36 |
$DATABASE_DEFINITION['file_mime_type'] = array(
|
|
|
37 |
'table name' => 'file_mime_type',
|
|
|
38 |
'key field' => 'file_mime_type_id',
|
1 |
rodolico |
39 |
'display columns' => array('Extension','Type'),
|
59 |
rodolico |
40 |
'display query' => 'select extension Extension ,file_mime_type_id,mime_type Type from file_mime_type',
|
1 |
rodolico |
41 |
'field info' => array(
|
|
|
42 |
/* a file name extension commonly associated with this file */
|
|
|
43 |
'extension' => array('display name' => 'extension' , 'type' => 'string' , 'width' => 10),
|
59 |
rodolico |
44 |
'file_mime_type_id' => array('display name' => 'file_mime_type_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
|
1 |
rodolico |
45 |
/* The standardized mime type */
|
|
|
46 |
'mime_type' => array('display name' => 'mime_type' , 'keyfield' => true , 'type' => 'string' , 'width' => 64)
|
|
|
47 |
)
|
|
|
48 |
)
|
|
|
49 |
?>
|