2 namespace TYPO3\CMS\Backend\Configuration;
71 'flagIcon' =>
'flags-multiple',
77 foreach ($languageRecords as $languageRecord) {
78 $languages[$languageRecord[
'uid']] = $languageRecord;
82 if ($staticLangRow[
'lg_iso_2']) {
83 $languages[$languageRecord[
'uid']][
'ISOcode'] = $staticLangRow[
'lg_iso_2'];
86 if ($languageRecord[
'flag'] !==
'') {
87 $languages[$languageRecord[
'uid']][
'flagIcon'] =
'flags-' . $languageRecord[
'flag'];
104 public function translationInfo($table, $uid, $languageUid = 0, array $row = null, $selFieldList =
'')
106 if (!
$GLOBALS[
'TCA'][$table] || !$uid) {
107 return 'No table "' . $table .
'" or no UID value';
112 if (!is_array($row)) {
113 return 'Record "' . $table .
'_' . $uid .
'" was not found';
116 if ($translationTable ===
'') {
117 return 'Translation is not supported for this table!';
119 if ($translationTable === $table && $row[
$GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField']] > 0) {
120 return 'Record "' . $table .
'_' . $uid .
'" seems to be a translation already (has a language value "' . $row[
$GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField']] .
'", relation to record "' . $row[
$GLOBALS[
'TCA'][$table][
'ctrl'][
'transOrigPointerField']] .
'")';
122 if ($translationTable === $table && $row[
$GLOBALS[
'TCA'][$table][
'ctrl'][
'transOrigPointerField']] != 0) {
123 return 'Record "' . $table .
'_' . $uid .
'" seems to be a translation already (has a relation to record "' . $row[
$GLOBALS[
'TCA'][$table][
'ctrl'][
'transOrigPointerField']] .
'")';
126 if (!$selFieldList) {
127 $selFieldList =
'uid,' .
$GLOBALS[
'TCA'][$translationTable][
'ctrl'][
'languageField'];
129 $where =
$GLOBALS[
'TCA'][$translationTable][
'ctrl'][
'transOrigPointerField'] .
'=' . (int)$uid .
130 ' AND pid=' . (
int)($table ===
'pages' ? $row[
'uid'] : $row[
'pid']) .
131 ' AND ' .
$GLOBALS[
'TCA'][$translationTable][
'ctrl'][
'languageField'] . (! $languageUid ?
'>0' :
'=' . (
int)$languageUid) .
134 $translationRecords = $this->
getDatabaseConnection()->exec_SELECTgetRows($selFieldList, $translationTable, $where);
135 $translations = array();
136 $translationsErrors = array();
137 foreach ($translationRecords as $translationRecord) {
138 if (!isset($translations[$translationRecord[
$GLOBALS[
'TCA'][$translationTable][
'ctrl'][
'languageField']]])) {
139 $translations[$translationRecord[
$GLOBALS[
'TCA'][$translationTable][
'ctrl'][
'languageField']]] = $translationRecord;
141 $translationsErrors[$translationRecord[
$GLOBALS[
'TCA'][$translationTable][
'ctrl'][
'languageField']]][] = $translationRecord;
147 'CType' => $row[
'CType'],
148 'sys_language_uid' => $row[
$GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField']],
149 'translation_table' => $translationTable,
150 'translations' => $translations,
151 'excessive_translations' => $translationsErrors
174 return $GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField'] &&
$GLOBALS[
'TCA'][$table][
'ctrl'][
'transOrigPointerField'] && !
$GLOBALS[
'TCA'][$table][
'ctrl'][
'transOrigPointerTable'];
185 $translationTable =
$GLOBALS[
'TCA'][$table][
'ctrl'][
'transForeignTable'];
187 !$translationTable ||
188 !
$GLOBALS[
'TCA'][$translationTable] ||
189 !
$GLOBALS[
'TCA'][$translationTable][
'ctrl'][
'languageField'] ||
190 !
$GLOBALS[
'TCA'][$translationTable][
'ctrl'][
'transOrigPointerField'] ||
191 $GLOBALS[
'TCA'][$translationTable][
'ctrl'][
'transOrigPointerTable'] !== $table
193 $translationTable =
'';
195 return $translationTable;
204 if (strlen($modSharedTSconfig[
'properties'][
'defaultLanguageFlag'])) {
206 if (preg_match(
'/\\.gif$/', $modSharedTSconfig[
'properties'][
'defaultLanguageFlag'])) {
207 $modSharedTSconfig[
'properties'][
'defaultLanguageFlag'] = str_replace(
'.gif',
'', $modSharedTSconfig[
'properties'][
'defaultLanguageFlag']);
209 $defaultLanguageFlag =
'flags-' . $modSharedTSconfig[
'properties'][
'defaultLanguageFlag'];
211 $defaultLanguageFlag =
'empty-empty';
213 return $defaultLanguageFlag;
222 if (strlen($modSharedTSconfig[
'properties'][
'defaultLanguageLabel'])) {
223 $defaultLanguageLabel = $modSharedTSconfig[
'properties'][
'defaultLanguageLabel'] .
' (' . $this->
getLanguageService()->sl(
'LLL:EXT:lang/locallang_mod_web_list.xlf:defaultLanguage') .
')';
225 $defaultLanguageLabel = $this->
getLanguageService()->sl(
'LLL:EXT:lang/locallang_mod_web_list.xlf:defaultLanguage');
227 return $defaultLanguageLabel;