Commit 98dc7455 authored by Andreas Wolf's avatar Andreas Wolf Committed by Thomas Löffler
Browse files

[TASK] Adjust TYPO3 core classes to namespaces

Change-Id: I762f91d0247bad9c7ae4bde992ac1bdf14b2383f
Reviewed-on: https://review.typo3.org/50612

Reviewed-by: Thomas Löffler's avatarThomas Löffler <loeffler@spooner-web.de>
Tested-by: Thomas Löffler's avatarThomas Löffler <loeffler@spooner-web.de>
parent e6479c24
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
/** /**
* Cache for extension files * Cache for extension files
*/ */
class Tx_TerFe2_Cache_FileCache implements t3lib_Singleton class Tx_TerFe2_Cache_FileCache implements \TYPO3\CMS\Core\SingletonInterface
{ {
/** /**
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
/** /**
* Abstract controller * Abstract controller
*/ */
abstract class Tx_TerFe2_Controller_AbstractController extends Tx_Extbase_MVC_Controller_ActionController abstract class Tx_TerFe2_Controller_AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
{ {
/** /**
...@@ -78,7 +78,7 @@ abstract class Tx_TerFe2_Controller_AbstractController extends Tx_Extbase_MVC_Co ...@@ -78,7 +78,7 @@ abstract class Tx_TerFe2_Controller_AbstractController extends Tx_Extbase_MVC_Co
protected function translate($label, array $arguments = array()) protected function translate($label, array $arguments = array())
{ {
$extensionKey = $this->request->getControllerExtensionKey(); $extensionKey = $this->request->getControllerExtensionKey();
return Tx_Extbase_Utility_Localization::translate($label, $extensionKey, $arguments); return \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate($label, $extensionKey, $arguments);
} }
...@@ -94,7 +94,7 @@ abstract class Tx_TerFe2_Controller_AbstractController extends Tx_Extbase_MVC_Co ...@@ -94,7 +94,7 @@ abstract class Tx_TerFe2_Controller_AbstractController extends Tx_Extbase_MVC_Co
* @param array $arguments Arguments to pass to the target action * @param array $arguments Arguments to pass to the target action
* @return void * @return void
*/ */
protected function redirectWithMessage($message, $action, $title = '', $severity = t3lib_FlashMessage::OK, protected function redirectWithMessage($message, $action, $title = '', $severity = \TYPO3\CMS\Core\Messaging\FlashMessage::OK,
$controller = NULL, $extension = NULL, array $arguments = NULL) $controller = NULL, $extension = NULL, array $arguments = NULL)
{ {
$this->flashMessageContainer->add($message, $title, $severity); $this->flashMessageContainer->add($message, $title, $severity);
...@@ -133,7 +133,7 @@ abstract class Tx_TerFe2_Controller_AbstractController extends Tx_Extbase_MVC_Co ...@@ -133,7 +133,7 @@ abstract class Tx_TerFe2_Controller_AbstractController extends Tx_Extbase_MVC_Co
*/ */
protected function redirectWithError($message, $action, $controller = NULL, $extension = NULL, array $arguments = NULL) protected function redirectWithError($message, $action, $controller = NULL, $extension = NULL, array $arguments = NULL)
{ {
$this->flashMessageContainer->add($message, '', t3lib_FlashMessage::ERROR); $this->flashMessageContainer->add($message, '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
$this->clearPageCache($GLOBALS['TSFE']->id); $this->clearPageCache($GLOBALS['TSFE']->id);
$this->redirect($action, $controller, $extension, $arguments); $this->redirect($action, $controller, $extension, $arguments);
} }
...@@ -151,7 +151,7 @@ abstract class Tx_TerFe2_Controller_AbstractController extends Tx_Extbase_MVC_Co ...@@ -151,7 +151,7 @@ abstract class Tx_TerFe2_Controller_AbstractController extends Tx_Extbase_MVC_Co
*/ */
protected function forwardWithError($message, $action, $controller = NULL, $extension = NULL, array $arguments = NULL) protected function forwardWithError($message, $action, $controller = NULL, $extension = NULL, array $arguments = NULL)
{ {
$this->flashMessageContainer->add($message, '', t3lib_FlashMessage::ERROR); $this->flashMessageContainer->add($message, '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
$this->clearPageCache($GLOBALS['TSFE']->id); $this->clearPageCache($GLOBALS['TSFE']->id);
$this->forward($action, $controller, $extension, $arguments); $this->forward($action, $controller, $extension, $arguments);
} }
...@@ -166,8 +166,8 @@ abstract class Tx_TerFe2_Controller_AbstractController extends Tx_Extbase_MVC_Co ...@@ -166,8 +166,8 @@ abstract class Tx_TerFe2_Controller_AbstractController extends Tx_Extbase_MVC_Co
protected function clearPageCache($pages) protected function clearPageCache($pages)
{ {
if (!empty($pages)) { if (!empty($pages)) {
$pages = t3lib_div::intExplode(',', $pages, TRUE); $pages = \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $pages, TRUE);
Tx_Extbase_Utility_Cache::clearPageCache($pages); $this->cacheService->clearPageCache([$pages]);
} }
} }
...@@ -182,7 +182,7 @@ abstract class Tx_TerFe2_Controller_AbstractController extends Tx_Extbase_MVC_Co ...@@ -182,7 +182,7 @@ abstract class Tx_TerFe2_Controller_AbstractController extends Tx_Extbase_MVC_Co
*/ */
protected function addBaseUriIfNecessary($uri) protected function addBaseUriIfNecessary($uri)
{ {
return t3lib_div::locationHeaderUrl($uri); return \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl($uri);
} }
} }
......
...@@ -20,7 +20,7 @@ class Tx_TerFe2_Controller_Eid_ExtensionController ...@@ -20,7 +20,7 @@ class Tx_TerFe2_Controller_Eid_ExtensionController
{ {
/** /**
* @var t3lib_DB * @var \TYPO3\CMS\Core\Database\DatabaseConnection
*/ */
protected $databaseConnection; protected $databaseConnection;
...@@ -91,4 +91,4 @@ class Tx_TerFe2_Controller_Eid_ExtensionController ...@@ -91,4 +91,4 @@ class Tx_TerFe2_Controller_Eid_ExtensionController
} }
$controller = new Tx_TerFe2_Controller_Eid_ExtensionController(); $controller = new Tx_TerFe2_Controller_Eid_ExtensionController();
$controller->dispatch(t3lib_div::_GET('action')); $controller->dispatch(\TYPO3\CMS\Core\Utility\GeneralUtility::_GET('action'));
...@@ -65,7 +65,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst ...@@ -65,7 +65,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst
protected $session; protected $session;
/** /**
* @var Tx_Extbase_Persistence_Manager * @var \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager
*/ */
protected $persistenceManager; protected $persistenceManager;
...@@ -94,7 +94,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst ...@@ -94,7 +94,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst
$this->ownerRepository = $this->objectManager->get('Tx_T3oAjaxlogin_Domain_Repository_UserRepository'); $this->ownerRepository = $this->objectManager->get('Tx_T3oAjaxlogin_Domain_Repository_UserRepository');
$this->providerManager = $this->objectManager->get('Tx_TerFe2_Provider_ProviderManager'); $this->providerManager = $this->objectManager->get('Tx_TerFe2_Provider_ProviderManager');
$this->session = $this->objectManager->get('Tx_TerFe2_Persistence_Session'); $this->session = $this->objectManager->get('Tx_TerFe2_Persistence_Session');
$this->persistenceManager = $this->objectManager->get('Tx_Extbase_Persistence_Manager'); $this->persistenceManager = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager::class);
// Show insecure extensions only for reviewers // Show insecure extensions only for reviewers
$this->extensionRepository->setShowInsecure($this->securityRole->isReviewer()); $this->extensionRepository->setShowInsecure($this->securityRole->isReviewer());
...@@ -224,7 +224,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst ...@@ -224,7 +224,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst
$this->view->assign('loggedInUser', $loggedInUser); $this->view->assign('loggedInUser', $loggedInUser);
/** @var Tx_TerFe2_Service_Documentation $documentationService */ /** @var Tx_TerFe2_Service_Documentation $documentationService */
$documentationService = t3lib_div::makeInstance('Tx_TerFe2_Service_Documentation'); $documentationService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_TerFe2_Service_Documentation');
$documentationLink = $documentationService->getDocumentationLink($extension->getExtKey(), $extension->getLastVersion()->getVersionString()); $documentationLink = $documentationService->getDocumentationLink($extension->getExtKey(), $extension->getLastVersion()->getVersionString());
$this->view->assign('documentationLink', $documentationLink); $this->view->assign('documentationLink', $documentationLink);
...@@ -236,7 +236,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst ...@@ -236,7 +236,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst
// gets all other extensions from the owner // gets all other extensions from the owner
$this->extensionRepository->setDefaultOrderings( $this->extensionRepository->setDefaultOrderings(
array( array(
'lastVersion.uploadDate' => Tx_Extbase_Persistence_QueryInterface::ORDER_DESCENDING 'lastVersion.uploadDate' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING
) )
); );
$otherExtensionsByUser = $this->extensionRepository->findAllOtherFromFrontendUser($extension, $extension->getFrontendUser()); $otherExtensionsByUser = $this->extensionRepository->findAllOtherFromFrontendUser($extension, $extension->getFrontendUser());
...@@ -249,7 +249,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst ...@@ -249,7 +249,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst
// adds username // adds username
$url .= '&user_id=' . urlencode($extension->getFlattrUsername()); $url .= '&user_id=' . urlencode($extension->getFlattrUsername());
// adds current url // adds current url
/** @var Tx_Extbase_MVC_Web_Routing_UriBuilder $uriBuilder */ /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
$uriBuilder = $this->controllerContext->getUriBuilder(); $uriBuilder = $this->controllerContext->getUriBuilder();
$uriBuilder->setArguments( $uriBuilder->setArguments(
array( array(
...@@ -351,7 +351,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst ...@@ -351,7 +351,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst
} }
if (!empty($tag)) { if (!empty($tag)) {
$tags = array(); $tags = array();
$intermediateTags = t3lib_div::trimExplode(' ', $tag, TRUE); $intermediateTags = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(' ', $tag, TRUE);
foreach ($intermediateTags as $tag) { foreach ($intermediateTags as $tag) {
$tag = trim($tag, ','); $tag = trim($tag, ',');
if (!empty($tag)) { if (!empty($tag)) {
...@@ -382,7 +382,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst ...@@ -382,7 +382,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst
$this->translate('msg.extension_updated'), $this->translate('msg.extension_updated'),
'edit', 'edit',
'', '',
t3lib_FlashMessage::OK, \TYPO3\CMS\Core\Messaging\FlashMessage::OK,
'Extension', 'Extension',
NULL, NULL,
array('extension' => $extension) array('extension' => $extension)
...@@ -392,7 +392,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst ...@@ -392,7 +392,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst
$this->translate('msg.extension_updated'), $this->translate('msg.extension_updated'),
'index', 'index',
'', '',
t3lib_FlashMessage::OK, \TYPO3\CMS\Core\Messaging\FlashMessage::OK,
'Registerkey' 'Registerkey'
); );
} }
...@@ -413,7 +413,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst ...@@ -413,7 +413,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst
'Tag "' . htmlspecialchars($tag->getTitle()) . '" was removed', 'Tag "' . htmlspecialchars($tag->getTitle()) . '" was removed',
'edit', 'edit',
'', '',
t3lib_FlashMessage::OK, \TYPO3\CMS\Core\Messaging\FlashMessage::OK,
'Extension', 'Extension',
NULL, NULL,
array('extension' => $extension) array('extension' => $extension)
...@@ -453,7 +453,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst ...@@ -453,7 +453,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst
$version = $this->versionRepository->findOneByExtensionAndVersionString($extension, $versionString); $version = $this->versionRepository->findOneByExtensionAndVersionString($extension, $versionString);
if (!$version) { if (!$version) {
$this->redirectWithMessage($this->translate('msg.version_not_found'), 'show', '', t3lib_FlashMessage::ERROR, NULL, NULL, array('extension' => $extension)); $this->redirectWithMessage($this->translate('msg.version_not_found'), 'show', '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, NULL, NULL, array('extension' => $extension));
} }
// Get file path // Get file path
...@@ -481,14 +481,14 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst ...@@ -481,14 +481,14 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst
// Check if file exists // Check if file exists
if (empty($fileUrl) || !Tx_TerFe2_Utility_File::fileExists($fileUrl)) { if (empty($fileUrl) || !Tx_TerFe2_Utility_File::fileExists($fileUrl)) {
$this->redirectWithMessage($this->translate('msg.file_not_found') . ': ' . basename($fileUrl), 'show', '', t3lib_FlashMessage::ERROR, NULL, NULL, array('extension' => $extension)); $this->redirectWithMessage($this->translate('msg.file_not_found') . ': ' . basename($fileUrl), 'show', '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, NULL, NULL, array('extension' => $extension));
} }
// Check file hash of t3x packages // Check file hash of t3x packages
if ($format === 't3x') { if ($format === 't3x') {
$fileHash = Tx_TerFe2_Utility_File::getFileHash($fileUrl); $fileHash = Tx_TerFe2_Utility_File::getFileHash($fileUrl);
if ($fileHash != $version->getFileHash()) { if ($fileHash != $version->getFileHash()) {
$this->redirectWithMessage($this->translate('msg.file_hash_not_equal'), 'show', '', t3lib_FlashMessage::ERROR, NULL, NULL, array('extension' => $extension)); $this->redirectWithMessage($this->translate('msg.file_hash_not_equal'), 'show', '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, NULL, NULL, array('extension' => $extension));
} }
} }
...@@ -509,7 +509,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst ...@@ -509,7 +509,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst
// Send file to browser // Send file to browser
if (!Tx_TerFe2_Utility_File::transferFile($fileUrl)) { if (!Tx_TerFe2_Utility_File::transferFile($fileUrl)) {
$this->redirectWithMessage($this->translate('msg.could_not_transfer_file'), 'show', '', t3lib_FlashMessage::ERROR, NULL, NULL, array('extension' => $extension)); $this->redirectWithMessage($this->translate('msg.could_not_transfer_file'), 'show', '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, NULL, NULL, array('extension' => $extension));
} }
// Fallback // Fallback
...@@ -528,7 +528,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst ...@@ -528,7 +528,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst
*/ */
public function uploadVersionAction(Tx_TerFe2_Domain_Model_Extension $extension, array $form = array()) public function uploadVersionAction(Tx_TerFe2_Domain_Model_Extension $extension, array $form = array())
{ {
if (!t3lib_extMgm::isLoaded('ter')) { if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('ter')) {
$this->flashMessageContainer->add($this->translate('msq.createVersionTerNotLoaded')); $this->flashMessageContainer->add($this->translate('msq.createVersionTerNotLoaded'));
} }
$this->view->assign('extension', $extension); $this->view->assign('extension', $extension);
...@@ -563,7 +563,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst ...@@ -563,7 +563,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst
$this->forwardWithError($this->translate('msg.acceptGPL'), 'uploadVersion'); $this->forwardWithError($this->translate('msg.acceptGPL'), 'uploadVersion');
} }
if (!t3lib_extMgm::isLoaded('ter')) { if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('ter')) {
$this->forwardWithError($this->translate('msg.createVersionTerNotLoaded'), 'uploadVersion'); $this->forwardWithError($this->translate('msg.createVersionTerNotLoaded'), 'uploadVersion');
} }
if (empty($this->frontendUser['username'])) { if (empty($this->frontendUser['username'])) {
...@@ -619,7 +619,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst ...@@ -619,7 +619,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst
* *
* @param array $options Options for extension list * @param array $options Options for extension list
* @param array $restoreSearch Restore last search from session * @param array $restoreSearch Restore last search from session
* @return Tx_Extbase_Persistence_ObjectStorage Objects * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage Objects
*/ */
protected function getExtensions(array &$options, $restoreSearch = FALSE) protected function getExtensions(array &$options, $restoreSearch = FALSE)
{ {
...@@ -633,8 +633,8 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst ...@@ -633,8 +633,8 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst
} }
// Direction // Direction
$desc = Tx_Extbase_Persistence_QueryInterface::ORDER_DESCENDING; $desc = \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING;
$asc = Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING; $asc = \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING;
$direction = $desc; $direction = $desc;
if (!empty($options['direction'])) { if (!empty($options['direction'])) {
$direction = ($options['direction'] === 'asc' ? $asc : $desc); $direction = ($options['direction'] === 'asc' ? $asc : $desc);
......
...@@ -106,7 +106,7 @@ class Tx_TerFe2_Controller_MediaController extends Tx_TerFe2_Controller_Abstract ...@@ -106,7 +106,7 @@ class Tx_TerFe2_Controller_MediaController extends Tx_TerFe2_Controller_Abstract
$extension->addMedia($newMedia); $extension->addMedia($newMedia);
} }
$actionParameters = array('extension' => $extension); $actionParameters = array('extension' => $extension);
$this->redirectWithMessage($this->translate('msg.media_created'), 'show', '', t3lib_FlashMessage::OK, 'Extension', NULL, $actionParameters); $this->redirectWithMessage($this->translate('msg.media_created'), 'show', '', \TYPO3\CMS\Core\Messaging\FlashMessage::OK, 'Extension', NULL, $actionParameters);
} }
......
...@@ -125,12 +125,12 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab ...@@ -125,12 +125,12 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab
$this->extensionRepository->add($extension); $this->extensionRepository->add($extension);
$this->flashMessageContainer->add( $this->flashMessageContainer->add(
'', $this->translate('registerkey.key_registered'), t3lib_FlashMessage::OK '', $this->translate('registerkey.key_registered'), \TYPO3\CMS\Core\Messaging\FlashMessage::OK
); );
$this->redirect('index', 'Registerkey'); $this->redirect('index', 'Registerkey');
} else { } else {
$this->flashMessageContainer->add( $this->flashMessageContainer->add(
$this->resolveWSErrorMessage('not_register.message'), $this->resolveWSErrorMessage('not_register.title'), t3lib_FlashMessage::ERROR $this->resolveWSErrorMessage('not_register.message'), $this->resolveWSErrorMessage('not_register.title'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR
); );
} }
} else { } else {
...@@ -152,7 +152,7 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab ...@@ -152,7 +152,7 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab
$this->flashMessageContainer->add( $this->flashMessageContainer->add(
$message, $message,
$this->resolveWSErrorMessage($error . '.title'), $this->resolveWSErrorMessage($error . '.title'),
t3lib_FlashMessage::ERROR \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR
); );
} }
...@@ -170,15 +170,15 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab ...@@ -170,15 +170,15 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab
$registeredExtensions = $this->terConnection->getExtensionKeysByUser($error); $registeredExtensions = $this->terConnection->getExtensionKeysByUser($error);
if ($error) { if ($error) {
$this->flashMessageContainer->add( $this->flashMessageContainer->add(
$this->resolveWSErrorMessage($error), '', t3lib_FlashMessage::ERROR $this->resolveWSErrorMessage($error), '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR
); );
} elseif (!is_array($registeredExtensions)) { } elseif (!is_array($registeredExtensions)) {
$this->flashMessageContainer->add( $this->flashMessageContainer->add(
$this->resolveWSErrorMessage('result_empty.message'), $this->resolveWSErrorMessage('result_empty.title'), t3lib_FlashMessage::ERROR $this->resolveWSErrorMessage('result_empty.message'), $this->resolveWSErrorMessage('result_empty.title'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR
); );
} elseif (empty($registeredExtensions)) { } elseif (empty($registeredExtensions)) {
$this->flashMessageContainer->add( $this->flashMessageContainer->add(
$this->resolveWSErrorMessage('nothing_found'), '', t3lib_FlashMessage::WARNING $this->resolveWSErrorMessage('nothing_found'), '', \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING
); );
} else { } else {
...@@ -195,7 +195,7 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab ...@@ -195,7 +195,7 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab
// $this->flashMessageContainer->add( // $this->flashMessageContainer->add(
// sprintf('%s already exists.', $extensionKey), // sprintf('%s already exists.', $extensionKey),
// '', // '',
// t3lib_FlashMessage::NOTICE // \TYPO3\CMS\Core\Messaging\FlashMessage::NOTICE
// ); // );
$countSkipped++; $countSkipped++;
} else { } else {
...@@ -207,7 +207,7 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab ...@@ -207,7 +207,7 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab
// $this->flashMessageContainer->add( // $this->flashMessageContainer->add(
// '', // '',
// sprintf('%s salvaged.', $extensionKey ), // sprintf('%s salvaged.', $extensionKey ),
// t3lib_FlashMessage::OK // \TYPO3\CMS\Core\Messaging\FlashMessage::OK
// ); // );
$countSalvaged++; $countSalvaged++;
...@@ -215,19 +215,19 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab ...@@ -215,19 +215,19 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab
} }
if ($countSalvaged > 0) { if ($countSalvaged > 0) {
$this->flashMessageContainer->add( $this->flashMessageContainer->add(
$this->translate('registerkey.salvage.success', array($countSalvaged)), '', t3lib_FlashMessage::OK $this->translate('registerkey.salvage.success', array($countSalvaged)), '', \TYPO3\CMS\Core\Messaging\FlashMessage::OK
); );
} elseif ($countSkipped == 1) { } elseif ($countSkipped == 1) {
$this->flashMessageContainer->add( $this->flashMessageContainer->add(
$this->translate('registerkey.salvage.pass1.message'), $this->translate('registerkey.salvage.pass.title'), t3lib_FlashMessage::WARNING $this->translate('registerkey.salvage.pass1.message'), $this->translate('registerkey.salvage.pass.title'), \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING
); );
} elseif ($countSkipped > 1) { } elseif ($countSkipped > 1) {
$this->flashMessageContainer->add( $this->flashMessageContainer->add(
$this->translate('registerkey.salvage.pass.message', array($countSkipped)), $this->translate('registerkey.salvage.pass.title'), t3lib_FlashMessage::WARNING $this->translate('registerkey.salvage.pass.message', array($countSkipped)), $this->translate('registerkey.salvage.pass.title'), \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING
); );
} else { } else {
$this->flashMessageContainer->add( $this->flashMessageContainer->add(
$this->resolveWSErrorMessage('nothing_found'), '', t3lib_FlashMessage::WARNING $this->resolveWSErrorMessage('nothing_found'), '', \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING
); );
} }
} }
...@@ -305,7 +305,7 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab ...@@ -305,7 +305,7 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab
$this->view->assign('extension', $extension); $this->view->assign('extension', $extension);
$this->view->assign('loggedIn', $this->userRepository->findCurrent()); $this->view->assign('loggedIn', $this->userRepository->findCurrent());
} else { } else {
$this->flashMessageContainer->add($this->translate('registerkey.notyourextension'), '', t3lib_FlashMessage::ERROR); $this->flashMessageContainer->add($this->translate('registerkey.notyourextension'), '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
$this->redirect('index', 'Registerkey'); $this->redirect('index', 'Registerkey');
} }
} }
...@@ -338,28 +338,28 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab ...@@ -338,28 +338,28 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab
if ($this->terConnection->assignExtensionKey($extension->getExtKey(), $this->frontendUser['username'], $error)) { if ($this->terConnection->assignExtensionKey($extension->getExtKey(), $this->frontendUser['username'], $error)) {
// Update categories // Update categories
$this->extensionRepository->update($extension); $this->extensionRepository->update($extension);
$this->flashMessageContainer->add($this->translate('registerkey.key_updated', '', t3lib_FlashMessage::OK)); $this->flashMessageContainer->add($this->translate('registerkey.key_updated', '', \TYPO3\CMS\Core\Messaging\FlashMessage::OK));
$this->redirect('index', 'Registerkey'); $this->redirect('index', 'Registerkey');
} else { } else {
// TODO: Show different message by $error code // TODO: Show different message by $error code
$this->flashMessageContainer->add($this->translate('registerkey.key_update_failed', '', t3lib_FlashMessage::ERROR)); $this->flashMessageContainer->add($this->translate('registerkey.key_update_failed', '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR));
} }
} else { } else {
$this->flashMessageContainer->add( $this->flashMessageContainer->add(
$this->resolveWSErrorMessage($error . '.message'), $this->resolveWSErrorMessage($error . '.title'), t3lib_FlashMessage::ERROR $this->resolveWSErrorMessage($error . '.message'), $this->resolveWSErrorMessage($error . '.title'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR
); );
} }
} else { } else {
// Update categories // Update categories
$extension = $this->updateCategories($extension, $categories); $extension = $this->updateCategories($extension, $categories);
$this->extensionRepository->update($extension); $this->extensionRepository->update($extension);
$this->flashMessageContainer->add($this->translate('registerkey.key_updated', '', t3lib_FlashMessage::OK)); $this->flashMessageContainer->add($this->translate('registerkey.key_updated', '', \TYPO3\CMS\Core\Messaging\FlashMessage::OK));
$this->redirect('index', 'Registerkey'); $this->redirect('index', 'Registerkey');
} }
$this->redirect('edit', 'Registerkey', NULL, array('extension' => $extension)); $this->redirect('edit', 'Registerkey', NULL, array('extension' => $extension));
} else { } else {
$this->flashMessageContainer->add($this->translate('registerkey.notyourextension', '', t3lib_FlashMessage::ERROR)); $this->flashMessageContainer->add($this->translate('registerkey.notyourextension', '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR));
$this->redirect('index', 'Registerkey'); $this->redirect('index', 'Registerkey');
} }
} }
...@@ -403,7 +403,7 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab ...@@ -403,7 +403,7 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab
$newUser = trim($newUser); $newUser = trim($newUser);
if ($newUser == '') { if ($newUser == '') {
$this->flashMessageContainer->add( $this->flashMessageContainer->add(
'', $this->translate('registerkey.newuserempty'), t3lib_FlashMessage::ERROR '', $this->translate('registerkey.newuserempty'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR
); );
} elseif ((strtolower($extension->getFrontendUser()) == strtolower($GLOBALS['TSFE']->fe_user->user['username'])) || $this->securityRole->isAdmin()) { } elseif ((strtolower($extension->getFrontendUser()) == strtolower($GLOBALS['TSFE']->fe_user->user['username'])) || $this->securityRole->isAdmin()) {
...@@ -415,15 +415,15 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab ...@@ -415,15 +415,15 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab