X-Git-Url: http://git.typo3.org/Packages/TYPO3.CMS.git/blobdiff_plain/4bb7483c156840e5f32d544549d5c5e1aa828c40..c36ae6b8063d537a7f9952da0949dc2474cba72c:/typo3/sysext/cms/layout/class.tx_cms_layout.php diff --git a/typo3/sysext/cms/layout/class.tx_cms_layout.php b/typo3/sysext/cms/layout/class.tx_cms_layout.php index 0ff9544badd4..9b034d63717f 100755 --- a/typo3/sysext/cms/layout/class.tx_cms_layout.php +++ b/typo3/sysext/cms/layout/class.tx_cms_layout.php @@ -412,10 +412,16 @@ class tx_cms_layout extends recordList { } $editUidList .= $row['uid'] . ','; - $singleElementHTML .= $this->tt_content_drawHeader($row, $this->tt_contentConfig['showInfo'] ? 15 : 5, $this->defLangBinding && $lP > 0, TRUE); + $disableMoveAndNewButtons = ($this->defLangBinding && $lP > 0); + $singleElementHTML .= $this->tt_content_drawHeader($row, $this->tt_contentConfig['showInfo'] ? 15 : 5, $disableMoveAndNewButtons, TRUE); $isRTE = $RTE && $this->isRTEforField('tt_content', $row, 'bodytext'); - $singleElementHTML .= '
' . $this->tt_content_drawItem($row, $isRTE) . '
'; + $innerContent = '
' . $this->tt_content_drawItem($row, $isRTE) . '
'; + + $singleElementHTML .= '
' . + $innerContent . + '
' . + $this->tt_content_drawFooter($row); // NOTE: this is the end tag for
// because of bad (historic) conception, starting tag has to be placed inside tt_content_drawHeader() @@ -425,6 +431,20 @@ class tx_cms_layout extends recordList { $statusHidden = ($this->isDisabled('tt_content', $row) ? ' t3-page-ce-hidden' : ''); $singleElementHTML = '
' . $singleElementHTML . '
'; + // Add icon "new content element below" + if (!$disableMoveAndNewButtons) { + // New content element: + if ($this->option_newWizard) { + $onClick = "window.location.href='db_new_content_el.php?id=" . $row['pid'] . '&sys_language_uid=' . $row['sys_language_uid'] . '&colPos=' . $row['colPos'] . '&uid_pid=' . (-$row['uid']) . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) . "';"; + } else { + $params = '&edit[tt_content][' . (-$row['uid']) . ']=new'; + $onClick = t3lib_BEfunc::editOnClick($params, $this->backPath); + } + $singleElementHTML .= '
' . + t3lib_iconWorks::getSpriteIcon('actions-document-new') . + '
'; + } + if ($this->defLangBinding && $this->tt_contentConfig['languageMode']) { $defLangBinding[$key][$lP][$row[($lP ? 'l18n_parent' : 'uid')]] = $singleElementHTML; } else { @@ -1160,6 +1180,34 @@ class tx_cms_layout extends recordList { return $out; } + /** + * Draw the footer for a single tt_content element + * + * @param array Record array + * @return string HTML of the footer + */ + protected function tt_content_drawFooter(array $row) { + $content = ''; + + // Get processed values: + $info = array(); + $this->getProcessedValue('tt_content', 'hidden,starttime,endtime,fe_group,spaceBefore,spaceAfter', $row, $info); + + // Display info from records fields: + if (count($info)) { + $content = '
+ ' . implode('
', $info) . ' +
'; + } + + // Wrap it + if (!empty($content)) { + $content = ''; + } + + return $content; + } + /** * Draw the header for a single tt_content element * @@ -1171,58 +1219,15 @@ class tx_cms_layout extends recordList { */ function tt_content_drawHeader($row, $space = 0, $disableMoveAndNewButtons = FALSE, $langMode = FALSE) { - // Load full table description: + // Load full table description: t3lib_div::loadTCA('tt_content'); - // Get record locking status: - if ($lockInfo = t3lib_BEfunc::isRecordLocked('tt_content', $row['uid'])) { - $lockIcon = '' . - t3lib_iconWorks::getSpriteIcon('status-warning-in-use') . - ''; - } else { - $lockIcon = ''; - } - - // Call stats information hook - $stat = ''; - if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'])) { - $_params = array('tt_content', $row['uid'], &$row); - foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'] as $_funcRef) { - $stat .= t3lib_div::callUserFunction($_funcRef, $_params, $this); - } - } - - // Create line with type of content element and icon/lock-icon/title: - $ceType = $this->getIcon('tt_content', $row) . ' ' . - $lockIcon . ' ' . - $stat . ' ' . - ($langMode ? $this->languageFlag($row['sys_language_uid']) : '') . ' ' . - htmlspecialchars($this->CType_labels[$row['CType']]) . - ' ' . $GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content', 'list_type', $row['list_type']), 1) . '
'; - - // If show info is set...; + // If show info is set...; if ($this->tt_contentConfig['showInfo']) { - // Get processed values: - $info = Array(); - $this->getProcessedValue('tt_content', 'hidden,starttime,endtime,fe_group,spaceBefore,spaceAfter', $row, $info); - // Render control panel for the element: if ($this->tt_contentConfig['showCommands'] && $this->doEdit) { - if (!$disableMoveAndNewButtons) { - // New content element: - if ($this->option_newWizard) { - $onClick = "window.location.href='db_new_content_el.php?id=" . $row['pid'] . '&sys_language_uid=' . $row['sys_language_uid'] . '&colPos=' . $row['colPos'] . '&uid_pid=' . (-$row['uid']) . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) . "';"; - } else { - $params = '&edit[tt_content][' . (-$row['uid']) . ']=new'; - $onClick = t3lib_BEfunc::editOnClick($params, $this->backPath); - } - $out .= '' . - t3lib_iconWorks::getSpriteIcon('actions-document-new') . - ''; - } - // Edit content element: $params = '&edit[tt_content][' . $this->tt_contentData['nextThree'][$row['uid']] . ']=edit'; $out .= ''; - // Move element up: + $moveButtonContent = ''; + $displayMoveButtons = FALSE; + + // Move element up: if ($this->tt_contentData['prev'][$row['uid']]) { $params = '&cmd[tt_content][' . $row['uid'] . '][move]=' . $this->tt_contentData['prev'][$row['uid']]; - $out .= '' . + $moveButtonContent .= '' . t3lib_iconWorks::getSpriteIcon('actions-move-up') . ''; + $displayMoveButtons = TRUE; } else { - $out .= t3lib_iconWorks::getSpriteIcon('empty-empty'); + $moveButtonContent .= t3lib_iconWorks::getSpriteIcon('empty-empty'); } - // Move element down: + // Move element down: if ($this->tt_contentData['next'][$row['uid']]) { $params = '&cmd[tt_content][' . $row['uid'] . '][move]= ' . $this->tt_contentData['next'][$row['uid']]; - $out .= '' . + $moveButtonContent .= '' . t3lib_iconWorks::getSpriteIcon('actions-move-down') . ''; + $displayMoveButtons = TRUE; } else { - $out .= t3lib_iconWorks::getSpriteIcon('empty-empty'); + $moveButtonContent .= t3lib_iconWorks::getSpriteIcon('empty-empty'); + } + + if ($displayMoveButtons) { + $out .= '' . $moveButtonContent . ''; } - $out .= ''; } } - // Display info from records fields: - $infoOutput = ''; - if (count($info)) { - $infoOutput = '
- ' . implode('
', $info) . ' -
'; + } + + $additionalIcons = array(); + $additionalIcons[] = $this->getIcon('tt_content', $row) . ' '; + $additionalIcons[] = ($langMode ? $this->languageFlag($row['sys_language_uid'], FALSE) : ''); + + // Get record locking status: + if ($lockInfo = t3lib_BEfunc::isRecordLocked('tt_content', $row['uid'])) { + $additionalIcons[] = '' . + t3lib_iconWorks::getSpriteIcon('status-warning-in-use') . + ''; + } + + // Call stats information hook + if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'])) { + $_params = array('tt_content', $row['uid'], &$row); + foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'] as $_funcRef) { + $additionalIcons[] = t3lib_div::callUserFunction($_funcRef, $_params, $this); } } + // Wrap the whole header // NOTE: end-tag for
is in getTable_tt_content() return '

+ ' . implode('', $additionalIcons) . ' + ' . $out . ' -
+

-
-
- ' . $ceType . ' -
- ' . $infoOutput; +
'; } /** @@ -1754,21 +1777,20 @@ class tx_cms_layout extends recordList { * Creates processed values for all fieldnames in $fieldList based on values from $row array. * The result is 'returned' through $info which is passed as a reference * - * @param string Table name - * @param string Commalist of fields. - * @param array Record from which to take values for processing. - * @param array Array to which the processed values are added. - * @return void + * @param string Table name + * @param string Commalist of fields. + * @param array Record from which to take values for processing. + * @param array Array to which the processed values are added. + * @return void */ - function getProcessedValue($table, $fieldList, $row, &$info) { - - // Splitting values from $fieldList: + function getProcessedValue($table, $fieldList, array $row, array &$info) { + // Splitting values from $fieldList $fieldArr = explode(',', $fieldList); - // Traverse fields from $fieldList: + // Traverse fields from $fieldList foreach ($fieldArr as $field) { if ($row[$field]) { - $info[] = htmlspecialchars($this->itemLabels[$field]) . ' ' . htmlspecialchars(t3lib_BEfunc::getProcessedValue($table, $field, $row[$field])); + $info[] = '' . htmlspecialchars($this->itemLabels[$field]) . ' ' . htmlspecialchars(t3lib_BEfunc::getProcessedValue($table, $field, $row[$field])); } } } @@ -2190,4 +2212,4 @@ if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLA include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/cms/layout/class.tx_cms_layout.php']); } -?> \ No newline at end of file +?>