/** * Check and remove the requested files from the trash * */ function DeleteFromTrash() { global $dataDir, $langmessage; if (empty($_POST['title']) || !is_array($_POST['title'])) { message($langmessage['OOPS'] . ' (No Titles)'); return; } $titles = array(); $not_deleted = array(); foreach ($_POST['title'] as $title => $null) { $title_info = admin_trash::GetInfo($title); if ($title_info === false) { $not_deleted[] = $title; continue; } $titles[$title] = true; } admin_trash::ModTrashData(null, $titles); if (count($not_deleted) > 0) { message($langmessage['delete_incomplete'] . ': ' . implode(', ', $not_deleted)); } }
/** * View the contents of a trash file * */ function ViewTrashFile($trash_index) { global $dataDir, $langmessage, $trash_file; $title_info = admin_trash::GetInfo($trash_index); //delete / restore links echo '<div class="pull-right">'; echo common::Link('Admin_Trash', $langmessage['restore'], 'cmd=RestoreDeleted&titles[]=' . rawurlencode($trash_index), array('data-cmd' => 'cnreq', 'class' => 'gpsubmit')); echo ' '; echo common::Link('Admin_Trash', $langmessage['delete'], 'cmd=DeleteFromTrash&titles[]=' . rawurlencode($trash_index), array('data-cmd' => 'cnreq', 'class' => 'gpsubmit')); echo '</div>'; echo '<h2 class="hmargin">'; echo common::Link('Admin_Trash', $langmessage['trash']); echo ' » '; echo htmlspecialchars($title_info['title']); echo '</h2>'; echo '<hr>'; //get file sections $file_sections = gpFiles::Get($title_info['page_file'], 'file_sections'); if ($file_sections) { echo section_content::Render($file_sections, $title_info['title']); } else { echo '<p>This page no longer has any content</p>'; } }