Esempio n. 1
0
    /**
     * renders a single column of a grid layout and sets the edit uid list
     *
     * @param PageLayoutView $parentObject : The parent object that triggered this hook
     * @param array $items : The content data of the column to be rendered
     * @param int $colPos : The column position we want to get the content for
     * @param array $gridContent : The rendered content data of the grid column
     * @param                $row
     * @param array $editUidList : determines if we will get edit icons or not
     *
     * @return void
     */
    public function renderSingleGridColumn(PageLayoutView $parentObject, &$items, &$colPos, &$gridContent, $row, &$editUidList)
    {
        $specificIds = Helper::getInstance()->getSpecificIds($row);
        if ($colPos < 32768) {
            if ($row['sys_language_uid']) {
                $language = (int) $row['sys_language_uid'];
            }
            $newParams = $parentObject->newContentElementOnClick($parentObject->id, '-1' . '&tx_gridelements_container=' . $specificIds['uid'] . '&tx_gridelements_columns=' . $colPos, $language);
        }
        $gridContent[$colPos] .= '
			<div class="t3-page-ce-wrapper">
				<div class="t3-page-ce-dropzone">
					<div class="t3-page-ce-wrapper-new-ce">
						<a href="#" onclick="' . htmlspecialchars($newParams) . '" title="' . $GLOBALS['LANG']->getLL('newInColumn', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-new') . '</a>
					</div>
			</div>';
        if (count($items) > 0) {
            foreach ($items as $itemRow) {
                if (is_array($itemRow)) {
                    $statusHidden = $parentObject->isDisabled('tt_content', $itemRow) ? ' t3-page-ce-hidden' : '';
                    $gridContent[$colPos] .= '
				<div class="t3-page-ce' . $statusHidden . '"><div class="t3-page-ce-dragitem">' . $this->renderSingleElementHTML($parentObject, $itemRow) . '</div></div>';
                    // New content element:
                    if ($parentObject->option_newWizard) {
                        $onClick = 'window.location.href=\'db_new_content_el.php?id=' . $itemRow['pid'] . '&sys_language_uid=' . $itemRow['sys_language_uid'] . '&colPos=' . $itemRow['colPos'] . '&uid_pid=' . -$itemRow['uid'] . '&returnUrl=' . rawurlencode(GeneralUtility::getIndpEnv('REQUEST_URI')) . '\';';
                    } else {
                        $params = '&edit[tt_content][' . -$itemRow['uid'] . ']=new';
                        $onClick = BackendUtility::editOnClick($params, $parentObject->backPath);
                    }
                    $gridContent[$colPos] .= '
				<div class="t3-page-ce-dropzone"><div class="t3-page-ce-new-ce">
					<a href="#" onclick="' . htmlspecialchars($onClick) . '" title="' . $GLOBALS['LANG']->getLL('newRecordHere', 1) . '">' . IconUtility::getSpriteIcon('actions-document-new') . '</a>
				</div></div></div>
					';
                    $editUidList[$colPos] .= $editUidList[$colPos] ? ',' . $itemRow['uid'] : $itemRow['uid'];
                }
            }
        }
        $gridContent[$colPos] .= '</div>';
    }
Esempio n. 2
0
 /**
  * @param array $rows
  * @param PageLayoutView $view
  * @return array
  */
 protected function processRecordOverlays(array $rows, PageLayoutView $view)
 {
     foreach ($rows as $index => &$record) {
         $record = $this->getWorkspaceVersionOfRecordOrRecordItself($record);
         BackendUtility::movePlhOL('tt_content', $record);
         if (TRUE === $this->isDeleteOrMovePlaceholder($record)) {
             unset($rows[$index]);
         } else {
             $record['isDisabled'] = $view->isDisabled('tt_content', $record);
         }
     }
     return $rows;
 }