本文整理汇总了PHP中TYPO3\CMS\Backend\Utility\BackendUtility::getProcessedValue方法的典型用法代码示例。如果您正苦于以下问题:PHP BackendUtility::getProcessedValue方法的具体用法?PHP BackendUtility::getProcessedValue怎么用?PHP BackendUtility::getProcessedValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Backend\Utility\BackendUtility
的用法示例。
在下文中一共展示了BackendUtility::getProcessedValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderFileInformationContent
/**
* Renders a HTML Block with file information
*
* @param File $file
* @return string
*/
protected function renderFileInformationContent(File $file = null)
{
/** @var LanguageService $lang */
$lang = $GLOBALS['LANG'];
if ($file !== null) {
$processedFile = $file->process(ProcessedFile::CONTEXT_IMAGEPREVIEW, array('width' => 150, 'height' => 150));
$previewImage = $processedFile->getPublicUrl(true);
$content = '';
if ($file->isMissing()) {
$flashMessage = \TYPO3\CMS\Core\Resource\Utility\BackendUtility::getFlashMessageForMissingFile($file);
$content .= $flashMessage->render();
}
if ($previewImage) {
$content .= '<img src="' . htmlspecialchars($previewImage) . '" ' . 'width="' . $processedFile->getProperty('width') . '" ' . 'height="' . $processedFile->getProperty('height') . '" ' . 'alt="" class="t3-tceforms-sysfile-imagepreview" />';
}
$content .= '<strong>' . htmlspecialchars($file->getName()) . '</strong>';
$content .= ' (' . htmlspecialchars(GeneralUtility::formatSize($file->getSize())) . 'bytes)<br />';
$content .= BackendUtility::getProcessedValue('sys_file', 'type', $file->getType()) . ' (' . $file->getMimeType() . ')<br />';
$content .= $lang->sL('LLL:EXT:lang/locallang_misc.xlf:fileMetaDataLocation', true) . ': ';
$content .= htmlspecialchars($file->getStorage()->getName()) . ' - ' . htmlspecialchars($file->getIdentifier()) . '<br />';
$content .= '<br />';
} else {
$content = '<h2>' . $lang->sL('LLL:EXT:lang/locallang_misc.xlf:fileMetaErrorInvalidRecord', true) . '</h2>';
}
return $content;
}
示例2: getResultRow
/**
* Process every columns of a row to convert value
*
* @param array $row
* @param string $table
* @return array
*/
public static function getResultRow($row, $table, $excludeFields = '', $export = false)
{
$record = array();
foreach ($row as $fieldName => $fieldValue) {
if (!\TYPO3\CMS\Core\Utility\GeneralUtility::inList($excludeFields, $fieldName)) {
$record[$fieldName] = \TYPO3\CMS\Backend\Utility\BackendUtility::getProcessedValueExtra($table, $fieldName, $fieldValue, 0, $row['uid']);
if (trim($record[$fieldName]) == 'N/A') {
$record[$fieldName] = '';
}
} else {
if (!\TYPO3\CMS\Core\Utility\GeneralUtility::inList('input', $GLOBALS['TCA'][$table]['columns'][$fieldName]['config']['type'])) {
$record[$fieldName] = \TYPO3\CMS\Backend\Utility\BackendUtility::getProcessedValue($table, $fieldName, $fieldValue, 0, 1, 1, $row['uid'], true);
} else {
$record[$fieldName] = $fieldValue;
}
if ($GLOBALS['TCA'][$table]['columns'][$fieldName]['config']['type'] == 'input') {
if ($GLOBALS['TCA'][$table]['columns'][$fieldName]['config']['eval'] == 'datetime' || $GLOBALS['TCA'][$table]['columns'][$fieldName]['config']['eval'] == 'date') {
$record[$fieldName] = $fieldValue;
}
}
if (empty($record[$fieldName])) {
$record[$fieldName] = $fieldValue;
}
if (trim($record[$fieldName]) == 'N/A') {
$record[$fieldName] = '';
}
}
if ($export === true) {
// add path to files
if ($GLOBALS['TCA'][$table]['columns'][$fieldName]['config']['type'] == 'group' && $GLOBALS['TCA'][$table]['columns'][$fieldName]['config']['internal_type'] == 'file') {
if (!empty($record[$fieldName])) {
$files = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $record[$fieldName]);
$newFiles = array();
foreach ($files as $file) {
$newFiles[] = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_HOST') . '/' . $GLOBALS['TCA'][$table]['columns'][$fieldName]['config']['uploadfolder'] . '/' . $file;
}
$record[$fieldName] = implode(', ', $newFiles);
}
}
if ($GLOBALS['TCA'][$table]['columns'][$fieldName]['config']['type'] == 'text' && !empty($GLOBALS['TCA'][$table]['columns'][$fieldName]['config']['wizards']['RTE'])) {
$lCobj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
$lCobj->start(array(), '');
$record[$fieldName] = $lCobj->parseFunc($record[$fieldName], array(), '< lib.parseFunc_RTE');
}
}
}
return $record;
}
示例3: renderFileInfo
/**
* User function for sys_file (element)
*
* @param array $PA the array with additional configuration options.
* @param \TYPO3\CMS\Backend\Form\FormEngine $tceformsObj the TCEforms parent object
* @return string The HTML code for the TCEform field
*/
public function renderFileInfo(array $PA, \TYPO3\CMS\Backend\Form\FormEngine $tceformsObj)
{
$fileRecord = $PA['row'];
if ($fileRecord['uid'] > 0) {
$fileObject = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->getFileObject($fileRecord['uid']);
$processedFile = $fileObject->process(\TYPO3\CMS\Core\Resource\ProcessedFile::CONTEXT_IMAGEPREVIEW, array('width' => 150, 'height' => 150));
$previewImage = $processedFile->getPublicUrl(TRUE);
$content = '';
if ($previewImage) {
$content .= '<img src="' . htmlspecialchars($previewImage) . '" alt="" class="t3-tceforms-sysfile-imagepreview" />';
}
$content .= '<strong>' . htmlspecialchars($fileObject->getName()) . '</strong> (' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::formatSize($fileObject->getSize())) . ')<br />';
$content .= \TYPO3\CMS\Backend\Utility\BackendUtility::getProcessedValue($PA['table'], 'type', $fileObject->getType()) . ' (' . $fileObject->getMimeType() . ')<br />';
$content .= $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_misc.xlf:fileMetaDataLocation', TRUE) . ': ' . htmlspecialchars($fileObject->getStorage()->getName()) . ' - ' . htmlspecialchars($fileObject->getIdentifier()) . '<br />';
$content .= '<br />';
} else {
$content = '<h2>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_misc.xlf:fileMetaErrorInvalidRecord', TRUE) . '</h2>';
}
return $content;
}
示例4: orderArticles
//.........这里部分代码省略.........
$row['price_net'] = $row['price_net'] * $row['amount'];
$row['price_gross'] = $row['price_net'] * (1 + (double) $row['tax'] / 100);
} else {
$row['price_gross'] = $row['price_gross'] * $row['amount'];
$row['price_net'] = $row['price_gross'] / (1 + (double) $row['tax'] / 100);
}
$sum['price_net_value'] += $row['price_net'];
$sum['price_gross_value'] += $row['price_gross'];
$row['price_net'] = Money::format(strval($row['price_net']), $currency);
$row['price_gross'] = Money::format(strval($row['price_gross']), $currency);
$rowBgColor = $cc % 2 ? '' : ' bgcolor="' . GeneralUtility::modifyHTMLColor($this->getControllerDocumentTemplate()->bgColor4, +10, +10, +10) . '"';
/*
* Not very nice to render html_code directly
* @todo change rendering html code here
*/
$iOut .= '<tr ' . $rowBgColor . '>';
foreach ($fieldRows as $field) {
$wrap = array('', '');
switch ($field) {
case $titleCol:
$iOut .= '<td>';
if ($orderEditable) {
$params = '&edit[' . $orderArticleTable . '][' . $row['uid'] . ']=edit';
$wrap = array('<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params, $this->getBackPath())) . '">', '</a>');
}
break;
case 'amount':
$iOut .= '<td>';
if ($orderEditable) {
$params = '&edit[' . $orderArticleTable . '][' . $row['uid'] . ']=edit&columnsOnly=amount';
$onclickAction = 'onclick="' . htmlspecialchars(BackendUtility::editOnClick($params, $this->getBackPath())) . '"';
$wrap = array('<b><a href="#" ' . $onclickAction . '>' . IconUtility::getSpriteIcon('actions-document-open'), '</a></b>');
}
break;
case 'price_net':
// fall through
// fall through
case 'price_gross':
$iOut .= '<td style="text-align: right">';
break;
default:
$iOut .= '<td>';
}
$iOut .= implode(BackendUtility::getProcessedValue($orderArticleTable, $field, $row[$field], 100), $wrap);
$iOut .= '</td>';
}
/*
* Trash icon
*/
$iOut .= '<td></td>
</tr>';
}
$out .= $iOut;
/*
* Cerate the summ row
*/
$out .= '<tr>';
$sum['price_net'] = Money::format(strval($sum['price_net_value']), $currency);
$sum['price_gross'] = Money::format(strval($sum['price_gross_value']), $currency);
foreach ($fieldRows as $field) {
switch ($field) {
case 'price_net':
// fall through
// fall through
case 'price_gross':
$out .= '<td class="c-headLineTable" style="text-align: right"><b>';
break;
default:
$out .= '<td class="c-headLineTable"><b>';
}
if (!empty($sum[$field])) {
$out .= BackendUtility::getProcessedValueExtra($orderArticleTable, $field, $sum[$field], 100);
}
$out .= '</b></td>';
}
$out .= '<td class="c-headLineTable"></td></tr>';
/*
* Always
* Update sum_price_net and sum_price_gross
* To Be shure everything is ok
*/
$values = array('sum_price_gross' => $sum['price_gross_value'], 'sum_price_net' => $sum['price_net_value']);
/**
* Order repository.
*
* @var OrderRepository
*/
$orderRepository = GeneralUtility::makeInstance('CommerceTeam\\Commerce\\Domain\\Repository\\OrderRepository');
$orderRepository->updateByOrderId($orderId, $values);
}
$out = '
<!--
DB listing of elements: "' . htmlspecialchars($orderTable) . '"
-->
<table border="0" cellpadding="0" cellspacing="0" class="typo3-dblist">
' . $out . '
</table>';
$content .= $out;
return $content;
}
示例5: getProcessedValue
/**
* Creates processed values for all field names in $fieldList based on values from $row array.
* The result is 'returned' through $info which is passed as a reference
*
* @param string $table Table name
* @param string $fieldList Comma separated list of fields.
* @param array $row Record from which to take values for processing.
* @param array $info Array to which the processed values are added.
* @return void
*/
public function getProcessedValue($table, $fieldList, array $row, array &$info)
{
// Splitting values from $fieldList
$fieldArr = explode(',', $fieldList);
// Traverse fields from $fieldList
foreach ($fieldArr as $field) {
if ($row[$field]) {
$info[] = '<strong>' . htmlspecialchars($this->itemLabels[$field]) . '</strong> ' . htmlspecialchars(BackendUtility::getProcessedValue($table, $field, $row[$field]));
}
}
}
示例6: versioningMgm
/**
* Management of versions for record
*
* @return void
*/
public function versioningMgm()
{
// Diffing:
$diff_1 = GeneralUtility::_POST('diff_1');
$diff_2 = GeneralUtility::_POST('diff_2');
if (GeneralUtility::_POST('do_diff')) {
$content = '';
$content .= '<div class="panel panel-space panel-default">';
$content .= '<div class="panel-heading">' . $GLOBALS['LANG']->getLL('diffing') . '</div>';
if ($diff_1 && $diff_2) {
$diff_1_record = BackendUtility::getRecord($this->table, $diff_1);
$diff_2_record = BackendUtility::getRecord($this->table, $diff_2);
if (is_array($diff_1_record) && is_array($diff_2_record)) {
$diffUtility = GeneralUtility::makeInstance(DiffUtility::class);
$rows = array();
$rows[] = '
<tr>
<th>' . $GLOBALS['LANG']->getLL('fieldname') . '</th>
<th width="98%">' . $GLOBALS['LANG']->getLL('coloredDiffView') . ':</th>
</tr>
';
foreach ($diff_1_record as $fN => $fV) {
if ($GLOBALS['TCA'][$this->table]['columns'][$fN] && $GLOBALS['TCA'][$this->table]['columns'][$fN]['config']['type'] !== 'passthrough' && $fN !== 't3ver_label') {
if ((string) $diff_1_record[$fN] !== (string) $diff_2_record[$fN]) {
$diffres = $diffUtility->makeDiffDisplay(BackendUtility::getProcessedValue($this->table, $fN, $diff_2_record[$fN], 0, 1), BackendUtility::getProcessedValue($this->table, $fN, $diff_1_record[$fN], 0, 1));
$rows[] = '
<tr>
<td>' . $fN . '</td>
<td width="98%">' . $diffres . '</td>
</tr>
';
}
}
}
if (count($rows) > 1) {
$content .= '<div class="table-fit"><table class="table">' . implode('', $rows) . '</table></div>';
} else {
$content .= '<div class="panel-body">' . $GLOBALS['LANG']->getLL('recordsMatchesCompletely') . '</div>';
}
} else {
$content .= '<div class="panel-body">' . $GLOBALS['LANG']->getLL('errorRecordsNotFound') . '</div>';
}
} else {
$content .= '<div class="panel-body">' . $GLOBALS['LANG']->getLL('errorDiffSources') . '</div>';
}
$content .= '</div>';
}
// Element:
$record = BackendUtility::getRecord($this->table, $this->uid);
$recTitle = BackendUtility::getRecordTitle($this->table, $record, true);
// Display versions:
$content .= '
<form name="theform" action="' . str_replace('&sendToReview=1', '', $this->REQUEST_URI) . '" method="post">
<div class="panel panel-space panel-default">
<div class="panel-heading">' . $recTitle . '</div>
<div class="table-fit">
<table class="table">
<thead>
<tr>
<th colspan="2" class="col-icon"></th>
<th title="' . $GLOBALS['LANG']->getLL('tblHeaderDesc_title') . '">' . $GLOBALS['LANG']->getLL('tblHeader_title') . '</th>
<th title="' . $GLOBALS['LANG']->getLL('tblHeaderDesc_uid') . '"><i>' . $GLOBALS['LANG']->getLL('tblHeader_uid') . '</i></th>
<th title="' . $GLOBALS['LANG']->getLL('tblHeaderDesc_t3ver_oid') . '"><i>' . $GLOBALS['LANG']->getLL('tblHeader_t3ver_oid') . '</i></th>
<th title="' . $GLOBALS['LANG']->getLL('tblHeaderDesc_t3ver_id') . '"><i>' . $GLOBALS['LANG']->getLL('tblHeader_t3ver_id') . '</i></th>
<th title="' . $GLOBALS['LANG']->getLL('tblHeaderDesc_t3ver_wsid') . '"><i>' . $GLOBALS['LANG']->getLL('tblHeader_t3ver_wsid') . '</i></th>
<th title="' . $GLOBALS['LANG']->getLL('tblHeaderDesc_t3ver_state', true) . '"><i>' . $GLOBALS['LANG']->getLL('tblHeader_t3ver_state') . '</i></th>
<th title="' . $GLOBALS['LANG']->getLL('tblHeaderDesc_t3ver_stage') . '"><i>' . $GLOBALS['LANG']->getLL('tblHeader_t3ver_stage') . '</i></th>
<th title="' . $GLOBALS['LANG']->getLL('tblHeaderDesc_t3ver_count') . '"><i>' . $GLOBALS['LANG']->getLL('tblHeader_t3ver_count') . '</i></th>
<th title="' . $GLOBALS['LANG']->getLL('tblHeaderDesc_pid') . '"><i>' . $GLOBALS['LANG']->getLL('tblHeader_pid') . '</i></th>
<th title="' . $GLOBALS['LANG']->getLL('tblHeaderDesc_t3ver_label') . '"><i>' . $GLOBALS['LANG']->getLL('tblHeader_t3ver_label') . '</i></th>
<th></th>
<th colspan="2">
<button class="btn btn-default btn-sm" type="submit" name="do_diff" value="true">
' . $GLOBALS['LANG']->getLL('diff') . '
</button>
</th>
</tr>
</thead>
<tbody>
';
$versions = BackendUtility::selectVersionsOfRecord($this->table, $this->uid, '*', $GLOBALS['BE_USER']->workspace);
foreach ($versions as $row) {
$adminLinks = $this->adminLinks($this->table, $row);
$editUrl = BackendUtility::getModuleUrl('record_edit', ['edit' => [$this->table => [$row['uid'] => 'edit']], 'columnsOnly' => 't3ver_label', 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')]);
$content .= '
<tr' . ($row['uid'] != $this->uid ? '' : ' class="active"') . '>
<td class="col-icon">' . ($row['uid'] != $this->uid ? '<a href="' . BackendUtility::getLinkToDataHandlerAction('&cmd[' . $this->table . '][' . $this->uid . '][version][swapWith]=' . $row['uid'] . '&cmd[' . $this->table . '][' . $this->uid . '][version][action]=swap') . '" title="' . $GLOBALS['LANG']->getLL('swapWithCurrent', true) . '">' . $this->moduleTemplate->getIconFactory()->getIcon('actions-version-swap-version', Icon::SIZE_SMALL)->render() . '</a>' : '<span title="' . $GLOBALS['LANG']->getLL('currentOnlineVersion', true) . '">' . $this->moduleTemplate->getIconFactory()->getIcon('status-status-current', Icon::SIZE_SMALL)->render() . '</span>') . '
</td>
<td class="col-icon">' . $this->moduleTemplate->getIconFactory()->getIconForRecord($this->table, $row, Icon::SIZE_SMALL)->render() . '</td>
<td>' . htmlspecialchars(BackendUtility::getRecordTitle($this->table, $row, true)) . '</td>
<td>' . $row['uid'] . '</td>
<td>' . $row['t3ver_oid'] . '</td>
<td>' . $row['t3ver_id'] . '</td>
<td>' . $row['t3ver_wsid'] . '</td>
<td>' . $row['t3ver_state'] . '</td>
//.........这里部分代码省略.........
示例7: renderDiff
/**
* Renders HTML table-rows with the comparison information of an sys_history entry record
*
* @param array $entry sys_history entry record.
* @param string $table The table name
* @param integer $rollbackUid If set to UID of record, display rollback links
* @return string HTML table
* @access private
* @todo Define visibility
*/
public function renderDiff($entry, $table, $rollbackUid = 0)
{
$lines = array();
if (is_array($entry['newRecord'])) {
$t3lib_diff_Obj = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Utility\\DiffUtility');
$fieldsToDisplay = array_keys($entry['newRecord']);
foreach ($fieldsToDisplay as $fN) {
if (is_array($GLOBALS['TCA'][$table]['columns'][$fN]) && $GLOBALS['TCA'][$table]['columns'][$fN]['config']['type'] != 'passthrough') {
// Create diff-result:
$diffres = $t3lib_diff_Obj->makeDiffDisplay(BackendUtility::getProcessedValue($table, $fN, $entry['oldRecord'][$fN], 0, 1), BackendUtility::getProcessedValue($table, $fN, $entry['newRecord'][$fN], 0, 1));
$lines[] = '
<tr class="bgColor4">
' . ($rollbackUid ? '<td style="width:33px">' . $this->createRollbackLink($table . ':' . $rollbackUid . ':' . $fN, $GLOBALS['LANG']->getLL('revertField', 1), 2) . '</td>' : '') . '
<td style="width:90px"><em>' . $GLOBALS['LANG']->sl(BackendUtility::getItemLabel($table, $fN), 1) . '</em></td>
<td style="width:300px">' . nl2br($diffres) . '</td>
</tr>';
}
}
}
if ($lines) {
$content = '<table border="0" cellpadding="2" cellspacing="2" id="typo3-history-item">
' . implode('', $lines) . '
</table>';
return $content;
}
// error fallback
return NULL;
}
示例8: getRowDetails
/**
* Fetch futher information to current selected worspace record.
*
* @param object $parameter
* @return array $data
*/
public function getRowDetails($parameter)
{
$diffReturnArray = array();
$liveReturnArray = array();
/** @var $t3lib_diff \TYPO3\CMS\Core\Utility\DiffUtility */
$t3lib_diff = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Utility\\DiffUtility');
/** @var $parseObj \TYPO3\CMS\Core\Html\RteHtmlParser */
$parseObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Html\\RteHtmlParser');
$liveRecord = BackendUtility::getRecord($parameter->table, $parameter->t3ver_oid);
$versionRecord = BackendUtility::getRecord($parameter->table, $parameter->uid);
$icon_Live = \TYPO3\CMS\Backend\Utility\IconUtility::mapRecordTypeToSpriteIconClass($parameter->table, $liveRecord);
$icon_Workspace = \TYPO3\CMS\Backend\Utility\IconUtility::mapRecordTypeToSpriteIconClass($parameter->table, $versionRecord);
$stagePosition = $this->getStagesService()->getPositionOfCurrentStage($parameter->stage);
$fieldsOfRecords = array_keys($liveRecord);
if ($GLOBALS['TCA'][$parameter->table]) {
if ($GLOBALS['TCA'][$parameter->table]['interface']['showRecordFieldList']) {
$fieldsOfRecords = $GLOBALS['TCA'][$parameter->table]['interface']['showRecordFieldList'];
$fieldsOfRecords = GeneralUtility::trimExplode(',', $fieldsOfRecords, TRUE);
}
}
foreach ($fieldsOfRecords as $fieldName) {
// check for exclude fields
if ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['TCA'][$parameter->table]['columns'][$fieldName]['exclude'] == 0 || GeneralUtility::inList($GLOBALS['BE_USER']->groupData['non_exclude_fields'], $parameter->table . ':' . $fieldName)) {
// call diff class only if there is a difference
if ((string) $liveRecord[$fieldName] !== (string) $versionRecord[$fieldName]) {
// Select the human readable values before diff
$liveRecord[$fieldName] = BackendUtility::getProcessedValue($parameter->table, $fieldName, $liveRecord[$fieldName], 0, 1, FALSE, $liveRecord['uid']);
$versionRecord[$fieldName] = BackendUtility::getProcessedValue($parameter->table, $fieldName, $versionRecord[$fieldName], 0, 1, FALSE, $versionRecord['uid']);
// Get the field's label. If not available, use the field name
$fieldTitle = $GLOBALS['LANG']->sL(BackendUtility::getItemLabel($parameter->table, $fieldName));
if (empty($fieldTitle)) {
$fieldTitle = $fieldName;
}
if ($GLOBALS['TCA'][$parameter->table]['columns'][$fieldName]['config']['type'] == 'group' && $GLOBALS['TCA'][$parameter->table]['columns'][$fieldName]['config']['internal_type'] == 'file') {
$versionThumb = BackendUtility::thumbCode($versionRecord, $parameter->table, $fieldName, '');
$liveThumb = BackendUtility::thumbCode($liveRecord, $parameter->table, $fieldName, '');
$diffReturnArray[] = array('field' => $fieldName, 'label' => $fieldTitle, 'content' => $versionThumb);
$liveReturnArray[] = array('field' => $fieldName, 'label' => $fieldTitle, 'content' => $liveThumb);
} else {
$diffReturnArray[] = array('field' => $fieldName, 'label' => $fieldTitle, 'content' => $t3lib_diff->makeDiffDisplay($liveRecord[$fieldName], $versionRecord[$fieldName]));
$liveReturnArray[] = array('field' => $fieldName, 'label' => $fieldTitle, 'content' => $parseObj->TS_images_rte($liveRecord[$fieldName]));
}
}
}
}
// Hook for modifying the difference and live arrays
// (this may be used by custom or dynamically-defined fields)
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['workspaces']['modifyDifferenceArray'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['workspaces']['modifyDifferenceArray'] as $className) {
$hookObject =& GeneralUtility::getUserObj($className);
$hookObject->modifyDifferenceArray($parameter, $diffReturnArray, $liveReturnArray, $t3lib_diff);
}
}
$commentsForRecord = $this->getCommentsForRecord($parameter->uid, $parameter->table);
return array('total' => 1, 'data' => array(array('diff' => $diffReturnArray, 'live_record' => $liveReturnArray, 'path_Live' => $parameter->path_Live, 'label_Stage' => $parameter->label_Stage, 'stage_position' => $stagePosition['position'], 'stage_count' => $stagePosition['count'], 'comments' => $commentsForRecord, 'icon_Live' => $icon_Live, 'icon_Workspace' => $icon_Workspace)));
}
示例9: renderDiff
/**
* Renders HTML table-rows with the comparison information of an sys_history entry record
*
* @param array $entry sys_history entry record.
* @param string $table The table name
* @param int $rollbackUid If set to UID of record, display rollback links
* @return string|NULL HTML table
* @access private
*/
public function renderDiff($entry, $table, $rollbackUid = 0)
{
$lines = array();
if (is_array($entry['newRecord'])) {
/* @var DiffUtility $diffUtility */
$diffUtility = GeneralUtility::makeInstance(DiffUtility::class);
$fieldsToDisplay = array_keys($entry['newRecord']);
$languageService = $this->getLanguageService();
foreach ($fieldsToDisplay as $fN) {
if (is_array($GLOBALS['TCA'][$table]['columns'][$fN]) && $GLOBALS['TCA'][$table]['columns'][$fN]['config']['type'] !== 'passthrough') {
// Create diff-result:
$diffres = $diffUtility->makeDiffDisplay(BackendUtility::getProcessedValue($table, $fN, $entry['oldRecord'][$fN], 0, true), BackendUtility::getProcessedValue($table, $fN, $entry['newRecord'][$fN], 0, true));
$lines[] = array('title' => ($rollbackUid ? $this->createRollbackLink($table . ':' . $rollbackUid . ':' . $fN, $languageService->getLL('revertField', true), 2) : '') . '
' . $languageService->sL(BackendUtility::getItemLabel($table, $fN), true), 'result' => str_replace('\\n', PHP_EOL, str_replace('\\r\\n', '\\n', $diffres)));
}
}
}
if ($lines) {
return $lines;
}
// error fallback
return null;
}
示例10: renderRecordDetailsTable
/**
* shows the infos of a directmail
* record in a table
*
* @param array $row: DirectMail DB record
* @return string the HTML output
*/
protected function renderRecordDetailsTable($row)
{
if (!$row['issent']) {
if ($GLOBALS['BE_USER']->check('tables_modify', 'sys_dmail')) {
$retUrl = 'returnUrl=' . rawurlencode(GeneralUtility::linkThisScript(array('sys_dmail_uid' => $row['uid'], 'createMailFrom_UID' => '', 'createMailFrom_URL' => '')));
$Eparams = '&edit[sys_dmail][' . $row['uid'] . ']=edit';
$editOnClick = 'document.location=\'' . $GLOBALS['BACK_PATH'] . 'alt_doc.php?' . $retUrl . $Eparams . '\'; return false;';
$content = '<a href="#" onClick="' . $editOnClick . '"><img' . IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit2.gif', 'width="12" height="12"') . ' alt="' . $GLOBALS['LANG']->getLL("dmail_edit") . '" width="12" height="12" style="margin: 2px 3px; vertical-align:top;" title="' . $GLOBALS['LANG']->getLL("dmail_edit") . '" />' . '<b>' . $GLOBALS['LANG']->getLL('dmail_edit') . '</b>' . '</a>';
} else {
$content = '<img' . IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit2.gif', 'width="12" height="12"') . ' alt="' . $GLOBALS['LANG']->getLL("dmail_edit") . '" width="12" height="12" style="margin: 2px 3px; vertical-align:top;" title="' . $GLOBALS['LANG']->getLL("dmail_edit") . '" />' . '(' . $GLOBALS['LANG']->getLL('dmail_noEdit_noPerms') . ')';
}
} else {
$content = '<img' . IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit2.gif', 'width="12" height="12"') . ' alt="' . $GLOBALS['LANG']->getLL("dmail_edit") . '" width="12" height="12" style="margin: 2px 3px; vertical-align:top;" title="' . $GLOBALS['LANG']->getLL("dmail_edit") . '" />' . '(' . $GLOBALS['LANG']->getLL('dmail_noEdit_isSent') . ')';
}
$content = '<tr>
<td class="t3-row-header">' . DirectMailUtility::fName('subject') . ' <b>' . GeneralUtility::fixed_lgd_cs(htmlspecialchars($row['subject']), 60) . '</b></td>
<td class="t3-row-header" style="text-align: right;">' . $content . '</td>
</tr>';
$nameArr = explode(',', 'from_name,from_email,replyto_name,replyto_email,organisation,return_path,priority,attachment,type,page,sendOptions,includeMedia,flowedFormat,plainParams,HTMLParams,encoding,charset,issent,renderedsize');
foreach ($nameArr as $name) {
$content .= '
<tr>
<td>' . DirectMailUtility::fName($name) . '</td>
<td>' . htmlspecialchars(BackendUtility::getProcessedValue('sys_dmail', $name, $row[$name])) . '</td>
</tr>';
}
$content = '<table border="0" cellpadding="1" cellspacing="1" width="460" class="typo3-dblist">' . $content . '</table>';
$sectionTitle = IconUtility::getSpriteIconForRecord('sys_dmail', $row) . ' ' . htmlspecialchars($row['subject']);
return $this->doc->section($sectionTitle, $content, 1, 1, 0, TRUE);
}
示例11: showExistingRecipientLists
/**
* Shows the existing recipient lists and shows link to create a new one or import a list
*
* @return string List of existing recipient list, link to create a new list and link to import
*/
public function showExistingRecipientLists()
{
$out = '<thead>
<th colspan="2"> </th>
<th>' . $this->getLanguageService()->sL(BackendUtility::getItemLabel('sys_dmail_group', 'title')) . '</th>
<th>' . $this->getLanguageService()->sL(BackendUtility::getItemLabel('sys_dmail_group', 'type')) . '</th>
<th>' . $this->getLanguageService()->sL(BackendUtility::getItemLabel('sys_dmail_group', 'description')) . '</th>
<th>' . $this->getLanguageService()->getLL('recip_group_amount') . '</th>
</thead>';
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,pid,title,description,type', 'sys_dmail_group', 'pid = ' . intval($this->id) . BackendUtility::deleteClause('sys_dmail_group'), '', $GLOBALS['TYPO3_DB']->stripOrderBy($GLOBALS['TCA']['sys_dmail_group']['ctrl']['default_sortby']));
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$result = $this->cmd_compileMailGroup(intval($row['uid']));
$count = 0;
$idLists = $result['queryInfo']['id_lists'];
if (is_array($idLists['tt_address'])) {
$count += count($idLists['tt_address']);
}
if (is_array($idLists['fe_users'])) {
$count += count($idLists['fe_users']);
}
if (is_array($idLists['PLAINLIST'])) {
$count += count($idLists['PLAINLIST']);
}
if (is_array($idLists[$this->userTable])) {
$count += count($idLists[$this->userTable]);
}
$out .= '<tr class="db_list_normal">
<td nowrap="nowrap">' . $this->iconFactory->getIconForRecord('sys_dmail_group', $row, Icon::SIZE_SMALL)->render() . '</td>
<td>' . $this->editLink('sys_dmail_group', $row['uid']) . '</td>
<td nowrap="nowrap">' . $this->linkRecip_record('<strong>' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($row['title'], 30)) . '</strong> ', $row['uid']) . '</td>
<td nowrap="nowrap">' . htmlspecialchars(BackendUtility::getProcessedValue('sys_dmail_group', 'type', $row['type'])) . ' </td>
<td>' . BackendUtility::getProcessedValue('sys_dmail_group', 'description', htmlspecialchars($row['description'])) . ' </td>
<td>' . $count . '</td>
</tr>';
}
$out = ' <table class="table table-striped table-hover">' . $out . '</table>';
$theOutput = $this->doc->section(BackendUtility::cshItem($this->cshTable, 'select_mailgroup', $GLOBALS['BACK_PATH']) . $this->getLanguageService()->getLL('recip_select_mailgroup'), $out, 1, 1, 0, true);
// New:
$out = '<a href="#" class="t3-link" onClick="' . BackendUtility::editOnClick('&edit[sys_dmail_group][' . $this->id . ']=new', $GLOBALS['BACK_PATH'], '') . '">' . $this->iconFactory->getIconForRecord('sys_dmail_group', array(), Icon::SIZE_SMALL) . $this->getLanguageService()->getLL('recip_create_mailgroup_msg') . '</a>';
$theOutput .= '<div style="padding-top: 20px;"></div>';
$theOutput .= $this->doc->section(BackendUtility::cshItem($this->cshTable, 'create_mailgroup', $GLOBALS['BACK_PATH']) . $this->getLanguageService()->getLL('recip_create_mailgroup'), $out, 1, 0, false, true, false, true);
// Import
$out = '<a class="t3-link" href="' . BackendUtility::getModuleUrl('DirectMailNavFrame_RecipientList') . '&id=' . $this->id . '&CMD=displayImport">' . $this->getLanguageService()->getLL('recip_import_mailgroup_msg') . '</a>';
$theOutput .= '<div style="padding-top: 20px;"></div>';
$theOutput .= $this->doc->section($this->getLanguageService()->getLL('mailgroup_import'), $out, 1, 1, 0, true);
return $theOutput;
}
示例12: htmlspecialchars
/**
* show the compact information of a direct mail record
*
* @param array $row: direct mail record
* @return string the compact infos of the direct mail record
*/
function directMail_compactView($row)
{
// Render record:
if ($row['type']) {
$dmailData = $row['plainParams'] . ', ' . $row['HTMLParams'];
} else {
$page = BackendUtility::getRecord('pages', $row['page'], 'title');
$dmailData = $row['page'] . ', ' . htmlspecialchars($page['title']);
$dmail_info = DirectMailUtility::fName('plainParams') . ' ' . htmlspecialchars($row['plainParams'] . LF . DirectMailUtility::fName('HTMLParams') . $row['HTMLParams']) . '; ' . LF;
}
$dmail_info .= $GLOBALS["LANG"]->getLL('view_media') . ' ' . BackendUtility::getProcessedValue('sys_dmail', 'includeMedia', $row['includeMedia']) . '; ' . LF . $GLOBALS["LANG"]->getLL('view_flowed') . ' ' . BackendUtility::getProcessedValue('sys_dmail', 'flowedFormat', $row['flowedFormat']);
$dmail_info = '<img' . IconUtility::skinImg($GLOBALS["BACK_PATH"], 'gfx/zoom2.gif', 'width="12" height="12"') . ' title="' . $dmail_info . '">';
$from_info = $GLOBALS["LANG"]->getLL('view_replyto') . ' ' . htmlspecialchars($row['replyto_name'] . ' <' . $row['replyto_email'] . '>') . '; ' . LF . DirectMailUtility::fName('organisation') . ' ' . htmlspecialchars($row['organisation']) . '; ' . LF . DirectMailUtility::fName('return_path') . ' ' . htmlspecialchars($row['return_path']);
$from_info = '<img' . IconUtility::skinImg($GLOBALS["BACK_PATH"], 'gfx/zoom2.gif', 'width="12" height="12"') . ' title="' . $from_info . '">';
$mail_info = DirectMailUtility::fName('priority') . ' ' . BackendUtility::getProcessedValue('sys_dmail', 'priority', $row['priority']) . '; ' . LF . DirectMailUtility::fName('encoding') . ' ' . BackendUtility::getProcessedValue('sys_dmail', 'encoding', $row['encoding']) . '; ' . LF . DirectMailUtility::fName('charset') . ' ' . BackendUtility::getProcessedValue('sys_dmail', 'charset', $row['charset']);
$mail_info = '<img' . IconUtility::skinImg($GLOBALS["BACK_PATH"], 'gfx/zoom2.gif', 'width="12" height="12"') . ' title="' . $mail_info . '">';
$delBegin = $row["scheduled_begin"] ? BackendUtility::datetime($row["scheduled_begin"]) : '-';
$delEnd = $row["scheduled_end"] ? BackendUtility::datetime($row["scheduled_begin"]) : '-';
//count total recipient from the query_info
$totalRecip = 0;
$id_lists = unserialize($row['query_info']);
foreach ($id_lists['id_lists'] as $idArray) {
$totalRecip += count($idArray);
}
$sentRecip = $GLOBALS['TYPO3_DB']->sql_num_rows($GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_dmail_maillog', 'mid=' . $row['uid'] . ' AND response_type = 0', '', 'rid ASC'));
$out = '<table cellpadding="3" cellspacing="0" class="stats-table">';
$out .= '<tr class="bgColor2"><td colspan="3">' . IconUtility::getSpriteIconForRecord('sys_dmail', $row) . htmlspecialchars($row['subject']) . '</td></tr>';
$out .= '<tr class="bgColor4"><td>' . $GLOBALS["LANG"]->getLL('view_from') . '</td><td>' . htmlspecialchars($row['from_name'] . ' <' . htmlspecialchars($row['from_email']) . '>') . '</td><td>' . $from_info . '</td></tr>';
$out .= '<tr class="bgColor4"><td>' . $GLOBALS["LANG"]->getLL('view_dmail') . '</td><td>' . BackendUtility::getProcessedValue('sys_dmail', 'type', $row['type']) . ': ' . $dmailData . '</td><td>' . $dmail_info . '</td></tr>';
$out .= '<tr class="bgColor4"><td>' . $GLOBALS["LANG"]->getLL('view_mail') . '</td><td>' . BackendUtility::getProcessedValue('sys_dmail', 'sendOptions', $row['sendOptions']) . ($row['attachment'] ? '; ' : '') . BackendUtility::getProcessedValue('sys_dmail', 'attachment', $row['attachment']) . '</td><td>' . $mail_info . '</td></tr>';
$out .= '<tr class="bgColor4"><td>' . $GLOBALS["LANG"]->getLL('view_delivery_begin_end') . '</td><td>' . $delBegin . ' / ' . $delEnd . '</td><td> </td></tr>';
$out .= '<tr class="bgColor4"><td>' . $GLOBALS["LANG"]->getLL('view_recipient_total_sent') . '</td><td>' . $totalRecip . ' / ' . $sentRecip . '</td><td> </td></tr>';
$out .= '</table>';
$out .= $this->doc->spacer(5);
return $out;
}
示例13: getPageInfoBox
/**
* Creates an info-box for the current page (identified by input record).
*
* @param array $rec Page record
* @param boolean $edit If set, there will be shown an edit icon, linking to editing of the page properties.
* @return string HTML for the box.
* @deprecated and unused since 6.0, will be removed two versions later
* @todo Define visibility
*/
public function getPageInfoBox($rec, $edit = 0)
{
\TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction();
// If editing of the page properties is allowed:
if ($edit) {
$params = '&edit[pages][' . $rec['uid'] . ']=edit';
$editIcon = '<a href="#" onclick="' . htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::editOnClick($params, $this->backPath)) . '" title="' . $GLOBALS['LANG']->getLL('edit', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-open') . '</a>';
} else {
$editIcon = $this->noEditIcon('noEditPage');
}
// Setting page icon, link, title:
$outPutContent = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('pages', $rec, array('title' => \TYPO3\CMS\Backend\Utility\BackendUtility::titleAttribForPages($rec))) . $editIcon . ' ' . htmlspecialchars($rec['title']);
// Init array where infomation is accumulated as label/value pairs.
$lines = array();
// Owner user/group:
if ($this->pI_showUser) {
// User:
$users = \TYPO3\CMS\Backend\Utility\BackendUtility::getUserNames('username,usergroup,usergroup_cached_list,uid,realName');
$groupArray = explode(',', $GLOBALS['BE_USER']->user['usergroup_cached_list']);
$users = \TYPO3\CMS\Backend\Utility\BackendUtility::blindUserNames($users, $groupArray);
$lines[] = array($GLOBALS['LANG']->getLL('pI_crUser') . ':', htmlspecialchars($users[$rec['cruser_id']]['username']) . ' (' . $users[$rec['cruser_id']]['realName'] . ')');
}
// Created:
$lines[] = array($GLOBALS['LANG']->getLL('pI_crDate') . ':', \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($rec['crdate']) . ' (' . \TYPO3\CMS\Backend\Utility\BackendUtility::calcAge($GLOBALS['EXEC_TIME'] - $rec['crdate'], $this->agePrefixes) . ')');
// Last change:
$lines[] = array($GLOBALS['LANG']->getLL('pI_lastChange') . ':', \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($rec['tstamp']) . ' (' . \TYPO3\CMS\Backend\Utility\BackendUtility::calcAge($GLOBALS['EXEC_TIME'] - $rec['tstamp'], $this->agePrefixes) . ')');
// Last change of content:
if ($rec['SYS_LASTCHANGED']) {
$lines[] = array($GLOBALS['LANG']->getLL('pI_lastChangeContent') . ':', \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($rec['SYS_LASTCHANGED']) . ' (' . \TYPO3\CMS\Backend\Utility\BackendUtility::calcAge($GLOBALS['EXEC_TIME'] - $rec['SYS_LASTCHANGED'], $this->agePrefixes) . ')');
}
// Spacer:
$lines[] = '';
// Display contents of certain page fields, if any value:
$dfields = explode(',', 'alias,target,hidden,starttime,endtime,fe_group,no_cache,cache_timeout,newUntil,lastUpdated,subtitle,keywords,description,abstract,author,author_email');
foreach ($dfields as $fV) {
if ($rec[$fV]) {
$lines[] = array($GLOBALS['LANG']->sL(\TYPO3\CMS\Backend\Utility\BackendUtility::getItemLabel('pages', $fV)), \TYPO3\CMS\Backend\Utility\BackendUtility::getProcessedValue('pages', $fV, $rec[$fV]));
}
}
// Finally, wrap the elements in the $lines array in table cells/rows
foreach ($lines as $fV) {
if (is_array($fV)) {
if (!$fV[2]) {
$fV[1] = htmlspecialchars($fV[1]);
}
$out .= '
<tr>
<td class="bgColor4" nowrap="nowrap"><strong>' . htmlspecialchars($fV[0]) . ' </strong></td>
<td class="bgColor4">' . $fV[1] . '</td>
</tr>';
} else {
$out .= '
<tr>
<td colspan="2"><img src="clear.gif" width="1" height="3" alt="" /></td>
</tr>';
}
}
// Wrap table tags around...
$outPutContent .= '
<!--
Page info box:
-->
<table border="0" cellpadding="0" cellspacing="1" id="typo3-page-info">
' . $out . '
</table>';
// ... and return it.
return $outPutContent;
}
示例14: 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) {
// Ignored fields
if ($name === 'size') {
continue;
}
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()) {
$references = $this->makeRef('_FILE', $this->fileObject);
if (!empty($references)) {
$header = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.referencesToThisItem');
$this->content .= $this->doc->section($header, $references);
}
}
}
示例15: renderDefaultLanguageDiff
/**
* Renders the diff-view of default language record content compared with what the record was originally translated from.
* Will render content if any is found in the internal array, $this->defaultLanguageData,
* depending on registerDefaultLanguageData() being called prior to this.
*
* @param string $table Table name of the record being edited
* @param string $field Field name represented by $item
* @param array $row Record array of the record being edited
* @param string $item HTML of the form field. This is what we add the content to.
* @return string Item string returned again, possibly with the original value added to.
* @see getSingleField(), registerDefaultLanguageData()
* @todo Define visibility
*/
public function renderDefaultLanguageDiff($table, $field, $row, $item)
{
if (is_array($this->defaultLanguageData_diff[$table . ':' . $row['uid']])) {
// Initialize:
$dLVal = array('old' => $this->defaultLanguageData_diff[$table . ':' . $row['uid']], 'new' => $this->defaultLanguageData[$table . ':' . $row['uid']]);
// There must be diff-data:
if (isset($dLVal['old'][$field])) {
if ((string) $dLVal['old'][$field] !== (string) $dLVal['new'][$field]) {
// Create diff-result:
$t3lib_diff_Obj = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Utility\\DiffUtility');
$diffres = $t3lib_diff_Obj->makeDiffDisplay(BackendUtility::getProcessedValue($table, $field, $dLVal['old'][$field], 0, 1), BackendUtility::getProcessedValue($table, $field, $dLVal['new'][$field], 0, 1));
$item .= '<div class="typo3-TCEforms-diffBox">' . '<div class="typo3-TCEforms-diffBox-header">' . htmlspecialchars($this->getLL('l_changeInOrig')) . ':</div>' . $diffres . '</div>';
}
}
}
return $item;
}