View source
<?php
function filebrowser_schema() {
$schema['filebrowser'] = array(
'fields' => array(
'path' => array(
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
),
'location' => array(
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
),
'can_explore' => array(
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'disp-width' => '1',
),
),
'primary key' => array(
'path',
),
);
return $schema;
}
function filebrowser_install() {
drupal_install_schema('filebrowser');
}
function filebrowser_uninstall() {
drupal_uninstall_schema('filebrowser');
}
function filebrowser_update_6100() {
$ret = array();
global $conf;
if (isset($conf['filebrowser_root']) && !db_table_exists('filebrowser')) {
db_create_table($ret, 'filebrowser', array(
'fields' => array(
'path' => array(
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
),
'location' => array(
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
),
'can_explore' => array(
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'disp-width' => '1',
),
),
'primary key' => array(
'path',
),
));
$ret[] = update_sql("INSERT INTO {filebrowser} (path, location, can_explore) VALUES ('filebrowser', '{$conf['filebrowser_root']}', 1)");
}
variable_del('filebrowser_icons');
variable_del('filebrowser_root');
variable_del('filebrowser_hide_description_files');
return $ret;
}