[TASK] Add FileCollectionRegistry 57/27257/9
authorFrans Saris <franssaris@gmail.com>
Sun, 2 Feb 2014 10:04:44 +0000 (11:04 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Mon, 17 Feb 2014 20:04:52 +0000 (21:04 +0100)
commite542fac68f84d56b7ce711593a4d58fc6a7fd37b
tree5d7f977f51574c64d5a861eca437bf6a58fd243d
parente31652250243c696409c83c00ab2d9e4b519ed5f
[TASK] Add FileCollectionRegistry

The classes belonging to the FileCollection types are hardwired
in ResourceFactory::createCollectionObject(), therefore you can
not use your own types.

This change introduces a Registry API that makes it possible to
register your own FileCollection type + class and has a generic
way to add the new type to TCA[sys_file_collection].

How to use:
- Register type in ext_localconf.php
  $register->registerFileCollectionClass(full_class_name, your_type);
- Add type to TCA in Configuration/TCA/sys_file_collection.php
  $register->addTypeToTCA(your_type, label, needed_fields);
  return $GLOBALS['TCA']['sys_file_collection'];

Resolves: #53910
Documentation: #56032
Releases: 6.2
Change-Id: Id6cb1c7a59f741b28fee7bdfef32890f34a072a5
Reviewed-on: https://review.typo3.org/27257
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/core/Classes/Resource/Collection/FileCollectionRegistry.php [new file with mode: 0644]
typo3/sysext/core/Classes/Resource/ResourceFactory.php
typo3/sysext/core/Configuration/DefaultConfiguration.php
typo3/sysext/core/Tests/Unit/Resource/Collection/FileCollectionRegistryTest.php [new file with mode: 0644]