iconFactory = $iconFactory; $this->uriBuilder = $uriBuilder; parent::__construct($backendLayoutView); } /** * {@inheritdoc} */ protected function insertPositionIcon(?array $row, int $colPos, int $pid): string { if ($this->saveAndClose) { $target = (string)$this->uriBuilder->buildUriFromRoute('tce_db', [ 'data' => [ 'tt_content' => [ StringUtility::getUniqueId('NEW') => array_replace($this->defVals, [ 'colPos' => $colPos, 'pid' => (is_array($row) ? -$row['uid'] : $pid), 'sys_language_uid' => $this->cur_sys_language, ]), ], ], 'redirect' => $this->R_URI, ]); } else { // @todo pass module context to this handler and pass to record_edit here $target = (string)$this->uriBuilder->buildUriFromRoute('record_edit', [ 'edit' => [ 'tt_content' => [ (is_array($row) ? -$row['uid'] : $pid) => 'new', ], ], 'returnUrl' => $this->R_URI, 'defVals' => [ 'tt_content' => array_replace($this->defVals, [ 'colPos' => $colPos, 'sys_language_uid' => $this->cur_sys_language, ]), ], ]); } $buttonLabel = htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:insertNewRecordHere')); return '