[FEATURE] Adds register values to FilesContentObj
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Classes / ContentObject / FilesContentObject.php
index d76e5a5..6e6840c 100644 (file)
@@ -140,6 +140,7 @@ class FilesContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConte
                $content = '';
                // optionSplit applied to conf to allow differnt settings per file
                $splitConf = $GLOBALS['TSFE']->tmpl->splitConfArray($conf, count($fileObjects));
+
                // Enable sorting for multiple fileObjects
                $sortingProperty = '';
                if ($conf['sorting'] || $conf['sorting.']) {
@@ -154,9 +155,14 @@ class FilesContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConte
                                }
                        });
                }
+
+               $GLOBALS['TSFE']->register['FILES_COUNT'] = count($fileObjects);
+               $fileObjectCounter = 0;
                foreach ($fileObjects as $key => $fileObject) {
+                       $GLOBALS['TSFE']->register['FILE_NUM_CURRENT'] = $fileObjectCounter;
                        $this->cObj->setCurrentFile($fileObject);
                        $content .= $this->cObj->cObjGetSingle($splitConf[$key]['renderObj'], $splitConf[$key]['renderObj.']);
+                       $fileObjectCounter++;
                }
                $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
                return $content;
@@ -191,4 +197,4 @@ class FilesContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConte
 }
 
 
-?>
\ No newline at end of file
+?>