33 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'fal'][
'registeredCollections'] as $type => $class) {
49 if (strlen($type) > 30) {
50 throw new \InvalidArgumentException(
'FileCollection type can have a max string length of 30 bytes', 1391295611);
53 if (!class_exists($className)) {
54 throw new \InvalidArgumentException(
'Class ' . $className .
' does not exist.', 1391295613);
57 if (!in_array(
'TYPO3\\CMS\\Core\\Resource\\Collection\\AbstractFileCollection', class_parents($className), TRUE)) {
58 throw new \InvalidArgumentException(
'FileCollection ' . $className .
' needs to extend the AbstractFileCollection.', 1391295633);
61 if (isset($this->types[$type])) {
63 if ($this->types[$type] === $className) {
65 } elseif (!$override) {
66 throw new \InvalidArgumentException(
'FileCollections ' . $type .
' is already registered.', 1391295643);
70 $this->types[$type] = $className;
83 public function addTypeToTCA($type, $label, $availableFields, array $additionalColumns = array()) {
85 $GLOBALS[
'TCA'][
'sys_file_collection'][
'types'][$type] = array(
86 'showitem' =>
'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, title;;1, type, ' . $availableFields
91 foreach (
$GLOBALS[
'TCA'][
'sys_file_collection'][
'columns'][
'type'][
'config'][
'items'] as $key => $item) {
92 if ($item[1] === $type) {
94 $GLOBALS[
'TCA'][
'sys_file_collection'][
'columns'][
'type'][
'config'][
'items'][$key][0] = $label;
98 $GLOBALS[
'TCA'][
'sys_file_collection'][
'columns'][
'type'][
'config'][
'items'][] = array(
103 if ($additionalColumns !== array()) {
106 return $GLOBALS[
'TCA'][
'sys_file_collection'];
117 if (!isset($this->types[$type])) {
118 throw new \InvalidArgumentException(
'Desired FileCollection type "' . $type .
'" is not in the list of available FileCollections.', 1391295644);
120 return $this->types[$type];
130 return isset($this->types[$type]);
static mergeRecursiveWithOverrule(array &$original, array $overrule, $addKeys=TRUE, $includeEmptyValues=TRUE, $enableUnsetFeature=TRUE)
registerFileCollectionClass($className, $type, $override=FALSE)
fileCollectionTypeExists($type)
addTypeToTCA($type, $label, $availableFields, array $additionalColumns=array())
getFileCollectionClass($type)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]