/** * Creates element for pasting files. * * @param string $path Path to the file/directory (target) * @param string $target target - NOT USED. * @param array $elInfo Various values for the labels. * @return array Item array, element in $menuItems * @internal */ public function FILE_paste($path, $target, $elInfo) { $loc = 'top.content.list_frame'; if ($this->backendUser->jsConfirmation(JsConfirmation::COPY_MOVE_PASTE)) { $conf = $loc . ' && confirm(' . GeneralUtility::quoteJSvalue(sprintf($this->languageService->sL('LLL:EXT:lang/locallang_core.xlf:mess.' . ($elInfo[2] === 'copy' ? 'copy' : 'move') . '_into'), $elInfo[0], $elInfo[1])) . ')'; } else { $conf = $loc; } $editOnClick = 'if(' . $conf . '){' . $loc . '.location.href=' . GeneralUtility::quoteJSvalue($this->clipObj->pasteUrl('_FILE', $path, 0) . '&redirect=') . '+top.rawurlencode(' . $this->frameLocation($loc . '.document') . '.pathname+' . $this->frameLocation($loc . '.document') . '.search); };top.nav.refresh();'; return $this->linkItem($this->label('pasteinto'), $this->iconFactory->getIcon('actions-document-paste-into', Icon::SIZE_SMALL)->render(), $editOnClick . 'return false;'); }
/** * Creates element for pasting files. * * @param string $path Path to the file/directory (target) * @param string $target target - NOT USED. * @param array $elInfo Various values for the labels. * @return array Item array, element in $menuItems * @internal */ public function FILE_paste($path, $target, $elInfo) { $loc = 'top.list_frame'; $jsCode = $loc . '.location.href=' . GeneralUtility::quoteJSvalue($this->clipObj->pasteUrl('_FILE', $path, 0) . '&redirect=') . '+top.rawurlencode(' . $this->frameLocation($loc . '.document') . '.pathname+' . $this->frameLocation($loc . '.document') . '.search); top.nav.refresh();'; if ($this->backendUser->jsConfirmation(JsConfirmation::COPY_MOVE_PASTE)) { $title = $this->languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_mod_web_list.xlf:clip_paste'); $confirmMessage = sprintf($this->languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:mess.' . ($elInfo[2] === 'copy' ? 'copy' : 'move') . '_into'), $elInfo[0], $elInfo[1]); $jsCode = 'top.TYPO3.Modal.confirm(' . GeneralUtility::quoteJSvalue($title) . ', ' . GeneralUtility::quoteJSvalue($confirmMessage) . ')' . '.on(\'button.clicked\', function(e) { if (e.target.name === \'ok\') {' . $jsCode . '} top.TYPO3.Modal.dismiss(); });'; } $editOnClick = 'if(' . $loc . ') { ' . $jsCode . ' }'; return $this->linkItem($this->label('pasteinto'), $this->iconFactory->getIcon('actions-document-paste-into', Icon::SIZE_SMALL)->render(), $editOnClick . 'return false;'); }