function filedepot_uninstall in filedepot 6
Same name and namespace in other branches
- 7 filedepot.install \filedepot_uninstall()
Implementation of hook_uninstall().
File
- ./
filedepot.install, line 40 - filedepot.install filedepot: File Management Module developed by Nextide www.nextide.ca
Code
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');
}