/**
  * Show the extension configuration form. The whole form field handling is done
  * in the corresponding view helper
  *
  * @param array $extension Extension information, must contain at least the key
  * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
  * @return void
  */
 public function showConfigurationFormAction(array $extension)
 {
     if (!array_key_exists('key', $extension)) {
         throw new ExtensionManagerException('Extension key not found.', 1359206803);
     }
     $configuration = $this->configurationItemRepository->findByExtensionKey($extension['key']);
     if ($configuration) {
         $this->view->assign('configuration', $configuration)->assign('extension', $extension);
     } else {
         /** @var Extension $extension */
         $extension = $this->extensionRepository->findOneByCurrentVersionByExtensionKey($extension['key']);
         // Extension has no configuration and is a distribution
         if ($extension->getCategory() === Extension::DISTRIBUTION_CATEGORY) {
             $this->redirect('welcome', 'Distribution', NULL, array('extension' => $extension->getUid()));
         }
         throw new ExtensionManagerException('The extension ' . htmlspecialchars($extension['key']) . ' has no configuration.');
     }
 }
Exemplo n.º 2
0
 /**
  * Show the extension configuration form. The whole form field handling is done
  * in the corresponding view helper
  *
  * @param array $extension Extension information, must contain at least the key
  * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
  * @return void
  */
 public function showConfigurationFormAction(array $extension)
 {
     if (!isset($extension['key'])) {
         throw new ExtensionManagerException('Extension key not found.', 1359206803);
     }
     $extKey = $extension['key'];
     $configuration = $this->configurationItemRepository->findByExtensionKey($extKey);
     if ($configuration) {
         $this->view->assign('configuration', $configuration)->assign('extension', $extension);
     } else {
         /** @var Extension $extension */
         $extension = $this->extensionRepository->findOneByCurrentVersionByExtensionKey($extKey);
         // Extension has no configuration and is a distribution
         if ($extension->getCategory() === Extension::DISTRIBUTION_CATEGORY) {
             $this->redirect('welcome', 'Distribution', null, ['extension' => $extension->getUid()]);
         }
         throw new ExtensionManagerException('The extension ' . $extKey . ' has no configuration.', 1476047775);
     }
 }