[TASK] Cleanup EM Code
[Packages/TYPO3.CMS.git] / typo3 / sysext / extensionmanager / Classes / Controller / ConfigurationController.php
index 39c7a3a..694da55 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Extensionmanager\Controller;
+
 /***************************************************************
  *  Copyright notice
  *
@@ -24,8 +26,6 @@
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
-
-
 /**
  * Controller for configuration related actions.
  *
  * @package Extension Manager
  * @subpackage Controller
  */
-class Tx_Extensionmanager_Controller_ConfigurationController extends Tx_Extensionmanager_Controller_AbstractController {
+class ConfigurationController extends \TYPO3\CMS\Extensionmanager\Controller\AbstractController {
 
        /**
-        * @var Tx_Extensionmanager_Domain_Repository_ConfigurationItemRepository
+        * @var \TYPO3\CMS\Extensionmanager\Domain\Repository\ConfigurationItemRepository
         */
        protected $configurationItemRepository;
 
        /**
-        * @param Tx_Extensionmanager_Domain_Repository_ConfigurationItemRepository $configurationItemRepository
+        * @param \TYPO3\CMS\Extensionmanager\Domain\Repository\ConfigurationItemRepository $configurationItemRepository
         * @return void
         */
-       public function injectConfigurationItemRepository(
-               Tx_Extensionmanager_Domain_Repository_ConfigurationItemRepository $configurationItemRepository
-       ) {
+       public function injectConfigurationItemRepository(\TYPO3\CMS\Extensionmanager\Domain\Repository\ConfigurationItemRepository $configurationItemRepository) {
                $this->configurationItemRepository = $configurationItemRepository;
        }
 
@@ -54,15 +52,12 @@ class Tx_Extensionmanager_Controller_ConfigurationController extends Tx_Extensio
         * Show the extension configuration form. The whole form field handling is done
         * in the corresponding view helper
         *
-        * @return void
+        * @param array $extension
         */
-       public function showConfigurationFormAction() {
-               $extension = $this->request->getArgument('extension');
+       public function showConfigurationFormAction($extension) {
                $extension = array_merge($extension, $GLOBALS['TYPO3_LOADED_EXT'][$extension['key']]);
                $configuration = $this->configurationItemRepository->findByExtension($extension);
-               $this->view
-                       ->assign('configuration', $configuration)
-                       ->assign('extension', $extension);
+               $this->view->assign('configuration', $configuration)->assign('extension', $extension);
        }
 
        /**
@@ -74,18 +69,15 @@ class Tx_Extensionmanager_Controller_ConfigurationController extends Tx_Extensio
         * @return void
         */
        public function saveAction(array $config, $extensionKey) {
-               /** @var $configurationUtility Tx_Extensionmanager_Utility_Configuration */
-               $configurationUtility = $this->objectManager->get('Tx_Extensionmanager_Utility_Configuration');
+               /** @var $configurationUtility \TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility */
+               $configurationUtility = $this->objectManager->get('TYPO3\\CMS\\Extensionmanager\\Utility\\ConfigurationUtility');
                $currentFullConfiguration = $configurationUtility->getCurrentConfiguration($extensionKey);
-               $newConfiguration = t3lib_div::array_merge_recursive_overrule($currentFullConfiguration, $config);
-
-               $configurationUtility->writeConfiguration(
-                       $configurationUtility->convertValuedToNestedConfiguration($newConfiguration),
-                       $extensionKey
-               );
+               $newConfiguration = \TYPO3\CMS\Core\Utility\GeneralUtility::array_merge_recursive_overrule($currentFullConfiguration, $config);
+               $configurationUtility->writeConfiguration($configurationUtility->convertValuedToNestedConfiguration($newConfiguration), $extensionKey);
                $this->redirect('showConfigurationForm', NULL, NULL, array('extension' => array('key' => $extensionKey)));
        }
 
-
 }
+
+
 ?>
\ No newline at end of file