[FEATURE] PageLayoutView - Allow to disable copy- / translate- buttons 45/52345/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Mon, 3 Apr 2017 17:59:04 +0000 (19:59 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 11 May 2017 14:26:53 +0000 (16:26 +0200)
The localization actions "Translate" and "Copy" are now toggleable by
PageTS and UserTS.

Resolves: #76910
Releases: master
Change-Id: Idee6cee57398b6ad7a24e6f84637e9ef3d33cfc5
Reviewed-on: https://review.typo3.org/52345
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Henrik Elsner <helsner@dfau.de>
Tested-by: Henrik Elsner <helsner@dfau.de>
Reviewed-by: Thomas Hohn <thomas@hohn.dk>
Tested-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Reviewed-by: Elmar Hinz <t3elmar@gmail.com>
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/core/Documentation/Changelog/master/Feature-76910-PageLayoutViewAllowToDisableCopyTranslateButtons.rst [new file with mode: 0644]

index f3b02d8..57b394d 100644 (file)
@@ -1927,8 +1927,14 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
         }
         $theNewButton = '';
 
-        $allowCopy = true;
-        $allowTranslate = true;
+        $localizationTsConfig = BackendUtility::getModTSconfig($this->id, 'mod.web_layout.localization');
+        $allowCopy = isset($localizationTsConfig['properties']['enableCopy'])
+            ? (int)$localizationTsConfig['properties']['enableCopy'] === 1
+            : true;
+        $allowTranslate = isset($localizationTsConfig['properties']['enableTranslate'])
+            ? (int)$localizationTsConfig['properties']['enableTranslate'] === 1
+            : true;
+
         if (!empty($this->languageHasTranslationsCache[$lP])) {
             if (isset($this->languageHasTranslationsCache[$lP]['hasStandAloneContent'])) {
                 $allowTranslate = false;
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-76910-PageLayoutViewAllowToDisableCopyTranslateButtons.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-76910-PageLayoutViewAllowToDisableCopyTranslateButtons.rst
new file mode 100644 (file)
index 0000000..b575f89
--- /dev/null
@@ -0,0 +1,25 @@
+.. include:: ../../Includes.txt
+
+==============================================================================
+Feature: #76910 - PageLayoutView - Allow to disable copy- / translate- buttons
+==============================================================================
+
+See :issue:`76910`
+
+Description
+===========
+
+The localization actions "Translate" and "Copy" are now toggleable by PageTS and UserTS.
+
+.. code-block:: typoscript
+
+       mod.web_layout.localization.enableCopy = 1
+       mod.web_layout.localization.enableTranslate = 1
+
+
+Impact
+======
+
+Using these options allows to disable or enable a certain action on user basis and/or page basis.
+
+.. index:: Backend, TSConfig