Feature #76910

PageLayoutView - Allow to disable copy- / translate- buttons

Added by Philipp Schlosser about 5 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2016-07-01
Due date:
% Done:

100%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Could there be an option to configure visibility of the "translate" and "copy" buttons (see Screenshot - I use TYPO3 7.6.9).

In \TYPO3\CMS\Backend\View\PageLayoutView following data-attributes were set to the button .t3js-localize in Line 1828 and 1829 :
' data-allow-copy="' . (int)$allowCopy . '"'
' data-allow-translate="' . (int)$allowTranslate . '"'

if you set $allowCopy or $allowTranslate manually to 0 the button for copying or translating your content will disappear, but you have no opportunity to do this by a configuration or by a hook.


Files

translate-copy-button.png (48.2 KB) translate-copy-button.png Philipp Schlosser, 2016-07-01 15:26

Related issues

Related to TYPO3 Core - Bug #92564: Mixed content problem through translation button in list viewNew2020-10-14

Actions
#1

Updated by Peter Rauber about 5 years ago

Hi Philipp

I know a way how to hide this via css in the backend:

Here is my scss-file, that will complie into an css-file:

// hide copy in page-module localization wizard (only translation allowed)
.t3-modal {
    &.localization-wizard {
        #localization-carousel {
            .item {
                .row {
                    .t3js-helptext {
                        display: none;
                    }

                    &:last-child {
                        display: none;
                    }

                    &:first-child {
                        display: block;
                    }
                }

                .t3js-summary {
                    .row {
                        &:last-child {
                            display: block;
                        }
                    }
                }
            }
        }
    }
}

To load the css in the backend, put this in your ext_tables.php (of an extension):

// add own backend stylesheet
if (TYPO3_MODE === 'BE') {
    // Register as a skin
    $GLOBALS['TBE_STYLES']['skins']['yourextensionname'] = array(
        'name' => 'yourextensionname',
        'stylesheetDirectories' => array(
            'css' => 'EXT:yourextensionname/Resources/Public/Css/'
        )
    );
}

Hope this helps.

#2

Updated by Riccardo De Contardi about 5 years ago

  • Category set to Backend User Interface
#3

Updated by Sven Liebendahl over 4 years ago

Hi Phillip,

me and my colleagues stumbled across the same issue: We simply wanted to disable the strict translation-mode button in the localization wizard.
I asked for help in the slack channel #cig-localization and a suggested solution by Andreas Fernandez was to use XCLASSing – which worked for me. I know it is not the best way possible, but it is a working solution:

XCLASSing TYPO3\CMS\Backend\View\PageLayoutView and overriding the method newLanguageButton should be sufficient. Hint: either data-allow-copy or data-allow-translate must be 0 respectively false then.

It would be handy if you could configure that with typoscript so that you easily can choose the available modes (buttons) of translation.

#4

Updated by Gerrit Code Review over 4 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/52345

#5

Updated by Andreas Fernandez over 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#6

Updated by Benni Mack almost 3 years ago

  • Status changed from Resolved to Closed
#7

Updated by André Buchmann almost 3 years ago

  • Status changed from Closed to New

The PageTS Setting

mod.web_layout.localization.enableCopy = 0
does not remove the copy button in the translation modal.

The other option

mod.web_layout.localization.enableTranslate = 0
works as expected.

Tested with TYPO3 9.5.1 in custom installation and a installation with the introduction package.

#8

Updated by André Buchmann almost 3 years ago

After a bit of debugging I found out that the setting is overwritten on line 2435 in typo3/sysext/backend/Classes/View/PageLayoutView.php if there are no translations for the selected language.

If there is nothing on the translated page the variable $this->languageHasTranslationsCache[$lP]['hasTranslations']… will be @false. The inverted value is then set for $allowCopy. This behavior was implemented to fix an other Bug #62550

#9

Updated by Gerrit Code Review almost 3 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59016

#10

Updated by Gerrit Code Review almost 3 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59016

#11

Updated by Gerrit Code Review almost 3 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59016

#12

Updated by Gerrit Code Review almost 3 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59016

#13

Updated by Gerrit Code Review almost 3 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59016

#14

Updated by Gerrit Code Review almost 3 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59016

#15

Updated by Anonymous almost 3 years ago

  • Status changed from Under Review to Resolved
#16

Updated by Jasmina Ließmann over 2 years ago

Is there any chance to get a backport of this fix for TYPO3 CMS 8.7?

The setting 'mod.web_layout.localization.enableCopy = 0' does not work for me with TYPO3 CMS 8.7.24.

#17

Updated by André Buchmann over 2 years ago

Hello Jasmina,

there won't be a backport for 8.7 as the feature was introduced in 9.5 first. This ticket is related to a bug in this feature only.

#18

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed
#19

Updated by Christoph Lehmann 11 months ago

  • Related to Bug #92564: Mixed content problem through translation button in list view added

Also available in: Atom PDF