/** * Prepared Files collection for current directory * * @return \Magento\Framework\Data\Collection\Filesystem */ public function getFiles() { if (!$this->_filesCollection) { $this->_filesCollection = $this->_imageStorage->getFilesCollection($this->_imageHelper->getCurrentPath(), $this->_getMediaType()); } return $this->_filesCollection; }
/** * Return tree node full path based on current path * * @return string */ public function getTreeCurrentPath() { $treePath = ['root']; if ($path = $this->_coreRegistry->registry('storage')->getSession()->getCurrentPath()) { $path = str_replace($this->_cmsWysiwygImages->getStorageRoot(), '', $path); $relative = []; foreach (explode('/', $path) as $dirName) { if ($dirName) { $relative[] = $dirName; $treePath[] = $this->_cmsWysiwygImages->idEncode(implode('/', $relative)); } } } return $treePath; }
/** * @param string $baseUrl * @param bool $isUsingStaticUrls */ protected function generalSettingsGetImageHtmlDeclaration($baseUrl, $isUsingStaticUrls) { $storeId = 1; $this->imagesHelper->setStoreId($storeId); $this->storeMock->expects($this->any())->method('getBaseUrl')->with(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA)->willReturn($baseUrl); $this->storeManagerMock->expects($this->any())->method('getStore')->willReturn($this->storeMock); $this->generalSettingsIsUsingStaticUrlsAllowed($isUsingStaticUrls); }
/** * Get path in root storage dir * * @param string $path * @return string|bool */ protected function _getRelativePathToRoot($path) { return substr($this->_sanitizePath($path), strlen($this->_sanitizePath($this->_cmsWysiwygImages->getStorageRoot()))); }