2 namespace TYPO3\CMS\Backend\ClickMenu;
189 if ($this->iParts[2]) {
190 $this->listFrame =
true;
192 if ($this->iParts[2] == 2) {
193 $this->alwaysContentFrame =
true;
195 if (isset($this->iParts[1]) && $this->iParts[1] !==
'') {
196 $this->isDBmenu =
true;
198 $TSkey = ($this->isDBmenu ?
'page' :
'folder') . ($this->listFrame ?
'List' :
'Tree');
199 $this->disabledItems =
GeneralUtility::trimExplode(
',', $this->backendUser->getTSConfigVal(
'options.contextMenu.' . $TSkey .
'.disableItems'),
true);
200 $this->leftIcons = (bool)$this->backendUser->getTSConfigVal(
'options.contextMenu.options.leftIcons');
202 if (!$this->cmLevel) {
204 if ($this->isDBmenu) {
211 if ($this->isDBmenu) {
212 $CMcontent = $this->
printNewDBLevel($this->iParts[0], $this->iParts[1]);
236 $menuItems = array();
240 if ($table ===
'pages' && $uid === 0) {
244 if ($table ===
'pages' && in_array($uid, $this->backendUser->returnWebmounts())) {
248 $l10nOverlay =
false;
251 $l10nOverlay = (int)$this->rec[
$GLOBALS[
'TCA'][$table][
'ctrl'][
'transOrigPointerField']] != 0;
254 if (is_array($this->rec) || $root) {
256 $lCP = $this->backendUser->calcPerms(
BackendUtility::getRecord(
'pages', $table ===
'pages' ? $this->rec[
'uid'] : $this->rec[
'pid']));
258 if (!in_array(
'view', $this->disabledItems,
true)) {
259 if ($table ===
'pages') {
260 $menuItems[
'view'] = $this->
DB_view($uid);
262 if ($table ===
'tt_content') {
264 $menuItems[
'view'] = $this->
DB_view($ws_rec[
'pid']);
268 if (!$root && ($this->backendUser->isPSet($lCP, $table,
'edit') || $this->backendUser->isPSet($lCP, $table,
'editcontent'))) {
269 if (!in_array(
'edit', $this->disabledItems,
true)) {
270 $menuItems[
'edit'] = $this->
DB_edit($table, $uid);
272 $this->editOK =
true;
275 if (!in_array(
'new', $this->disabledItems,
true) && $this->backendUser->isPSet($lCP, $table,
'new')) {
276 $menuItems[
'new'] = $this->
DB_new($table, $uid);
279 if (!in_array(
'info', $this->disabledItems,
true) && !$root) {
280 $menuItems[
'info'] = $this->
DB_info($table, $uid);
282 $menuItems[
'spacer1'] =
'spacer';
284 if (!in_array(
'copy', $this->disabledItems,
true) && !$root && !$DBmount && !$l10nOverlay) {
285 $menuItems[
'copy'] = $this->
DB_copycut($table, $uid,
'copy');
288 if (!in_array(
'cut', $this->disabledItems,
true) && !$root && !$DBmount && !$l10nOverlay) {
289 $menuItems[
'cut'] = $this->
DB_copycut($table, $uid,
'cut');
292 $elFromAllTables = count($this->clipObj->elFromTable(
''));
293 if (!in_array(
'paste', $this->disabledItems,
true) && $elFromAllTables) {
294 $selItem = $this->clipObj->getSelectedRecord();
298 $this->clipObj->currentMode()
301 if ($elFromAllTables) {
302 $menuItems[
'pasteinto'] = $this->
DB_paste(
'', $uid,
'into', $elInfo);
305 $elFromTable = count($this->clipObj->elFromTable($table));
306 if (!$root && !$DBmount && $elFromTable &&
$GLOBALS[
'TCA'][$table][
'ctrl'][
'sortby']) {
307 $menuItems[
'pasteafter'] = $this->
DB_paste($table, -$uid,
'after', $elInfo);
313 if (!in_array(
'delete', $this->disabledItems,
true) && !$root && !$DBmount && $this->backendUser->isPSet($lCP, $table,
'delete')) {
314 $menuItems[
'spacer2'] =
'spacer';
315 $menuItems[
'delete'] = $this->
DB_delete($table, $uid, $elInfo);
317 if (!in_array(
'history', $this->disabledItems,
true)) {
318 $menuItems[
'history'] = $this->
DB_history($table, $uid, $elInfo);
321 $localItems = array();
322 if (!$this->cmLevel && !in_array(
'moreoptions', $this->disabledItems,
true)) {
325 $localItems[
'spacer3'] =
'spacer';
326 $localItems[
'moreoptions'] = $this->
linkItem(
327 $this->
label(
'more'),
333 $menuItemHideUnhideAllowed =
false;
336 if (isset(
$GLOBALS[
'TCA'][$table][
'ctrl'][
'enablecolumns'][
'disabled'])) {
337 $hiddenField =
$GLOBALS[
'TCA'][$table][
'ctrl'][
'enablecolumns'][
'disabled'];
339 $hiddenField !==
'' && !empty(
$GLOBALS[
'TCA'][$table][
'columns'][$hiddenField][
'exclude'])
340 && $this->backendUser->check(
'non_exclude_fields', $table .
':' . $hiddenField)
342 $menuItemHideUnhideAllowed =
true;
345 if ($menuItemHideUnhideAllowed && !in_array(
'hide', $this->disabledItems,
true)) {
346 $localItems[
'hide'] = $this->
DB_hideUnhide($table, $this->rec, $hiddenField);
348 $anyEnableColumnsFieldAllowed =
false;
350 if (isset(
$GLOBALS[
'TCA'][$table][
'ctrl'][
'enablecolumns'])) {
351 $columnsToCheck =
$GLOBALS[
'TCA'][$table][
'ctrl'][
'enablecolumns'];
352 if ($table ===
'pages' && !empty($columnsToCheck)) {
353 $columnsToCheck[] =
'extendToSubpages';
355 foreach ($columnsToCheck as $currentColumn) {
357 !empty(
$GLOBALS[
'TCA'][$table][
'columns'][$currentColumn][
'exclude'])
358 && $this->backendUser->check(
'non_exclude_fields', $table .
':' . $currentColumn)
360 $anyEnableColumnsFieldAllowed =
true;
364 if ($anyEnableColumnsFieldAllowed && !in_array(
'edit_access', $this->disabledItems,
true)) {
365 $localItems[
'edit_access'] = $this->
DB_editAccess($table, $uid);
367 if ($table ===
'pages' && $this->editPageIconSet && !in_array(
'edit_pageproperties', $this->disabledItems,
true)) {
373 $deleteFound =
false;
374 foreach ($menuItems as $key => $value) {
376 if ($key ===
'delete') {
385 array_splice($menuItems, $c, 0, $localItems);
387 $menuItems = array_merge($menuItems, $localItems);
395 if (!is_array($this->rec)) {
396 $this->rec = array();
416 $menuItems = array();
419 if ($table ===
'pages' && $uid === 0) {
423 if (is_array($this->rec) || $root) {
424 $lCP = $this->backendUser->calcPerms(
BackendUtility::getRecord(
'pages', $table ===
'pages' ? $this->rec[
'uid'] : $this->rec[
'pid']));
426 if (!$root && ($this->backendUser->isPSet($lCP, $table,
'edit') || $this->backendUser->isPSet($lCP, $table,
'editcontent'))) {
427 $this->editOK =
true;
433 if ($subname ===
'moreoptions') {
436 if (($table ===
'pages' || $table ===
'tt_content') && !in_array(
'move_wizard', $this->disabledItems,
true)) {
437 $localItems[
'move_wizard'] = $this->
DB_moveWizard($table, $uid, $this->rec);
439 if (($table ===
'pages' || $table ===
'tt_content') && !in_array(
'new_wizard', $this->disabledItems,
true)) {
440 $localItems[
'new_wizard'] = $this->
DB_newWizard($table, $uid, $this->rec);
442 if ($table ===
'pages' && !in_array(
'perms', $this->disabledItems,
true) && $this->backendUser->check(
'modules',
'system_BeuserTxPermission')) {
443 $localItems[
'perms'] = $this->
DB_perms($table, $uid, $this->rec);
445 if (!in_array(
'db_list', $this->disabledItems,
true) && $this->backendUser->check(
'modules',
'web_list')) {
446 $localItems[
'db_list'] = $this->
DB_db_list($table, $uid, $this->rec);
450 if ($table ===
'pages') {
454 $menuItems = array_merge($menuItems, $localItems);
458 if (!is_array($menuItems)) {
459 $menuItems = array();
485 if (is_array($this->extClassArray)) {
486 foreach ($this->extClassArray as $conf) {
488 $menuItems = $obj->main($this, $menuItems, $table, $uid);
505 $loc =
'top.content.list_frame';
506 return ($overrideLoc ?
'var docRef=' . $overrideLoc :
'var docRef=(top.content.list_frame)?top.content.list_frame:' . $loc)
524 if ($this->clipObj->current ===
'normal') {
525 $isSel = $this->clipObj->isSelected($table, $uid);
528 if ($this->listFrame) {
529 $addParam[
'reloadListFrame'] = $this->alwaysContentFrame ? 2 : 1;
531 $icon = $this->iconFactory->getIcon(
'actions-edit-' . $type . ($isSel === $type ?
'-release' :
''),
Icon::SIZE_SMALL)->render();
535 'TYPO3.ClickMenu.fetch(' .
GeneralUtility::quoteJSvalue($this->clipObj->selUrlDB($table, $uid, ($type ===
'copy' ? 1 : 0), ($isSel == $type), $addParam)) .
');return false;'
551 public function DB_paste($table, $uid, $type, $elInfo)
553 $loc =
'top.content.list_frame';
555 $conf = $loc .
' && confirm(' .
GeneralUtility::quoteJSvalue(sprintf($this->languageService->sL((
'LLL:EXT:lang/locallang_core.xlf:mess.' . ($elInfo[2] ===
'copy' ?
'copy' :
'move') .
'_' . $type)), $elInfo[0], $elInfo[1])) .
')';
559 $editOnClick =
'if(' . $conf .
'){' . $loc .
'.location.href=' .
GeneralUtility::quoteJSvalue($this->clipObj->pasteUrl($table, $uid, 0) .
'&redirect=') .
'+top.rawurlencode(' . $this->
frameLocation(($loc .
'.document')) .
'.pathname+' . $this->
frameLocation(($loc .
'.document')) .
'.search);}';
561 $this->
label(
'paste' . $type),
562 $this->iconFactory->getIcon(
'actions-document-paste-' . $type,
Icon::SIZE_SMALL)->render(),
563 $editOnClick .
'return false;'
578 $this->
label(
'info'),
579 $this->iconFactory->getIcon(
'actions-document-info',
Icon::SIZE_SMALL)->render(),
594 $url = BackendUtility::getModuleUrl(
'record_history', array(
'element' => $table .
':' . $uid));
596 $this->languageService->makeEntities($this->languageService->getLL(
'CM_history')),
597 $this->iconFactory->getIcon(
'actions-document-history-open',
Icon::SIZE_SMALL)->render(),
621 if (
$rec[
'perms_userid'] == $this->backendUser->user[
'uid'] || $this->backendUser->isAdmin()) {
622 $parameters[
'return_id'] = $uid;
623 $parameters[
'edit'] =
'1';
626 $url = BackendUtility::getModuleUrl(
'system_BeuserTxPermission', $parameters);
628 $this->languageService->makeEntities($this->languageService->getLL(
'CM_perms')),
629 $this->iconFactory->getIcon(
'status-status-locked',
Icon::SIZE_SMALL)->render(),
645 $urlParams = array();
646 $urlParams[
'id'] = $table ===
'pages' ? $uid :
$rec[
'pid'];
647 $urlParams[
'table'] = $table ===
'pages' ?
'' : $table;
648 $url = BackendUtility::getModuleUrl(
'web_list', $urlParams,
'',
true);
650 $this->languageService->makeEntities($this->languageService->getLL(
'CM_db_list')),
651 $this->iconFactory->getIcon(
'actions-system-list-open',
Icon::SIZE_SMALL)->render(),
668 $url = BackendUtility::getModuleUrl(
'move_element') .
'&table=' . $table .
'&uid=' . $uid;
669 $url .= ($table ===
'tt_content' ?
'&sys_language_uid=' . (int)
$rec[
'sys_language_uid'] :
'');
671 $this->languageService->makeEntities($this->languageService->getLL(
'CM_moveWizard' . ($table ===
'pages' ?
'_page' :
''))),
672 $this->iconFactory->getIcon(
'actions-' . ($table ===
'pages' ?
'page' :
'document') .
'-move',
Icon::SIZE_SMALL)->render(),
688 if ($table ===
'pages') {
689 $url = BackendUtility::getModuleUrl(
'db_new', [
'id' => $uid,
'pagesOnly' => 1]);
693 $newContentWizardModuleName = $tsConfig[
'properties'][
'newContentElementWizard.'][
'override'] ?:
'new_content_element';
694 $url = BackendUtility::getModuleUrl($newContentWizardModuleName, [
'id' =>
$rec[
'pid'],
'sys_language_uid' => (
int)
$rec[
'sys_language_uid']]);
697 $this->languageService->makeEntities($this->languageService->getLL(
'CM_newWizard')),
698 $this->iconFactory->getIcon(($table ===
'pages' ?
'actions-page-new' :
'actions-document-new'),
Icon::SIZE_SMALL)->render(),
713 $url = BackendUtility::getModuleUrl(
'record_edit', array(
714 'columnsOnly' => rawurlencode((implode(
',',
$GLOBALS[
'TCA'][$table][
'ctrl'][
'enablecolumns']) . ($table ===
'pages' ?
',extendToSubpages' :
''))),
715 'edit[' . $table .
'][' . $uid .
']' =>
'edit'
718 $this->languageService->makeEntities($this->languageService->getLL(
'CM_editAccess')),
719 $this->iconFactory->getIcon(
'actions-document-edit-access',
Icon::SIZE_SMALL)->render(),
734 $url = BackendUtility::getModuleUrl(
'record_edit', array(
735 'edit[pages][' . $uid .
']' =>
'edit'
738 $this->languageService->makeEntities($this->languageService->getLL(
'CM_editPageProperties')),
739 $this->iconFactory->getIcon(
'actions-page-open',
Icon::SIZE_SMALL)->render(),
756 $newPageModule = trim($this->backendUser->getTSConfigVal(
'options.overridePageModule'));
758 $loc =
'top.content.list_frame';
759 $theIcon = $this->iconFactory->getIcon(
'actions-document-open',
Icon::SIZE_SMALL)->render();
761 $link = BackendUtility::getModuleUrl(
'record_edit', array(
762 'edit[' . $table .
'][' . $uid .
']' =>
'edit'
765 if ($this->iParts[0] ===
'pages' && $this->iParts[1] && $this->backendUser->check(
'modules', $pageModule)) {
766 $this->editPageIconSet =
true;
769 return $this->
linkItem($this->
label(
'edit'), $theIcon, $editOnClick .
';');
782 $frame =
'top.content.list_frame';
784 $module = $this->listFrame
785 ?
GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl(
'record_edit', array(
'edit[' . $table .
'][-' . $uid .
']' =>
'new')) .
'&returnUrl=') .
'+top.rawurlencode(' . $location .
'.pathname+' . $location .
'.search)'
787 $editOnClick =
'if(' . $frame .
'){' . $frame .
'.location.href=' . $module .
';}';
788 $icon = $this->iconFactory->getIcon(
'actions-' . ($table ===
'pages' ?
'page' :
'document') .
'-new',
Icon::SIZE_SMALL)->render();
789 return $this->
linkItem($this->
label(
'new'), $icon, $editOnClick);
803 $loc =
'top.content.list_frame';
809 $editOnClick =
'if(' . $loc .
' && ' . $conf .
' ){' . $loc .
'.location.href=' .
813 '&cmd[' . $table .
'][' . $uid .
'][delete]=1&prErr=1&vC=' . $this->backendUser->veriCode()
815 if ($table ===
'pages') {
816 $editOnClick .=
'top.nav.refresh.defer(500, top.nav);';
819 $this->
label(
'delete'),
820 $this->iconFactory->getIcon(
'actions-edit-delete',
Icon::SIZE_SMALL)->render(),
821 $editOnClick .
'return false;'
835 $icon = $this->iconFactory->getIcon(
'actions-document-view',
Icon::SIZE_SMALL)->render();
849 $this->
label(
'tempMountPoint'),
850 $this->iconFactory->getIcon(
'apps-pagetree-page-mountpoint',
Icon::SIZE_SMALL)->render(),
851 'if (top.content.nav_frame) {
852 var node = top.TYPO3.Backend.NavigationContainer.PageTree.getSelected();
860 id: ' . (int)$page_id .
'
865 node.ownerTree.commandProvider.mountAsTreeRoot(useNode, node.ownerTree);
895 $uid =
$rec[
'_ORIG_uid'] ?:
$rec[
'uid'];
896 $loc =
'top.content.list_frame';
897 $editOnClick =
'if(' . $loc .
'){' . $loc .
'.location.href=' .
901 '&data[' . $table .
'][' . $uid .
'][' . $flagField .
']=' . (
$rec[$flagField] ? 0 : 1) .
'&prErr=1&vC=' . $this->backendUser->veriCode()
903 if ($table ===
'pages') {
904 $editOnClick .=
'top.nav.refresh.defer(500, top.nav);';
908 $this->iconFactory->getIcon(
'actions-edit-' . (
$rec[$flagField] ?
'un' :
'') .
'hide',
Icon::SIZE_SMALL)->render(),
909 $editOnClick .
'return false;',
930 $menuItems = array();
931 $combinedIdentifier = rawurldecode($combinedIdentifier);
933 ->retrieveFileOrFolderObject($combinedIdentifier);
936 $isStorageRoot =
false;
938 $userMayViewStorage =
false;
939 $userMayEditStorage =
false;
940 $identifier = $fileObject->getCombinedIdentifier();
941 if ($fileObject instanceof
Folder) {
942 $icon =
'<span title="' . htmlspecialchars($fileObject->getName()) .
'" class="absmiddle">'
943 . $this->iconFactory->getIconForResource($fileObject,
Icon::SIZE_SMALL)->render()
946 if ($fileObject->getIdentifier() === $fileObject->getStorage()->getRootLevelFolder()->getIdentifier()) {
947 $isStorageRoot =
true;
948 if ($this->backendUser->check(
'tables_select',
'sys_file_storage')) {
949 $userMayViewStorage =
true;
951 if ($this->backendUser->check(
'tables_modify',
'sys_file_storage')) {
952 $userMayEditStorage =
true;
955 if (!$fileObject->getStorage()->isOnline()) {
960 $icon =
'<span class="absmiddle" title="' . htmlspecialchars($title) .
'">'
961 . $this->iconFactory->getIconForResource($fileObject,
Icon::SIZE_SMALL)->render()
965 if (!in_array(
'hide', $this->disabledItems,
true) && $isStorageRoot && $userMayEditStorage) {
971 $this->
label($record[
'is_online'] ?
'offline' :
'online'),
976 if (!in_array(
'edit', $this->disabledItems,
true) && $fileObject->checkActionPermission(
'write')) {
977 if (!$folder && !$isStorageRoot && $fileObject->isIndexed() && $this->backendUser->check(
'tables_modify',
'sys_file_metadata')) {
978 $metaData = $fileObject->_getMetaData();
979 $menuItems[
'edit2'] = $this->
DB_edit(
'sys_file_metadata', $metaData[
'uid']);
981 if (!$folder &&
GeneralUtility::inList(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'textfile_ext'], $fileObject->getExtension()) && $fileObject->checkActionPermission(
'write')) {
982 $menuItems[
'edit'] = $this->
FILE_launch($identifier,
'file_edit',
'editcontent',
'actions-page-open');
983 }
elseif ($isStorageRoot && $userMayEditStorage) {
984 $menuItems[
'edit'] = $this->
DB_edit(
'sys_file_storage', $fileObject->getStorage()->getUid());
988 if (!in_array(
'rename', $this->disabledItems,
true) && !$isStorageRoot && $fileObject->checkActionPermission(
'rename')) {
989 $menuItems[
'rename'] = $this->
FILE_launch($identifier,
'file_rename',
'rename',
'actions-edit-rename');
992 if (!in_array(
'upload', $this->disabledItems,
true) && $folder && $isOnline && $fileObject->checkActionPermission(
'write')) {
993 $menuItems[
'upload'] = $this->
FILE_launch($identifier,
'file_upload',
'upload',
'actions-edit-upload');
996 if (!in_array(
'new', $this->disabledItems,
true) && $folder && $isOnline && $fileObject->checkActionPermission(
'write')) {
997 $menuItems[
'new'] = $this->
FILE_launch($identifier,
'file_newfolder',
'new',
'actions-document-new');
1000 if (!in_array(
'info', $this->disabledItems,
true) && $fileObject->checkActionPermission(
'read')) {
1001 if ($isStorageRoot && $userMayViewStorage) {
1002 $menuItems[
'info'] = $this->
DB_info(
'sys_file_storage', $fileObject->getStorage()->getUid());
1004 $menuItems[
'info'] = $this->
fileInfo($identifier);
1007 $menuItems[] =
'spacer';
1009 if (!in_array(
'copy', $this->disabledItems,
true) && !$isStorageRoot && $fileObject->checkActionPermission(
'read')) {
1010 $menuItems[
'copy'] = $this->
FILE_copycut($identifier,
'copy');
1013 if (!in_array(
'cut', $this->disabledItems,
true) && !$isStorageRoot && $fileObject->checkActionPermission(
'move')) {
1014 $menuItems[
'cut'] = $this->
FILE_copycut($identifier,
'cut');
1017 $elFromAllTables = count($this->clipObj->elFromTable(
'_FILE'));
1018 if (!in_array(
'paste', $this->disabledItems,
true) && $elFromAllTables && $folder && $fileObject->checkActionPermission(
'write')) {
1019 $elArr = $this->clipObj->elFromTable(
'_FILE');
1020 $selItem = reset($elArr);
1024 $fileOrFolderInClipBoard->getName(),
1025 $clickedFileOrFolder->getName(),
1026 $this->clipObj->currentMode()
1028 if (!$fileOrFolderInClipBoard instanceof Folder || !$fileOrFolderInClipBoard->getStorage()->isWithinFolder($fileOrFolderInClipBoard, $clickedFileOrFolder)) {
1029 $menuItems[
'pasteinto'] = $this->
FILE_paste($identifier, $selItem, $elInfo);
1032 $menuItems[] =
'spacer';
1034 if (!in_array(
'delete', $this->disabledItems,
true) && $fileObject->checkActionPermission(
'delete')) {
1035 if ($isStorageRoot && $userMayEditStorage) {
1037 $menuItems[
'delete'] = $this->
DB_delete(
'sys_file_storage', $fileObject->getStorage()->getUid(), $elInfo);
1038 }
elseif (!$isStorageRoot) {
1039 $menuItems[
'delete'] = $this->
FILE_delete($identifier);
1073 public function FILE_launch($path, $moduleName, $type, $iconName, $noReturnUrl =
false)
1075 $loc =
'top.content.list_frame';
1077 if (strpos($moduleName,
'.php') !==
false) {
1079 'Using a php file directly in ClickMenu is deprecated since TYPO3 CMS 7, and will be removed in CMS 8.'
1080 .
' Register the class as module and use BackendUtility::getModuleUrl() to get the right link.'
1081 .
' For examples how to do this see ext_tables.php of EXT:backend.'
1083 $scriptUrl = $moduleName;
1085 $scriptUrl = BackendUtility::getModuleUrl($moduleName);
1088 $editOnClick =
'if(' . $loc .
'){' . $loc .
'.location.href=' .
GeneralUtility::quoteJSvalue($scriptUrl .
'&target=' . rawurlencode($path)) . ($noReturnUrl ?
'' :
'+\'&returnUrl=\'+top.rawurlencode(' . $this->
frameLocation($loc .
'.document') .
'.pathname+' . $this->
frameLocation($loc .
'.document') .
'.search)') .
';}';
1090 $this->
label($type),
1092 $editOnClick .
'top.nav.refresh();'
1109 $uid = GeneralUtility::shortmd5($path);
1110 if ($this->clipObj->current ===
'normal') {
1111 $isSel = $this->clipObj->isSelected($table, $uid);
1113 $addParam = array();
1114 if ($this->listFrame) {
1115 $addParam[
'reloadListFrame'] = $this->alwaysContentFrame ? 2 : 1;
1118 $this->
label($type),
1119 $this->iconFactory->getIcon(
'actions-edit-' . $type . ($isSel === $type ?
'-release' :
''),
Icon::SIZE_SMALL)->render(),
1120 'TYPO3.ClickMenu.fetch(' .
GeneralUtility::quoteJSvalue($this->clipObj->selUrlFile($path, ($type ===
'copy' ? 1 : 0), ($isSel == $type), $addParam)) .
');return false;'
1133 $loc =
'top.content.list_frame';
1135 $conf =
'confirm(' .
GeneralUtility::quoteJSvalue((sprintf($this->languageService->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.delete'), basename($path)) .
BackendUtility::referenceCount(
'_FILE', $path,
' ' . $this->languageService->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.referencesToFile')))) .
')';
1139 $editOnClick =
'if(' . $loc .
' && ' . $conf .
' ){' . $loc .
'.location.href=' .
1143 '&file[delete][0][data]=' . rawurlencode($path) .
'&vC=' . $this->backendUser->veriCode()
1146 $this->
label(
'delete'),
1147 $this->iconFactory->getIcon(
'actions-edit-delete',
Icon::SIZE_SMALL)->render(),
1148 $editOnClick .
'return false;'
1163 $loc =
'top.content.list_frame';
1165 $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])) .
')';
1169 $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();';
1171 $this->
label(
'pasteinto'),
1172 $this->iconFactory->getIcon(
'actions-document-paste-into',
Icon::SIZE_SMALL)->render(),
1173 $editOnClick .
'return false;'
1185 return $this->
DB_info(
'_FILE', $identifier);
1203 $menuItems = array();
1205 if ($table ===
'pages') {
1216 if ($table ===
'folders') {
1254 $negativeSign = $into ===
'into' ?
'' :
'-';
1255 $loc =
'top.content.list_frame';
1256 $editOnClick =
'if(' . $loc .
'){' . $loc .
'.document.location=' .
1260 '&cmd[pages][' . $srcUid .
'][' . $action .
']=' . $negativeSign . $dstUid .
'&prErr=1&vC=' .
1261 $this->backendUser->veriCode()
1262 ) .
';};top.nav.refresh();';
1264 $this->
label($action .
'Page_' . $into),
1265 $this->iconFactory->getIcon(
'actions-document-paste-' . $into,
Icon::SIZE_SMALL)->render(),
1266 $editOnClick .
'return false;'
1281 $loc =
'top.content.list_frame';
1282 $editOnClick =
'if(' . $loc .
'){' . $loc .
'.document.location=' .
1286 '&file[' . $action .
'][0][data]=' . $srcPath .
'&file[' . $action .
'][0][target]=' . $dstPath .
'&prErr=1&vC=' .
1287 $this->backendUser->veriCode()
1288 ) .
';};top.nav.refresh();';
1290 $this->
label($action .
'Folder_into'),
1291 $this->iconFactory->getIcon(
'apps-pagetree-drag-move-into',
Icon::SIZE_SMALL)->render(),
1292 $editOnClick .
'return false;'
1330 <div class="typo3-CSM-wrapperCM">
1331 <table border="0" cellpadding="0" cellspacing="0" class="typo3-CSM">
1334 return '<data><clickmenu><htmltable><![CDATA[' . $CMtable .
']]></htmltable><cmlevel>' . $this->cmLevel .
'</cmlevel></clickmenu></data>';
1349 return '<div class="typo3-CSM-wrapperCM">
1363 foreach ($menuItems as $cc => $i) {
1365 if (is_string($i) && $i ===
'spacer') {
1367 <tr style="height: 1px;" class="bgColor2">
1368 <td colspan="2"></td>
1373 $onClick = preg_replace(
'/return[[:space:]]+hideCM\\(\\)[[:space:]]*;/i',
'', $onClick);
1374 $onClick = preg_replace(
'/return[[:space:]]+false[[:space:]]*;/i',
'', $onClick);
1375 $onClick = preg_replace(
'/hideCM\\(\\);/i',
'', $onClick);
1377 $onClick .=
'TYPO3.ClickMenu.hideAll();';
1379 $CSM =
' oncontextmenu="this.click();return false;"';
1381 <tr class="typo3-CSM-itemRow" onclick="' . htmlspecialchars($onClick) .
'"' . $CSM .
'>
1382 ' . (!$this->leftIcons ?
'<td class="typo3-CSM-item">' . $i[1] .
'</td><td align="center">' . $i[2] .
'</td>' :
'<td align="center">' . $i[2] .
'</td><td class="typo3-CSM-item">' . $i[1] .
'</td>') .
'
1400 if (is_array($newMenuItems)) {
1403 foreach ($posArr as $pos) {
1407 $pointer = count($menuItems);
1410 switch (strtolower($place)) {
1417 if ((
string)key($menuItems) === $menuEntry) {
1422 if (!next($menuItems)) {
1430 if ($place ===
'before') {
1432 if ($placeExtra ===
'spacer' and prev($menuItems) ===
'spacer') {
1435 }
elseif ($place ===
'after') {
1436 if ($placeExtra ===
'spacer' and next($menuItems) ===
'spacer') {
1443 if (strtolower($place) ===
'top') {
1446 $pointer = count($menuItems);
1456 $pointer = max(0, $pointer);
1457 $menuItemsBefore = array_slice($menuItems, 0, $pointer ?: 0);
1458 $menuItemsAfter = array_slice($menuItems, $pointer);
1459 $menuItems = $menuItemsBefore + $newMenuItems + $menuItemsAfter;
1474 public function linkItem($str, $icon, $onClick, $onlyCM = 0, $dontHide = 0)
1476 $onClick = str_replace(
'top.loadTopMenu',
'showClickmenu_raw', $onClick);
1478 '<a href="#" onclick="' . htmlspecialchars($onClick) .
'">' . $str . $icon .
'</a>',
1497 return $this->backendUser->uc[
'noMenuMode'] && $this->backendUser->uc[
'noMenuMode'] !==
'icons' ?
'' :
' ' . $iconCode;
1508 if ($this->iParts[3]) {
1510 if ($this->iParts[3][0] ===
'+') {
1511 $this->iParts[3] = substr($this->iParts[3], 1);
1519 $newMenuArray = array();
1520 foreach ($menuItems as $key => $value) {
1522 $newMenuArray[$key] = $value;
1525 $menuItems = $newMenuArray;
1529 foreach ($elements as $value) {
1530 unset($menuItems[$value]);
1547 $prevItemWasSpacer =
false;
1548 foreach ($menuItems as $key => $value) {
1549 if (is_string($value) && $value ===
'spacer') {
1550 if ($prevItemWasSpacer) {
1551 unset($menuItems[$key]);
1553 $prevItemWasSpacer =
true;
1555 $prevItemWasSpacer =
false;
1560 $key = key($menuItems);
1561 $value = current($menuItems);
1562 if (is_string($value) && $value ===
'spacer') {
1563 unset($menuItems[$key]);
1567 $key = key($menuItems);
1568 $value = current($menuItems);
1569 if (is_string($value) && $value ===
'spacer') {
1570 unset($menuItems[$key]);
1584 return $this->languageService->makeEntities($this->languageService->sL(
'LLL:EXT:lang/locallang_core.xlf:cm.' . $label,
true));
1605 return $str .
'.location';