コード例 #1
0
ファイル: Files.php プロジェクト: aiesh/magento2
 /**
  * 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;
 }
コード例 #2
0
ファイル: Tree.php プロジェクト: kidaa30/magento2-platformsh
 /**
  * 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;
 }
コード例 #3
0
ファイル: ImagesTest.php プロジェクト: Doability/magento2dev
 /**
  * @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);
 }
コード例 #4
0
ファイル: Storage.php プロジェクト: tingyeeh/magento2
 /**
  * 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())));
 }