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 directory (this is the // default for the media firewall), then don't delete it. // Need to consider the settings for all gedcoms foreach (get_all_gedcoms() as $ged_id=>$gedcom) { $MEDIA_FIREWALL_ROOTDIR=get_gedcom_setting($ged_id, 'MEDIA_FIREWALL_ROOTDIR', WT_DATA_DIR); $MEDIA_DIRECTORY =get_gedcom_setting($ged_id, 'MEDIA_DIRECTORY'); if (realpath($MEDIA_FIREWALL_ROOTDIR)==realpath(WT_DATA_DIR)) { $locked_by_context[]=trim($MEDIA_DIRECTORY, '/'); } } print_header(WT_I18N::translate('Cleanup data directory')); echo '

', WT_I18N::translate('Cleanup data directory'), '

', '

', WT_I18N::translate('To delete a file or subdirectory from the data directory drag it to the wastebasket or select its checkbox. Click the Delete button to permanently remove the indicated files.'), '

', WT_I18N::translate('Files marked with %s are required for proper operation and cannot be removed.', ''), '

'; //post back if (isset($_REQUEST['to_delete'])) { echo '
', WT_I18N::translate('Deleted files:'), '
'; foreach ($_REQUEST['to_delete'] as $k=>$v) { if (is_dir(WT_DATA_DIR.$v)) { full_rmdir(WT_DATA_DIR.$v); } elseif (file_exists(WT_DATA_DIR.$v)) { unlink(WT_DATA_DIR.$v); } echo '
', $v, '
'; } } require_once WT_ROOT.'js/prototype.js.htm'; require_once WT_ROOT.'js/scriptaculous.js.htm'; echo '
'; $dir=dir(WT_DATA_DIR); $entries=array(); while (false !== ($entry=$dir->read())) { $entries[]=$entry; } sort($entries); echo '
    '; foreach ($entries as $entry) { if ($entry[0] != '.') { if (in_array($entry, $locked_by_context)) { echo "
  • "; echo ' ', $entry, ''; } else { echo "
  • "; echo '', $entry; $element[] = "li_".$entry; } echo '
  • '; } } echo '
'; $dir->close(); echo '
', '
', '', '
', '
 
', '
    ', '
', '
', WT_JS_START; foreach($element as $val) { echo "new Draggable('".$val."', {revert:true});"; } echo 'Droppables.add("trash", {', 'hoverclass: "facts_valuered",', 'onDrop: function(element) {', ' $("trashlist").innerHTML +=', ' \'
  • \'+ element.attributes.name.value +\'
  • \' ;', ' element.style.display = \'none\';', '}});', 'function ul_clear() {', ' $("trashlist").innerHTML = "";', ' list = document.getElementById("reorder_list");', ' children = list.childNodes;', ' for(i=0; i', WT_I18N::translate('Delete'), '', '

    ', '', '
    '; print_footer();