本文整理汇总了PHP中TYPO3\CMS\Backend\Utility\BackendUtility::getItemLabel方法的典型用法代码示例。如果您正苦于以下问题:PHP BackendUtility::getItemLabel方法的具体用法?PHP BackendUtility::getItemLabel怎么用?PHP BackendUtility::getItemLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Backend\Utility\BackendUtility
的用法示例。
在下文中一共展示了BackendUtility::getItemLabel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preProcess
/**
* Preprocesses the preview rendering of a content element of type "script"
*
* @param \TYPO3\CMS\Backend\View\PageLayoutView $parentObject Calling parent object
* @param bool $drawItem Whether to draw the item using the default functionality
* @param string $headerContent Header content
* @param string $itemContent Item content
* @param array $row Record row of tt_content
*
* @return void
*/
public function preProcess(PageLayoutView &$parentObject, &$drawItem, &$headerContent, &$itemContent, array &$row)
{
if ($row['CType'] === 'script') {
$itemContent .= $this->getLanguageService()->sL(BackendUtility::getItemLabel('tt_content', 'select_key'), TRUE) . ' ' . $row['select_key'] . '<br />';
$itemContent .= '<br />' . $parentObject->linkEditContent($parentObject->renderText($row['bodytext']), $row) . '<br />';
$itemContent .= '<br />' . $parentObject->linkEditContent($parentObject->renderText($row['imagecaption']), $row) . '<br />';
$drawItem = FALSE;
}
}
示例2: fName
/**
* Get locallang label
*
* @param string $name Locallang label index
*
* @return string The label
*/
static function fName($name)
{
return stripslashes($GLOBALS['LANG']->sL(BackendUtility::getItemLabel('sys_dmail', $name)));
}
示例3: renderListHeader
//.........这里部分代码省略.........
$cells = $hookObject->renderListHeaderActions($table, $currentIdList, $cells, $this);
}
}
$theData[$fCol] = implode('', $cells);
break;
// Control panel:
// Control panel:
case '_CONTROL_':
if (!$GLOBALS['TCA'][$table]['ctrl']['readOnly']) {
// If new records can be created on this page, add links:
if ($this->calcPerms & ($table == 'tx_commerce_categories' ? 8 : 16) && $this->showNewRecLink($table) && $this->parentUid) {
if ($table == 'tt_content' && $this->newWizards) {
// If mod.web_list.newContentWiz.overrideWithExtension is set,
// use that extension's create new content wizard instead:
$tmpTyposcriptConfig = BackendUtility::getModTSconfig($this->pageinfo['uid'], 'mod.web_list');
$tmpTyposcriptConfig = $tmpTyposcriptConfig['properties']['newContentWiz.']['overrideWithExtension'];
$newContentWizScriptPath = $this->backPath . ExtensionManagementUtility::isLoaded($tmpTyposcriptConfig) ? ExtensionManagementUtility::extRelPath($tmpTyposcriptConfig) . 'mod1/db_new_content_el.php' : 'sysext/cms/layout/db_new_content_el.php';
$icon = '<a href="#" onclick="' . htmlspecialchars('return jumpExt(\'' . $newContentWizScriptPath . '?id=' . $this->id . '\');') . '" title="' . $language->getLL('new', TRUE) . '">' . ($table == 'tx_commerce_categories' ? IconUtility::getSpriteIcon('actions-page-new') : IconUtility::getSpriteIcon('actions-document-new')) . '</a>';
} elseif ($table == 'tx_commerce_categories' && $this->newWizards) {
$icon = '<a href="' . htmlspecialchars($this->backPath . 'db_new.php?id=' . $this->id . '&pagesOnly=1&returnUrl=' . rawurlencode(GeneralUtility::getIndpEnv('REQUEST_URI'))) . '" title="' . $language->getLL('new', TRUE) . '">' . ($table == 'tx_commerce_categories' ? IconUtility::getSpriteIcon('actions-page-new') : IconUtility::getSpriteIcon('actions-document-new')) . '</a>';
} else {
$parameters = '&edit[' . $table . '][' . $this->id . ']=new';
if ($table == 'pages_language_overlay') {
$parameters .= '&overrideVals[pages_language_overlay][doktype]=' . (int) $this->pageRow['doktype'];
}
switch ($table) {
case 'tx_commerce_categories':
$parameters .= '&defVals[tx_commerce_categories][parent_category]=' . $this->parentUid;
break;
case 'tx_commerce_products':
$parameters .= '&defVals[tx_commerce_products][categories]=' . $this->parentUid;
break;
default:
}
$icon = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($parameters, $this->backPath, -1)) . '" title="' . $language->getLL('new', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-new') . '</a>';
}
}
// If the table can be edited, add link for editing
// ALL SHOWN fields for all listed records:
if ($permsEdit && $this->table && is_array($currentIdList)) {
$editIdList = implode(',', $currentIdList);
if ($this->clipNumPane()) {
$editIdList = "'+editList('" . $table . "','" . $editIdList . "')+'";
}
$params = '&edit[' . $table . '][' . $editIdList . ']=edit&columnsOnly=' . implode(',', $this->fieldArray) . '&disHelp=1';
$icon .= '<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params, $this->backPath, -1)) . '" title="' . $language->getLL('editShownColumns', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-open') . '</a>';
}
// add an empty entry, so column count fits again after moving this into $icon
$theData[$fCol] = ' ';
}
break;
// space column
// space column
case '_AFTERCONTROL_':
// space column
// space column
case '_AFTERREF_':
$theData[$fCol] = ' ';
break;
// Regular fields header:
// Regular fields header:
default:
$theData[$fCol] = '';
if ($this->table && is_array($currentIdList)) {
// If the numeric clipboard pads are selected, show duplicate sorting link:
if ($this->clipNumPane()) {
$theData[$fCol] .= '<a href="' . htmlspecialchars($this->listURL('', -1) . '&duplicateField=' . $fCol) . '" title="' . $language->getLL('clip_duplicates', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-duplicates-select') . '</a>';
}
// If the table can be edited, add link for editing THIS field for all records:
if (!$GLOBALS['TCA'][$table]['ctrl']['readOnly'] && $permsEdit && $GLOBALS['TCA'][$table]['columns'][$fCol]) {
$editIdList = implode(',', $currentIdList);
if ($this->clipNumPane()) {
$editIdList = "'+editList('" . $table . "','" . $editIdList . "')+'";
}
$params = '&edit[' . $table . '][' . $editIdList . ']=edit&columnsOnly=' . $fCol . '&disHelp=1';
$iTitle = sprintf($language->getLL('editThisColumn'), rtrim(trim($language->sL(BackendUtility::getItemLabel($table, $fCol))), ':'));
$theData[$fCol] .= '<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params, $this->backPath, -1)) . '" title="' . htmlspecialchars($iTitle) . '">' . IconUtility::getSpriteIcon('actions-document-open') . '</a>';
}
}
$theData[$fCol] .= $this->addSortLink($language->sL(BackendUtility::getItemLabel($table, $fCol, '<i>[|]</i>')), $fCol, $table);
}
}
/**
* Above each listed table in Web>List a header row is shown.
* Containing the labels of all shown fields and additional icons to
* create new records for this table or perform special clipboard tasks
* like mark and copy all listed records to clipboard, etc.
*/
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'] as $classData) {
$hookObject = GeneralUtility::getUserObj($classData);
if (!$hookObject instanceof \TYPO3\CMS\Recordlist\RecordList\RecordListHookInterface) {
throw new UnexpectedValueException('$hookObject must implement interface \\TYPO3\\CMS\\Recordlist\\RecordList\\RecordListHookInterface', 1195567855);
}
$theData = $hookObject->renderListHeader($table, $currentIdList, $theData, $this);
}
}
// Create and return header table row:
return $this->addelement(1, $icon, $theData, ' class="c-headLine"', '');
}
示例4: renderListHeader
//.........这里部分代码省略.........
if ($table === 'tt_content' && $this->newWizards) {
// If mod.newContentElementWizard.override is set, use that extension's create new content wizard instead:
$tmpTSc = BackendUtility::getModTSconfig($this->pageinfo['uid'], 'mod');
$newContentElementWizard = $tmpTSc['properties']['newContentElementWizard.']['override'] ?: 'new_content_element';
$newContentWizScriptPath = BackendUtility::getModuleUrl($newContentElementWizard, array('id' => $this->id));
$onClick = 'return jumpExt(' . GeneralUtility::quoteJSvalue($newContentWizScriptPath) . ');';
$icon = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars($onClick) . '" title="' . $lang->getLL('new', true) . '">' . $spriteIcon->render() . '</a>';
} elseif ($table == 'pages' && $this->newWizards) {
$parameters = ['id' => $this->id, 'pagesOnly' => 1, 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')];
$href = BackendUtility::getModuleUrl('db_new', $parameters);
$icon = '<a class="btn btn-default" href="' . htmlspecialchars($href) . '" title="' . $lang->getLL('new', true) . '">' . $spriteIcon->render() . '</a>';
} else {
$params = '&edit[' . $table . '][' . $this->id . ']=new';
if ($table == 'pages_language_overlay') {
$params .= '&overrideVals[pages_language_overlay][doktype]=' . (int) $this->pageRow['doktype'];
}
$icon = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params, '', -1)) . '" title="' . $lang->getLL('new', true) . '">' . $spriteIcon->render() . '</a>';
}
}
// If the table can be edited, add link for editing ALL SHOWN fields for all listed records:
if ($permsEdit && $this->table && is_array($currentIdList)) {
$editIdList = implode(',', $currentIdList);
if ($this->clipNumPane()) {
$editIdList = '\'+editList(' . GeneralUtility::quoteJSvalue($table) . ',' . GeneralUtility::quoteJSvalue($editIdList) . ')+\'';
}
$params = 'edit[' . $table . '][' . $editIdList . ']=edit&columnsOnly=' . implode(',', $this->fieldArray);
// we need to build this uri differently, otherwise GeneralUtility::quoteJSvalue messes up the edit list function
$onClick = BackendUtility::editOnClick('', '', -1);
$onClickArray = explode('?', $onClick, 2);
$lastElement = array_pop($onClickArray);
array_push($onClickArray, $params . '&' . $lastElement);
$onClick = implode('?', $onClickArray);
$icon .= '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars($onClick) . '" title="' . $lang->getLL('editShownColumns', true) . '">' . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
$icon = '<div class="btn-group" role="group">' . $icon . '</div>';
}
// Add an empty entry, so column count fits again after moving this into $icon
$theData[$fCol] = ' ';
}
break;
default:
// Regular fields header:
$theData[$fCol] = '';
// Check if $fCol is really a field and get the label and remove the colons
// at the end
$sortLabel = BackendUtility::getItemLabel($table, $fCol);
if ($sortLabel !== null) {
$sortLabel = $lang->sL($sortLabel, true);
$sortLabel = rtrim(trim($sortLabel), ':');
} else {
// No TCA field, only output the $fCol variable with square brackets []
$sortLabel = htmlspecialchars($fCol);
$sortLabel = '<i>[' . rtrim(trim($sortLabel), ':') . ']</i>';
}
if ($this->table && is_array($currentIdList)) {
// If the numeric clipboard pads are selected, show duplicate sorting link:
if ($this->clipNumPane()) {
$theData[$fCol] .= '<a class="btn btn-default" href="' . htmlspecialchars($this->listURL('', '-1') . '&duplicateField=' . $fCol) . '" title="' . $lang->getLL('clip_duplicates', true) . '">' . $this->iconFactory->getIcon('actions-document-duplicates-select', Icon::SIZE_SMALL)->render() . '</a>';
}
// If the table can be edited, add link for editing THIS field for all
// listed records:
if ($this->isEditable($table) && $permsEdit && $GLOBALS['TCA'][$table]['columns'][$fCol]) {
$editIdList = implode(',', $currentIdList);
if ($this->clipNumPane()) {
$editIdList = '\'+editList(' . GeneralUtility::quoteJSvalue($table) . ',' . GeneralUtility::quoteJSvalue($editIdList) . ')+\'';
}
$params = 'edit[' . $table . '][' . $editIdList . ']=edit&columnsOnly=' . $fCol;
// we need to build this uri differently, otherwise GeneralUtility::quoteJSvalue messes up the edit list function
$onClick = BackendUtility::editOnClick('', '', -1);
$onClickArray = explode('?', $onClick, 2);
$lastElement = array_pop($onClickArray);
array_push($onClickArray, $params . '&' . $lastElement);
$onClick = implode('?', $onClickArray);
$iTitle = sprintf($lang->getLL('editThisColumn'), $sortLabel);
$theData[$fCol] .= '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars($onClick) . '" title="' . htmlspecialchars($iTitle) . '">' . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
}
if (strlen($theData[$fCol]) > 0) {
$theData[$fCol] = '<div class="btn-group" role="group">' . $theData[$fCol] . '</div> ';
}
}
$theData[$fCol] .= $this->addSortLink($sortLabel, $fCol, $table);
}
}
/**
* @hook renderListHeader: Allows to change the contents of columns/cells of the Web>List table headers
* @usage Above each listed table in Web>List a header row is shown.
* Containing the labels of all shown fields and additional icons to create new records for this
* table or perform special clipboard tasks like mark and copy all listed records to clipboard, etc.
*/
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'] as $classData) {
$hookObject = GeneralUtility::getUserObj($classData);
if (!$hookObject instanceof RecordListHookInterface) {
throw new \UnexpectedValueException('$hookObject must implement interface ' . RecordListHookInterface::class, 1195567855);
}
$theData = $hookObject->renderListHeader($table, $currentIdList, $theData, $this);
}
}
// Create and return header table row:
return '<thead>' . $this->addElement(1, $icon, $theData, '', '', '', 'th') . '</thead>';
}
示例5: getRowDetails
/**
* Fetch further information to current selected workspace record.
*
* @param \stdClass $parameter
* @return array $data
*/
public function getRowDetails($parameter)
{
$diffReturnArray = array();
$liveReturnArray = array();
/** @var $diffUtility \TYPO3\CMS\Core\Utility\DiffUtility */
$diffUtility = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Utility\DiffUtility::class);
/** @var $parseObj \TYPO3\CMS\Core\Html\RteHtmlParser */
$parseObj = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Html\RteHtmlParser::class);
$liveRecord = BackendUtility::getRecord($parameter->table, $parameter->t3ver_oid);
$versionRecord = BackendUtility::getRecord($parameter->table, $parameter->uid);
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$icon_Live = $iconFactory->getIconForRecord($parameter->table, $liveRecord, Icon::SIZE_SMALL)->render();
$icon_Workspace = $iconFactory->getIconForRecord($parameter->table, $versionRecord, Icon::SIZE_SMALL)->render();
$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) {
if (empty($GLOBALS['TCA'][$parameter->table]['columns'][$fieldName]['config'])) {
continue;
}
// 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;
}
// Gets the TCA configuration for the current field
$configuration = $GLOBALS['TCA'][$parameter->table]['columns'][$fieldName]['config'];
// 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 ($configuration['type'] === 'inline' && $configuration['foreign_table'] === 'sys_file_reference') {
$useThumbnails = false;
if (!empty($configuration['foreign_selector_fieldTcaOverride']['config']['appearance']['elementBrowserAllowed']) && !empty($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'])) {
$fileExtensions = GeneralUtility::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'], true);
$allowedExtensions = GeneralUtility::trimExplode(',', $configuration['foreign_selector_fieldTcaOverride']['config']['appearance']['elementBrowserAllowed'], true);
$differentExtensions = array_diff($allowedExtensions, $fileExtensions);
$useThumbnails = empty($differentExtensions);
}
$liveFileReferences = BackendUtility::resolveFileReferences($parameter->table, $fieldName, $liveRecord, 0);
$versionFileReferences = BackendUtility::resolveFileReferences($parameter->table, $fieldName, $versionRecord, $this->getCurrentWorkspace());
$fileReferenceDifferences = $this->prepareFileReferenceDifferences($liveFileReferences, $versionFileReferences, $useThumbnails);
if ($fileReferenceDifferences === null) {
continue;
}
$diffReturnArray[] = array('field' => $fieldName, 'label' => $fieldTitle, 'content' => $fileReferenceDifferences['differences']);
$liveReturnArray[] = array('field' => $fieldName, 'label' => $fieldTitle, 'content' => $fileReferenceDifferences['live']);
} elseif ((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']);
if ($configuration['type'] == 'group' && $configuration['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' => $diffUtility->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);
if (method_exists($hookObject, 'modifyDifferenceArray')) {
$hookObject->modifyDifferenceArray($parameter, $diffReturnArray, $liveReturnArray, $diffUtility);
}
}
}
$commentsForRecord = $this->getCommentsForRecord($parameter->uid, $parameter->table);
return array('total' => 1, 'data' => array(array('diff' => $diffReturnArray, 'live_record' => $liveReturnArray, 'icon_Live' => $icon_Live, 'icon_Workspace' => $icon_Workspace, 'comments' => $commentsForRecord, 'path_Live' => htmlspecialchars($parameter->path_Live), 'label_Stage' => htmlspecialchars($parameter->label_Stage), 'stage_position' => (int) $stagePosition['position'], 'stage_count' => (int) $stagePosition['count'])));
}
示例6: checkValueForCheck
/**
* Evaluates 'check' type values.
*
* @param array $res The result array. The processed value (if any!) is set in the 'value' key.
* @param string $value The value to set.
* @param array $tcaFieldConf Field configuration from TCA
* @param string $table Table name
* @param int $id UID of record
* @param int $realPid The real PID value of the record. For updates, this is just the pid of the record. For new records this is the PID of the page where it is inserted. If $realPid is -1 it means that a new version of the record is being inserted.
* @param string $field Field name
* @return array Modified $res array
*/
protected function checkValueForCheck($res, $value, $tcaFieldConf, $table, $id, $realPid, $field)
{
$itemC = count($tcaFieldConf['items']);
if (!$itemC) {
$itemC = 1;
}
$maxV = pow(2, $itemC) - 1;
if ($value < 0) {
$value = 0;
}
if ($value > $maxV) {
$value = $maxV;
}
if ($field && $realPid >= 0 && $value > 0 && !empty($tcaFieldConf['eval'])) {
$evalCodesArray = GeneralUtility::trimExplode(',', $tcaFieldConf['eval'], true);
$otherRecordsWithSameValue = array();
$maxCheckedRecords = 0;
if (in_array('maximumRecordsCheckedInPid', $evalCodesArray, true)) {
$otherRecordsWithSameValue = $this->getRecordsWithSameValue($table, $id, $field, $value, $realPid);
$maxCheckedRecords = (int) $tcaFieldConf['validation']['maximumRecordsCheckedInPid'];
}
if (in_array('maximumRecordsChecked', $evalCodesArray, true)) {
$otherRecordsWithSameValue = $this->getRecordsWithSameValue($table, $id, $field, $value);
$maxCheckedRecords = (int) $tcaFieldConf['validation']['maximumRecordsChecked'];
}
// there are more than enough records with value "1" in the DB
// if so, set this value to "0" again
if ($maxCheckedRecords && count($otherRecordsWithSameValue) >= $maxCheckedRecords) {
$value = 0;
if ($this->enableLogging) {
$this->log($table, $id, 5, 0, 1, 'Could not activate checkbox for field "%s". A total of %s record(s) can have this checkbox activated. Uncheck other records first in order to activate the checkbox of this record.', -1, array($GLOBALS['LANG']->sL(BackendUtility::getItemLabel($table, $field)), $maxCheckedRecords));
}
}
}
$res['value'] = $value;
return $res;
}
示例7: getDifferences
/**
* Gets the differences between two record versions out
* of one record history entry.
*
* @param array $entry Record history entry
* @return array
*/
protected function getDifferences(array $entry)
{
$differences = array();
$tableName = $entry['tablename'];
if (is_array($entry['newRecord'])) {
$fields = array_keys($entry['newRecord']);
foreach ($fields as $field) {
if (!empty($GLOBALS['TCA'][$tableName]['columns'][$field]['config']['type']) && $GLOBALS['TCA'][$tableName]['columns'][$field]['config']['type'] !== 'passthrough') {
// Create diff-result:
$fieldDifferences = $this->getDifferencesObject()->makeDiffDisplay(BackendUtility::getProcessedValue($tableName, $field, $entry['oldRecord'][$field], 0, TRUE), BackendUtility::getProcessedValue($tableName, $field, $entry['newRecord'][$field], 0, TRUE));
if (!empty($fieldDifferences)) {
$differences[] = array('label' => $this->getLanguageService()->sl((string) BackendUtility::getItemLabel($tableName, $field)), 'html' => nl2br(trim($fieldDifferences)));
}
}
}
}
return $differences;
}
示例8: getSupplierListing
/**
* Generates a list of all saved Suppliers.
*
* @return string
*/
protected function getSupplierListing()
{
$fields = explode(',', SettingsFactory::getInstance()->getExtConf('coSuppliers'));
$headerRow = '<tr><td></td>';
foreach ($fields as $field) {
$headerRow .= '<td class="bgColor6"><strong>' . $this->getLanguageService()->sL(BackendUtility::getItemLabel('tx_commerce_supplier', htmlspecialchars($field))) . '</strong></td>';
}
$headerRow .= '</tr>';
$result = $this->fetchDataByTable('tx_commerce_supplier');
$supplierRows = $this->renderSupplierRows($result, $fields);
$this->tableForNewLink = 'supplier';
return '<table>' . $headerRow . $supplierRows . '</table>';
}
示例9: 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);
}
}
}
示例10: getTcaRecordTitle
/**
* Returns TCA label, used in TCA only.
*
* @param array $params Record value
*/
public function getTcaRecordTitle(array &$params)
{
$languageService = $this->getLanguageService();
$feGroup = '';
if ($params['row']['fe_group']) {
$feGroup = $languageService->sL(BackendUtility::getItemLabel('tx_commerce_article_prices', 'fe_group'), 1) . BackendUtility::getProcessedValueExtra('tx_commerce_article_prices', 'fe_group', $params['row']['fe_group'], 100, $params['row']['uid']);
}
$params['title'] = $languageService->sL(BackendUtility::getItemLabel('tx_commerce_article_prices', 'price_gross'), 1) . ': ' . sprintf('%01.2f', $params['row']['price_gross'] / 100) . ', ' . $languageService->sL(BackendUtility::getItemLabel('tx_commerce_article_prices', 'price_net'), 1) . ': ' . sprintf('%01.2f', $params['row']['price_net'] / 100) . ' (' . $languageService->sL(BackendUtility::getItemLabel('tx_commerce_article_prices', 'price_scale_amount_start'), 1) . ': ' . $params['row']['price_scale_amount_start'] . ' ' . $languageService->sL(BackendUtility::getItemLabel('tx_commerce_article_prices', 'price_scale_amount_end'), 1) . ': ' . $params['row']['price_scale_amount_end'] . ') ' . $feGroup;
}
示例11: fieldSelectBox
/**
* Create the selector box for selecting fields to display from a table:.
*
* @param string $table Table name
* @param bool|int $formFields If true, form-fields will be wrapped
* around the table.
*
* @return string HTML table with the selector box
* (name: displayFields['.$table.'][])
*/
public function fieldSelectBox($table, $formFields = 1)
{
$language = $this->getLanguageService();
// Init:
$formElements = array('', '');
if ($formFields) {
$formElements = array('<form action="' . htmlspecialchars($this->listURL()) . '" method="post">', '</form>');
}
// Load already selected fields, if any:
$setFields = is_array($this->setFields[$table]) ? $this->setFields[$table] : array();
// Request fields from table:
// $fields = $this->makeFieldList($table, FALSE, TRUE);
$fields = $this->additionalFieldArray;
// Add pseudo "control" fields
$fields[] = '_PATH_';
$fields[] = '_REF_';
$fields[] = '_LOCALIZATION_';
$fields[] = '_CONTROL_';
$fields[] = '_CLIPBOARD_';
// Create an option for each field:
$opt = array();
$opt[] = '<option value=""></option>';
foreach ($fields as $fN) {
$label = BackendUtility::getItemLabel($table, $fN, 'LLL:EXT:commerce/Resources/Private/Language/locallang_mod_orders.xml:|');
$fl = $label ? $label : '[' . $fN . ']';
// Field label
$labelForField = SettingsFactory::getInstance()->getTcaValue($table . '.columns.' . $fN . '.label');
$fL = $labelForField ? rtrim($language->sL($labelForField), ':') : $fl;
$opt[] = '
<option value="' . $fN . '"' . (in_array($fN, $setFields) ? ' selected="selected"' : '') . '>' . htmlspecialchars($fL) . '</option>';
}
// Compile the options into a multiple selector box:
$lMenu = '
<select size="' . max(min(count($fields) + 1, 20), 3) . '" multiple="multiple" name="displayFields[' . $table . '][]">' . implode('', $opt) . '</select>';
// Table with the field selector::
$content = '
' . $formElements[0] . '
<!--
Field selector for extended table view:
-->
<table border="0" cellpadding="0" cellspacing="0" id="typo3-dblist-fieldSelect">
<tr>
<td>' . $lMenu . '</td>
<td><input type="submit" name="search" value="' . $language->sL('LLL:EXT:lang/locallang_core.php:labels.setFields', 1) . '" /></td>
</tr>
</table>
' . $formElements[1];
return $content;
}
示例12: address
/**
* Address
* Renders an address block.
*
* @param array $parameter Parameter
* @param \TYPO3\CMS\Backend\Form\FormEngine $fobj Form engine
* @param string $table Table
* @param int $uid Record UID
*
* @return string HTML-Content
*/
public function address(array $parameter, \TYPO3\CMS\Backend\Form\FormEngine $fobj, $table, $uid)
{
/**
* Intialize Template Class
* as this class is included via alt_doc we don't have to require template.php
* in fact an require would cause an error.
*
* @var \TYPO3\CMS\Backend\Template\DocumentTemplate
*/
$doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$doc->backPath = $this->getBackPath();
$content = '';
/*
* First select Data from Database
*/
if ($data = BackendUtility::getRecord($table, $uid, 'uid,' . SettingsFactory::getInstance()->getTcaValue($table . '.interface.showRecordFieldList'))) {
/*
* We should get just one Result
* So Render Result as $arr for template::table()
*/
/*
* Better formating via template class
*/
$content .= $doc->spacer(10);
/*
* TYPO3 Core API's Page 63
*/
$params = '&edit[' . $table . '][' . $uid . ']=edit';
$onclickAction = 'onclick="' . htmlspecialchars(BackendUtility::editOnClick($params, $this->getBackPath())) . '"';
$headerWrap = array('<b><a href="#" ' . $onclickAction . '>', '</a></b>');
$content .= $doc->getHeader($table, $data, 'Local Lang definition is missing', 1, $headerWrap);
$content .= $doc->spacer(10);
$display = array();
$showRecordFieldList = SettingsFactory::getInstance()->getTcaValue($table . '.interface.showRecordFieldList');
foreach ($data as $key => $value) {
/*
* Walk through rowset,
* get TCA values
* and LL Names
*/
if (GeneralUtility::inList($showRecordFieldList, $key)) {
/*
* Get The label
*/
$translatedLabel = $this->getLanguageService()->sL(BackendUtility::getItemLabel($table, $key));
$display[$key] = array($translatedLabel, htmlspecialchars($value));
}
}
$tableLayout = array('table' => array('<table>', '</table>'), 'defRowEven' => array('defCol' => array('<td class="bgColor5">', '</td>')), 'defRowOdd' => array('defCol' => array('<td class="bgColor4">', '</td>')));
$content .= $doc->table($display, $tableLayout);
}
$content .= '<input type="hidden" name="' . $parameter['itemFormElName'] . '" value="' . htmlspecialchars($parameter['itemFormElValue']) . '">';
return $content;
}
示例13: valuelist
/**
* Renders the value list to a value
*
* @param array $parameter Parameter
*
* @return string HTML-Content
*/
public function valuelist(array $parameter)
{
$database = $this->getDatabaseConnection();
$language = $this->getLanguageService();
$content = '';
$foreignTable = 'tx_commerce_attribute_values';
$table = 'tx_commerce_attributes';
/**
* Document template
*
* @var \TYPO3\CMS\Backend\Template\SmallDocumentTemplate $doc
*/
$doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\SmallDocumentTemplate');
$doc->backPath = $GLOBALS['BACK_PATH'];
$attributeStoragePid = $parameter['row']['pid'];
$attributeUid = $parameter['row']['uid'];
/**
* Select Attribute Values
*/
// @todo TS config of fields in list
$rowFields = array('attributes_uid', 'value');
$titleCol = $GLOBALS['TCA'][$foreignTable]['ctrl']['label'];
// Create the SQL query for selecting the elements in the listing:
$result = $database->exec_SELECTquery('*', $foreignTable, 'pid = $attributeStoragePid ' . BackendUtility::deleteClause($foreignTable) . ' AND attributes_uid=\'' . $database->quoteStr($attributeUid, $foreignTable) . '\'');
$dbCount = $database->sql_num_rows($result);
$out = '';
if ($dbCount) {
/**
* Only if we have a result
*/
$theData[$titleCol] = '<span class="c-table">' . $language->sL('LLL:EXT:commerce/Resources/Private/Language/locallang_be.xml:attributeview.valuelist', 1) . '</span> (' . $dbCount . ')';
$fieldCount = count($rowFields);
$out .= '
<tr>
<td class="c-headLineTable" style="width:95%;" colspan="' . ($fieldCount + 1) . '">' . $theData[$titleCol] . '</td>
</tr>';
/**
* Header colum
*/
$out .= '<tr>';
foreach ($rowFields as $field) {
$out .= '<td class="c-headLineTable"><b>' . $language->sL(BackendUtility::getItemLabel($foreignTable, $field)) . '</b></td>';
}
$out .= '<td class="c-headLineTable"></td>';
$out .= '</tr>';
/**
* Walk true Data
*/
$cc = 0;
$iOut = '';
while ($row = $database->sql_fetch_assoc($result)) {
$cc++;
$rowBackgroundColor = $cc % 2 ? '' : ' bgcolor="' . \TYPO3\CMS\Core\Utility\GeneralUtility::modifyHTMLColor($GLOBALS['SOBE']->doc->bgColor4, 10, 10, 10) . '"';
/**
* Not very noice to render html_code directly
*
* @todo change rendering html code here
* */
$iOut .= '<tr ' . $rowBackgroundColor . '>';
foreach ($rowFields as $field) {
$iOut .= '<td>';
$wrap = array('', '');
switch ($field) {
case $titleCol:
$params = '&edit[' . $foreignTable . '][' . $row['uid'] . ']=edit';
$wrap = array('<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params, $GLOBALS['BACK_PATH'])) . '">', '</a>');
break;
default:
}
$iOut .= implode(BackendUtility::getProcessedValue($foreignTable, $field, $row[$field], 100), $wrap);
$iOut .= '</td>';
}
/**
* Trash icon
*/
$onClick = 'deleteRecord(\'' . $foreignTable . '\', ' . $row['uid'] . ', \'alt_doc.php?edit[tx_commerce_attributes][' . $attributeUid . ']=edit\');';
$iOut .= '<td> ';
$iOut .= '<a href="#" onclick="' . $onClick . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-delete') . '</a></td>';
$iOut .= '</tr>';
}
$out .= $iOut;
/**
* Cerate the summ row
*/
$out .= '<tr>';
foreach ($rowFields as $field) {
$out .= '<td class="c-headLineTable"><b>';
if ($sum[$field] > 0) {
$out .= BackendUtility::getProcessedValueExtra($foreignTable, $field, $sum[$field], 100);
}
$out .= '</b></td>';
}
$out .= '<td class="c-headLineTable"></td>';
//.........这里部分代码省略.........
示例14: 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 = '<tr>
<td class="t3-row-header" colspan="2"> </td>
<td class="t3-row-header">' . $GLOBALS['LANG']->sL(BackendUtility::getItemLabel('sys_dmail_group', 'title')) . '</td>
<td class="t3-row-header">' . $GLOBALS['LANG']->sL(BackendUtility::getItemLabel('sys_dmail_group', 'type')) . '</td>
<td class="t3-row-header">' . $GLOBALS['LANG']->sL(BackendUtility::getItemLabel('sys_dmail_group', 'description')) . '</td>
<td class="t3-row-header">' . $GLOBALS['LANG']->getLL('recip_group_amount') . '</td>
</tr>';
$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>
<td nowrap="nowrap">' . IconUtility::getSpriteIconForRecord('sys_dmail_group', $row) . '</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="typo3-dblist" border="0" cellpadding="0" cellspacing="0">' . $out . '</table>';
$theOutput = $this->doc->section(BackendUtility::cshItem($this->cshTable, 'select_mailgroup', $GLOBALS['BACK_PATH']) . $GLOBALS['LANG']->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'], '') . '">' . IconUtility::getSpriteIconForRecord('sys_dmail_group', array()) . $GLOBALS['LANG']->getLL('recip_create_mailgroup_msg') . '</a>';
$theOutput .= $this->doc->spacer(20);
$theOutput .= $this->doc->section(BackendUtility::cshItem($this->cshTable, 'create_mailgroup', $GLOBALS['BACK_PATH']) . $GLOBALS['LANG']->getLL('recip_create_mailgroup'), $out, 1, 0, FALSE, TRUE, FALSE, TRUE);
// Import
$out = '<a class="t3-link" href="index.php?id=' . $this->id . '&CMD=displayImport">' . $GLOBALS['LANG']->getLL('recip_import_mailgroup_msg') . '</a>';
$theOutput .= $this->doc->spacer(20);
$theOutput .= $this->doc->section($GLOBALS['LANG']->getLL('mailgroup_import'), $out, 1, 1, 0, TRUE);
return $theOutput;
}
示例15: renderListHeader
//.........这里部分代码省略.........
// References
case '_REF_':
$headerColumns[$fCol] = '<i>[' . $language->sL('LLL:EXT:lang/locallang_mod_file_list.xml:c__REF_', 1) . ']</i>';
break;
// Path
// Path
case '_LOCALIZATION_':
$headerColumns[$fCol] = '<i>[' . $language->sL('LLL:EXT:lang/locallang_core.php:labels._LOCALIZATION_', 1) . ']</i>';
break;
// Path
// Path
case '_LOCALIZATION_b':
$headerColumns[$fCol] = $language->getLL('Localize', 1);
break;
// Clipboard:
// Clipboard:
case '_CLIPBOARD_':
if ($parentObject->id && !$GLOBALS['TCA'][$table]['ctrl']['readOnly'] && $GLOBALS['SOBE']->MOD_SETTINGS['bigControlPanel']) {
$headerColumns[$fCol] = $language->getLL('moveorderto');
} else {
$headerColumns[$fCol] = '';
}
break;
// Control panel:
// Control panel:
case '_CONTROL_':
if (!$GLOBALS['TCA'][$table]['ctrl']['readOnly']) {
// If new records can be created on this page, add links:
if ($parentObject->calcPerms & ($table == 'pages' ? 8 : 16) && $parentObject->showNewRecLink($table)) {
if ($table == 'pages') {
$sprite = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-page-new');
} else {
$sprite = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-new');
}
if ($table == 'tt_content' && $parentObject->newWizards) {
// If mod.web_list.newContentWiz.overrideWithExtension is set,
// use that extension's create new content wizard instead:
$tmpTypoScript = \TYPO3\CMS\Backend\Utility\BackendUtility::getModTSconfig($parentObject->id, 'mod.web_list');
$tmpTypoScript = $tmpTypoScript['properties']['newContentWiz.']['overrideWithExtension'];
$newContentWizScriptPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($tmpTypoScript) ? \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($tmpTypoScript) . 'mod1/db_new_content_el.php' : 'sysext/cms/layout/db_new_content_el.php';
$icon = '<a href="#" onclick="' . htmlspecialchars('return jumpExt(\'' . $newContentWizScriptPath . '?id=' . $parentObject->id . '\');') . '" title="' . $language->getLL('new', TRUE) . '">' . $sprite . '</a>';
} elseif ($table == 'pages' && $parentObject->newWizards) {
$icon = '<a href="' . htmlspecialchars($parentObject->backPath . 'db_new.php?id=' . $parentObject->id . '&pagesOnly=1&returnUrl=' . rawurlencode(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI'))) . '" title="' . $language->getLL('new', TRUE) . '">' . $sprite . '</a>';
} else {
$params = '&edit[' . $table . '][' . $parentObject->id . ']=new';
if ($table == 'pages_language_overlay') {
$params .= '&overrideVals[pages_language_overlay][doktype]=' . (int) $parentObject->pageRow['doktype'];
}
$icon = '<a href="#" onclick="' . htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::editOnClick($params, $parentObject->backPath, -1)) . '" title="' . $language->getLL('new', TRUE) . '">' . $sprite . '</a>';
}
}
// If the table can be edited, add link for editing
// ALL SHOWN fields for all listed records:
if ($permsEdit && $parentObject->table && is_array($currentIdList)) {
$editIdList = implode(',', $currentIdList);
if ($parentObject->clipNumPane()) {
$editIdList = "'+editList('" . $table . "','" . $editIdList . "')+'";
}
$params = '&edit[' . $table . '][' . $editIdList . ']=edit&columnsOnly=' . implode(',', $parentObject->fieldArray) . '&disHelp=1';
$icon .= '<a href="#" onclick="' . htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::editOnClick($params, $parentObject->backPath, -1)) . '" title="' . $language->getLL('editShownColumns', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-open') . '</a>';
}
// add an empty entry, so column count fits again after moving this into $icon
$headerColumns[$fCol] = ' ';
}
break;
// space column
// space column
case '_AFTERCONTROL_':
// space column
// space column
case '_AFTERREF_':
$headerColumns[$fCol] = ' ';
break;
// Regular fields header:
// Regular fields header:
default:
$headerColumns[$fCol] = '';
if ($parentObject->table && is_array($currentIdList)) {
// If the numeric clipboard pads are selected, show duplicate sorting link:
if ($parentObject->clipNumPane()) {
$headerColumns[$fCol] .= '<a href="' . htmlspecialchars($parentObject->listURL('', -1) . '&duplicateField=' . $fCol) . '" title="' . $language->getLL('clip_duplicates', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-duplicates-select') . '</a>';
}
// If the table can be edited, add link for
// editing THIS field for all listed records:
if (!$GLOBALS['TCA'][$table]['ctrl']['readOnly'] && $permsEdit && $GLOBALS['TCA'][$table]['columns'][$fCol]) {
$editIdList = implode(',', $currentIdList);
if ($parentObject->clipNumPane()) {
$editIdList = "'+editList('" . $table . "','" . $editIdList . "')+'";
}
$params = '&edit[' . $table . '][' . $editIdList . ']=edit&columnsOnly=' . $fCol . '&disHelp=1';
$iTitle = sprintf($language->getLL('editThisColumn'), rtrim(trim($language->sL(\TYPO3\CMS\Backend\Utility\BackendUtility::getItemLabel($table, $fCol))), ':'));
$headerColumns[$fCol] .= '<a href="#" onclick="' . htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::editOnClick($params, $parentObject->backPath, -1)) . '" title="' . htmlspecialchars($iTitle) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-open') . '</a>';
}
}
$headerColumns[$fCol] .= $parentObject->addSortLink($language->sL(\TYPO3\CMS\Backend\Utility\BackendUtility::getItemLabel($table, $fCol, 'LLL:EXT:commerce/Resources/Private/Language/locallang_mod_orders.xml:|')), $fCol, $table);
}
}
}
return $headerColumns;
}