'Stores files created by IMCE.', 'fields' => array( 'fid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'description' => 'The {files}.fid that belongs to IMCE.', ), ), 'primary key' => array('fid'), ); return $schema; } /** * Update from 5.x to 6.x. */ function imce_update_6000() { module_load_include('inc', 'imce', 'inc/imce.core.profiles'); imce_install_profiles(); return array(); } /** * New option: total user quota. */ function imce_update_6001() { $profiles = variable_get('imce_profiles', array()); foreach ($profiles as $id => $profile) { $profiles[$id]['tuquota'] = 0; } variable_set('imce_profiles', $profiles); return array(); } /** * Make file browser tab optional in user profiles. */ function imce_update_6002() { $profiles = variable_get('imce_profiles', array()); foreach ($profiles as $id => $profile) { $profiles[$id]['usertab'] = isset($profiles[$id]['usertab']) ? $profiles[$id]['usertab'] : 1; } variable_set('imce_profiles', $profiles); return array(array('success' => TRUE, 'query' => 'File browser tab in user profiles was made optional.')); } /** * Convert 6.x-1.x to 6.x-2.x */ function imce_update_6200() { //delete deprecated variables.cancelled! return array(); } /** * Introduce {imce_files} db table where IMCE files are stored. */ function imce_update_6201() { $ret = array(); if (db_table_exists('imce_files')) { return $ret; } $table = array( 'description' => 'Stores files created by IMCE.', 'fields' => array( 'fid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'description' => 'The {files}.fid that belongs to IMCE.', ), ), 'primary key' => array('fid'), ); db_create_table($ret, 'imce_files', $table); return $ret; } /** * Fixes misconfigurations where anonymous user is given User-1 profile */ function imce_update_6202() { $roles = variable_get('imce_roles_profiles', array()); $rid = DRUPAL_ANONYMOUS_RID; if (!empty($roles[$rid]['pid']) && $roles[$rid]['pid'] == 1) { $roles[$rid]['pid'] = '0'; variable_set('imce_roles_profiles', $roles); } return array(); }