Commit 74ebd31a authored by Benni Mack's avatar Benni Mack Committed by Oliver Bartsch
Browse files

[TASK] Deprecate custom JSWindow options in HMENU settings

The HMENU / TMENU options for opening up links of a menu
in a custom JavaScript popup are deprecated. Respective settings:

page.123 = HMENU
page.123.1 = TMENU
page.123.1.JSWindow = 1
page.123.1.JSWindow.params = width=200,height=300,status=0,menubar=0

alternatively this syntax was possible as well:

page.123.1 = TMENU
page.123.1.target = 200x300

both variants and properties related to JavaScript are now
deprecated.

Resolves: #95351
Releases: master
Change-Id: Iea28a8c8ecd907382cba327cb6c631e8beadfd4b
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/71233

Reviewed-by: Oliver Hader's avatarOliver Hader <oliver.hader@typo3.org>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: Oliver Hader's avatarOliver Hader <oliver.hader@typo3.org>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
parent f360dc89
.. include:: ../../Includes.txt
===============================================================
Deprecation: #95351 - Custom JSWindow options in HMENU settings
===============================================================
See :issue:`95351`
Description
===========
The common HMENU settings for each HMENU level `JSWindow` (including
subproperties) and `target` with a value such as `target = 200x300`, to be set
on e.g. TMENU properties have been marked as deprecated.
Examples:
page.123 = HMENU
page.123.1 = TMENU
page.123.1.JSWindow = 1
page.123.1.JSWindow.params = width=200,height=300,status=0,menubar=0
page.123 = HMENU
page.123.1 = TMENU
page.123.1.target = 200x300
Impact
======
Calling a frontend page with a HMENU and JSwindow popups will trigger a
PHP deprecation warning.
Affected Installations
======================
TYPO3 installations with a HMENU and JSwindow settings which are configured
via TypoScript, which is highly unlikely in 2021.
Migration
=========
Use an external JavaScript file with an event listener to achieve the same
functionality.
.. index:: Frontend, TypoScript, NotScanned, ext:frontend
......@@ -1343,7 +1343,9 @@ abstract class AbstractMenuContentObject
}
}
// opens URL in new window
// @deprecated will be removed in TYPO3 v12.0.
if ($this->mconf['JSWindow'] ?? false) {
trigger_error('Calling HMENU with option JSwindow will stop working in TYPO3 v12.0. Use a external JavaScript file with proper event listeners to open a custom window.', E_USER_DEPRECATED);
$conf = $this->mconf['JSWindow.'];
$url = $LD['totalURL'];
$LD['totalURL'] = '#';
......@@ -1369,7 +1371,9 @@ abstract class AbstractMenuContentObject
$LD['target'] = $targetIsType ? '' : trim(substr($LD['target'], strlen($matches[1]) + 1));
}
// Open in popup window?
// @deprecated will be removed in TYPO3 v12.0.
if (($matches[3] ?? false) && ($matches[4] ?? false)) {
trigger_error('Calling HMENU with a special target to open a link in a window will be removed in TYPO3 v12.0. Use a external JavaScript file with proper event listeners to open a custom window.', E_USER_DEPRECATED);
$attrs['data-window-url'] = $tsfe->baseUrlWrap($LD['totalURL']);
$attrs['data-window-target'] = $LD['target'] ?? 'FEopenLink';
$attrs['data-window-features'] = 'width=' . $matches[3] . ',height=' . $matches[4] . ($matches[5] ? ',' . substr($matches[5], 1) : '');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment