作者:adroll
项目:TYPO3.CM
/**
* Returns TRUE if the input "record" contains a folder which can be linked.
*
* @param \TYPO3\CMS\Core\Resource\Folder $folderObject object with information about the folder element. Contains keys like title, uid, path, _title
*
* @return bool TRUE is returned if the path is NOT a recycler or temp folder AND if ->ext_noTempRecyclerDirs is not set.
*/
public function ext_isLinkable($folderObject)
{
if ($this->ext_noTempRecyclerDirs && (substr($folderObject->getIdentifier(), -7) == '_temp_/' || substr($folderObject->getIdentifier(), -11) == '_recycler_/')) {
return FALSE;
} else {
return TRUE;
}
}
作者:adroll
项目:TYPO3.CM
/**
* Returns TRUE if the input "record" contains a folder which can be linked.
*
* @param \TYPO3\CMS\Core\Resource\Folder $folderObject Object with information about the folder element. Contains keys like title, uid, path, _title
* @return bool TRUE is returned if the path is found in the web-part of the server and is NOT a recycler or temp folder
*/
public function ext_isLinkable(\TYPO3\CMS\Core\Resource\Folder $folderObject)
{
if (strstr($folderObject->getIdentifier(), '_recycler_') || strstr($folderObject->getIdentifier(), '_temp_')) {
return FALSE;
} else {
return TRUE;
}
}
作者:plan2ne
项目:TYPO3.CM
/**
* @throws \PHPUnit_Framework_Exception
*/
protected function setUp()
{
$this->storageMock = $this->getMock(ResourceStorage::class, array(), array(), '', FALSE);
$this->storageMock->expects($this->any())->method('getUid')->will($this->returnValue(5));
$this->folderMock = $this->getMock(Folder::class, array(), array(), '', FALSE);
$this->folderMock->expects($this->any())->method('getStorage')->willReturn($this->storageMock);
$this->storageMock->expects($this->any())->method('getProcessingFolder')->willReturn($this->folderMock);
$this->databaseRow = array('uid' => '1234567', 'identifier' => 'dummy.txt', 'name' => $this->getUniqueId('dummy_'), 'storage' => $this->storageMock->getUid());
}
作者:khanhdeu
项目:typo3tes
/**
* @test
*/
public function flattenResultDataValueFlattensFileAndFolderResourcesButReturnsAnythingElseAsIs()
{
$this->fileController = $this->getAccessibleMock('TYPO3\\CMS\\Backend\\Controller\\File\\FileController', array('dummy'));
$this->folderResourceMock->expects($this->once())->method('getIdentifier')->will($this->returnValue('bar'));
$this->mockFileProcessor->expects($this->any())->method('getErrorMessages')->will($this->returnValue(array()));
$this->assertTrue($this->fileController->_call('flattenResultDataValue', TRUE));
$this->assertSame(array(), $this->fileController->_call('flattenResultDataValue', array()));
$this->assertSame(array('id' => 'foo', 'date' => '29-11-73', 'iconClasses' => 't3-icon t3-icon-mimetypes t3-icon-mimetypes-text t3-icon-text-html'), $this->fileController->_call('flattenResultDataValue', $this->fileResourceMock));
$this->assertSame('bar', $this->fileController->_call('flattenResultDataValue', $this->folderResourceMock));
}
作者:s-nune
项目:fal_securedownloa
/**
* renders <f:then> child if the current visitor ...
* otherwise renders <f:else> child.
*
* @param Folder $folder
* @return string
*/
public function render(Folder $folder)
{
/** @var $leafStateService \BeechIt\FalSecuredownload\Service\LeafStateService */
$leafStateService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('BeechIt\\FalSecuredownload\\Service\\LeafStateService');
$feUser = !empty($GLOBALS['TSFE']) ? $GLOBALS['TSFE']->fe_user : false;
if ($feUser && $leafStateService->getLeafStateForUser($feUser, $folder->getCombinedIdentifier())) {
return $this->renderThenChild();
} else {
return $this->renderElseChild();
}
}
作者:rickymathe
项目:TYPO3.CM
/**
* @test
*/
public function flattenResultDataValueFlattensFileAndFolderResourcesButReturnsAnythingElseAsIs()
{
$this->fileController = $this->getAccessibleMock(\TYPO3\CMS\Backend\Controller\File\FileController::class, array('dummy'));
$this->folderResourceMock->expects($this->once())->method('getIdentifier')->will($this->returnValue('bar'));
$this->mockFileProcessor->expects($this->any())->method('getErrorMessages')->will($this->returnValue(array()));
$this->assertTrue($this->fileController->_call('flattenResultDataValue', true));
$this->assertSame(array(), $this->fileController->_call('flattenResultDataValue', array()));
$result = $this->fileController->_call('flattenResultDataValue', $this->fileResourceMock);
$this->assertContains('<span class="t3js-icon icon icon-size-small icon-state-default icon-mimetypes-text-html" data-identifier="mimetypes-text-html">', $result['icon']);
unset($result['icon']);
$this->assertSame(array('id' => 'foo', 'date' => '29-11-73', 'thumbUrl' => ''), $result);
$this->assertSame('bar', $this->fileController->_call('flattenResultDataValue', $this->folderResourceMock));
}
作者:viso
项目:medi
/**
* Get main headline based on active folder or storage for backend module
*
* Folder names are resolved to their special names like done in the tree view.
*
* @param Folder $folder
* @return string
*/
protected function getFolderName(Folder $folder)
{
$name = $folder->getName();
if ($name === '') {
// Show storage name on storage root
if ($folder->getIdentifier() === '/') {
$name = $folder->getStorage()->getName();
}
} else {
$name = key(ListUtility::resolveSpecialFolderNames(array($name => $folder)));
}
return $name;
}
作者:s-nune
项目:fal_securedownloa
/**
* Get folder configuration record
*
* @param Folder $folder
* @return array
*/
public function getFolderRecord(Folder $folder)
{
if (!isset(self::$folderRecordCache[$folder->getCombinedIdentifier()]) || !array_key_exists($folder->getCombinedIdentifier(), self::$folderRecordCache)) {
$record = $this->getDatabase()->exec_SELECTgetSingleRow('*', 'tx_falsecuredownload_folder', 'storage = ' . (int) $folder->getStorage()->getUid() . '
AND folder_hash = ' . $this->getDatabase()->fullQuoteStr($folder->getHashedIdentifier(), 'tx_falsecuredownload_folder'));
// cache results
self::$folderRecordCache[$folder->getCombinedIdentifier()] = $record;
}
return self::$folderRecordCache[$folder->getCombinedIdentifier()];
}
作者:nicksergi
项目:TYPO3v4-Cor
/**
* Constructor function for class
*
* @return void
* @todo Define visibility
*/
public function init()
{
// Initialize GPvars:
$this->number = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('number');
$this->target = $combinedIdentifier = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('target');
$this->returnUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::sanitizeLocalUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('returnUrl'));
// create the folder object
if ($combinedIdentifier) {
$this->folderObject = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->getFolderObjectFromCombinedIdentifier($combinedIdentifier);
}
// Cleaning and checking target directory
if (!$this->folderObject) {
$title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:paramError', TRUE);
$message = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:targetNoDir', TRUE);
throw new \RuntimeException($title . ': ' . $message, 1294586843);
}
// Setting the title and the icon
$icon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('apps-filetree-root');
$this->title = $icon . htmlspecialchars($this->folderObject->getStorage()->getName()) . ': ' . htmlspecialchars($this->folderObject->getIdentifier());
// Setting template object
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->setModuleTemplate('templates/file_newfolder.html');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->JScode = $this->doc->wrapScriptTags('
var path = "' . $this->target . '";
function reload(a) { //
if (!changed || (changed && confirm(' . $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:mess.redraw')) . '))) {
var params = "&target="+encodeURIComponent(path)+"&number="+a+"&returnUrl=' . rawurlencode($this->returnUrl) . '";
window.location.href = "file_newfolder.php?"+params;
}
}
function backToList() { //
top.goToModule("file_list");
}
var changed = 0;
');
}
作者:amazing
项目:TYPO3.CM
/**
* Writes the file with the is $fileId to the legacy import folder. The file name will used from
* argument $fileName and the file was successfully created or an identical file was already found,
* $fileName will held the uid of the new created file record.
*
* @param string $fileName The file name for the new file. Value would be changed to the uid of the new created file record.
* @param int $fileId The id of the file in data array
* @return bool
*/
protected function writeSysFileResourceForLegacyImport(&$fileName, $fileId)
{
if ($this->legacyImportFolder === null) {
return false;
}
if (!isset($this->dat['files'][$fileId])) {
$this->error('ERROR: File ID "' . $fileId . '" could not be found');
return false;
}
$temporaryFile = $this->writeTemporaryFileFromData($fileId, 'files');
if ($temporaryFile === null) {
// error on writing the file. Error message was already added
return false;
}
$importFolder = $this->legacyImportFolder;
if (isset($this->dat['files'][$fileId]['relFileName'])) {
$relativeFilePath = PathUtility::dirname($this->dat['files'][$fileId]['relFileName']);
if (!$this->legacyImportFolder->hasFolder($relativeFilePath)) {
$this->legacyImportFolder->createFolder($relativeFilePath);
}
$importFolder = $this->legacyImportFolder->getSubfolder($relativeFilePath);
}
$fileObject = null;
try {
// check, if there is alreay the same file in the folder
if ($importFolder->hasFile($fileName)) {
$fileStorage = $importFolder->getStorage();
$file = $fileStorage->getFile($importFolder->getIdentifier() . $fileName);
if ($file->getSha1() === sha1_file($temporaryFile)) {
$fileObject = $file;
}
}
} catch (Exception $e) {
}
if ($fileObject === null) {
try {
$fileObject = $importFolder->addFile($temporaryFile, $fileName, DuplicationBehavior::RENAME);
} catch (Exception $e) {
$this->error('Error: no file could be added to the storage for file name ' . $this->alternativeFileName[$temporaryFile]);
}
}
if (md5_file(PATH_site . $fileObject->getPublicUrl()) == $this->dat['files'][$fileId]['content_md5']) {
$fileName = $fileObject->getUid();
$this->fileIDMap[$fileId] = $fileName;
$this->filePathMap[$fileId] = $fileObject->getPublicUrl();
return true;
} else {
$this->error('ERROR: File content "' . $this->dat['files'][$fileId]['relFileName'] . '" was corrupted');
}
return false;
}
作者:nicksergi
项目:TYPO3v4-Cor
/**
* Simple function to make a hierarchical subfolder request into
* a "flat" option list
*
* @param \TYPO3\CMS\Core\Resource\Folder $parentFolder
* @param integer $level a limiter
* @return \TYPO3\CMS\Core\Resource\Folder[]
*/
protected function getSubfoldersForOptionList(\TYPO3\CMS\Core\Resource\Folder $parentFolder, $level = 0)
{
$level++;
// hard break on recursion
if ($level > 99) {
return array();
}
$allFolderItems = array($parentFolder);
$subFolders = $parentFolder->getSubfolders();
foreach ($subFolders as $subFolder) {
$subFolderItems = $this->getSubfoldersForOptionList($subFolder, $level);
$allFolderItems = array_merge($allFolderItems, $subFolderItems);
}
return $allFolderItems;
}
作者:cosmo
项目:TYPO3.CM
/**
* Init file/folder parameters
*/
protected function initFileOrFolderRecord()
{
$fileOrFolderObject = ResourceFactory::getInstance()->retrieveFileOrFolderObject($this->uid);
if ($fileOrFolderObject instanceof Folder) {
$this->folderObject = $fileOrFolderObject;
$this->access = $this->folderObject->checkActionPermission('read');
$this->type = 'folder';
} else {
$this->fileObject = $fileOrFolderObject;
$this->access = $this->fileObject->checkActionPermission('read');
$this->type = 'file';
$this->table = 'sys_file';
try {
$this->row = BackendUtility::getRecordWSOL($this->table, $fileOrFolderObject->getUid());
} catch (\Exception $e) {
$this->row = array();
}
}
}
作者:Mr-Robot
项目:TYPO3.CM
/**
* Init file/folder parameters
*/
protected function initFileOrFolderRecord()
{
$fileOrFolderObject = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->retrieveFileOrFolderObject($this->uid);
if ($fileOrFolderObject instanceof \TYPO3\CMS\Core\Resource\Folder) {
$this->folderObject = $fileOrFolderObject;
$this->access = $this->folderObject->checkActionPermission('read');
$this->type = 'folder';
} else {
$this->fileObject = $fileOrFolderObject;
$this->access = $this->fileObject->checkActionPermission('read');
$this->type = 'file';
$this->table = 'sys_file_metadata';
try {
$metaData = $fileOrFolderObject->_getMetaData();
$this->row = BackendUtility::getRecordWSOL($this->table, $metaData['uid']);
} catch (\Exception $e) {
$this->row = array();
}
}
}
作者:Gregp
项目:TYPO3.CM
/**
* Main function, rendering the content of the rename form
*
* @return void
*/
public function main()
{
if ($this->fileOrFolderObject instanceof \TYPO3\CMS\Core\Resource\Folder) {
$fileIdentifier = $this->fileOrFolderObject->getCombinedIdentifier();
} else {
$fileIdentifier = $this->fileOrFolderObject->getUid();
}
$pageContent = '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('tce_file')) . '" method="post" name="editform" role="form">';
// Making the formfields for renaming:
$pageContent .= '
<div class="form-group">
<input class="form-control" type="text" name="file[rename][0][target]" value="' . htmlspecialchars($this->fileOrFolderObject->getName()) . '" ' . $this->getDocumentTemplate()->formWidth(40) . ' />
<input type="hidden" name="file[rename][0][data]" value="' . htmlspecialchars($fileIdentifier) . '" />
</div>
';
// Making submit button:
$pageContent .= '
<div class="form-group">
<input class="btn btn-primary" type="submit" value="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:file_rename.php.submit', true) . '" />
<input class="btn btn-danger" type="submit" value="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.cancel', true) . '" onclick="backToList(); return false;" />
<input type="hidden" name="redirect" value="' . htmlspecialchars($this->returnUrl) . '" />
</div>
';
$pageContent .= '</form>';
// Create buttons
$buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
// csh button
$cshButton = $buttonBar->makeHelpButton()->setModuleName('xMOD_csh_corebe')->setFieldName('file_rename');
$buttonBar->addButton($cshButton);
// back button
if ($this->returnUrl) {
$backButton = $buttonBar->makeLinkButton()->sethref(GeneralUtility::linkThisUrl($this->returnUrl))->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', true))->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-view-go-back', Icon::SIZE_SMALL));
$buttonBar->addButton($backButton);
}
// set header
$this->content = '<h1>' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:file_rename.php.pagetitle') . '</h1>';
// add section
$this->content .= $this->moduleTemplate->section('', $pageContent);
$this->moduleTemplate->setContent($this->content);
}
作者:plan2ne
项目:TYPO3.CM
/**
* Main function, rendering the content of the rename form
*
* @return void
*/
public function main()
{
// Make page header:
$this->content = $this->doc->startPage($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:file_rename.php.pagetitle'));
$pageContent = $this->doc->header($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:file_rename.php.pagetitle'));
if ($this->fileOrFolderObject instanceof \TYPO3\CMS\Core\Resource\Folder) {
$fileIdentifier = $this->fileOrFolderObject->getCombinedIdentifier();
} else {
$fileIdentifier = $this->fileOrFolderObject->getUid();
}
$pageContent .= '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('tce_file')) . '" method="post" name="editform" role="form">';
// Making the formfields for renaming:
$pageContent .= '
<div class="form-group">
<input class="form-control" type="text" name="file[rename][0][target]" value="' . htmlspecialchars($this->fileOrFolderObject->getName()) . '" ' . $this->getDocumentTemplate()->formWidth(40) . ' />
<input type="hidden" name="file[rename][0][data]" value="' . htmlspecialchars($fileIdentifier) . '" />
</div>
';
// Making submit button:
$pageContent .= '
<div class="form-group">
<input class="btn btn-primary" type="submit" value="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:file_rename.php.submit', TRUE) . '" />
<input class="btn btn-danger" type="submit" value="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.cancel', TRUE) . '" onclick="backToList(); return false;" />
<input type="hidden" name="redirect" value="' . htmlspecialchars($this->returnUrl) . '" />
' . \TYPO3\CMS\Backend\Form\FormEngine::getHiddenTokenField('tceAction') . '
</div>
';
$pageContent .= '</form>';
$docHeaderButtons = array('back' => '');
$docHeaderButtons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'file_rename');
// Back
if ($this->returnUrl) {
$docHeaderButtons['back'] = '<a href="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisUrl($this->returnUrl)) . '" class="typo3-goBack" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-view-go-back') . '</a>';
}
// Add the HTML as a section:
$markerArray = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => '', 'CONTENT' => $pageContent, 'PATH' => $this->title);
$this->content .= $this->doc->moduleBody(array(), $docHeaderButtons, $markerArray);
$this->content .= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
}
作者:dachcom-digita
项目:TYPO3.CM
/**
* Get the HTML data required for a bulk selection of files of the TYPO3 Element Browser.
*
* @param int $filesCount Number of files currently displayed
* @return string HTML data required for a bulk selection of files - if $filesCount is 0, nothing is returned
*/
protected function getBulkSelector($filesCount)
{
if (!$filesCount) {
return '';
}
$lang = $this->getLanguageService();
$out = '';
// Getting flag for showing/not showing thumbnails:
$noThumbsInEB = $this->getBackendUser()->getTSConfigVal('options.noThumbsInEB');
if (!$noThumbsInEB && $this->selectedFolder) {
// MENU-ITEMS, fetching the setting for thumbnails from File>List module:
$_MOD_MENU = array('displayThumbs' => '');
$_MCONF['name'] = 'file_list';
$_MOD_SETTINGS = BackendUtility::getModuleData($_MOD_MENU, GeneralUtility::_GP('SET'), $_MCONF['name']);
$addParams = GeneralUtility::implodeArrayForUrl('', $this->getUrlParameters(['identifier' => $this->selectedFolder->getCombinedIdentifier()]));
$thumbNailCheck = '<div class="checkbox" style="padding:5px 0 15px 0"><label for="checkDisplayThumbs">' . BackendUtility::getFuncCheck('', 'SET[displayThumbs]', $_MOD_SETTINGS['displayThumbs'], $this->thisScript, $addParams, 'id="checkDisplayThumbs"') . $lang->sL('LLL:EXT:lang/locallang_mod_file_list.xlf:displayThumbs', true) . '</label></div>';
$out .= $thumbNailCheck;
} else {
$out .= '<div style="padding-top: 15px;"></div>';
}
return $out;
}
作者:hlo
项目:TYPO3.CM
/**
* Get the HTML data required for a bulk selection of files of the TYPO3 Element Browser.
*
* @param int $filesCount Number of files currently displayed
* @return string HTML data required for a bulk selection of files - if $filesCount is 0, nothing is returned
*/
protected function getBulkSelector($filesCount)
{
if (!$filesCount) {
return '';
}
$lang = $this->getLanguageService();
$labelToggleSelection = $lang->sL('LLL:EXT:lang/locallang_browse_links.xlf:toggleSelection', true);
$labelImportSelection = $lang->sL('LLL:EXT:lang/locallang_browse_links.xlf:importSelection', true);
$out = $this->doc->spacer(10) . '<div>' . '<a href="#" id="t3-js-importSelection" title="' . $labelImportSelection . '">' . $this->iconFactory->getIcon('actions-document-import-t3d', Icon::SIZE_SMALL) . $labelImportSelection . '</a> ' . '<a href="#" id="t3-js-toggleSelection" title="' . $labelToggleSelection . '">' . $this->iconFactory->getIcon('actions-document-select', Icon::SIZE_SMALL) . $labelToggleSelection . '</a>' . '</div>';
// Getting flag for showing/not showing thumbnails:
$noThumbsInEB = $this->getBackendUser()->getTSConfigVal('options.noThumbsInEB');
if (!$noThumbsInEB && $this->selectedFolder) {
// MENU-ITEMS, fetching the setting for thumbnails from File>List module:
$_MOD_MENU = array('displayThumbs' => '');
$_MCONF['name'] = 'file_list';
$_MOD_SETTINGS = BackendUtility::getModuleData($_MOD_MENU, GeneralUtility::_GP('SET'), $_MCONF['name']);
$addParams = GeneralUtility::implodeArrayForUrl('', $this->getUrlParameters(['identifier' => $this->selectedFolder->getCombinedIdentifier()]));
$thumbNailCheck = '<div class="checkbox"><label for="checkDisplayThumbs">' . BackendUtility::getFuncCheck('', 'SET[displayThumbs]', $_MOD_SETTINGS['displayThumbs'], $this->thisScript, $addParams, 'id="checkDisplayThumbs"') . $lang->sL('LLL:EXT:lang/locallang_mod_file_list.xlf:displayThumbs', true) . '</label></div>';
$out .= $this->doc->spacer(5) . $thumbNailCheck . $this->doc->spacer(15);
} else {
$out .= $this->doc->spacer(15);
}
return $out;
}
作者:kabarak
项目:ya
/**
* Checks if a given object or identifier is within a container, e.g. if
* a file or folder is within another folder.
* This can e.g. be used to check for webmounts.
*
* @param \TYPO3\CMS\Core\Resource\Folder $container
* @param mixed $content An object or an identifier to check
* @return boolean TRUE if $content is within $container
*/
public function isWithin(\TYPO3\CMS\Core\Resource\Folder $container, $content)
{
// TODO: Implement isWithin() method.
error_log('CALLED: ' . __FUNCTION__ . ' with ' . $content . ' in folder ' . $container->getCombinedIdentifier());
}
作者:adroll
项目:TYPO3.CM
/**
* Make reference count
*
* @param File|Folder $fileOrFolderObject Array with information about the file/directory for which to make the clipboard panel for the listing.
* @return string HTML
*/
public function makeRef($fileOrFolderObject)
{
if ($fileOrFolderObject instanceof FolderInterface) {
return '-';
}
// Look up the file in the sys_refindex.
// Exclude sys_file_metadata records as these are no use references
$databaseConnection = $this->getDatabaseConnection();
$table = 'sys_refindex';
$referenceCount = $databaseConnection->exec_SELECTcountRows('*', $table, 'ref_table=' . $databaseConnection->fullQuoteStr('sys_file', $table) . ' AND ref_uid=' . (int) $fileOrFolderObject->getUid() . ' AND deleted=0' . ' AND tablename != ' . $databaseConnection->fullQuoteStr('sys_file_metadata', $table));
return $this->generateReferenceToolTip($referenceCount, '\'_FILE\', ' . GeneralUtility::quoteJSvalue($fileOrFolderObject->getCombinedIdentifier()));
}
作者:nicksergi
项目:TYPO3v4-Cor
/**
* @param $path
* @param int $start
* @param int $numberOfItems
* @param array $folderFilterCallbacks
* @param boolean $recursive
* @return array
*/
public function fetchFolderListFromDriver($path, $start = 0, $numberOfItems = 0, array $folderFilterCallbacks = array(), $recursive = FALSE)
{
$items = $this->driver->getFolderList($path, $start, $numberOfItems, $folderFilterCallbacks, $recursive);
// Exclude the _processed_ folder, so it won't get indexed etc
$processingFolder = $this->getProcessingFolder();
if ($processingFolder && $path == '/') {
$processedFolderIdentifier = $this->processingFolder->getIdentifier();
$processedFolderIdentifier = trim($processedFolderIdentifier, '/');
if (isset($items[$processedFolderIdentifier])) {
unset($items[$processedFolderIdentifier]);
}
}
uksort($items, 'strnatcasecmp');
return $items;
}