Skip to content

Commit

Permalink
[TASK] Drop option mod.web_list.newWizards and use new modal CE wizard
Browse files Browse the repository at this point in the history
Enabled PageTsConfig option 'mod.web_list.newWizards' by default,
drop that option and link to the new content element wizard that
is displayed in a modal.

Resolves: #84463
Releases: master
Change-Id: Idb3a2b5e108426e976c560021b302f6f84dffd72
Reviewed-on: https://review.typo3.org/56346
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Wolf <andreas.wolf@typo3.org>
Tested-by: Andreas Wolf <andreas.wolf@typo3.org>
  • Loading branch information
lolli42 authored and andreaswolf committed Mar 18, 2018
1 parent 05fe422 commit ff0ee37
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 10 deletions.
@@ -0,0 +1,41 @@
.. include:: ../../Includes.txt

=========================================================================
Deprecation: #84463 - PageTsConfig option mod.web_list.newWizards dropped
=========================================================================

See :issue:`84463`

Description
===========

The widely unknown PageTsConfig option :ts:`mod.web_list.newWizards` has
been enabled by default and dropped.

PHP property :php:`newWizards` of class :php:`TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList`
has been deprecated along the way.


Impact
======

The "+" sign in the list module of `pages` table now by default links to the wizard
to select the new page position.

The "+" sign in the list module of `tt_content` table now by default links to the
new content element wizard in a modal.


Affected Installations
======================

Most installations should not be affected by the code change, the extension scanner
will find extensions using the mentioned class property.


Migration
=========

Do not use property :php:`newWizards` anymore, drop the PageTsConfig option if used.

.. index:: Backend, PHP-API, TSConfig, PartiallyScanned
Expand Up @@ -547,4 +547,9 @@
'Deprecation-84338-ProtectedMethodsAndPropertiesInTableController.rst',
],
],
'TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList->newWizards' => [
'restFiles' => [
'Deprecation-84463-PageTsConfigOptionModweb_listnewWizardsDropped.rst',
],
],
];
Expand Up @@ -327,7 +327,6 @@ public function main()
$dblist->tableTSconfigOverTCA = $this->modTSconfig['properties']['table.'];
$dblist->allowedNewTables = GeneralUtility::trimExplode(',', $this->modTSconfig['properties']['allowedNewTables'], true);
$dblist->deniedNewTables = GeneralUtility::trimExplode(',', $this->modTSconfig['properties']['deniedNewTables'], true);
$dblist->newWizards = $this->modTSconfig['properties']['newWizards'] ? 1 : 0;
$dblist->pageRow = $this->pageinfo;
$dblist->counter++;
$dblist->MOD_MENU = ['bigControlPanel' => '', 'clipBoard' => ''];
Expand Down
36 changes: 27 additions & 9 deletions typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php
Expand Up @@ -24,6 +24,7 @@
use TYPO3\CMS\Backend\Tree\View\PageTreeView;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
Expand Down Expand Up @@ -53,6 +54,15 @@
*/
class DatabaseRecordList
{
use PublicPropertyDeprecationTrait;

/**
* @var array
*/
protected $deprecatedPublicProperties = [
'newWizards' => 'Using $newWizards of class DatabaseRecordList from outside is discouraged, property will be removed in v10.',
];

// *********
// External:
// *********
Expand All @@ -75,10 +85,11 @@ class DatabaseRecordList

/**
* If TRUE, the control panel will contain links to the create-new wizards for
* pages and tt_content elements (normally, the link goes to just creatinga new
* pages and tt_content elements (normally, the link goes to just creating a new
* element without the wizards!).
*
* @var bool
* @deprecated and unused since v9, will be removed in v10
*/
public $newWizards = false;

Expand Down Expand Up @@ -1661,16 +1672,23 @@ public function renderListHeader($table, $currentIdList)
$spriteIcon = $table === 'pages'
? $this->iconFactory->getIcon('actions-page-new', Icon::SIZE_SMALL)
: $this->iconFactory->getIcon('actions-add', Icon::SIZE_SMALL);
if ($table === 'tt_content' && $this->newWizards) {
if ($table === 'tt_content') {
// If mod.newContentElementWizard.override is set, use that extension's create new content wizard instead:
$tmpTSc = BackendUtility::getModTSconfig($this->pageinfo['uid'], 'mod');
$newContentElementWizard = $tmpTSc['properties']['newContentElementWizard.']['override'] ?? 'new_content_element';
$newContentWizScriptPath = (string)$uriBuilder->buildUriFromRoute($newContentElementWizard, ['id' => $this->id]);

$onClick = 'return jumpExt(' . GeneralUtility::quoteJSvalue($newContentWizScriptPath) . ');';
$icon = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars($onClick) . '" title="'
. htmlspecialchars($lang->getLL('new')) . '">' . $spriteIcon->render() . '</a>';
} elseif ($table === 'pages' && $this->newWizards) {
$newContentElementWizard = $tmpTSc['properties']['newContentElementWizard.']['override'] ?? 'new_content_element_wizard';
$url = (string)$uriBuilder->buildUriFromRoute(
$newContentElementWizard,
[
'id' => $this->id,
'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI'),
]
);
$icon = '<a href="#" data-url="' . htmlspecialchars($url) . '" '
. 'data-title="' . htmlspecialchars($lang->getLL('new')) . '"'
. 'class="btn btn-default t3js-toggle-new-content-element-wizard">'
. $spriteIcon->render()
. '</a>';
} elseif ($table === 'pages') {
$parameters = ['id' => $this->id, 'pagesOnly' => 1, 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')];
$href = (string)$uriBuilder->buildUriFromRoute('db_new', $parameters);
$icon = '<a class="btn btn-default" href="' . htmlspecialchars($href) . '" title="' . htmlspecialchars($lang->getLL('new')) . '">'
Expand Down

0 comments on commit ff0ee37

Please sign in to comment.