Paperyard
Public Member Functions | Private Attributes | List of all members
Paperyard\Controllers\Archive\ConfirmDetails Class Reference
Inheritance diagram for Paperyard\Controllers\Archive\ConfirmDetails:
Paperyard\Controllers\BasicController

Public Member Functions

 __construct (Twig $view, LoggerInterface $logger, Messages $flash)
 
 __invoke (Request $request, Response $response, $args)
 
 render ()
 
- Public Member Functions inherited from Paperyard\Controllers\BasicController
 getPlugins ()
 
 registerPlugin ($name, $type=PluginType::NORMAL)
 
 getLanguageFlag ()
 

Private Attributes

 $rootPath = '/data/sort/'
 
 $documentFullPath
 

Additional Inherited Members

- Protected Attributes inherited from Paperyard\Controllers\BasicController
 $view
 
 $logger
 
 $flash
 

Detailed Description

Definition at line 14 of file ConfirmDetails.php.

Constructor & Destructor Documentation

Paperyard\Controllers\Archive\ConfirmDetails::__construct ( Twig  $view,
LoggerInterface  $logger,
Messages  $flash 
)
Parameters
Twig$view
LoggerInterface$logger
Messages$flash

Definition at line 27 of file ConfirmDetails.php.

28  {
29  $this->view = $view;
30  $this->logger = $logger;
31  $this->flash = $flash;
32 
33  $this->registerPlugin('bootstrap-datepicker.min');
34  $this->registerPlugin('pdf.min', PluginType::ONLY_JS);
35  $this->registerPlugin('confirm_details', PluginType::ONLY_JS);
36  }
registerPlugin($name, $type=PluginType::NORMAL)

Member Function Documentation

Paperyard\Controllers\Archive\ConfirmDetails::__invoke ( Request  $request,
Response  $response,
  $args 
)

Definition at line 38 of file ConfirmDetails.php.

39  {
40  // we encodes the path in case any special character is used
41  $this->documentFullPath = base64_decode($request->getAttribute('path'));
42 
43  // test if document exists
44  if (!file_exists($this->documentFullPath)) {
45  $this->flash->addMessage('error', _('Document not found.'));
46  return $response->withRedirect('/latest');
47  }
48 
49  // display document details
50  $this->view->render($response, 'archive/confirm_details.twig', $this->render());
51  return $response;
52  }
Paperyard\Controllers\Archive\ConfirmDetails::render ( )

Definition at line 54 of file ConfirmDetails.php.

55  {
56  return array(
57  'plugins' => parent::getPlugins(),
58  'document' => new Document($this->documentFullPath)
59  );
60  }

Member Data Documentation

Paperyard\Controllers\Archive\ConfirmDetails::$documentFullPath
private

Definition at line 20 of file ConfirmDetails.php.

Paperyard\Controllers\Archive\ConfirmDetails::$rootPath = '/data/sort/'
private

Definition at line 17 of file ConfirmDetails.php.


The documentation for this class was generated from the following file: