Definition at line 17 of file Archive.php.
Paperyard\Controllers\Archive\Archive::__construct |
( |
Twig |
$view, |
|
|
LoggerInterface |
$logger, |
|
|
Messages |
$flash |
|
) |
| |
- Parameters
-
Twig | $view | |
LoggerInterface | $logger | |
Messages | $flash | |
Definition at line 33 of file Archive.php.
registerPlugin($name, $type=PluginType::NORMAL)
Paperyard\Controllers\Archive\Archive::__invoke |
( |
Request |
$request, |
|
|
Response |
$response, |
|
|
|
$args |
|
) |
| |
- Parameters
-
Request | $request | |
Response | $response | |
| $args | |
- Returns
- Response
Definition at line 51 of file Archive.php.
53 $this->archiveRelPath = $request->getAttribute(
'path');
56 if (!is_dir($this->archiveFullPath)) {
57 $this->flash->addMessage(
'error', _(
'Archive not found.'));
58 return $response->withRedirect(
'/archive');
61 $this->view->render($response,
'archive/archive.twig', $this->
render());
Paperyard\Controllers\Archive\Archive::getArchives |
( |
| ) |
|
|
private |
Finds all archives deeper than the current.
- Returns
- array all deeper archives
Definition at line 84 of file Archive.php.
91 $iterator = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($archive_path, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST);
92 foreach ($iterator as $file) {
94 $archives[] = str_replace($this->rootPath,
"", $file);
Paperyard\Controllers\Archive\Archive::getFiles |
( |
| ) |
|
|
private |
Finds all archives deeper than the current.
- Returns
- array all deeper archives
Definition at line 105 of file Archive.php.
108 $archive_search_pattern = $this->archiveFullPath .
"/*.pdf";
111 $pdfs = glob($archive_search_pattern, GLOB_NOSORT);
114 array_walk(
$pdfs,
function (&$pdf) {
115 $pdf = (
new Document($pdf))->toArray();
Paperyard\Controllers\Archive\Archive::getNewestFiles |
( |
| ) |
|
|
private |
Sort all archives by date.
- Returns
- array sorted archives
Definition at line 125 of file Archive.php.
131 usort(
$pdfs,
function($a, $b){
132 return $a[
'date'] < $b[
'date'];
Paperyard\Controllers\Archive\Archive::render |
( |
| ) |
|
- Returns
- array data to render the view
Definition at line 68 of file Archive.php.
71 'plugins' => parent::getPlugins(),
72 'languageFlag' => parent::getLanguageFlag(),
Paperyard\Controllers\Archive\Archive::$archiveFullPath |
|
private |
Paperyard\Controllers\Archive\Archive::$archiveRelPath |
|
private |
Paperyard\Controllers\Archive\Archive::$rootPath = '/data/sort' |
|
private |
The documentation for this class was generated from the following file:
- paperyard/paperyard/frontend/controllers/archive/Archive.php