/** * Renders the HTML code for a single tt_content element * * @param PageLayoutView $parentObject : The parent object that triggered this hook * @param array $itemRow : The data row to be rendered as HTML * * @return string */ public function renderSingleElementHTML(PageLayoutView $parentObject, $itemRow) { $singleElementHTML = $parentObject->tt_content_drawHeader($itemRow, $parentObject->tt_contentConfig['showInfo'] ? 15 : 5, $parentObject->defLangBinding && $parentObject->lP > 0, TRUE); $isRTE = $parentObject->RTE && $parentObject->isRTEforField('tt_content', $itemRow, 'bodytext'); $singleElementHTML .= '<div ' . (!empty($itemRow['_ORIG_uid']) ? ' class="ver-element"' : '') . '><div class="t3-page-ce-body-inner t3-page-ce-body-inner-' . $itemRow['CType'] . '">' . $parentObject->tt_content_drawItem($itemRow, $isRTE) . '</div></div>'; $footerContent = ''; // Get processed values: $info = array(); $parentObject->getProcessedValue('tt_content', 'starttime,endtime,fe_group,spaceBefore,spaceAfter', $itemRow, $info); // Display info from records fields: if (count($info)) { $footerContent = '<div class="t3-page-ce-info"> ' . implode('<br />', $info) . ' </div>'; } // Wrap it if (!empty($footerContent)) { $singleElementHTML .= '<div class="t3-page-ce-footer">' . $footerContent . '</div>'; } return $singleElementHTML; }
/** * Draws the preview content for a content element * * @param string $row Content element * @param boolean $isRTE Set if the RTE link can be created. * @return string HTML * @throws \UnexpectedValueException */ public function tt_content_drawItem($row, $isRTE = FALSE) { if (!$this->validModuleConfig()) { return parent::tt_content_drawItem($row, $isRTE); } $result = parent::tt_content_drawItem($row, $isRTE); if ($this->allowLanguageNotificationLinesForRecord($row)) { $translations = array(); $translationRows = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordsByField('tt_content', 'l18n_parent', $row['uid']); if ($translationRows) { foreach ($translationRows as $translationRow) { $translations[$translationRow['sys_language_uid']] = $translationRow; } } $languageLines = array(); $lineCounter = 0; foreach ($this->getLanguagesForPage() as $languageId => $languageIconTitle) { $lineCounter = ($lineCounter + 1) % 2; $editVisibilityIcon = ''; if ($translations[$languageId]) { $lineContent = $this->linkEditContent(\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('tt_content', $translations[$languageId]), $translations[$languageId]); $languageIcon = $this->linkEditContent($this->languageFlag($languageId, FALSE), $translations[$languageId]); $buttonIcon = $this->linkEditContent(\TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-open'), $translations[$languageId]); $editVisibilityIcon = $this->getHideUnhideContent($translations[$languageId]); $hiddenField = $GLOBALS['TCA']['tt_content']['ctrl']['enablecolumns']['disabled']; $class = 'edit-existing-record' . ($translations[$languageId][$hiddenField] ? ' t3-page-ce t3-page-ce-hidden' : ''); } else { $lineContent = $this->linkLocalizeContent($this->getLanguageService()->sL('LLL:EXT:nxcondensedbelayout/Resources/Private/Language/Backend.xlf:tt_content.createTranslation'), $row, $languageId); $languageIcon = $this->linkLocalizeContent($this->languageFlag($languageId, FALSE), $row, $languageId); $buttonIcon = $this->linkLocalizeContent(\TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-page-new'), $row, $languageId); $class = 'create-new-translation'; } $languageLines[] = sprintf(self::ROW_TEMPLATE, $lineCounter + 3, $class, $languageIcon, $buttonIcon, $editVisibilityIcon, $lineContent); } $result .= sprintf(self::TABLE_TEMPLATE, join('', $languageLines)); } return $result; }
/** * @param array $row * @param PageLayoutView $dblist * @return string */ protected function drawElement(array $row, PageLayoutView $dblist) { $footerRenderMethod = new \ReflectionMethod($dblist, 'tt_content_drawFooter'); $footerRenderMethod->setAccessible(TRUE); $space = 0; $disableMoveAndNewButtons = FALSE; $langMode = $dblist->tt_contentConfig['languageMode']; $dragDropEnabled = FALSE; // Necessary for edit button in workspace. $dblist->tt_contentData['nextThree'][$row['uid']] = $row['uid']; $rendered = $dblist->tt_content_drawHeader($row, $space, $disableMoveAndNewButtons, $langMode, $dragDropEnabled); $rendered .= '<div class="t3-page-ce-body-inner">' . $dblist->tt_content_drawItem($row) . '</div>'; $rendered .= $footerRenderMethod->invokeArgs($dblist, array($row)); $rendered .= '</div>'; return $rendered; }
/** * Renders the HTML code for a single tt_content element * * @param PageLayoutView $parentObject : The parent object that triggered this hook * @param array $itemRow : The data row to be rendered as HTML * * @return string */ public function renderSingleElementHTML(PageLayoutView $parentObject, $itemRow) { // @todo $parentObject->lP is gone, defLangBinding is proably not enough for the third param to act correctly $singleElementHTML = $parentObject->tt_content_drawHeader($itemRow, $parentObject->tt_contentConfig['showInfo'] ? 15 : 5, $parentObject->defLangBinding, true, true); $singleElementHTML .= '<div ' . (!empty($itemRow['_ORIG_uid']) ? ' class="ver-element"' : '') . '><div class="t3-page-ce-body-inner t3-page-ce-body-inner-' . $itemRow['CType'] . '">' . $parentObject->tt_content_drawItem($itemRow) . '</div></div>'; $footerContent = ''; // Get processed values: $info = array(); $parentObject->getProcessedValue('tt_content', 'starttime,endtime,fe_group,spaceBefore,spaceAfter', $itemRow, $info); // Display info from records fields: if (!empty($info)) { $footerContent = '<div class="t3-page-ce-info"> ' . implode('<br />', $info) . ' </div>'; } // Wrap it if (!empty($footerContent)) { $singleElementHTML .= '<div class="t3-page-ce-footer">' . $footerContent . '</div>'; } return $singleElementHTML; }