[BUGFIX] Root-level folders cannot be displayed
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Resource / ResourceFactory.php
index 948cf09..8d4c15e 100644 (file)
@@ -53,7 +53,7 @@ class ResourceFactory implements \TYPO3\CMS\Core\SingletonInterface {
        protected $storageInstances = array();
 
        /**
-        * @var t3lib_file_AbstractCollection[]
+        * @var \TYPO3\CMS\Core\Resource\Collection\AbstractFileCollection[]
         */
        protected $collectionInstances = array();
 
@@ -348,6 +348,21 @@ class ResourceFactory implements \TYPO3\CMS\Core\SingletonInterface {
                return $this->getStorageObject($storageUid)->getFolder($folderIdentifier);
        }
 
+       /**
+        * Gets a storage object from a combined identifier
+        *
+        * @param string $identifier An identifier of the form [storage uid]:[object identifier]
+        * @return \TYPO3\CMS\Core\Resource\ResourceStorage
+        */
+       public function getStorageObjectFromCombinedIdentifier($identifier) {
+               $parts = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(':', $identifier);
+               if (count($parts) === 2) {
+                       $storageUid = $parts[0];
+               }
+
+               return $this->getStorageObject($storageUid);
+       }
+
        /**
         * Gets a file or folder object.
         *