[TASK] Deprecate ext:backend ModuleLayout view helpers
authorChristian Kuhn <lolli@schwarzbu.ch>
Wed, 26 May 2021 15:09:58 +0000 (17:09 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 27 May 2021 19:05:06 +0000 (21:05 +0200)
commit5a4560909b86a5d1d90e617e0b6726254b9f8f70
tree5467662de4813c8f79a790806abc7721db41524f
parent6c08ab2483a328183bd3dde1f55a5cd7d8d0bd12
[TASK] Deprecate ext:backend ModuleLayout view helpers

A while after the PHP based ModuleTemplate API has been
introduced back in 2015, a couple of fluid view helpers
have been added to ext:backend as a second way to handle
full backend module content like the doc header.
It found an example use in ext:beuser.

Development however stopped at this point, the provided
view helpers are only a sub set of the PHP based API and
they didn't find broader use within the core - all other
backend modules stick to the ModuleTemplate based API.

On a structural level, those view helpers are questionable:
They move functionality to the view component which is
arguably more a controller task. The ext:beuser module
proofes this since it had to assign controller knowledge
like the current action and controller name to the view
in order to render the doc header module down and shortcut
buttons.

The patch drops usages of these view helpers in ext:beuser,
plus the minor usages of the outer ModuleLayout view helper
in ext:install and ext:belog, substitutes them with the
PHP ModuleTemplate API within controllers, and deprecates
the full set of ModuleLayout view helpers.

The change sharpens our separation between controller and
view: The "outer" module handling like doc header buttons
and menus are tied to controller logic and should be
located there, while the module body is rendered by a
fluid view.

As a bonus, a couple of issues within ext:beuser are
fixed along the way, since they can now be easily solved
and were rather hard to tackle with the view helper based
approach:
* The beuser module now remembers state and jumps to
  for instance the group sub module when a user selected
  this last. This is now in line with many other backend
  modules that do the same.
* Shortcuts to single user details work.
* The main doc header drop down can now contain all possible
  sub modules, including those that are available only
  indirectly, for instance the single user details view.
  This is good when calling these from shortcuts.

Change-Id: Idef3aa6975e97677c1da0cef57f70c855bd2ea9f
Resolves: #94209
Releases: master
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69269
Tested-by: Oliver Bartsch <bo@cedev.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Jochen <rothjochen@gmail.com>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Jochen <rothjochen@gmail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
30 files changed:
typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/Button/AbstractButtonViewHelper.php
typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/Button/LinkButtonViewHelper.php
typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/Button/ShortcutButtonViewHelper.php
typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/MenuItemViewHelper.php
typo3/sysext/backend/Classes/ViewHelpers/ModuleLayout/MenuViewHelper.php
typo3/sysext/backend/Classes/ViewHelpers/ModuleLayoutViewHelper.php
typo3/sysext/belog/Classes/Controller/BackendLogController.php
typo3/sysext/belog/Resources/Private/Layouts/Default.html
typo3/sysext/beuser/Classes/Controller/BackendUserController.php
typo3/sysext/beuser/Classes/Controller/BackendUserGroupController.php [deleted file]
typo3/sysext/beuser/Resources/Private/Language/locallang.xlf
typo3/sysext/beuser/Resources/Private/Layouts/Default.html
typo3/sysext/beuser/Resources/Private/Partials/BackendUser/OnlineListRow.html
typo3/sysext/beuser/Resources/Private/Partials/BackendUserGroup/IndexListRow.html
typo3/sysext/beuser/Resources/Private/Templates/BackendUser/Compare.html
typo3/sysext/beuser/Resources/Private/Templates/BackendUser/CompareGroups.html [new file with mode: 0644]
typo3/sysext/beuser/Resources/Private/Templates/BackendUser/Groups.html [new file with mode: 0644]
typo3/sysext/beuser/Resources/Private/Templates/BackendUser/Index.html
typo3/sysext/beuser/Resources/Private/Templates/BackendUser/Online.html
typo3/sysext/beuser/Resources/Private/Templates/BackendUser/Show.html
typo3/sysext/beuser/Resources/Private/Templates/BackendUserGroup/Compare.html [deleted file]
typo3/sysext/beuser/Resources/Private/Templates/BackendUserGroup/Index.html [deleted file]
typo3/sysext/beuser/ext_tables.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-94209-BackendModuleLayoutViewHelpers.rst [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/BackendModuleController.php
typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php
typo3/sysext/install/Configuration/Services.yaml [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Language/BackendModule.xlf
typo3/sysext/install/Resources/Private/Templates/BackendModule/BackendUserConfirmation.html
typo3/sysext/install/Tests/Functional/Controller/BackendModuleControllerTest.php