TYPO3 CMS  TYPO3_6-2
LanguageController.php
Go to the documentation of this file.
1 <?php
3 
24 
30 
36 
42 
47  protected $jsonActions = array('updateTranslation');
48 
55  protected function initializeView(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface $view) {
56  $actionName = $this->request->getControllerActionName();
57  if (in_array($actionName, $this->jsonActions)) {
58  $viewObjectName = 'TYPO3\\CMS\\Lang\\View\\Language\\' . ucfirst($actionName) . 'Json';
59  $this->view = $this->objectManager->get($viewObjectName);
60  $this->view->setControllerContext($this->controllerContext);
61  $this->view->initializeView();
62  }
63  }
64 
74  public function indexAction(\TYPO3\CMS\Lang\Domain\Model\LanguageSelectionForm $languageSelectionForm = NULL, $extensions = NULL) {
75  if ($languageSelectionForm === NULL) {
76  $languageSelectionForm = $this->objectManager->get('TYPO3\\CMS\\Lang\\Domain\\Model\\LanguageSelectionForm');
77  $languageSelectionForm->setLanguages($this->languageRepository->findAll());
78  $languageSelectionForm->setSelectedLanguages($this->languageRepository->findSelected());
79  }
80 
81  if (empty($extensions)) {
82  $extensions = $this->extensionRepository->findAll();
83  }
84 
85  $this->view->assign('languageSelectionForm', $languageSelectionForm);
86  $this->view->assign('extensions', $extensions);
87  }
88 
96  public function updateLanguageSelectionAction(\TYPO3\CMS\Lang\Domain\Model\LanguageSelectionForm $languageSelectionForm) {
97  if ($languageSelectionForm !== NULL) {
98  $this->languageRepository->updateSelectedLanguages($languageSelectionForm->getSelectedLanguages());
99  }
100  $this->redirect('index');
101  }
102 
111  public function updateTranslationAction($extension, $locales) {
112  $locales = $this->updateTranslationService->updateTranslation($extension, $locales);
113  $this->view->assign('extension', $extension);
114  $this->view->assign('locales', $locales);
115  }
116 
117 }
indexAction(\TYPO3\CMS\Lang\Domain\Model\LanguageSelectionForm $languageSelectionForm=NULL, $extensions=NULL)
redirect($actionName, $controllerName=NULL, $extensionName=NULL, array $arguments=NULL, $pageUid=NULL, $delay=0, $statusCode=303)
updateLanguageSelectionAction(\TYPO3\CMS\Lang\Domain\Model\LanguageSelectionForm $languageSelectionForm)
$locales
Definition: be_users.php:6
initializeView(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface $view)