setRedirect('trash'); } /** * List meta data of delete pages. * * @return Response */ public static function list(): Response { $Response = new Response(); $path = AM_BASE_DIR . AM_DIR_PAGES . Page::TRASH_DIRECTORY; $items = FileSystem::glob("$path/*/" . DataFile::FILENAME); $Shared = new Shared(); $trash = Page::TRASH_DIRECTORY; $pages = array(); foreach ($items as $key => $item) { $dir = basename(dirname($item)); $id = $trash . '/' . $dir; $Page = Page::fromDataFile($id, $id, $key, $Shared, $trash, 1); if ($Page) { $pages[] = array( 'title' => $Page->get(Fields::TITLE), 'lastModified' => $Page->get(Fields::TIME_LAST_MODIFIED), 'path' => $Page->path ); } usort($pages, function ($a, $b) { if ($a['lastModified'] == $b['lastModified']) { return 0; } return $a < $b ? 1 : -1; }); } return $Response->setData($pages); } /** * Permanently delete a page. * * @return Response */ public static function permanentlyDelete(): Response { $Response = new Response(); $path = Request::post('path'); if (!$path) { return $Response; } $fullPath = AM_BASE_DIR . AM_DIR_PAGES . $path; if (!is_readable($fullPath) || !is_readable(dirname($fullPath))) { return $Response; } FileSystem::trash(array($fullPath)); return $Response->setRedirect('trash'); } /** * Restore a given page to the home directory. * * @return Response */ public static function restore(): Response { $Response = new Response(); $path = Request::post('path'); $newPath = FileSystem::movePageDir($path, '/', basename($path)); return $Response->setRedirect(Page::dashboardUrlByPath($newPath)); } } __halt_compiler();----SIGNATURE:----iiwAkXNY3v2PrElpAP166gtTckritinvPTau5T7cT8A7jaJm7jj6NApuhPy7y8JEasDsismtvwqOjUwE7Ld7c7zBc5dZo732PWa2tM1cBIuvlEkzIQtz/5FC6WadJBsnOamWr6uD1EQOgjvMPmHrJCamAwOkRlfCZc3LjzUNRoNnoOOiEegPV/ovJiQYVTBmPBIns+mwKKDcGTPJ0pul70y7CWJD1kZXDbm3QPDISm9Ead6BlX/WFDTBcYKhJyvaGoIabBb96gi9EvjGnAsNNYaigR1WlUN9oMmkPtrcfarWu9CkCVZ+lix1FzWtVkFHAl2n+uVWjJfsC4TEeuTvytPanu+vub+YbrV9ndnzwYAFtZdaFSw0PvCOQ1DKlSmbAsNABuUVP8lQ1T9gCPNXCERW2voTHF77etoWzW3bIlhnF0mFiVNUtvgUvmN571U30PTjuIkJngzrPs6P+5j4RsgCKl5LTapUs/PQ9PcmmzFQa0YR6hFsCvwZaiuYIsWNPVjur0X/nLxc41YPJl1kHjp1oSpT5E6IJdc+iyqU9erG2T5AHMdcq2k7fEA51vMfG/zH+u62ztOFadALoY6L/QK8/vZ7ETAHkXiYqqHVLNQr0no3CltJ2nAAo9pMjGXjPPgIvJ9v+q3boy1h2s4DpF9goHC6eiywXaxZ+KmjEdI=----ATTACHMENT:----MzYyNjAyMzk3NTk1NTY3MCAzNTYzMzk2OTU1ODQ2MDUgMzk4ODQ1NTc0MjIzMzU5MQ==