[FEATURE] Allow cObject registration during runtime 46/36146/8
authorBenjamin Mack <benni@typo3.org>
Tue, 20 Jan 2015 19:20:27 +0000 (20:20 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 30 Jan 2015 11:14:23 +0000 (12:14 +0100)
Instead of having a hard-coded list of available
content Objects with complex hook registration,
any extension can now register its own cObject
by adding or overwriting an AbstractContentObject
in ext_localconf.php via
$GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']

This way it is also possible to move legacy content objects
to other extensions than EXT:frontend.

Resolves: #64386
Releases: master
Change-Id: Iac3e13cb32fa99685c6ff9e284ff8c49b26f9759
Reviewed-on: http://review.typo3.org/36146
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/core/Configuration/DefaultConfiguration.php
typo3/sysext/core/Documentation/Changelog/master/Feature-64386-ContentObjectRegistration.rst [new file with mode: 0644]
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Tests/Functional/ContentObject/FluidTemplateContentObjectTest.php
typo3/sysext/frontend/Tests/Unit/ContentObject/CaseContentObjectTest.php
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php
typo3/sysext/frontend/Tests/Unit/ContentObject/FilesContentObjectTest.php
typo3/sysext/frontend/Tests/Unit/ContentObject/FluidTemplateContentObjectTest.php
typo3/sysext/frontend/Tests/Unit/Plugin/AbstractPluginTest.php
typo3/sysext/frontend/ext_localconf.php

index 13d2d17..ed5d189 100644 (file)
@@ -767,6 +767,7 @@ return array(
                'workspacePreviewLogoutTemplate' => '',         // If set, points to an HTML file relative to the TYPO3_site root which will be read and outputted as template for this message. Example: fileadmin/templates/template_workspace_preview_logout.html. Inside you can put the marker %1$s to insert the URL to go back to. Use this in &lt;a href="%1$s"&gt;Go back...&lt;/a&gt; links
                'versionNumberInFilename' => 'querystring',             // String: embed,querystring,''. Allows to automatically include a version number (timestamp of the file) to referred CSS and JS filenames on the rendered page. This will make browsers and proxies reload the files if they change (thus avoiding caching issues). Set to 'embed' will have the timestamp embedded in the filename, ie. filename.1269312081.js. IMPORTANT: 'embed' requires extra .htaccess rules to work (please refer to _.htaccess or the _.htaccess file from the dummy package)<p>Set to 'querystring' (default setting) to append the version number as a query parameter (doesn't require mod_rewrite). Set to '' will turn this functionality off (behaves like TYPO3 &lt; v4.4).</p>
                'contentRenderingTemplates' => array(), // Array to define the TypoScript parts that define the main content rendering. Extensions like "css_styled_content" provide content rendering templates. Other extensions like "felogin" or "indexed search" extend these templates and their TypoScript parts are added directly after the content templates. See EXT:css_styled_content/ext_localconf.php and EXT:frontend/Classes/TypoScript/TemplateService.php
+               'ContentObjects' => array(),    // Array to register ContentObject (cObjects) like TEXT or HMENU within ext_localconf.php, see EXT:frontend/ext_localconf.php
                'XCLASS' => array(),            // See 'Inside TYPO3' document for more information.
        ),
        'MAIL' => array( // Mail configurations to tune how \TYPO3\CMS\Core\Mail\ classes will send their mails.
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-64386-ContentObjectRegistration.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-64386-ContentObjectRegistration.rst
new file mode 100644 (file)
index 0000000..13f0672
--- /dev/null
@@ -0,0 +1,22 @@
+====================================================
+Feature: #64386 - Public Content Object Registration
+====================================================
+
+Description
+===========
+
+A new global option is now available to register and/or extend / overwrite content objects like TEXT.
+A list of all available Content Objects that was previously registered within the main ContentObjectRenderer class
+is now moved to the global array ``$GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']`` which allows for modifications
+via third-party extensions.
+
+Example: Register a new Content Object EXAMPLE in a third-party extension
+
+.. code-block:: php
+
+  $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects']['EXAMPLE'] = Acme\MyExtension\ContentObject\ExampleContentObject::class
+
+The registered class must be a subclass of TYPO3\CMS\Frontend\ContentObject\AbstractContentObject.
+
+For future autoloading mechanisms, it is encouraged to place the custom ContentObject class inside
+``EXT:myextension/Classes/ContentObject/``.
index fccc9d7..ad291a6 100644 (file)
@@ -221,46 +221,11 @@ class ContentObjectRenderer {
        );
 
        /**
-        * Class names for accordant content objects
+        * Class names for accordant content object names
         *
         * @var array
         */
-       protected $contentObjectClassMapping = array(
-               'TEXT' => 'Text',
-               'CASE' => 'Case',
-               'CLEARGIF' => 'ClearGif',
-               'COBJ_ARRAY' => 'ContentObjectArray',
-               'COA' => 'ContentObjectArray',
-               'COA_INT' => 'ContentObjectArrayInternal',
-               'USER' => 'User',
-               'USER_INT' => 'UserInternal',
-               'FILE' => 'File',
-               'FILES' => 'Files',
-               'IMAGE' => 'Image',
-               'IMG_RESOURCE' => 'ImageResource',
-               'IMGTEXT' => 'ImageText',
-               'CONTENT' => 'Content',
-               'RECORDS' => 'Records',
-               'HMENU' => 'HierarchicalMenu',
-               'CTABLE' => 'ContentTable',
-               'OTABLE' => 'OffsetTable',
-               'COLUMNS' => 'Columns',
-               'HRULER' => 'HorizontalRuler',
-               'CASEFUNC' => 'Case',
-               'LOAD_REGISTER' => 'LoadRegister',
-               'RESTORE_REGISTER' => 'RestoreRegister',
-               'FORM' => 'Form',
-               'SEARCHRESULT' => 'SearchResult',
-               'TEMPLATE' => 'Template',
-               'FLUIDTEMPLATE' => 'FluidTemplate',
-               'MULTIMEDIA' => 'Multimedia',
-               'MEDIA' => 'Media',
-               'SWFOBJECT' => 'ShockwaveFlashObject',
-               'FLOWPLAYER' => 'FlowPlayer',
-               'QTOBJECT' => 'QuicktimeObject',
-               'SVG' => 'ScalableVectorGraphics',
-               'EDITPANEL' => 'EditPanel',
-       );
+       protected $contentObjectClassMap = array();
 
        /**
         * Holds ImageMagick parameters and extensions used for compression
@@ -583,6 +548,34 @@ class ContentObjectRenderer {
         */
        public function __construct(TypoScriptFrontendController $typoScriptFrontendController = NULL) {
                $this->typoScriptFrontendController = $typoScriptFrontendController ?: $GLOBALS['TSFE'];
+               $this->contentObjectClassMap = $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects'];
+       }
+
+       /**
+        * Allow injecting content object class map.
+        *
+        * This method is private API, please use configuration
+        * $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects'] to add new content objects
+        *
+        * @internal
+        * @param array $contentObjectClassMap
+        */
+       public function setContentObjectClassMap(array $contentObjectClassMap) {
+               $this->contentObjectClassMap = $contentObjectClassMap;
+       }
+
+       /**
+        * Register a single content object name to class name
+        *
+        * This method is private API, please use configuration
+        * $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects'] to add new content objects
+        *
+        * @internal
+        * @param string $className
+        * @param string $contentObjectName
+        */
+       public function registerContentObjectClass($className, $contentObjectName) {
+               $this->contentObjectClassMap[$contentObjectName] = $className;
        }
 
        /**
@@ -804,16 +797,23 @@ class ContentObjectRenderer {
 
        /**
         * Returns a new content object of type $name.
+        * This content object needs to be registered as content object
+        * in $this->contentObjectClassMap
         *
         * @param string $name
         * @return NULL|AbstractContentObject
+        * @throws ContentRenderingException
         */
        public function getContentObject($name) {
-               if (!isset($this->contentObjectClassMapping[$name])) {
+               if (!isset($this->contentObjectClassMap[$name])) {
                        return NULL;
                }
-               $fullyQualifiedClassName = 'TYPO3\\CMS\\Frontend\\ContentObject\\' . $this->contentObjectClassMapping[$name] . 'ContentObject';
-               return GeneralUtility::makeInstance($fullyQualifiedClassName, $this);
+               $fullyQualifiedClassName = $this->contentObjectClassMap[$name];
+               $contentObject = GeneralUtility::makeInstance($fullyQualifiedClassName, $this);
+               if (!($contentObject instanceof AbstractContentObject)) {
+                       throw new ContentRenderingException(sprintf('Registered content object class name "%" must be an instance of AbstractContentObject, but is not!', $fullyQualifiedClassName), 1422564295);
+               }
+               return $contentObject;
        }
 
        /********************************************
index b9f9b0f..eaff5b2 100644 (file)
@@ -13,6 +13,8 @@ namespace TYPO3\CMS\Frontend\Tests\Functional\ContentObject;
  *
  * The TYPO3 project - inspiring people to share!
  */
+use TYPO3\CMS\Frontend\ContentObject\TextContentObject;
+use TYPO3\CMS\Frontend\ContentObject\FluidTemplateContentObject;
 
 /**
  * Test case
@@ -50,6 +52,10 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\FunctionalTes
                $expectedResult = 'ABC';
 
                $contentObjectRenderer = new \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
+               $contentObjectRenderer->setContentObjectClassMap(array(
+                       'FLUIDTEMPLATE' => FluidTemplateContentObject::class,
+                       'TEXT' => TextContentObject::class,
+               ));
                $fluidTemplateContentObject = new \TYPO3\CMS\Frontend\ContentObject\ContentObjectArrayContentObject(
                        $contentObjectRenderer
                );
index fc98463..968aff1 100644 (file)
@@ -16,6 +16,7 @@ namespace TYPO3\CMS\Frontend\Tests\Unit\ContentObject;
 use TYPO3\CMS\Core\Tests\UnitTestCase;
 use TYPO3\CMS\Frontend\ContentObject\CaseContentObject;
 use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
+use TYPO3\CMS\Frontend\ContentObject\TextContentObject;
 use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
 use TYPO3\CMS\Core\TypoScript\TemplateService;
 use TYPO3\CMS\Frontend\Page\PageRepository;
@@ -45,14 +46,16 @@ class CaseContentObjectTest extends UnitTestCase {
                $tsfe->sys_page = $this->getMock(PageRepository::class, array('getRawRecord'));
                $tsfe->csConvObj = new CharsetConverter();
                $tsfe->renderCharset = 'utf-8';
-
                $GLOBALS['TSFE'] = $tsfe;
 
-               $contentObject = $this->getMock(ContentObjectRenderer::class, array('dummy'));
-               $this->subject = $this->getMock(CaseContentObject::class, array('dummy'), array($contentObject));
+               $contentObjectRenderer = new ContentObjectRenderer();
+               $contentObjectRenderer->setContentObjectClassMap(array(
+                       'CASE' => CaseContentObject::class,
+                       'TEXT' => TextContentObject::class,
+               ));
+               $this->subject = new CaseContentObject($contentObjectRenderer);
        }
 
-
        /**
         * @test
         */
index 4fe6026..e8306d7 100644 (file)
@@ -50,6 +50,48 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        protected $templateServiceMock = NULL;
 
        /**
+        * Default content object name -> class name map, shipped with TYPO3 CMS
+        *
+        * @var array
+        */
+       protected $contentObjectMap = array(
+               'TEXT'             => \TYPO3\CMS\Frontend\ContentObject\TextContentObject::class,
+               'CASE'             => \TYPO3\CMS\Frontend\ContentObject\CaseContentObject::class,
+               'CLEARGIF'         => \TYPO3\CMS\Frontend\ContentObject\ClearGifContentObject::class,
+               'COBJ_ARRAY'       => \TYPO3\CMS\Frontend\ContentObject\ContentObjectArrayContentObject::class,
+               'COA'              => \TYPO3\CMS\Frontend\ContentObject\ContentObjectArrayContentObject::class,
+               'COA_INT'          => \TYPO3\CMS\Frontend\ContentObject\ContentObjectArrayInternalContentObject::class,
+               'USER'             => \TYPO3\CMS\Frontend\ContentObject\UserContentObject::class,
+               'USER_INT'         => \TYPO3\CMS\Frontend\ContentObject\UserInternalContentObject::class,
+               'FILE'             => \TYPO3\CMS\Frontend\ContentObject\FileContentObject::class,
+               'FILES'            => \TYPO3\CMS\Frontend\ContentObject\FilesContentObject::class,
+               'IMAGE'            => \TYPO3\CMS\Frontend\ContentObject\ImageContentObject::class,
+               'IMG_RESOURCE'     => \TYPO3\CMS\Frontend\ContentObject\ImageResourceContentObject::class,
+               'IMGTEXT'          => \TYPO3\CMS\Frontend\ContentObject\ImageTextContentObject::class,
+               'CONTENT'          => \TYPO3\CMS\Frontend\ContentObject\ContentContentObject::class,
+               'RECORDS'          => \TYPO3\CMS\Frontend\ContentObject\RecordsContentObject::class,
+               'HMENU'            => \TYPO3\CMS\Frontend\ContentObject\HierarchicalMenuContentObject::class,
+               'CTABLE'           => \TYPO3\CMS\Frontend\ContentObject\ContentTableContentObject::class,
+               'OTABLE'           => \TYPO3\CMS\Frontend\ContentObject\OffsetTableContentObject::class,
+               'COLUMNS'          => \TYPO3\CMS\Frontend\ContentObject\ColumnsContentObject::class,
+               'HRULER'           => \TYPO3\CMS\Frontend\ContentObject\HorizontalRulerContentObject::class,
+               'CASEFUNC'         => \TYPO3\CMS\Frontend\ContentObject\CaseContentObject::class,
+               'LOAD_REGISTER'    => \TYPO3\CMS\Frontend\ContentObject\LoadRegisterContentObject::class,
+               'RESTORE_REGISTER' => \TYPO3\CMS\Frontend\ContentObject\RestoreRegisterContentObject::class,
+               'FORM'             => \TYPO3\CMS\Frontend\ContentObject\FormContentObject::class,
+               'SEARCHRESULT'     => \TYPO3\CMS\Frontend\ContentObject\SearchResultContentObject::class,
+               'TEMPLATE'         => \TYPO3\CMS\Frontend\ContentObject\TemplateContentObject::class,
+               'FLUIDTEMPLATE'    => \TYPO3\CMS\Frontend\ContentObject\FluidTemplateContentObject::class,
+               'MULTIMEDIA'       => \TYPO3\CMS\Frontend\ContentObject\MultimediaContentObject::class,
+               'MEDIA'            => \TYPO3\CMS\Frontend\ContentObject\MediaContentObject::class,
+               'SWFOBJECT'        => \TYPO3\CMS\Frontend\ContentObject\ShockwaveFlashObjectContentObject::class,
+               'FLOWPLAYER'       => \TYPO3\CMS\Frontend\ContentObject\FlowPlayerContentObject::class,
+               'QTOBJECT'         => \TYPO3\CMS\Frontend\ContentObject\QuicktimeObjectContentObject::class,
+               'SVG'              => \TYPO3\CMS\Frontend\ContentObject\ScalableVectorGraphicsContentObject::class,
+               'EDITPANEL'        => \TYPO3\CMS\Frontend\ContentObject\EditPanelContentObject::class
+       );
+
+       /**
         * Set up
         */
        public function setUp() {
@@ -69,13 +111,14 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $GLOBALS['TSFE'] = $this->typoScriptFrontendControllerMock;
 
                $GLOBALS['TYPO3_DB'] = $this->getMock(\TYPO3\CMS\Core\Database\DatabaseConnection::class, array());
-               $GLOBALS['TYPO3_CONF_VARS']['SYS'][\TYPO3\CMS\Core\Charset\CharsetConverter_utils::class] = 'mbstring';
+               $GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] = 'mbstring';
 
                $this->subject = $this->getAccessibleMock(
                        \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class,
                        array('getResourceFactory', 'getEnvironmentVariable'),
                        array($this->typoScriptFrontendControllerMock)
                );
+               $this->subject->setContentObjectClassMap($this->contentObjectMap);
                $this->subject->start(array(), 'tt_content');
        }
 
@@ -159,53 +202,22 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /*************************
         * Tests concerning getContentObject
         ************************/
+
        public function getContentObjectValidContentObjectsDataProvider() {
-               return array(
-                       array('TEXT', 'Text'),
-                       array('CASE', 'Case'),
-                       array('CLEARGIF', 'ClearGif'),
-                       array('COBJ_ARRAY', 'ContentObjectArray'),
-                       array('COA', 'ContentObjectArray'),
-                       array('COA_INT', 'ContentObjectArrayInternal'),
-                       array('USER', 'User'),
-                       array('USER_INT', 'UserInternal'),
-                       array('FILE', 'File'),
-                       array('FILES', 'Files'),
-                       array('IMAGE', 'Image'),
-                       array('IMG_RESOURCE', 'ImageResource'),
-                       array('IMGTEXT', 'ImageText'),
-                       array('CONTENT', 'Content'),
-                       array('RECORDS', 'Records'),
-                       array('HMENU', 'HierarchicalMenu'),
-                       array('CTABLE', 'ContentTable'),
-                       array('OTABLE', 'OffsetTable'),
-                       array('COLUMNS', 'Columns'),
-                       array('HRULER', 'HorizontalRuler'),
-                       array('CASEFUNC', 'Case'),
-                       array('LOAD_REGISTER', 'LoadRegister'),
-                       array('RESTORE_REGISTER', 'RestoreRegister'),
-                       array('FORM', 'Form'),
-                       array('SEARCHRESULT', 'SearchResult'),
-                       array('TEMPLATE', 'Template'),
-                       array('FLUIDTEMPLATE', 'FluidTemplate'),
-                       array('MULTIMEDIA', 'Multimedia'),
-                       array('MEDIA', 'Media'),
-                       array('SWFOBJECT', 'ShockwaveFlashObject'),
-                       array('FLOWPLAYER', 'FlowPlayer'),
-                       array('QTOBJECT', 'QuicktimeObject'),
-                       array('SVG', 'ScalableVectorGraphics'),
-                       array('EDITPANEL', 'EditPanel'),
-               );
+               $dataProvider = array();
+               foreach ($this->contentObjectMap as $name => $className) {
+                       $dataProvider[] = array($name, $className);
+               }
+               return $dataProvider;
        }
 
        /**
         * @test
         * @dataProvider getContentObjectValidContentObjectsDataProvider
         * @param string $name TypoScript name of content object
-        * @param string $className Expected class name
+        * @param string $fullClassName Expected class name
         */
-       public function getContentObjectCallsMakeInstanceForNewContentObjectInstance($name, $className) {
-               $fullClassName = 'TYPO3\\CMS\\Frontend\\ContentObject\\' . $className . 'ContentObject';
+       public function getContentObjectCallsMakeInstanceForNewContentObjectInstance($name, $fullClassName) {
                $contentObjectInstance = $this->getMock($fullClassName, array(), array(), '', FALSE);
                \TYPO3\CMS\Core\Utility\GeneralUtility::addInstance($fullClassName, $contentObjectInstance);
                $this->assertSame($contentObjectInstance, $this->subject->getContentObject($name));
index c192db8..7624de5 100644 (file)
@@ -13,6 +13,9 @@ namespace TYPO3\CMS\Frontend\Tests\Unit\ContentObject;
  *
  * The TYPO3 project - inspiring people to share!
  */
+use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
+use TYPO3\CMS\Frontend\ContentObject\FilesContentObject;
+use TYPO3\CMS\Frontend\ContentObject\TextContentObject;
 
 /**
  * Testcase for TYPO3\CMS\Frontend\ContentObject\FilesContentObject
@@ -46,8 +49,12 @@ class FilesContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $GLOBALS['TSFE']->csConvObj = new \TYPO3\CMS\Core\Charset\CharsetConverter();
                $GLOBALS['TSFE']->renderCharset = 'utf-8';
 
-               $contentObject = $this->getMock(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class, array('dummy'));
-               $this->subject = $this->getMock(\TYPO3\CMS\Frontend\ContentObject\FilesContentObject::class, array('dummy'), array($contentObject));
+               $contentObjectRenderer = new ContentObjectRenderer();
+               $contentObjectRenderer->setContentObjectClassMap(array(
+                       'FILES' => FilesContentObject::class,
+                       'TEXT' => TextContentObject::class,
+               ));
+               $this->subject = new FilesContentObject($contentObjectRenderer);
        }
 
        /**
index 7f5831b..3fff2dd 100644 (file)
@@ -63,7 +63,7 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                );
                $this->subject = $this->getAccessibleMock(
                        \TYPO3\CMS\Frontend\ContentObject\FluidTemplateContentObject::class,
-                       array('dummy', 'initializeStandaloneViewInstance'),
+                       array('initializeStandaloneViewInstance'),
                        array($this->contentObjectRenderer)
                );
                /** @var $tsfe \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController */
index ae63861..9a8d9da 100644 (file)
@@ -13,6 +13,8 @@ namespace TYPO3\CMS\Frontend\Tests\Unit\Plugin;
  *
  * The TYPO3 project - inspiring people to share!
  */
+use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
+use TYPO3\CMS\Frontend\ContentObject\TextContentObject;
 
 /**
  * Testcase for TYPO3\CMS\Frontend\Plugin\AbstractPlugin
@@ -42,7 +44,11 @@ class AbstractPluginTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $GLOBALS['TSFE']->cObjectDepthCounter = 100;
 
                $this->abstractPlugin = new \TYPO3\CMS\Frontend\Plugin\AbstractPlugin();
-               $this->abstractPlugin->cObj = new \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer();
+               $contentObjectRenderer = new ContentObjectRenderer();
+               $contentObjectRenderer->setContentObjectClassMap(array(
+                       'TEXT' => TextContentObject::class,
+               ));
+               $this->abstractPlugin->cObj = $contentObjectRenderer;
                $this->defaultPiVars = $this->abstractPlugin->piVars;
        }
 
index 8b0c7dd..64789e2 100644 (file)
@@ -26,4 +26,42 @@ if (TYPO3_MODE === 'FE') {
 
        // Register the core media wizard provider
        \TYPO3\CMS\Frontend\MediaWizard\MediaWizardProviderManager::registerMediaWizardProvider(\TYPO3\CMS\Frontend\MediaWizard\MediaWizardProvider::class);
+
+       // Register all available content elements
+       $GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects'] = array_merge($GLOBALS['TYPO3_CONF_VARS']['FE']['ContentObjects'], array(
+               'TEXT'             => \TYPO3\CMS\Frontend\ContentObject\TextContentObject::class,
+               'CASE'             => \TYPO3\CMS\Frontend\ContentObject\CaseContentObject::class,
+               'CLEARGIF'         => \TYPO3\CMS\Frontend\ContentObject\ClearGifContentObject::class,
+               'COBJ_ARRAY'       => \TYPO3\CMS\Frontend\ContentObject\ContentObjectArrayContentObject::class,
+               'COA'              => \TYPO3\CMS\Frontend\ContentObject\ContentObjectArrayContentObject::class,
+               'COA_INT'          => \TYPO3\CMS\Frontend\ContentObject\ContentObjectArrayInternalContentObject::class,
+               'USER'             => \TYPO3\CMS\Frontend\ContentObject\UserContentObject::class,
+               'USER_INT'         => \TYPO3\CMS\Frontend\ContentObject\UserInternalContentObject::class,
+               'FILE'             => \TYPO3\CMS\Frontend\ContentObject\FileContentObject::class,
+               'FILES'            => \TYPO3\CMS\Frontend\ContentObject\FilesContentObject::class,
+               'IMAGE'            => \TYPO3\CMS\Frontend\ContentObject\ImageContentObject::class,
+               'IMG_RESOURCE'     => \TYPO3\CMS\Frontend\ContentObject\ImageResourceContentObject::class,
+               'IMGTEXT'          => \TYPO3\CMS\Frontend\ContentObject\ImageTextContentObject::class,
+               'CONTENT'          => \TYPO3\CMS\Frontend\ContentObject\ContentContentObject::class,
+               'RECORDS'          => \TYPO3\CMS\Frontend\ContentObject\RecordsContentObject::class,
+               'HMENU'            => \TYPO3\CMS\Frontend\ContentObject\HierarchicalMenuContentObject::class,
+               'CTABLE'           => \TYPO3\CMS\Frontend\ContentObject\ContentTableContentObject::class,
+               'OTABLE'           => \TYPO3\CMS\Frontend\ContentObject\OffsetTableContentObject::class,
+               'COLUMNS'          => \TYPO3\CMS\Frontend\ContentObject\ColumnsContentObject::class,
+               'HRULER'           => \TYPO3\CMS\Frontend\ContentObject\HorizontalRulerContentObject::class,
+               'CASEFUNC'         => \TYPO3\CMS\Frontend\ContentObject\CaseContentObject::class,
+               'LOAD_REGISTER'    => \TYPO3\CMS\Frontend\ContentObject\LoadRegisterContentObject::class,
+               'RESTORE_REGISTER' => \TYPO3\CMS\Frontend\ContentObject\RestoreRegisterContentObject::class,
+               'FORM'             => \TYPO3\CMS\Frontend\ContentObject\FormContentObject::class,
+               'SEARCHRESULT'     => \TYPO3\CMS\Frontend\ContentObject\SearchResultContentObject::class,
+               'TEMPLATE'         => \TYPO3\CMS\Frontend\ContentObject\TemplateContentObject::class,
+               'FLUIDTEMPLATE'    => \TYPO3\CMS\Frontend\ContentObject\FluidTemplateContentObject::class,
+               'MULTIMEDIA'       => \TYPO3\CMS\Frontend\ContentObject\MultimediaContentObject::class,
+               'MEDIA'            => \TYPO3\CMS\Frontend\ContentObject\MediaContentObject::class,
+               'SWFOBJECT'        => \TYPO3\CMS\Frontend\ContentObject\ShockwaveFlashObjectContentObject::class,
+               'FLOWPLAYER'       => \TYPO3\CMS\Frontend\ContentObject\FlowPlayerContentObject::class,
+               'QTOBJECT'         => \TYPO3\CMS\Frontend\ContentObject\QuicktimeObjectContentObject::class,
+               'SVG'              => \TYPO3\CMS\Frontend\ContentObject\ScalableVectorGraphicsContentObject::class,
+               'EDITPANEL'        => \TYPO3\CMS\Frontend\ContentObject\EditPanelContentObject::class
+       ));
 }