commit 2f604f1a0b245da3834caebf73f0773c1de77106
Author: Petr Lukašík <lukasik@rtsoft.cz>
Date:   Wed Jun 5 16:22:27 2019 +0200

    Re #7510 úprava na využití struktury nette session

diff --git a/app/AdminModule/presenters/TransportPresenter.php b/app/AdminModule/presenters/TransportPresenter.php
index 945f725..487bee3 100644
--- a/app/AdminModule/presenters/TransportPresenter.php
+++ b/app/AdminModule/presenters/TransportPresenter.php
@@ -8,6 +8,7 @@ use App\Enum\EFlashMessage;
 use App\Model\Facade\TransportFacade;
 use App\Model\Repository\ObjectTypeRepository;
 use App\Model\Repository\SurfaceTypeRepository;
+use App\Model\TransportModel;
 use App\Utils\TextParser;
 
 class TransportPresenter extends BaseUserPresenter
@@ -27,12 +28,16 @@ class TransportPresenter extends BaseUserPresenter
     /** @var TransportFacade */
     private $transportFacade;
 
+    /** @var TransportModel */
+    private $transportModel;
+
     public function __construct(
         IImportFormFactory $importFormFactory,
         IExportFormFactory $exportFormFactory,
         SurfaceTypeRepository $surfaceTypeRepository,
         ObjectTypeRepository $objectTypeRepository,
-        TransportFacade $transportFacade
+        TransportFacade $transportFacade,
+        TransportModel $transportModel
     )
     {
         parent::__construct();
@@ -41,6 +46,7 @@ class TransportPresenter extends BaseUserPresenter
         $this->surfaceTypeRepository = $surfaceTypeRepository;
         $this->objectTypeRepository = $objectTypeRepository;
         $this->transportFacade = $transportFacade;
+        $this->transportModel = $transportModel;
     }
 
     /**
@@ -53,11 +59,10 @@ class TransportPresenter extends BaseUserPresenter
         $surfaceTypes = $this->surfaceTypeRepository->fetchSurfaceTypes();
         $parser->setTypes($objectTypes, $surfaceTypes);
 
-        // Potřebuju to jako persistentní data do další akce presenteru
-        $_SESSION['parsedText'] = $parser->parseText();
+        $this->transportModel->setParsedText($parser->parseText());
 
         $this->template->fileName = $parser->getTextFile()->getName();
-        $this->template->parsedFile = $_SESSION['parsedText'];
+        $this->template->parsedFile = $this->transportModel->getParsedText();
         $this->template->transliterationNum = $this->countTransliterations();
         $this->template->surfaces = $surfaceTypes;
     }
@@ -67,8 +72,7 @@ class TransportPresenter extends BaseUserPresenter
      */
     public function actionConfirmPreview()
     {
-        $result = $this->transportFacade->saveImportedData($_SESSION['parsedText']);
-        $_SESSION['parsedText'] = null;
+        $result = $this->transportFacade->saveImportedData($this->transportModel->getParsedText());
 
         if ($result) {
             $this->presenter->flashMessage('All data were imported successfully.', EFlashMessage::SUCCESS);
diff --git a/app/config/model.neon b/app/config/model.neon
index 9ed4e83..c9c793e 100644
--- a/app/config/model.neon
+++ b/app/config/model.neon
@@ -23,4 +23,5 @@ services:
     - App\Model\Facade\TransportFacade
 
     #Sessions
-    - App\Model\TransliterationSearchModel
\ No newline at end of file
+    - App\Model\TransliterationSearchModel
+    - App\Model\TransportModel
\ No newline at end of file
diff --git a/app/model/TransportModel.php b/app/model/TransportModel.php
new file mode 100644
index 0000000..d1e8cd5
--- /dev/null
+++ b/app/model/TransportModel.php
@@ -0,0 +1,44 @@
+<?php
+
+
+namespace App\Model;
+
+
+use Nette\Http\Session;
+use Nette\Http\SessionSection;
+
+class TransportModel
+{
+    const SECTION_NAME = "Transport";
+    const SECTION_EXPIRATION = 0;
+
+    /** @var SessionSection  */
+    private $section;
+
+    public function __construct(Session $session)
+    {
+        $this->section = $session->getSection(self::SECTION_NAME);
+        $this->section->setExpiration(self::SECTION_EXPIRATION);
+    }
+
+    /**
+     * @return SessionSection
+     */
+    public function getTransportSection(){
+        return $this->section;
+    }
+
+    /**
+     * @param array $parsedText
+     */
+    public function setParsedText(array $parsedText){
+        $this->section->parsedText = $parsedText;
+    }
+
+    /**
+     * @return array
+     */
+    public function getParsedText(){
+        return $this->section->parsedText;
+    }
+}
\ No newline at end of file
