requireAdminLogin() ->setPageTitle(/* I18N: The “Data folder” is a configuration setting */ WT_I18N::translate('Clean up data folder')) ->pageHeader(); require WT_ROOT.'includes/functions/functions_edit.php'; function full_rmdir($dir) { if (!is_writable($dir)) { if (!@chmod($dir, WT_PERM_EXE)) { return false; } } $d = dir($dir); while (false !== ($entry = $d->read())) { if ($entry == '.' || $entry == '..') { continue; } $entry = $dir . '/' . $entry; if (is_dir($entry)) { if (!full_rmdir($entry)) { return false; } continue; } if (!@unlink($entry)) { $d->close(); return false; } } $d->close(); rmdir($dir); return TRUE; } // Vars $ajaxdeleted = false; $locked_by_context = array('index.php', 'config.ini.php'); // If we are storing the media in the data folder (this is the // defaultl), then don’t delete it. // Need to consider the settings for all gedcoms foreach (WT_Tree::getAll() as $tree) { $MEDIA_DIRECTORY=$tree->preference('MEDIA_DIRECTORY'); if (substr($MEDIA_DIRECTORY, 0, 3) !='../') { // Just need to add the first part of the path $tmp = explode('/', $MEDIA_DIRECTORY); $locked_by_context[] = $tmp[0]; } } echo '
', WT_I18N::translate('Files marked with %s are required for proper operation and cannot be removed.', ''), '
'; //post back if (isset($_REQUEST['to_delete'])) { echo '