Commit 541c07bb authored by Daniel Goerz's avatar Daniel Goerz Committed by Wouter Wolters
Browse files

[TASK] Use flash messages for status of branch export

After a successful or unsuccessful attempt to export a
page branch to a file a short message about the outcome
is displayed. This patch improves the appearance of the
message by using a FlashMessage.

Additionally a call to an undefined method is removed.

Change-Id: I41940ca865211c9347707e731c3b4a90fb11b9ba
Releases: master
Resolves: #69460
Reviewed-on: http://review.typo3.org/42967

Reviewed-by: default avatarMichael Oehlhof <typo3@oehlhof.de>
Tested-by: default avatarMichael Oehlhof <typo3@oehlhof.de>
Reviewed-by: default avatarMorton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: default avatarMorton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
parent 1f09d0c9
......@@ -20,6 +20,7 @@ use TYPO3\CMS\Core\Database\DatabaseConnection;
use TYPO3\CMS\Core\Http\Response;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Resource\DuplicationBehavior;
use TYPO3\CMS\Core\Resource\ResourceFactory;
......@@ -457,10 +458,23 @@ class ImportExportController extends \TYPO3\CMS\Backend\Module\BaseScriptClass i
$temporaryFolderForExport->delete();
}
$this->content .= $this->doc->section($GLOBALS['LANG']->getLL('exportdata_savedFile'), sprintf($GLOBALS['LANG']->getLL('exportdata_savedInSBytes', TRUE), $file->getPublicUrl(), GeneralUtility::formatSize(strlen($out))), 0, 1);
/** @var FlashMessage $flashMessage */
$flashMessage = GeneralUtility::makeInstance(
FlashMessage::class,
sprintf($GLOBALS['LANG']->getLL('exportdata_savedInSBytes', TRUE), $file->getPublicUrl(), GeneralUtility::formatSize(strlen($out))),
$GLOBALS['LANG']->getLL('exportdata_savedFile'),
FlashMessage::OK
);
} else {
$this->content .= $this->doc->section($GLOBALS['LANG']->getLL('exportdata_problemsSavingFile'), sprintf($GLOBALS['LANG']->getLL('exportdata_badPathS', TRUE), $this->getTemporaryFolderPath()), 0, 1, 2);
/** @var FlashMessage $flashMessage */
$flashMessage = GeneralUtility::makeInstance(
FlashMessage::class,
sprintf($GLOBALS['LANG']->getLL('exportdata_badPathS', TRUE), $saveFolder->getPublicUrl()),
$GLOBALS['LANG']->getLL('exportdata_problemsSavingFile'),
FlashMessage::ERROR
);
}
$this->content .= $flashMessage->render();
}
}
// OUTPUT to BROWSER:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment