本文整理汇总了PHP中TYPO3\CMS\Core\Resource\ResourceStorage::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP ResourceStorage::getName方法的具体用法?PHP ResourceStorage::getName怎么用?PHP ResourceStorage::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Resource\ResourceStorage
的用法示例。
在下文中一共展示了ResourceStorage::getName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
/**
* Processes the file
*
* @param Resource\ProcessedFile $processedFile
* @param Resource\ResourceStorage $targetStorage The storage to put the processed file into
*
* @throws \RuntimeException
*/
protected function process(Resource\ProcessedFile $processedFile, Resource\ResourceStorage $targetStorage)
{
$targetFolder = $targetStorage->getProcessingFolder();
if (!is_object($targetFolder)) {
throw new \RuntimeException('Could not get processing folder for storage ' . $this->storage->getName(), 1350514301);
}
// We only have to trigger the file processing if the file either is new, does not exist or the
// original file has changed since the last processing run (the last case has to trigger a reprocessing
// even if the original file was used until now)
if ($processedFile->isNew() || !$processedFile->usesOriginalFile() && !$processedFile->exists() || $processedFile->isOutdated()) {
$task = $processedFile->getTask();
/** @var $processor Resource\Processing\LocalImageProcessor */
$processor = Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\Processing\\LocalImageProcessor');
$processor->processTask($task);
if ($processedFile->isProcessed()) {
/** @var $processedFileRepository Resource\ProcessedFileRepository */
$processedFileRepository = Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\ProcessedFileRepository');
$processedFileRepository->add($processedFile);
}
}
}
示例2: getBrowseableTreeForStorage
/**
* Get a tree for one storage
*
* @param \TYPO3\CMS\Core\Resource\ResourceStorage $storageObject
* @return void
*/
public function getBrowseableTreeForStorage(\TYPO3\CMS\Core\Resource\ResourceStorage $storageObject)
{
// If there are filemounts, show each, otherwise just the rootlevel folder
$fileMounts = $storageObject->getFileMounts();
$rootLevelFolders = array();
if (count($fileMounts)) {
foreach ($fileMounts as $fileMountInfo) {
$rootLevelFolders[] = array('folder' => $fileMountInfo['folder'], 'name' => $fileMountInfo['title']);
}
} elseif ($this->BE_USER->isAdmin()) {
$rootLevelFolders[] = array('folder' => $storageObject->getRootLevelFolder(), 'name' => $storageObject->getName());
}
// Clean the tree
$this->reset();
// Go through all "root level folders" of this tree (can be the rootlevel folder or any file mount points)
foreach ($rootLevelFolders as $rootLevelFolderInfo) {
/** @var $rootLevelFolder \TYPO3\CMS\Core\Resource\Folder */
$rootLevelFolder = $rootLevelFolderInfo['folder'];
$rootLevelFolderName = $rootLevelFolderInfo['name'];
$folderHashSpecUID = GeneralUtility::md5int($rootLevelFolder->getCombinedIdentifier());
$this->specUIDmap[$folderHashSpecUID] = $rootLevelFolder->getCombinedIdentifier();
// Hash key
$storageHashNumber = $this->getShortHashNumberForStorage($storageObject, $rootLevelFolder);
// Set first:
$this->bank = $storageHashNumber;
$isOpen = $this->stored[$storageHashNumber][$folderHashSpecUID] || $this->expandFirst;
// Set PM icon:
$cmd = $this->generateExpandCollapseParameter($this->bank, !$isOpen, $rootLevelFolder);
if (!$storageObject->isBrowsable() || $this->getNumberOfSubfolders($rootLevelFolder) === 0) {
$rootIcon = 'blank';
} elseif (!$isOpen) {
$rootIcon = 'plusonly';
} else {
$rootIcon = 'minusonly';
}
$icon = '<img' . IconUtility::skinImg($this->backPath, 'gfx/ol/' . $rootIcon . '.gif') . ' alt="" />';
// Only link icon if storage is browseable
if (in_array($rootIcon, array('minusonly', 'plusonly'))) {
$firstHtml = $this->PM_ATagWrap($icon, $cmd);
} else {
$firstHtml = $icon;
}
// Mark a storage which is not online, as offline
// maybe someday there will be a special icon for this
if ($storageObject->isOnline() === FALSE) {
$rootLevelFolderName .= ' (' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_mod_file.xlf:sys_file_storage.isOffline') . ')';
}
// Preparing rootRec for the mount
$firstHtml .= $this->wrapIcon(IconUtility::getSpriteIconForResource($rootLevelFolder, array('mount-root' => TRUE)), $rootLevelFolder);
$row = array('uid' => $folderHashSpecUID, 'title' => $rootLevelFolderName, 'path' => $rootLevelFolder->getCombinedIdentifier(), 'folder' => $rootLevelFolder);
// Add the storage root to ->tree
$this->tree[] = array('HTML' => $firstHtml, 'row' => $row, 'bank' => $this->bank, 'hasSub' => $isOpen && $storageObject->isBrowsable());
// If the mount is expanded, go down:
if ($isOpen && $storageObject->isBrowsable()) {
// Set depth:
$this->getFolderTree($rootLevelFolder, 999);
}
}
}
示例3: getBrowseableTreeForStorage
/**
* Get a tree for one storage
*
* @param \TYPO3\CMS\Core\Resource\ResourceStorage $storageObject
* @return void
*/
public function getBrowseableTreeForStorage(\TYPO3\CMS\Core\Resource\ResourceStorage $storageObject)
{
// If there are filemounts, show each, otherwise just the rootlevel folder
$fileMounts = $storageObject->getFileMounts();
$rootLevelFolders = array();
if (!empty($fileMounts)) {
foreach ($fileMounts as $fileMountInfo) {
$rootLevelFolders[] = array('folder' => $fileMountInfo['folder'], 'name' => $fileMountInfo['title']);
}
} elseif ($this->BE_USER->isAdmin()) {
$rootLevelFolders[] = array('folder' => $storageObject->getRootLevelFolder(), 'name' => $storageObject->getName());
}
// Clean the tree
$this->reset();
// Go through all "root level folders" of this tree (can be the rootlevel folder or any file mount points)
foreach ($rootLevelFolders as $rootLevelFolderInfo) {
/** @var $rootLevelFolder \TYPO3\CMS\Core\Resource\Folder */
$rootLevelFolder = $rootLevelFolderInfo['folder'];
$rootLevelFolderName = $rootLevelFolderInfo['name'];
$folderHashSpecUID = GeneralUtility::md5int($rootLevelFolder->getCombinedIdentifier());
$this->specUIDmap[$folderHashSpecUID] = $rootLevelFolder->getCombinedIdentifier();
// Hash key
$storageHashNumber = $this->getShortHashNumberForStorage($storageObject, $rootLevelFolder);
// Set first:
$this->bank = $storageHashNumber;
$isOpen = $this->stored[$storageHashNumber][$folderHashSpecUID] || $this->expandFirst;
// Set PM icon:
$cmd = $this->generateExpandCollapseParameter($this->bank, !$isOpen, $rootLevelFolder);
// Only show and link icon if storage is browseable
if (!$storageObject->isBrowsable() || $this->getNumberOfSubfolders($rootLevelFolder) === 0) {
$firstHtml = '';
} else {
$firstHtml = $this->renderPMIconAndLink($cmd, $isOpen);
}
// Mark a storage which is not online, as offline
// maybe someday there will be a special icon for this
if ($storageObject->isOnline() === false) {
$rootLevelFolderName .= ' (' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_mod_file.xlf:sys_file_storage.isOffline') . ')';
}
// Preparing rootRec for the mount
$icon = $this->iconFactory->getIconForResource($rootLevelFolder, Icon::SIZE_SMALL, null, array('mount-root' => true));
$firstHtml .= $this->wrapIcon($icon, $rootLevelFolder);
$row = array('uid' => $folderHashSpecUID, 'title' => $rootLevelFolderName, 'path' => $rootLevelFolder->getCombinedIdentifier(), 'folder' => $rootLevelFolder);
// Add the storage root to ->tree
$this->tree[] = array('HTML' => $firstHtml, 'row' => $row, 'bank' => $this->bank, 'hasSub' => $isOpen && $storageObject->isBrowsable(), 'invertedDepth' => 1000);
// If the mount is expanded, go down:
if ($isOpen && $storageObject->isBrowsable()) {
// Set depth:
$this->getFolderTree($rootLevelFolder, 999);
}
}
}
示例4: getBrowseableTreeForStorage
/**
* Get a tree for one storage
*
* @param \TYPO3\CMS\Core\Resource\ResourceStorage $storageObject
* @return void
*/
public function getBrowseableTreeForStorage(\TYPO3\CMS\Core\Resource\ResourceStorage $storageObject)
{
// If there are filemounts, show each, otherwise just the rootlevel folder
$fileMounts = $storageObject->getFileMounts();
$rootLevelFolders = array();
if (!empty($fileMounts)) {
foreach ($fileMounts as $fileMountInfo) {
$rootLevelFolders[] = array('folder' => $fileMountInfo['folder'], 'name' => $fileMountInfo['title']);
}
} elseif ($this->BE_USER->isAdmin()) {
$rootLevelFolders[] = array('folder' => $storageObject->getRootLevelFolder(), 'name' => $storageObject->getName());
}
// Clean the tree
$this->reset();
// Go through all "root level folders" of this tree (can be the rootlevel folder or any file mount points)
foreach ($rootLevelFolders as $rootLevelFolderInfo) {
/** @var $rootLevelFolder \TYPO3\CMS\Core\Resource\Folder */
$rootLevelFolder = $rootLevelFolderInfo['folder'];
$rootLevelFolderName = $rootLevelFolderInfo['name'];
$folderHashSpecUID = GeneralUtility::md5int($rootLevelFolder->getCombinedIdentifier());
$this->specUIDmap[$folderHashSpecUID] = $rootLevelFolder->getCombinedIdentifier();
// Hash key
$storageHashNumber = $this->getShortHashNumberForStorage($storageObject, $rootLevelFolder);
// Set first:
$this->bank = $storageHashNumber;
$isOpen = $this->stored[$storageHashNumber][$folderHashSpecUID] || $this->expandFirst;
// Set PM icon:
$cmd = $this->generateExpandCollapseParameter($this->bank, !$isOpen, $rootLevelFolder);
if (!$storageObject->isBrowsable() || $this->getNumberOfSubfolders($rootLevelFolder) === 0) {
$firstHtml = '';
} else {
// Only show and link icon if storage is browseable
$link = '';
if ($this->thisScript) {
$link = ' href="' . htmlspecialchars($this->getThisScript() . 'PM=' . $cmd) . '"';
}
$firstHtml = '<a class="list-tree-control list-tree-control-' . ($isOpen ? 'open' : 'closed') . '"' . $link . '><i class="fa"></i></a>';
}
// Mark a storage which is not online, as offline
// maybe someday there will be a special icon for this
if ($storageObject->isOnline() === FALSE) {
$rootLevelFolderName .= ' (' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_mod_file.xlf:sys_file_storage.isOffline') . ')';
}
// Preparing rootRec for the mount
$firstHtml .= $this->wrapIcon(IconUtility::getSpriteIconForResource($rootLevelFolder, array('mount-root' => TRUE)), $rootLevelFolder);
$row = array('uid' => $folderHashSpecUID, 'title' => $rootLevelFolderName, 'path' => $rootLevelFolder->getCombinedIdentifier(), 'folder' => $rootLevelFolder);
// Add the storage root to ->tree
$this->tree[] = array('HTML' => $firstHtml, 'row' => $row, 'bank' => $this->bank, 'hasSub' => $isOpen && $storageObject->isBrowsable());
// If the mount is expanded, go down:
if ($isOpen && $storageObject->isBrowsable()) {
// Set depth:
$this->getFolderTree($rootLevelFolder, 999);
}
}
}