Project

General

Profile

Actions

Feature #76910

closed

PageLayoutView - Allow to disable copy- / translate- buttons

Added by Philipp Schlosser over 7 years ago. Updated almost 5 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 1 (1 open0 closed)

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

Actions
Actions #1

Updated by Peter Rauber over 7 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.

Actions #2

Updated by Riccardo De Contardi over 7 years ago

  • Category set to Backend User Interface
Actions #3

Updated by Sven Liebendahl about 7 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.

Actions #4

Updated by Gerrit Code Review almost 7 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

Actions #5

Updated by Andreas Fernandez almost 7 years ago

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

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions #7

Updated by André Buchmann over 5 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.

Actions #8

Updated by André Buchmann over 5 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

Actions #9

Updated by Gerrit Code Review over 5 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

Actions #10

Updated by Gerrit Code Review over 5 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

Actions #11

Updated by Gerrit Code Review over 5 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

Actions #12

Updated by Gerrit Code Review over 5 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

Actions #13

Updated by Gerrit Code Review over 5 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

Actions #14

Updated by Gerrit Code Review over 5 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

Actions #15

Updated by Anonymous over 5 years ago

  • Status changed from Under Review to Resolved
Actions #16

Updated by Jasmina Ließmann about 5 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.

Actions #17

Updated by André Buchmann about 5 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.

Actions #18

Updated by Benni Mack almost 5 years ago

  • Status changed from Resolved to Closed
Actions #19

Updated by Christoph Lehmann over 3 years ago

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

Also available in: Atom PDF