Rev 58 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
<?php
global $DATABASE_DEFINITION;
$DATABASE_DEFINITION['file'] = array(
'table name' => 'file',
'key field' => 'file_id',
'display columns' => array('Name','Added','Type','Description'),
'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)',
'field info' => array(
/* date record was deleted/supserceded */
'removed_date' => array('display name' => 'removed_date' , 'type' => 'date'),
'file_id' => array('display name' => 'file_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
/* either contents of text file or ::filename:: to be a link to a file on the disk */
'content' => array('display name' => 'content' , 'type' => 'text'),
'name' => array('display name' => 'name' , 'type' => 'string' , 'width' => 64),
/* date record was added */
'added_date' => array('display name' => 'added_date' , 'type' => 'date'),
'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'),
/* A brief (or long) description of this file */
'description' => array('display name' => 'description' , 'type' => 'text')
)
);
$DATABASE_DEFINITION['file_link'] = array(
'table name' => 'file_link',
'key field' => 'file_link_id',
'display columns' => array('site','file_link_id','owner_type','file_id','site_id','owner_id'),
'display query' => 'select site,file_link_id,owner_type,file_id,site_id,owner_id from file_link',
'field info' => array(
'site' => array('display name' => 'site' , 'type' => 'or'),
'file_link_id' => array('display name' => 'file_link_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
'owner_type' => array('display name' => 'owner_type' , 'default' => 'd', 'type' => 'string'),
'file_id' => array('display name' => 'file_id' , 'type' => 'lookup', 'table' => 'file', 'keyfield' => 'file_id', 'display_field' => 'name'),
'site_id' => array('display name' => 'site_id' , 'type' => 'or'),
'owner_id' => array('display name' => 'owner_id' , 'required' => true , 'type' => 'int')
)
);
$DATABASE_DEFINITION['file_mime_type'] = array(
'table name' => 'file_mime_type',
'key field' => 'file_mime_type_id',
'display columns' => array('Extension','Type'),
'display query' => 'select extension Extension ,file_mime_type_id,mime_type Type from file_mime_type',
'field info' => array(
/* a file name extension commonly associated with this file */
'extension' => array('display name' => 'extension' , 'type' => 'string' , 'width' => 10),
'file_mime_type_id' => array('display name' => 'file_mime_type_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
/* The standardized mime type */
'mime_type' => array('display name' => 'mime_type' , 'keyfield' => true , 'type' => 'string' , 'width' => 64)
)
)
?>