filedepot.install in filedepot 6
Same filename and directory in other branches
filedepot.install filedepot: File Management Module developed by Nextide www.nextide.ca
File
filedepot.installView source
<?php
/**
* @file
* filedepot.install
* filedepot: File Management Module developed by Nextide www.nextide.ca
*
*/
/**
* Implementation of hook_install().
*/
function filedepot_install() {
drupal_install_schema('filedepot');
/* Setup the default extension mapping so icons appear in the file listing */
$rawextensions = 'jpg=jpg.gif, gif=gif.gif, bmp=bmp.gif, doc=doc.gif, docx=doc.gif, xls=xls.gif, xlsx=xls.gif,';
$rawextensions .= 'ppt=ppt.gif, pptx=ppt.gif, mpp=mpp.gif, pdf=pdf.gif, txt=txt.gif, zip=zip.gif';
$extensionlines = preg_split('/\\r\\n|\\r|\\n/', $rawextensions);
foreach ($extensionlines as $line) {
if (!empty($line)) {
$records = explode(',', $line);
foreach ($records as $mapping) {
$data = explode('=', $mapping);
$ext = trim($data[0]);
$icon = trim($data[1]);
$extensiondata[$ext] = $icon;
}
}
}
variable_set('filedepot_extension_data', serialize($extensiondata));
}
/**
* Implementation of hook_uninstall().
*/
function filedepot_uninstall() {
global $base_path;
include_once './' . drupal_get_path('module', 'filedepot') . '/filedepot.class.php';
$filedepot = filedepot::getInstance();
include_once './' . drupal_get_path('module', 'filedepot') . '/lib-common.php';
$query = db_query("SELECT nid FROM {filedepot_categories} WHERE pid=0");
while ($A = db_fetch_array($query)) {
$filedepot
->deleteFolder($A['nid']);
}
$sitepath = dirname(realpath($_SERVER['SCRIPT_FILENAME']));
$sitepath = str_replace('\\', '/', $sitepath);
if (@is_dir($filedepot->tmp_incoming_path) === TRUE) {
filedepot_delTree($filedepot->tmp_incoming_path);
}
if (@is_dir($filedepot->tmp_storage_path) === TRUE) {
filedepot_delTree($filedepot->tmp_storage_path);
}
if (@is_dir($filedepot->root_storage_path) === TRUE) {
filedepot_delTree($filedepot->root_storage_path);
}
drupal_uninstall_schema('filedepot');
variable_del('filedepot_content_type_initialized');
variable_del('filedepot_allow_folder_duplicates');
variable_del('filedepot_default_allow_broadcasts');
variable_del('filedepot_default_notify_filechange');
variable_del('filedepot_default_notify_newfile');
variable_del('filedepot_notifications_enabled');
variable_del('filedepot_pass1_recordcount');
variable_del('filedepot_pass2_recordcount');
variable_del('filedepot_storage_path');
variable_del('filedepot_yui_baseurl');
variable_del('filedepot_filter_mode');
variable_del('filedepot_filetype_filter');
variable_del('filedepot_filetype_filterdata');
variable_del('filedepot_default_owner');
variable_del('filedepot_default_perms_data');
variable_del('filedepot_default_roles');
variable_del('filedepot_extensions');
variable_del('filedepot_extension_data');
}
/**
* Implementation of hook_schema().
*/
function filedepot_schema() {
$schema['filedepot_categories'] = array(
'description' => t('TODO: please describe this table!'),
'fields' => array(
'cid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'serial',
'size' => 'medium',
'not null' => TRUE,
),
'pid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
'default' => 0,
),
'nid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'vid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'name' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
'default' => '',
),
'description' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
'default' => '',
),
'folderorder' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'small',
'not null' => TRUE,
'default' => 0,
),
'last_modified_date' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array(
'cid',
),
'indexes' => array(
'nid' => array(
'nid',
'vid',
),
'pid' => array(
'pid',
),
),
);
$schema['filedepot_files'] = array(
'description' => t('TODO: please describe this table!'),
'fields' => array(
'fid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'serial',
'size' => 'medium',
'not null' => TRUE,
),
'cid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
'default' => 0,
),
'fname' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
'default' => '',
),
'title' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '128',
'not null' => TRUE,
'default' => '',
),
'description' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'text',
'size' => 'big',
'not null' => FALSE,
),
'version' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'unsigned' => TRUE,
'size' => 'tiny',
'not null' => TRUE,
'default' => 1,
),
'cckfid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'size' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'mimetype' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
'default' => '',
),
'extension' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '8',
'not null' => TRUE,
'default' => '',
),
'submitter' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
'default' => 0,
),
'status' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
'date' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'version_ctl' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
'status_changedby_uid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array(
'fid',
),
'indexes' => array(
'cid' => array(
'cid',
),
),
);
$schema['filedepot_access'] = array(
'description' => t('filedepot Access Rights - for user or group access to category'),
'fields' => array(
'accid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'serial',
'size' => 'medium',
'not null' => TRUE,
),
'catid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
'default' => 0,
),
'permid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
'default' => 0,
),
'permtype' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '8',
'not null' => TRUE,
'default' => '0',
),
'view' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
'upload' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
'upload_direct' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
'upload_ver' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
'approval' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
'admin' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array(
'accid',
),
'indexes' => array(
'catid' => array(
'catid',
),
'permid' => array(
'permid',
),
'permtype' => array(
'permtype',
),
),
);
$schema['filedepot_fileversions'] = array(
'description' => t('TODO: please describe this table!'),
'fields' => array(
'id' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'serial',
'size' => 'medium',
'not null' => TRUE,
),
'fid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
'default' => 0,
),
'fname' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
'default' => '',
),
'version' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'unsigned' => TRUE,
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
'cckfid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'size' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'notes' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'text',
'size' => 'big',
'not null' => TRUE,
),
'date' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'uid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
'default' => 0,
),
'status' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array(
'id',
),
'indexes' => array(
'fid' => array(
'fid',
),
),
);
$schema['filedepot_downloads'] = array(
'description' => t('TODO: please describe this table!'),
'fields' => array(
'uid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
'default' => 0,
),
'fid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'remote_ip' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '15',
'not null' => TRUE,
'default' => '',
),
'date' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
),
'indexes' => array(
'date' => array(
'date',
),
'fid' => array(
'fid',
),
'uid' => array(
'uid',
),
),
);
$schema['filedepot_favorites'] = array(
'description' => t('TODO: please describe this table!'),
'fields' => array(
'uid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
),
'fid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
),
),
'indexes' => array(
'topic_id' => array(
'fid',
),
'uid' => array(
'uid',
),
),
);
$schema['filedepot_recentfolders'] = array(
'description' => t('TODO: please describe this table!'),
'fields' => array(
'id' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'serial',
'not null' => TRUE,
),
'uid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
),
'cid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
),
),
'primary key' => array(
'id',
),
'indexes' => array(
'cid' => array(
'cid',
),
'uid' => array(
'uid',
),
),
);
$schema['filedepot_filesubmissions'] = array(
'description' => t('TODO: please describe this table!'),
'fields' => array(
'id' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'serial',
'size' => 'medium',
'not null' => TRUE,
),
'fid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
'default' => 0,
),
'cid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
'default' => 0,
),
'fname' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
'default' => '',
),
'tempname' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
'default' => '',
),
'title' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '128',
'not null' => TRUE,
'default' => '',
),
'description' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'text',
'size' => 'big',
'not null' => TRUE,
),
'cckfid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'tags' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
'default' => '',
),
'version' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'unsigned' => TRUE,
'size' => 'tiny',
'not null' => TRUE,
'default' => 1,
),
'version_note' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'text',
'size' => 'big',
'not null' => TRUE,
),
'size' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'mimetype' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
'default' => '',
),
'extension' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '8',
'not null' => TRUE,
'default' => '',
),
'submitter' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
'default' => 0,
),
'date' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'version_ctl' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
'notify' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 1,
),
'status' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array(
'id',
),
'indexes' => array(
'cid' => array(
'cid',
),
),
);
$schema['filedepot_usersettings'] = array(
'description' => t('TODO: please describe this table!'),
'fields' => array(
'uid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
),
'notify_newfile' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 1,
),
'notify_changedfile' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 1,
),
'allow_broadcasts' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 1,
),
'allowable_view_folders' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'text',
'not null' => TRUE,
),
),
'indexes' => array(
'uid' => array(
'uid',
),
),
);
$schema['filedepot_import_queue'] = array(
'description' => t('TODO: please describe this table!'),
'fields' => array(
'id' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'serial',
'not null' => TRUE,
),
'orig_filename' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '150',
'not null' => TRUE,
),
'queue_filename' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
),
'cckfid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'timestamp' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
),
'uid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
'default' => 0,
),
'mimetype' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '128',
'not null' => FALSE,
),
'size' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'description' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '255',
'not null' => FALSE,
),
'version_note' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '255',
'not null' => FALSE,
),
),
'primary key' => array(
'id',
),
);
$schema['filedepot_export_queue'] = array(
'description' => t('TODO: please describe this table!'),
'fields' => array(
'id' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'serial',
'not null' => TRUE,
),
'orig_filename' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '150',
'not null' => TRUE,
),
'token' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '20',
'not null' => TRUE,
),
'extension' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '10',
'not null' => TRUE,
),
'timestamp' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
),
'uid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
'default' => 0,
),
'fid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
),
),
'primary key' => array(
'id',
),
);
$schema['filedepot_notificationlog'] = array(
'description' => t('TODO: please describe this table!'),
'fields' => array(
'target_uid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
),
'submitter_uid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
),
'notification_type' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
),
'fid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
'default' => 0,
),
'cid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
'default' => 0,
),
'datetime' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
),
),
'indexes' => array(
'target_uid' => array(
'target_uid',
),
),
);
$schema['filedepot_notifications'] = array(
'description' => t('TODO: please describe this table!'),
'fields' => array(
'id' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'serial',
'size' => 'medium',
'not null' => TRUE,
),
'fid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
'default' => 0,
),
'ignore_filechanges' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
'cid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
'default' => 0,
),
'cid_newfiles' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
'cid_changes' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
'uid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
'default' => 0,
),
'date' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array(
'id',
),
'indexes' => array(
'cid' => array(
'cid',
),
'fid' => array(
'fid',
),
'uid' => array(
'uid',
),
),
);
$schema['nextag_words'] = array(
'description' => t('TODO: please describe this table!'),
'fields' => array(
'id' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'serial',
'not null' => TRUE,
),
'tagword' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '32',
'not null' => TRUE,
),
'displayword' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '32',
'not null' => FALSE,
),
'metric' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'small',
'not null' => TRUE,
'default' => 1,
),
'last_updated' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array(
'id',
),
'indexes' => array(
'tagword' => array(
'tagword',
),
),
);
$schema['nextag_items'] = array(
'description' => t('TODO: please describe this table!'),
'fields' => array(
'itemid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => TRUE,
),
'type' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '32',
'not null' => TRUE,
),
'tags' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'text',
'not null' => FALSE,
),
),
'indexes' => array(
'itemid' => array(
'itemid',
),
'type' => array(
'type',
),
),
);
$schema['nextag_metrics'] = array(
'description' => t('TODO: please describe this table!'),
'fields' => array(
'tagid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
),
'type' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '32',
'not null' => TRUE,
),
'groupid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => FALSE,
),
'roleid' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'medium',
'not null' => FALSE,
),
'metric' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'size' => 'small',
'not null' => TRUE,
),
'last_updated' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
),
'indexes' => array(
'tagid' => array(
'tagid',
),
'type' => array(
'type',
),
'uid' => array(
'roleid',
),
),
);
return $schema;
}
/**
* Implementation of hook_requirements().
*
* Check for PHP JSON extension and fail (or notify) if we cannot find it
*/
function filedepot_requirements($phase) {
$requirements = array();
$t = get_t();
$value = $t('Enabled');
$severity = REQUIREMENT_OK;
$description = NULL;
if (!function_exists('json_encode')) {
$value = $t('Not enabled');
$severity = REQUIREMENT_ERROR;
$description = $t('Your server does not have the PHP JSON extension enabled.');
}
$requirements['filedepot_php_json_extension'] = array(
'title' => $t('PHP JSON extension'),
'value' => $value,
'severity' => $severity,
'description' => $description,
);
return $requirements;
}
/**
* Implementation of hook_update_N().
* RC3 - Change the size field to support a larger file size (bytes)
*/
function filedepot_update_6001() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("ALTER TABLE {filedepot_files} CHANGE `size` `size` INT( 11 ) NOT NULL DEFAULT '0'");
db_query("ALTER TABLE {filedepot_fileversions} CHANGE `size` `size` INT( 11 ) NOT NULL DEFAULT '0'");
db_query("ALTER TABLE {filedepot_filesubmissions} CHANGE `size` `size` INT( 11 ) NOT NULL DEFAULT '0'");
db_query("ALTER TABLE {filedepot_import_queue} CHANGE `size` `size` INT( 11 ) NOT NULL DEFAULT '0'");
break;
case 'pgsql':
db_change_column($ret, 'filedepot_files', 'size', 'size', 'int', array(
'not null' => TRUE,
));
db_change_column($ret, 'filedepot_fileversions', 'size', 'size', 'int', array(
'not null' => TRUE,
));
db_change_column($ret, 'filedepot_filesubmissions', 'size', 'size', 'int', array(
'not null' => TRUE,
));
db_change_column($ret, 'filedepot_import_queue', 'size', 'size', 'int', array(
'not null' => TRUE,
));
break;
}
}
/**
* Implementation of hook_update_N().
* RC4 - After adding support for OG - needed to change the tag class to allow perms/metrics assigned by groups
*/
function filedepot_update_6002() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("ALTER TABLE {nextag_metrics} CHANGE `uid` `groupid` MEDIUMINT( 9 ) NULL DEFAULT NULL");
break;
case 'pgsql':
db_change_column($ret, 'nextag_metrics', 'uid', 'groupid', 'int', array(
'not null' => FALSE,
));
break;
}
}
Functions
Name![]() |
Description |
---|---|
filedepot_install | Implementation of hook_install(). |
filedepot_requirements | Implementation of hook_requirements(). |
filedepot_schema | Implementation of hook_schema(). |
filedepot_uninstall | Implementation of hook_uninstall(). |
filedepot_update_6001 | Implementation of hook_update_N(). RC3 - Change the size field to support a larger file size (bytes) |
filedepot_update_6002 | Implementation of hook_update_N(). RC4 - After adding support for OG - needed to change the tag class to allow perms/metrics assigned by groups |