[TASK] Rebuild extension translation list in lang module
[Packages/TYPO3.CMS.git] / typo3 / sysext / lang / Classes / Domain / Model / LanguageSelectionForm.php
index 2c35afe..15457c6 100644 (file)
@@ -35,26 +35,66 @@ class LanguageSelectionForm extends \TYPO3\CMS\Extbase\DomainObject\AbstractEnti
        /**
         * @var array
         */
-       protected $locale = array();
+       protected $languages = array();
 
        /**
-        * Setter for the choosen locale
+        * @var array
+        */
+       protected $selectedLanguages = array();
+
+       /**
+        * Setter for the languages
         *
-        * @param array $locale all locale that were selected in the form
+        * @param array $locale Selected languages
         * @return void
         */
-       public function setLocale(array $locale) {
-               $this->locale = $locale;
+       public function setLanguages(array $languages) {
+               $this->languages = $languages;
        }
 
        /**
-        * Getter for the choosen locale
+        * Getter for the languages
         *
         * @return array
         */
-       public function getLocale() {
-               return $this->locale;
+       public function getLanguages() {
+               return $this->languages;
+       }
+
+       /**
+        * Setter for the selected languages
+        *
+        * @param array $locale Selected languages
+        * @return void
+        */
+       public function setSelectedLanguages(array $selectedLanguages) {
+               $this->selectedLanguages = $selectedLanguages;
        }
-}
 
+       /**
+        * Getter for the selected languages
+        *
+        * @return array
+        */
+       public function getSelectedLanguages() {
+               return $this->selectedLanguages;
+       }
+
+       /**
+        * Returns a comma separated list of selected languages
+        *
+        * @return string
+        */
+       public function getSelectedLanguagesLocaleList() {
+               if (!empty($this->selectedLanguages) && is_array($this->selectedLanguages)) {
+                       $locales = array();
+                       foreach ($this->selectedLanguages as $language) {
+                               $locales[] = $language->getLocale();
+                       }
+                       return implode(',', $locales);
+               }
+               return '';
+       }
+
+}
 ?>
\ No newline at end of file