コード例 #1
0
 /**
  * Creation/update a language pack for the Static Info Tables
  *
  * @param \SJBR\StaticInfoTables\Domain\Model\LanguagePack $languagePack
  * @return string An HTML display of data overview
  */
 public function createLanguagePackAction(\SJBR\StaticInfoTables\Domain\Model\LanguagePack $languagePack)
 {
     // Add the localization columns
     $locale = $languagePack->getLocale();
     // Get the English name of the locale
     $localeUtility = $this->objectManager->get('SJBR\\StaticInfoTables\\Utility\\LocaleUtility');
     $language = $localeUtility->getLanguageFromLocale($locale);
     $languagePack->setLanguage($language);
     $languagePack->setTypo3VersionRange($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][\TYPO3\CMS\Core\Utility\GeneralUtility::camelCaseToLowerCaseUnderscored($this->extensionName)]['constraints']['depends']['typo3']);
     // If version is not set, use the version of the base extension
     if (!$languagePack->getVersion()) {
         $languagePack->setVersion($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][\TYPO3\CMS\Core\Utility\GeneralUtility::camelCaseToLowerCaseUnderscored($this->extensionName)]['version']);
     }
     $this->countryRepository->addLocalizationColumns($locale);
     $this->countryZoneRepository->addLocalizationColumns($locale);
     $this->currencyRepository->addLocalizationColumns($locale);
     $this->languageRepository->addLocalizationColumns($locale);
     $this->territoryRepository->addLocalizationColumns($locale);
     // Store the Language Pack
     $languagePackRepository = $this->objectManager->get('SJBR\\StaticInfoTables\\Domain\\Repository\\LanguagePackRepository');
     $messages = $languagePackRepository->writeLanguagePack($languagePack);
     if (count($messages)) {
         foreach ($messages as $message) {
             $this->addFlashMessage($message, '', \TYPO3\CMS\Core\Messaging\AbstractMessage::OK);
         }
     }
     $this->forward('information');
 }