Commit 8b693daa authored by Claus Due's avatar Claus Due Committed by Christian Kuhn
Browse files

[!!!][FEATURE] Switch to standalone Fluid template engine

This change:

* Adds `typo3fluid/fluid` as dependency
* Converts system extension `fluid` to a so-called Fluid adapter
* Adds TYPO3-specific Fluid integrations as compatibility layer
* Turns Fluid's RenderingContext into a very flexible API
* Updates a few templates and core ViewHelpers for compatibility

On a more general level the change allows using a wide array of
new template syntaxes and integration features (see feature
documentation included with this commit in `core` extension).

The breaking changes are minimal; mostly caused by removal of
deprecated code from the `fluid` system extension (rather than
fundamental changes to how Fluid itself works). Custom templates
should work with little or no migration required.

Change-Id: Ib505cb66dabcc711868924d2fab3015ce549fbde
Releases: master
Resolves: #62940
Resolves: #69863
Resolves: #58752
Resolves: #48221
Resolves: #49903
Resolves: #54509
Resolves: #55343
Resolves: #55660
Resolves: #57446
Resolves: #70036
Resolves: #61144
Resolves: #60082
Resolves: #11287
Resolves: #70960
Resolves: #71552
Resolves: #67930
Resolves: #48656
Resolves: #71821
Resolves: #59540
Reviewed-on: https://review.typo3.org/42425

Tested-by: Andreas Fernandez's avatarAndreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <typo3@scripting-base.de>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Marc Neuhaus's avatarMarc Neuhaus <apocalip@gmail.com>
Reviewed-by: Frank Nägler's avatarFrank Naegler <frank.naegler@typo3.org>
Reviewed-by: default avatarMorton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Xavier Perseguers's avatarXavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers's avatarXavier Perseguers <xavier@typo3.org>
Reviewed-by: Alexander Opitz's avatarAlexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz's avatarAlexander Opitz <opitz.alexander@googlemail.com>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 5e0d7f39
......@@ -43,7 +43,8 @@
"typo3/cms-composer-installers": "^1.2.5",
"psr/http-message": "~1.0",
"cogpowered/finediff": "~0.3.1",
"mso/idna-convert": "^0.9.1"
"mso/idna-convert": "^0.9.1",
"typo3fluid/fluid": "^1.0.3"
},
"require-dev": {
"phpunit/phpunit": "~4.8.0",
......@@ -58,7 +59,10 @@
},
"extra": {
"typo3/class-alias-loader": {
"always-add-alias-loader": true
"always-add-alias-loader": true,
"class-alias-maps": [
"typo3/sysext/fluid/Migrations/Code/ClassAliasMap.php"
]
},
"branch-alias": {
"dev-master": "7.x-dev"
......
......@@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "41598b90e8e110bf0f35092212ce802c",
"content-hash": "2d42a93c330f37e0f0e74072652d123a",
"hash": "b3ee1a2e920605bac9c105764365761e",
"content-hash": "d06ab9b6a8fe495278326559effe7788",
"packages": [
{
"name": "cogpowered/finediff",
......@@ -705,6 +705,44 @@
"typo3"
],
"time": "2015-11-03 21:19:57"
},
{
"name": "typo3fluid/fluid",
"version": "1.0.3",
"source": {
"type": "git",
"url": "https://github.com/TYPO3Fluid/Fluid.git",
"reference": "7465b0c8564b34a5cfdadda21d63b91b8596ac76"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/TYPO3Fluid/Fluid/zipball/7465b0c8564b34a5cfdadda21d63b91b8596ac76",
"reference": "7465b0c8564b34a5cfdadda21d63b91b8596ac76",
"shasum": ""
},
"require": {
"php": ">=5.5.0"
},
"require-dev": {
"mikey179/vfsstream": "*",
"phpunit/phpunit": "*",
"satooshi/php-coveralls": "*"
},
"bin": [
"bin/fluid"
],
"type": "library",
"autoload": {
"psr-4": {
"TYPO3Fluid\\Fluid\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0+"
],
"description": "The TYPO3 Fluid template rendering engine",
"time": "2016-01-28 21:45:24"
}
],
"packages-dev": [
......
......@@ -17,12 +17,11 @@ use TYPO3\CMS\Backend\Backend\Avatar\Avatar;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
/**
* Get avatar for backend user
*/
class AvatarViewHelper extends AbstractViewHelper implements CompilableInterface
class AvatarViewHelper extends AbstractViewHelper
{
/**
* Resolve user avatar from backend user id.
......
......@@ -15,14 +15,13 @@ namespace TYPO3\CMS\Belog\ViewHelpers\Be;
*/
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
use TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper;
/**
* Get page path string from page id
* @internal
*/
class PagePathViewHelper extends AbstractBackendViewHelper implements CompilableInterface
class PagePathViewHelper extends AbstractBackendViewHelper
{
/**
* Resolve page id to page path string (with automatic cropping to maximum given length).
......
......@@ -17,14 +17,13 @@ namespace TYPO3\CMS\Belog\ViewHelpers;
use TYPO3\CMS\Backend\Template\DocumentTemplate;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
use TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper;
/**
* Display error icon from error integer value
* @internal
*/
class ErrorIconViewHelper extends AbstractBackendViewHelper implements CompilableInterface
class ErrorIconViewHelper extends AbstractBackendViewHelper
{
/**
* Renders an error icon link as known from the TYPO3 backend.
......
......@@ -67,7 +67,7 @@ class TranslateLabelSelectViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\S
return '';
}
$labelKey = $this->hasArgument('optionLabelPrefix') ? $this->arguments['optionLabelPrefix'] . $label : $label;
$translatedLabel = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate($labelKey, $this->controllerContext->getRequest()->getControllerExtensionName());
$translatedLabel = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate($labelKey, $this->renderingContext->getControllerContext()->getRequest()->getControllerExtensionName());
return $translatedLabel ?: $label;
}
}
......@@ -17,13 +17,12 @@ namespace TYPO3\CMS\Belog\ViewHelpers;
use TYPO3\CMS\Belog\Domain\Model\LogEntry;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
/**
* Create detail string from log entry
* @internal
*/
class FormatDetailsViewHelper extends AbstractViewHelper implements CompilableInterface
class FormatDetailsViewHelper extends AbstractViewHelper
{
/**
* Create formatted detail string from log row.
......
......@@ -24,13 +24,12 @@ use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
/**
* Get history entry from for log entry
* @internal
*/
class HistoryEntryViewHelper extends AbstractViewHelper implements CompilableInterface
class HistoryEntryViewHelper extends AbstractViewHelper
{
/**
* Get system history record
......
......@@ -17,13 +17,12 @@ namespace TYPO3\CMS\Belog\ViewHelpers;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
/**
* Returns true, if a specific extension is loaded
* @internal
*/
class IsExtensionLoadedViewHelper extends AbstractViewHelper implements CompilableInterface
class IsExtensionLoadedViewHelper extends AbstractViewHelper
{
/**
* Checks whether an extension is loaded.
......
......@@ -16,13 +16,12 @@ namespace TYPO3\CMS\Belog\ViewHelpers;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
/**
* Get username from backend user id
* @internal
*/
class UsernameViewHelper extends AbstractViewHelper implements CompilableInterface
class UsernameViewHelper extends AbstractViewHelper
{
/**
* First level cache of user names
......
......@@ -16,13 +16,12 @@ namespace TYPO3\CMS\Belog\ViewHelpers;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
/**
* Get workspace title from workspace id
* @internal
*/
class WorkspaceTitleViewHelper extends AbstractViewHelper implements CompilableInterface
class WorkspaceTitleViewHelper extends AbstractViewHelper
{
/**
* First level cache of workspace titles
......
......@@ -16,12 +16,11 @@ namespace TYPO3\CMS\Beuser\ViewHelpers;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
/**
* Get a value from an array by given key.
*/
class ArrayElementViewHelper extends AbstractViewHelper implements CompilableInterface
class ArrayElementViewHelper extends AbstractViewHelper
{
/**
* Return array element by key. Accessed values must be scalar (string, int, float or double)
......
......@@ -16,13 +16,12 @@ namespace TYPO3\CMS\Beuser\ViewHelpers\Display;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
/**
* Converts comma separated list of pages uids to html unordered list (<ul>) with speaking titles
* @internal
*/
class PagesViewHelper extends AbstractViewHelper implements CompilableInterface
class PagesViewHelper extends AbstractViewHelper
{
/**
* Render unordered list for pages
......
......@@ -16,13 +16,12 @@ namespace TYPO3\CMS\Beuser\ViewHelpers\Display;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
/**
* Converts comma separated list of sys_filemounts uids to html unordered list (<ul>) with speaking titles
* @internal
*/
class SysFileMountsViewHelper extends AbstractViewHelper implements CompilableInterface
class SysFileMountsViewHelper extends AbstractViewHelper
{
/**
* Render unordered list for sys_filemounts
......
......@@ -16,13 +16,12 @@ namespace TYPO3\CMS\Beuser\ViewHelpers\Display;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
/**
* Converts comma separated list of sys_language uids to html unordered list (<ul>) with speaking titles
* @internal
*/
class SysLanguageViewHelper extends AbstractViewHelper implements CompilableInterface
class SysLanguageViewHelper extends AbstractViewHelper
{
/**
* Render unordered list for sys_language
......
......@@ -18,14 +18,13 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
/**
* Edit Record ViewHelper, see FormEngine logic
*
* @internal
*/
class EditRecordViewHelper extends AbstractViewHelper implements CompilableInterface
class EditRecordViewHelper extends AbstractViewHelper
{
/**
* Returns a URL to link to FormEngine
......
......@@ -19,13 +19,12 @@ use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
/**
* Render a link to DataHandler command
* @internal
*/
class IssueCommandViewHelper extends AbstractViewHelper implements CompilableInterface
class IssueCommandViewHelper extends AbstractViewHelper
{
/**
* Returns a URL with a command to TYPO3 Core Engine (tce_db.php)
......
......@@ -17,7 +17,6 @@ namespace TYPO3\CMS\Beuser\ViewHelpers;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
/**
* Render permission icon group (user / group / others) of the "Access" module.
......@@ -25,7 +24,7 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
* Most of that could be done in fluid directly, but this view helper
* is much better performance wise.
*/
class PermissionsViewHelper extends AbstractViewHelper implements CompilableInterface
class PermissionsViewHelper extends AbstractViewHelper
{
/**
* @var array Cached labels for a single permission mask like "Delete page"
......@@ -46,7 +45,7 @@ class PermissionsViewHelper extends AbstractViewHelper implements CompilableInte
}
/**
* Implementing CompilableInterface suppresses object instantiation of this view helper
* Static rendering method
*
* @param array $arguments
* @param \Closure $renderChildrenClosure
......
......@@ -23,14 +23,13 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
/**
* Displays 'Delete user' link with sprite icon to remove user
*
* @internal
*/
class RemoveUserViewHelper extends AbstractViewHelper implements CompilableInterface
class RemoveUserViewHelper extends AbstractViewHelper
{
/**
* Render link with sprite icon to remove user
......
......@@ -19,14 +19,13 @@ use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Domain\Model\BackendUser;
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
use TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper;
/**
* Views sprite icon for a record (object)
* @internal
*/
class SpriteIconForRecordViewHelper extends AbstractBackendViewHelper implements CompilableInterface
class SpriteIconForRecordViewHelper extends AbstractBackendViewHelper
{
/**
* Displays spriteIcon for database table and object
......
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