From: Benjamin Mack Date: Sun, 30 Nov 2014 01:41:11 +0000 (+0100) Subject: [TASK] Adapt FormEngine translated records to Bootstrap X-Git-Tag: 7.1.0~711 X-Git-Url: http://git.typo3.org/Packages/TYPO3.CMS.git/commitdiff_plain/579660210dc5710a2fe9f4cd0bb1bd28438c97cc [TASK] Adapt FormEngine translated records to Bootstrap When editing a translated record, a message is shown of what is written in the original field. Additionally, if the original record was modified since the last change, a diff is shown. If an icon is available then it is displayed. The patch adapts the following things: 1. CSS classes are renamed in order to reflect FormEngine and not old TCEForms namings. 2. If the original language does not have an icon the label of the icon is shown again. This actually a bug introduced when adapting sprites in FormEngine and is now back to the original version. 3. Styling is adapted, also for the diff to use bootstrap values. Resolves: #63440 Releases: master Change-Id: I314446e3e184dff26f52c70e37c6969c069728bd Reviewed-on: http://review.typo3.org/34800 Reviewed-by: Georg Ringer Tested-by: Georg Ringer Reviewed-by: Stefan Neufeind Tested-by: Stefan Neufeind --- diff --git a/typo3/sysext/backend/Classes/Form/Element/FlexElement.php b/typo3/sysext/backend/Classes/Form/Element/FlexElement.php index d7239cac9ac6..420bc603348c 100644 --- a/typo3/sysext/backend/Classes/Form/Element/FlexElement.php +++ b/typo3/sysext/backend/Classes/Form/Element/FlexElement.php @@ -468,7 +468,7 @@ class FlexElement extends AbstractFormElement { $theFormEl = $this->formEngine->getSingleField_SW($table, $field, $row, $fakePA); $theTitle = htmlspecialchars($fakePA['fieldConf']['label']); if (!in_array('DEF', $rotateLang)) { - $defInfo = '
' + $defInfo = '
' . $this->formEngine->getLanguageIcon($table, $row, 0) . $this->formEngine->previewFieldValue($editData[$key]['vDEF'], $fakePA['fieldConf'], $field) . ' 
'; @@ -478,7 +478,7 @@ class FlexElement extends AbstractFormElement { if (!$PA['_noEditDEF']) { $prLang = $this->formEngine->getAdditionalPreviewLanguages(); foreach ($prLang as $prL) { - $defInfo .= '
' + $defInfo .= '
' . $this->formEngine->getLanguageIcon($table, $row, ('v' . $prL['ISOcode'])) . $this->formEngine->previewFieldValue($editData[$key][('v' . $prL['ISOcode'])], $fakePA['fieldConf'], $field) . ' 
'; diff --git a/typo3/sysext/backend/Classes/Form/FormEngine.php b/typo3/sysext/backend/Classes/Form/FormEngine.php index bf34f62c3738..1f30ed8c85c4 100644 --- a/typo3/sysext/backend/Classes/Form/FormEngine.php +++ b/typo3/sysext/backend/Classes/Form/FormEngine.php @@ -2123,18 +2123,18 @@ class FormEngine { // Don't show content if it's for IRRE child records: if ($fieldConfig['config']['type'] != 'inline') { if ($defaultLanguageValue !== '') { - $item .= '
' . $this->getLanguageIcon($table, $row, 0) + $item .= '
' . $this->getLanguageIcon($table, $row, 0) . $this->getMergeBehaviourIcon($fieldConfig['l10n_mode']) - . $this->previewFieldValue($defaultLanguageValue, $fieldConfig, $field) . ' 
'; + . $this->previewFieldValue($defaultLanguageValue, $fieldConfig, $field) . '
'; } $previewLanguages = $this->getAdditionalPreviewLanguages(); foreach ($previewLanguages as $previewLanguage) { $defaultLanguageValue = BackendUtility::getProcessedValue($table, $field, $this->additionalPreviewLanguageData[$table . ':' . $row['uid']][$previewLanguage['uid']][$field], 0, 1); if ($defaultLanguageValue !== '') { - $item .= '
' + $item .= '
' . $this->getLanguageIcon($table, $row, ('v' . $previewLanguage['ISOcode'])) . $this->getMergeBehaviourIcon($fieldConfig['l10n_mode']) - . $this->previewFieldValue($defaultLanguageValue, $fieldConfig, $field) . ' 
'; + . $this->previewFieldValue($defaultLanguageValue, $fieldConfig, $field) . '
'; } } } @@ -2170,8 +2170,10 @@ class FormEngine { BackendUtility::getProcessedValue($table, $field, $dLVal['old'][$field], 0, 1), BackendUtility::getProcessedValue($table, $field, $dLVal['new'][$field], 0, 1) ); - $item .= '
' . '
' - . htmlspecialchars($this->getLL('l_changeInOrig')) . ':
' . $diffres . '
'; + $item .= '
+
' . htmlspecialchars($this->getLL('l_changeInOrig')) . '
+
' . $diffres . '
+
'; } } } @@ -4327,7 +4329,7 @@ class FormEngine { } } $out = ''; - if ($this->cachedLanguageFlag[$mainKey][$sys_language_uid]['flagIcon']) { + if ($this->cachedLanguageFlag[$mainKey][$sys_language_uid]['flagIcon'] && $this->cachedLanguageFlag[$mainKey][$sys_language_uid]['flagIcon'] != 'empty-empty') { $out .= IconUtility::getSpriteIcon($this->cachedLanguageFlag[$mainKey][$sys_language_uid]['flagIcon']); $out .= ' '; } elseif ($this->cachedLanguageFlag[$mainKey][$sys_language_uid]['title']) { diff --git a/typo3/sysext/core/Classes/Utility/DiffUtility.php b/typo3/sysext/core/Classes/Utility/DiffUtility.php index 805f7be08835..2da79cdf3bf5 100644 --- a/typo3/sysext/core/Classes/Utility/DiffUtility.php +++ b/typo3/sysext/core/Classes/Utility/DiffUtility.php @@ -95,10 +95,10 @@ class DiffUtility { $outString .= $this->addClearBuffer($clearBuffer); $clearBuffer = ''; if (is_array($diffResArray[$a + 1]['old'])) { - $outString .= '<' . $wrapTag . ' class="diff-r">' . htmlspecialchars(implode(' ', $diffResArray[($a + 1)]['old'])) . ' '; + $outString .= '<' . $wrapTag . ' class="text-danger">' . htmlspecialchars(implode(' ', $diffResArray[($a + 1)]['old'])) . ' '; } if (is_array($diffResArray[$a + 1]['new'])) { - $outString .= '<' . $wrapTag . ' class="diff-g">' . htmlspecialchars(implode(' ', $diffResArray[($a + 1)]['new'])) . ' '; + $outString .= '<' . $wrapTag . ' class="text-success">' . htmlspecialchars(implode(' ', $diffResArray[($a + 1)]['new'])) . ' '; } $chInfParts = explode(',', $diffResArray[$a + 1]['changeInfo']); if ((string)$chInfParts[0] === (string)($a + 1)) { diff --git a/typo3/sysext/t3skin/Resources/Private/Styles/TYPO3/_element_tceforms.less b/typo3/sysext/t3skin/Resources/Private/Styles/TYPO3/_element_tceforms.less index d752239097a8..9eafa66a1065 100644 --- a/typo3/sysext/t3skin/Resources/Private/Styles/TYPO3/_element_tceforms.less +++ b/typo3/sysext/t3skin/Resources/Private/Styles/TYPO3/_element_tceforms.less @@ -754,19 +754,31 @@ select option.c-divider { text-transform: uppercase; } -.typo3-TCEforms div.typo3-TCEforms-originalLanguageValue { +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +show text of default language under the translated input field + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ +.t3-form-original-language { background-color: #dadada; border: 1px solid #c0c0c0; + padding: 2px; + font-size: 0.9em; + margin-top: 4px; } -.typo3-TCEforms div.typo3-TCEforms-diffBox { - background-color: white; - border: 1px solid black; +.t3-form-original-language-diff { + border: 1px solid #c0c0c0; + font-size: 0.9em; + margin-top: 4px; } -.typo3-TCEforms div.typo3-TCEforms-diffBox-header { - background-color: red; +.t3-form-original-language-diffheader { + .bg-danger(); font-weight: bold; + padding: 2px; +} + +.t3-form-original-language-diffcontent { + padding: 2px; } /* Default. Always used on main-palettes in the bottom of the forms */ diff --git a/typo3/sysext/t3skin/Resources/Public/Css/visual/t3skin.css b/typo3/sysext/t3skin/Resources/Public/Css/visual/t3skin.css index 3378854ee4ea..7cc1e2df551b 100644 --- a/typo3/sysext/t3skin/Resources/Public/Css/visual/t3skin.css +++ b/typo3/sysext/t3skin/Resources/Public/Css/visual/t3skin.css @@ -9958,17 +9958,31 @@ select option.c-divider { font-style: italic; text-transform: uppercase; } -.typo3-TCEforms div.typo3-TCEforms-originalLanguageValue { +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +show text of default language under the translated input field + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ +.t3-form-original-language { background-color: #dadada; border: 1px solid #c0c0c0; + padding: 2px; + font-size: 0.9em; + margin-top: 4px; } -.typo3-TCEforms div.typo3-TCEforms-diffBox { - background-color: white; - border: 1px solid black; +.t3-form-original-language-diff { + border: 1px solid #c0c0c0; + font-size: 0.9em; + margin-top: 4px; } -.typo3-TCEforms div.typo3-TCEforms-diffBox-header { - background-color: red; +.t3-form-original-language-diffheader { + background-color: #efc7c7; font-weight: bold; + padding: 2px; +} +a.t3-form-original-language-diffheader:hover { + background-color: #e49f9f; +} +.t3-form-original-language-diffcontent { + padding: 2px; } /* Default. Always used on main-palettes in the bottom of the forms */ .typo3-TCEforms .typo3-TCEforms-checkboxArray td {