本文整理汇总了PHP中TYPO3\CMS\Core\Resource\File::isIndexed方法的典型用法代码示例。如果您正苦于以下问题:PHP File::isIndexed方法的具体用法?PHP File::isIndexed怎么用?PHP File::isIndexed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Resource\File
的用法示例。
在下文中一共展示了File::isIndexed方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderReferences
/**
* Render references section (references from and references to current record)
*
* @return string
*/
protected function renderReferences()
{
$content = '';
switch ($this->type) {
case 'db':
$references = $this->makeRef($this->table, $this->row['uid']);
if (!empty($references)) {
$content .= '<h3>' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.referencesToThisItem', true) . '</h3>';
$content .= $references;
}
$referencesFrom = $this->makeRefFrom($this->table, $this->row['uid']);
if (!empty($referencesFrom)) {
$content .= '<h3>' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.referencesFromThisItem', true) . '</h3>';
$content .= $referencesFrom;
}
break;
case 'file':
if ($this->fileObject && $this->fileObject->isIndexed()) {
$references = $this->makeRef('_FILE', $this->fileObject);
if (!empty($references)) {
$content .= '<h3>' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.referencesToThisItem', true) . '</h3>';
$content .= $references;
}
}
break;
}
return $content;
}
示例2: renderReferences
protected function renderReferences()
{
$content = '';
switch ($this->type) {
case 'db':
$references = $this->makeRef($this->table, $this->row['uid']);
if (!empty($references)) {
$content .= $this->doc->section($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.referencesToThisItem'), $references);
}
$referencesFrom = $this->makeRefFrom($this->table, $this->row['uid']);
if (!empty($referencesFrom)) {
$content .= $this->doc->section($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.referencesFromThisItem'), $referencesFrom);
}
break;
case 'file':
if ($this->fileObject && $this->fileObject->isIndexed()) {
$references = $this->makeRef('_FILE', $this->fileObject);
if (!empty($references)) {
$header = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.referencesToThisItem');
$content .= $this->doc->section($header, $references);
}
}
break;
}
return $content;
}
示例3: renderFileInfo
/**
* Main function. Will generate the information to display for the item
* set internally.
*
* @param string $returnLinkTag <a> tag closing/returning.
* @return void
* @todo Define visibility
*/
public function renderFileInfo($returnLinkTag)
{
$fileExtension = $this->fileObject->getExtension();
$code = '<div class="fileInfoContainer">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForFile($fileExtension) . '<strong>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.file', TRUE) . ':</strong> ' . $this->fileObject->getName() . ' ' . '<strong>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.filesize') . ':</strong> ' . \TYPO3\CMS\Core\Utility\GeneralUtility::formatSize($this->fileObject->getSize()) . '</div>
';
$this->content .= $this->doc->section('', $code);
$this->content .= $this->doc->divider(2);
// If the file was an image...
// @todo: add this check in the domain model, or in the processing folder
if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'], $fileExtension)) {
// @todo: find a way to make getimagesize part of the t3lib_file object
$imgInfo = @getimagesize($this->fileObject->getForLocalProcessing(FALSE));
$thumbUrl = $this->fileObject->process(\TYPO3\CMS\Core\Resource\ProcessedFile::CONTEXT_IMAGEPREVIEW, array('width' => '150m', 'height' => '150m'))->getPublicUrl(TRUE);
$code = '<div class="fileInfoContainer fileDimensions">' . '<strong>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.dimensions') . ':</strong> ' . $imgInfo[0] . 'x' . $imgInfo[1] . ' ' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.pixels') . '</div>';
$code .= '<br />
<div align="center">' . $returnLinkTag . '<img src="' . $thumbUrl . '" alt="' . htmlspecialchars(trim($this->fileObject->getName())) . '" title="' . htmlspecialchars(trim($this->fileObject->getName())) . '" /></a></div>';
$this->content .= $this->doc->section('', $code);
} elseif ($fileExtension == 'ttf') {
$thumbUrl = $this->fileObject->process(\TYPO3\CMS\Core\Resource\ProcessedFile::CONTEXT_IMAGEPREVIEW, array('width' => '530m', 'height' => '600m'))->getPublicUrl(TRUE);
$thumb = '<br />
<div align="center">' . $returnLinkTag . '<img src="' . $thumbUrl . '" border="0" title="' . htmlspecialchars(trim($this->fileObject->getName())) . '" alt="" /></a></div>';
$this->content .= $this->doc->section('', $thumb);
}
// Traverse the list of fields to display for the record:
$tableRows = array();
$showRecordFieldList = $GLOBALS['TCA'][$this->table]['interface']['showRecordFieldList'];
$fieldList = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $showRecordFieldList, TRUE);
foreach ($fieldList as $name) {
$name = trim($name);
if (!isset($GLOBALS['TCA'][$this->table]['columns'][$name])) {
continue;
}
$isExcluded = !(!$GLOBALS['TCA'][$this->table]['columns'][$name]['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $this->table . ':' . $name));
if ($isExcluded) {
continue;
}
$uid = $this->row['uid'];
$itemValue = \TYPO3\CMS\Backend\Utility\BackendUtility::getProcessedValue($this->table, $name, $this->row[$name], 0, 0, FALSE, $uid);
$itemLabel = $GLOBALS['LANG']->sL(\TYPO3\CMS\Backend\Utility\BackendUtility::getItemLabel($this->table, $name), 1);
$tableRows[] = '
<tr>
<td class="t3-col-header">' . $itemLabel . '</td>
<td>' . htmlspecialchars($itemValue) . '</td>
</tr>';
}
// Create table from the information:
$tableCode = '
<table border="0" cellpadding="0" cellspacing="0" id="typo3-showitem" class="t3-table-info">
' . implode('', $tableRows) . '
</table>';
$this->content .= $this->doc->section('', $tableCode);
// References:
if ($this->fileObject->isIndexed()) {
$header = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.referencesToThisItem');
$this->content .= $this->doc->section($header, $this->makeRef('_FILE', $this->fileObject));
}
}
示例4: getReferences
/**
* Get references section (references from and references to current record)
*
* @return array
*/
protected function getReferences() : array
{
$references = [];
switch ($this->type) {
case 'db':
$references['refLines'] = $this->makeRef($this->table, $this->row['uid']);
$references['refFromLines'] = $this->makeRefFrom($this->table, $this->row['uid']);
break;
case 'file':
if ($this->fileObject && $this->fileObject->isIndexed()) {
$references['refLines'] = $this->makeRef('_FILE', $this->fileObject);
}
break;
}
return $references;
}
示例5: linkWrapFile
/**
* Wraps filenames in links which opens the metadata editor.
*
* @param string $code String to be wrapped in links
* @param File $fileObject File to be linked
* @return string HTML
*/
public function linkWrapFile($code, File $fileObject)
{
try {
if ($fileObject instanceof File && $fileObject->isIndexed() && $fileObject->checkActionPermission('write') && $this->getBackendUser()->check('tables_modify', 'sys_file_metadata')) {
$metaData = $fileObject->_getMetaData();
$data = array('sys_file_metadata' => array($metaData['uid'] => 'edit'));
$editOnClick = BackendUtility::editOnClick(GeneralUtility::implodeArrayForUrl('edit', $data), '', $this->listUrl());
$title = htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.editMetadata'));
$code = '<a href="#" title="' . $title . '" onclick="' . htmlspecialchars($editOnClick) . '">' . GeneralUtility::fixed_lgd_cs($code, $this->fixedL) . '</a>';
}
} catch (\Exception $e) {
// intentional fall-through
}
return $code;
}
示例6: linkWrapFile
/**
* Wraps filenames in links which opens the metadata editor.
*
* @param string $code String to be wrapped in links
* @param File $fileObject File to be linked
* @return string HTML
*/
public function linkWrapFile($code, File $fileObject)
{
try {
if ($fileObject instanceof File && $fileObject->isIndexed() && $fileObject->checkActionPermission('write') && $this->getBackendUser()->check('tables_modify', 'sys_file_metadata')) {
$metaData = $fileObject->_getMetaData();
$urlParameters = ['edit' => ['sys_file_metadata' => [$metaData['uid'] => 'edit']], 'returnUrl' => $this->listURL()];
$url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
$title = htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.editMetadata'));
$code = '<a href="' . htmlspecialchars($url) . '" title="' . $title . '">' . GeneralUtility::fixed_lgd_cs($code, $this->fixedL) . '</a>';
}
} catch (\Exception $e) {
// intentional fall-through
}
return $code;
}