‪TYPO3CMS  ‪main
Clipboard.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use Psr\Http\Message\ServerRequestInterface;
22 use TYPO3\CMS\Backend\Utility\BackendUtility;
30 use TYPO3\CMS\Core\Imaging\IconSize;
41 
48 {
68  public array ‪$clipData = [];
69 
70  public bool ‪$changed = false;
71 
72  public string ‪$current = '';
73 
74  public bool ‪$lockToNormal = false;
75 
76  public int ‪$numberOfPads = 3;
77 
81 
82  protected ?ServerRequestInterface ‪$request = null;
83 
85  {
86  $this->iconFactory = ‪$iconFactory;
87  $this->uriBuilder = ‪$uriBuilder;
88  $this->resourceFactory = ‪$resourceFactory;
89  }
90 
91  /*****************************************
92  *
93  * Initialize
94  *
95  ****************************************/
99  public function ‪initializeClipboard(?ServerRequestInterface ‪$request = null): void
100  {
101  // Initialize the request
102  // @todo: Clipboard does two things: It is a repository to find out which records
103  // are in the clipboard, and it is a class to help with rendering the
104  // clipboard. $request is optional and only used in rendering.
105  // It would be better to split these two aspects into single classes.
106  $this->request = ‪$request ?? ‪$GLOBALS['TYPO3_REQUEST'] ?? null;
107 
108  $userTsConfig = $this->‪getBackendUser()->getTSConfig();
109  // Get data
110  $clipData = $this->‪getBackendUser()->getModuleData('clipboard', !empty($userTsConfig['options.']['saveClipboard']) ? '' : 'ses') ?: [];
111  ‪$clipData += ['normal' => []];
112  $this->numberOfPads = ‪MathUtility::forceIntegerInRange((int)($userTsConfig['options.']['clipboardNumberPads'] ?? 3), 0, 20);
113  // Resets/reinstates the clipboard pads
114  $this->clipData['normal'] = is_array(‪$clipData['normal']) ? ‪$clipData['normal'] : [];
115  for ($a = 1; $a <= ‪$this->numberOfPads; $a++) {
116  $index = 'tab_' . $a;
117  $this->clipData[$index] = is_iterable(‪$clipData[$index] ?? null) ? ‪$clipData[$index] : [];
118  }
119  // Setting the current pad pointer ($this->current))
120  ‪$current = (string)(‪$clipData['current'] ?? '');
121  $this->current = isset($this->clipData[‪$current]) ? ‪$current : 'normal';
122  $this->clipData['current'] = ‪$this->current;
123  }
124 
130  public function ‪lockToNormal(): void
131  {
132  $this->‪lockToNormal = true;
133  $this->current = 'normal';
134  }
135 
147  public function ‪setCmd(array $cmd): void
148  {
149  $cmd['el'] ??= [];
150  $cmd['el'] = is_iterable($cmd['el']) ? $cmd['el'] : [];
151  foreach ($cmd['el'] as $key => $value) {
152  if ($this->current === 'normal') {
153  unset($this->clipData['normal']);
154  }
155  if ($value) {
156  $this->clipData[‪$this->current]['el'][$key] = $value;
157  } else {
158  $this->‪removeElement((string)$key);
159  }
160  $this->changed = true;
161  }
162  // Change clipboard pad (if not locked to normal)
163  if ($cmd['setP'] ?? false) {
164  $this->‪setCurrentPad((string)$cmd['setP']);
165  }
166  // Remove element (value = item ident: DB; '[tablename]|[uid]' FILE: '_FILE|[md5 hash of path]'
167  if ($cmd['remove'] ?? false) {
168  $this->‪removeElement((string)$cmd['remove']);
169  $this->changed = true;
170  }
171  // Remove all on current pad (value = pad-ident)
172  if ($cmd['removeAll'] ?? false) {
173  $this->clipData[$cmd['removeAll']] = [];
174  $this->changed = true;
175  }
176  // Set copy mode of the tab
177  if (isset($cmd['setCopyMode'])) {
178  $this->clipData[‪$this->current]['mode'] = $cmd['setCopyMode'] ? 'copy' : '';
179  $this->changed = true;
180  }
181  }
182 
188  public function ‪setCurrentPad(string $padIdentifier): void
189  {
190  // Change clipboard pad (if not locked to normal)
191  if (!$this->‪lockToNormal && $this->current !== $padIdentifier) {
192  if (isset($this->clipData[$padIdentifier])) {
193  $this->clipData['current'] = ($this->current = $padIdentifier);
194  }
195  if ($this->current !== 'normal' || !$this->‪isElements()) {
196  $this->clipData[‪$this->current]['mode'] = '';
197  }
198  // Setting mode to default (move) if no items on it or if not 'normal'
199  $this->changed = true;
200  }
201  }
202 
207  public function ‪endClipboard(): void
208  {
209  if ($this->changed) {
210  $this->‪saveClipboard();
211  }
212  $this->changed = false;
213  }
214 
223  public function ‪cleanUpCBC(array $CBarr, string $table, bool $removeDeselected = false): array
224  {
225  foreach ($CBarr as $reference => $value) {
226  $referenceTable = (string)(explode('|', $reference)[0] ?? '');
227  if ($referenceTable !== $table || ($removeDeselected && !$value)) {
228  unset($CBarr[$reference]);
229  }
230  }
231  return $CBarr;
232  }
233 
234  public function ‪getClipboardData(string $table = ''): array
235  {
236  $lang = $this->‪getLanguageService();
237 
238  $clipboardData = [
239  'current' => ‪$this->current,
240  'copyMode' => $this->‪currentMode(),
241  'elementCount' => count($this->‪elFromTable($table)),
242  ];
243 
244  // Initialize tabs by adding the "normal" tab
245  $tabs = [
246  [
247  'identifier' => 'normal',
248  'info' => $this->‪getTabInfo('normal', $table),
249  'title' => $lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.normal'),
250  'description' => $lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.normal-description'),
251  'items' => $this->current === 'normal' ? $this->‪getTabItems('normal', $table) : [],
252  ],
253  ];
254  // Add numeric tabs
255  for ($a = 1; $a <= ‪$this->numberOfPads; $a++) {
256  $tabs[] = [
257  'identifier' => 'tab_' . $a,
258  'info' => $this->‪getTabInfo('tab_' . $a, $table),
259  'title' => sprintf($lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.cliptabs-name'), (string)$a),
260  'description' => $lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.cliptabs-description'),
261  'items' => $this->current === 'tab_' . $a ? $this->‪getTabItems('tab_' . $a, $table) : [],
262  ];
263  }
264  // Add tabs to clipboard Data
265  $clipboardData['tabs'] = $tabs;
266 
267  return $clipboardData;
268  }
269 
276  protected function ‪getTabItems(string $padIdentifier, string $currentTable): array
277  {
278  if (!is_array($this->clipData[$padIdentifier]['el'] ?? false)) {
279  return [];
280  }
281 
282  $records = [];
283  foreach ($this->clipData[$padIdentifier]['el'] as $reference => $value) {
284  if (!$value) {
285  // Skip element if empty value
286  continue;
287  }
288  [$table, ‪$uid] = explode('|', $reference);
289  // Rendering files/directories on the clipboard
290  if ($table === '_FILE') {
291  $fileObject = $this->resourceFactory->retrieveFileOrFolderObject($value);
292  if ($fileObject) {
293  $thumb = '';
294  $folder = $fileObject instanceof ‪Folder;
295  $size = $folder ? '' : '(' . GeneralUtility::formatSize((int)$fileObject->getSize()) . 'bytes)';
297  if (!$folder && ($fileObject->isImage() || $fileObject->isMediaFile())) {
298  $processedFile = $fileObject->process(
300  [
301  'width' => 64,
302  'height' => 64,
303  ]
304  );
305 
306  $thumb = '<img src="' . htmlspecialchars($processedFile->getPublicUrl() ?? '') . '" ' .
307  'width="' . htmlspecialchars((string)$processedFile->getProperty('width')) . '" ' .
308  'height="' . htmlspecialchars((string)$processedFile->getProperty('height')) . '" ' .
309  'title="' . htmlspecialchars($processedFile->getName()) . '" alt="" />';
310  }
311  $linkItemText = ‪GeneralUtility::fixed_lgd_cs($fileObject->getName(), (int)($this->getBackendUser()->uc['titleLen'] ?? 0));
312  $combinedIdentifier = ($parentFolder = $fileObject->getParentFolder()) instanceof ‪Folder ? $parentFolder->‪getCombinedIdentifier() : '';
313  $filesRequested = $currentTable === '_FILE';
314  $records[] = [
315  'identifier' => '_FILE|' . md5($value),
316  'icon' => $this->iconFactory
317  ->getIconForResource($fileObject, IconSize::SMALL)
318  ->setTitle($fileObject->getName() . ' ' . $size)
319  ->render(),
320  'title' => $this->‪linkItemText(htmlspecialchars($linkItemText), $combinedIdentifier, $filesRequested),
321  'thumb' => $thumb,
322  'infoDataDispatch' => [
323  'action' => 'TYPO3.InfoWindow.showItem',
324  'args' => GeneralUtility::jsonEncodeForHtmlAttribute([$table, $value], false),
325  ],
326  ];
327  } else {
328  // If the file did not exist (or is illegal) then it is removed from the clipboard immediately:
329  unset($this->clipData[$padIdentifier]['el'][$reference]);
330  $this->changed = true;
331  }
332  } else {
333  // Rendering records:
334  ‪$record = BackendUtility::getRecordWSOL($table, (int)‪$uid);
335  if (is_array(‪$record)) {
336  $isRequestedTable = $currentTable !== '_FILE';
337  $records[] = [
338  'identifier' => $table . '|' . ‪$uid,
339  'icon' => $this->iconFactory->getIconForRecord($table, ‪$record, IconSize::SMALL)->render(),
340  'title' => $this->‪linkItemText(htmlspecialchars(‪GeneralUtility::fixed_lgd_cs(BackendUtility::getRecordTitle(
341  $table,
342  ‪$record
343  ), (int)$this->‪getBackendUser()->uc['titleLen'])), ‪$record, $isRequestedTable),
344  'infoDataDispatch' => [
345  'action' => 'TYPO3.InfoWindow.showItem',
346  'args' => GeneralUtility::jsonEncodeForHtmlAttribute([$table, (int)‪$uid], false),
347  ],
348  ];
349 
350  $localizationData = $this->‪getLocalizations($table, ‪$record, $isRequestedTable);
351  if (!empty($localizationData)) {
352  $records = array_merge($records, $localizationData);
353  }
354  } else {
355  unset($this->clipData[$padIdentifier]['el'][$reference]);
356  $this->changed = true;
357  }
358  }
359  }
360  $this->‪endClipboard();
361  return $records;
362  }
363 
367  public function ‪hasElements(): bool
368  {
369  foreach ($this->clipData as $data) {
370  if (isset($data['el']) && is_array($data['el']) && !empty($data['el'])) {
371  return true;
372  }
373  }
374  return false;
375  }
376 
385  protected function ‪getLocalizations(string $table, array $parentRecord, bool $isRequestedTable): array
386  {
387  if (!BackendUtility::isTableLocalizable($table)) {
388  return [];
389  }
390 
391  $records = [];
392  $tcaCtrl = ‪$GLOBALS['TCA'][$table]['ctrl'];
393  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table);
394  $queryBuilder->getRestrictions()
395  ->removeAll()
396  ->add(GeneralUtility::makeInstance(DeletedRestriction::class));
397 
398  $queryBuilder
399  ->select('*')
400  ->from($table)
401  ->where(
402  $queryBuilder->expr()->eq(
403  $tcaCtrl['transOrigPointerField'],
404  $queryBuilder->createNamedParameter((int)$parentRecord['uid'], ‪Connection::PARAM_INT)
405  ),
406  $queryBuilder->expr()->neq(
407  $tcaCtrl['languageField'],
408  $queryBuilder->createNamedParameter(0, ‪Connection::PARAM_INT)
409  ),
410  $queryBuilder->expr()->gt(
411  'pid',
412  $queryBuilder->createNamedParameter(-1, ‪Connection::PARAM_INT)
413  )
414  )
415  ->orderBy($tcaCtrl['languageField']);
416 
417  if (BackendUtility::isTableWorkspaceEnabled($table)) {
418  $queryBuilder->getRestrictions()->add(
419  GeneralUtility::makeInstance(WorkspaceRestriction::class, $this->‪getBackendUser()->workspace)
420  );
421  }
422 
423  foreach ($queryBuilder->executeQuery()->fetchAllAssociative() as ‪$record) {
424  $title = htmlspecialchars(‪GeneralUtility::fixed_lgd_cs(BackendUtility::getRecordTitle($table, ‪$record), (int)$this->‪getBackendUser()->uc['titleLen']));
425  if (!$isRequestedTable) {
426  // In case the current table is not the requested table, e.g. "_FILE", wrap title in "muted" style
427  $title = '<span class="text-body-secondary">' . $title . '</span>';
428  }
429  $records[] = [
430  'icon' => $this->iconFactory->getIconForRecord($table, ‪$record, IconSize::SMALL)->render(),
431  'title' => $title,
432  'infoDataDispatch' => [
433  'action' => 'TYPO3.InfoWindow.showItem',
434  'args' => GeneralUtility::jsonEncodeForHtmlAttribute([$table, (int)‪$record['uid']], false),
435  ],
436  ];
437  }
438 
439  return $records;
440  }
441 
451  protected function ‪getTabInfo(string $padIdentifier, string $table = ''): string
452  {
453  $el = count($this->‪elFromTable($table, $padIdentifier));
454  if (!$el) {
455  return '';
456  }
457  $modeLabel = ($this->clipData['normal']['mode'] ?? '') === 'copy' ? $this->‪clipboardLabel('cm.copy') : $this->‪clipboardLabel('cm.cut');
458  return ' (' . ($padIdentifier === 'normal' ? $modeLabel : htmlspecialchars((string)$el)) . ')';
459  }
460 
469  protected function ‪linkItemText(string $itemText, $reference, bool $isRequestedTable): string
470  {
471  if (is_array($reference)) {
472  if ($isRequestedTable) {
473  // Wrap in link to corresponding page in recordlist in case current requested table matches
474  $itemText = '<a href="' . htmlspecialchars((string)$this->uriBuilder->buildUriFromRoute('web_list', ['id' => $reference['pid']])) . '">' . $itemText . '</a>';
475  } else {
476  $itemText = '<span class="text-body-secondary">' . $itemText . '</span>';
477  }
478  } elseif (is_string($reference)) {
479  if ($isRequestedTable && ‪ExtensionManagementUtility::isLoaded('filelist')) {
480  // Wrap in link to the files folder in case current requested table matches and filelist is loaded
481  $itemText = '<a href="' . htmlspecialchars((string)$this->uriBuilder->buildUriFromRoute('media_management', ['id' => $reference])) . '">' . $itemText . '</a>';
482  } else {
483  $itemText = '<span class="text-body-secondary">' . $itemText . '</span>';
484  }
485  }
486  return $itemText;
487  }
488 
498  public function ‪selUrlDB(string $table, int ‪$uid, bool $copy = false, bool $deselect = false): string
499  {
500  return $this->‪buildUrl(['CB' => [
501  'el' => [
502  $table . '|' . ‪$uid => $deselect ? 0 : 1,
503  ],
504  'setCopyMode' => (int)$copy,
505  ]]);
506  }
507 
516  public function ‪selUrlFile(string $path, bool $copy = false, bool $deselect = false): string
517  {
518  return $this->‪buildUrl(['CB' => [
519  'el' => [
520  '_FILE|' . md5($path) => $deselect ? '' : $path,
521  ],
522  'setCopyMode' => (int)$copy,
523  ]]);
524  }
525 
537  public function ‪pasteUrl(string $table, ‪$identifier, bool $setRedirect = true, array $update = null): string
538  {
539  $urlParameters = [
540  'CB' => [
541  'paste' => $table . '|' . ‪$identifier,
542  'pad' => ‪$this->current,
543  ],
544  ];
545  if ($setRedirect) {
546  $urlParameters['redirect'] = $this->‪buildUrl(['CB' => []]);
547  }
548  if (is_array($update)) {
549  $urlParameters['CB']['update'] = $update;
550  }
551  return (string)$this->uriBuilder->buildUriFromRoute($table === '_FILE' ? 'tce_file' : 'tce_db', $urlParameters);
552  }
553 
564  public function ‪confirmMsgText(
565  string $table,
566  $reference,
567  string $type,
568  array $selectedElements,
569  string $columnLabel = ''
570  ): string {
571  if (!$this->‪getBackendUser()->jsConfirmation(‪JsConfirmation::COPY_MOVE_PASTE)) {
572  return '';
573  }
574 
575  $labelKey = 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:mess.'
576  . ($this->‪currentMode() === 'copy' ? 'copy' : 'move')
577  . ($this->current === 'normal' ? '' : 'cb') . '_' . $type;
578  $confirmationMessage = $this->‪getLanguageService()->sL($labelKey . ($columnLabel ? '_colPos' : ''));
579 
580  if ($table === '_FILE' && is_string($reference)) {
581  $recordTitle = ‪PathUtility::basename($reference);
582  if ($this->current === 'normal') {
583  $selectedItem = reset($selectedElements);
584  $selectedRecordTitle = ‪PathUtility::basename($selectedItem);
585  } else {
586  $selectedRecordTitle = (string)count($selectedElements);
587  }
588  } else {
589  $recordTitle = $table === 'pages' && !is_array($reference)
590  ? ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']
591  : BackendUtility::getRecordTitle($table, $reference);
592  if ($this->current === 'normal') {
593  $selectedItem = $this->‪getSelectedRecord();
594  $selectedRecordTitle = $selectedItem['_RECORD_TITLE'];
595  } else {
596  $selectedRecordTitle = (string)count($selectedElements);
597  }
598  }
599  // @TODO
600  // This can get removed as soon as the "_colPos" label is translated
601  // into all available locallang languages.
602  if (!$confirmationMessage && $columnLabel) {
603  $recordTitle .= ' | ' . $columnLabel;
604  $confirmationMessage = $this->‪getLanguageService()->sL($labelKey);
605  }
606 
607  return sprintf(
608  $confirmationMessage,
609  ‪GeneralUtility::fixed_lgd_cs($selectedRecordTitle, 30),
610  ‪GeneralUtility::fixed_lgd_cs($recordTitle, 30),
611  ‪GeneralUtility::fixed_lgd_cs($columnLabel, 30)
612  );
613  }
614 
621  protected function ‪clipboardLabel(string $key): string
622  {
623  return htmlspecialchars($this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:' . $key));
624  }
625 
626  /*****************************************
627  *
628  * Helper functions
629  *
630  ****************************************/
636  public function ‪removeElement(string $elementKey): void
637  {
638  unset($this->clipData[$this->current]['el'][$elementKey]);
639  $this->changed = true;
640  }
641 
646  protected function ‪saveClipboard(): void
647  {
648  $this->‪getBackendUser()->pushModuleData('clipboard', $this->clipData);
649  }
650 
656  public function ‪currentMode(): string
657  {
658  return ($this->clipData[$this->current]['mode'] ?? '') === 'copy' ? 'copy' : 'cut';
659  }
660 
665  public function ‪cleanCurrent(): void
666  {
667  if (!is_array($this->clipData[$this->current]['el'] ?? false)) {
668  return;
669  }
670 
671  foreach ($this->clipData[$this->current]['el'] as $reference => $value) {
672  [$table, ‪$uid] = explode('|', $reference);
673  if ($table !== '_FILE') {
674  if (!$value || !is_array(BackendUtility::getRecord($table, (int)‪$uid, 'uid'))) {
675  unset($this->clipData[$this->current]['el'][$reference]);
676  $this->changed = true;
677  }
678  } elseif (!$value) {
679  unset($this->clipData[$this->current]['el'][$reference]);
680  $this->changed = true;
681  } else {
682  try {
683  $this->resourceFactory->retrieveFileOrFolderObject($value);
684  } catch (‪ResourceDoesNotExistException $e) {
685  // The file has been deleted in the meantime, so just remove it silently
686  unset($this->clipData[$this->current]['el'][$reference]);
687  }
688  }
689  }
690  }
691 
699  public function ‪elFromTable(string $matchTable = '', string $padIdentifier = ''): array
700  {
701  $padIdentifier = $padIdentifier ?: ‪$this->current;
702 
703  if (!is_array($this->clipData[$padIdentifier]['el'] ?? false)) {
704  return [];
705  }
706 
707  $elements = [];
708  foreach ($this->clipData[$padIdentifier]['el'] as $reference => $value) {
709  if (!$value) {
710  continue;
711  }
712  [$table, ‪$uid] = explode('|', $reference);
713  if ($table !== '_FILE') {
714  if ((!$matchTable || $table === $matchTable) && (‪$GLOBALS['TCA'][$table] ?? false)) {
715  $elements[$reference] = $padIdentifier === 'normal' ? $value : ‪$uid;
716  }
717  } elseif ($table === $matchTable) {
718  $elements[$reference] = $value;
719  }
720  }
721  return $elements;
722  }
723 
733  public function ‪isSelected(string $table, ‪$identifier): string
734  {
735  $key = $table . '|' . ‪$identifier;
736  $mode = $this->current === 'normal' ? $this->‪currentMode() : 'any';
737  return !empty($this->clipData[$this->current]['el'][$key]) ? $mode : '';
738  }
739 
746  public function ‪getSelectedRecord(): array
747  {
748  $elements = $this->‪elFromTable();
749  reset($elements);
750  [$table, ‪$uid] = explode('|', (string)key($elements));
751  if (!$this->‪isSelected($table, (int)‪$uid)) {
752  return [];
753  }
754  $selectedRecord = BackendUtility::getRecordWSOL($table, (int)‪$uid);
755  $selectedRecord['_RECORD_TITLE'] = BackendUtility::getRecordTitle($table, $selectedRecord);
756  return $selectedRecord;
757  }
758 
764  protected function ‪isElements(): bool
765  {
766  return is_array($this->clipData[$this->current]['el'] ?? null) && !empty($this->clipData[$this->current]['el']);
767  }
768 
770  {
771  return ‪$GLOBALS['LANG'];
772  }
773 
775  {
776  return ‪$GLOBALS['BE_USER'];
777  }
778 
783  protected function ‪buildUrl(array $parameters = []): string
784  {
785  if ($this->request === null) {
786  throw new \RuntimeException(
787  'Request object must be set to generate clipboard URL\'s',
788  1633604720
789  );
790  }
791  return (string)$this->uriBuilder->buildUriFromRequest(
792  $this->request,
793  array_replace($this->request->getQueryParams(), $parameters)
794  );
795  }
796 }
‪TYPO3\CMS\Backend\Clipboard\Clipboard\linkItemText
‪linkItemText(string $itemText, $reference, bool $isRequestedTable)
Definition: Clipboard.php:469
‪TYPO3\CMS\Core\Resource\ProcessedFile\CONTEXT_IMAGEPREVIEW
‪const CONTEXT_IMAGEPREVIEW
Definition: ProcessedFile.php:55
‪TYPO3\CMS\Backend\Clipboard\Clipboard\getSelectedRecord
‪array getSelectedRecord()
Definition: Clipboard.php:746
‪TYPO3\CMS\Core\Utility\PathUtility
Definition: PathUtility.php:27
‪TYPO3\CMS\Core\Database\Connection\PARAM_INT
‪const PARAM_INT
Definition: Connection.php:46
‪TYPO3\CMS\Core\Utility\GeneralUtility\fixed_lgd_cs
‪static string fixed_lgd_cs(string $string, int $chars, string $appendString='...')
Definition: GeneralUtility.php:93
‪TYPO3\CMS\Backend\Clipboard\Clipboard\selUrlDB
‪string selUrlDB(string $table, int $uid, bool $copy=false, bool $deselect=false)
Definition: Clipboard.php:498
‪TYPO3\CMS\Backend\Clipboard\Clipboard
Definition: Clipboard.php:48
‪TYPO3\CMS\Backend\Clipboard\Clipboard\isElements
‪bool isElements()
Definition: Clipboard.php:764
‪TYPO3\CMS\Backend\Clipboard\Clipboard\$numberOfPads
‪int $numberOfPads
Definition: Clipboard.php:76
‪TYPO3\CMS\Backend\Clipboard\Clipboard\$changed
‪bool $changed
Definition: Clipboard.php:70
‪TYPO3\CMS\Backend\Clipboard\Clipboard\getTabItems
‪array getTabItems(string $padIdentifier, string $currentTable)
Definition: Clipboard.php:276
‪TYPO3\CMS\Backend\Clipboard\Clipboard\pasteUrl
‪pasteUrl(string $table, $identifier, bool $setRedirect=true, array $update=null)
Definition: Clipboard.php:537
‪TYPO3\CMS\Backend\Clipboard\Clipboard\lockToNormal
‪lockToNormal()
Definition: Clipboard.php:130
‪TYPO3\CMS\Backend\Clipboard\Clipboard\$lockToNormal
‪bool $lockToNormal
Definition: Clipboard.php:74
‪TYPO3\CMS\Core\Authentication\JsConfirmation
Definition: JsConfirmation.php:28
‪TYPO3\CMS\Core\Imaging\IconFactory
Definition: IconFactory.php:34
‪TYPO3\CMS\Backend\Clipboard\Clipboard\$resourceFactory
‪ResourceFactory $resourceFactory
Definition: Clipboard.php:80
‪TYPO3\CMS\Backend\Clipboard\Clipboard\$uriBuilder
‪UriBuilder $uriBuilder
Definition: Clipboard.php:79
‪TYPO3\CMS\Core\Utility\PathUtility\basename
‪static basename(string $path)
Definition: PathUtility.php:219
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility\isLoaded
‪static isLoaded(string $key)
Definition: ExtensionManagementUtility.php:93
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility
Definition: ExtensionManagementUtility.php:40
‪TYPO3\CMS\Backend\Clipboard\Clipboard\getTabInfo
‪getTabInfo(string $padIdentifier, string $table='')
Definition: Clipboard.php:451
‪TYPO3\CMS\Backend\Clipboard\Clipboard\isSelected
‪string isSelected(string $table, $identifier)
Definition: Clipboard.php:733
‪TYPO3\CMS\Backend\Clipboard\Clipboard\currentMode
‪string currentMode()
Definition: Clipboard.php:656
‪TYPO3\CMS\Backend\Clipboard\Clipboard\setCurrentPad
‪setCurrentPad(string $padIdentifier)
Definition: Clipboard.php:188
‪TYPO3\CMS\Backend\Clipboard\Clipboard\getLanguageService
‪getLanguageService()
Definition: Clipboard.php:769
‪TYPO3\CMS\Backend\Clipboard\Clipboard\initializeClipboard
‪initializeClipboard(?ServerRequestInterface $request=null)
Definition: Clipboard.php:99
‪TYPO3\CMS\Backend\Routing\UriBuilder
Definition: UriBuilder.php:44
‪TYPO3\CMS\Core\Resource\Folder
Definition: Folder.php:37
‪TYPO3\CMS\Core\Resource\ResourceFactory
Definition: ResourceFactory.php:41
‪TYPO3\CMS\Core\Resource\Exception\ResourceDoesNotExistException
Definition: ResourceDoesNotExistException.php:24
‪TYPO3\CMS\Core\Resource\File
Definition: File.php:26
‪TYPO3\CMS\Webhooks\Message\$record
‪identifier readonly int readonly array $record
Definition: PageModificationMessage.php:36
‪TYPO3\CMS\Backend\Clipboard\Clipboard\$iconFactory
‪IconFactory $iconFactory
Definition: Clipboard.php:78
‪TYPO3\CMS\Backend\Clipboard\Clipboard\getClipboardData
‪getClipboardData(string $table='')
Definition: Clipboard.php:234
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:64
‪TYPO3\CMS\Backend\Clipboard\Clipboard\$request
‪ServerRequestInterface $request
Definition: Clipboard.php:82
‪TYPO3\CMS\Backend\Clipboard\Clipboard\removeElement
‪removeElement(string $elementKey)
Definition: Clipboard.php:636
‪TYPO3\CMS\Backend\Clipboard\Clipboard\$current
‪string $current
Definition: Clipboard.php:72
‪TYPO3\CMS\Backend\Clipboard\Clipboard\cleanUpCBC
‪array cleanUpCBC(array $CBarr, string $table, bool $removeDeselected=false)
Definition: Clipboard.php:223
‪TYPO3\CMS\Backend\Clipboard\Clipboard\$clipData
‪array $clipData
Definition: Clipboard.php:68
‪TYPO3\CMS\Backend\Clipboard\Clipboard\__construct
‪__construct(IconFactory $iconFactory, UriBuilder $uriBuilder, ResourceFactory $resourceFactory)
Definition: Clipboard.php:84
‪TYPO3\CMS\Backend\Clipboard\Clipboard\endClipboard
‪endClipboard()
Definition: Clipboard.php:207
‪TYPO3\CMS\Core\Resource\ProcessedFile
Definition: ProcessedFile.php:47
‪TYPO3\CMS\Backend\Clipboard\Clipboard\saveClipboard
‪saveClipboard()
Definition: Clipboard.php:646
‪TYPO3\CMS\Core\Database\Connection
Definition: Connection.php:35
‪TYPO3\CMS\Backend\Clipboard\Clipboard\clipboardLabel
‪string clipboardLabel(string $key)
Definition: Clipboard.php:621
‪TYPO3\CMS\Webhooks\Message\$uid
‪identifier readonly int $uid
Definition: PageModificationMessage.php:35
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction
Definition: DeletedRestriction.php:28
‪TYPO3\CMS\Backend\Clipboard\Clipboard\cleanCurrent
‪cleanCurrent()
Definition: Clipboard.php:665
‪TYPO3\CMS\Backend\Clipboard\Clipboard\selUrlFile
‪string selUrlFile(string $path, bool $copy=false, bool $deselect=false)
Definition: Clipboard.php:516
‪TYPO3\CMS\Core\Utility\MathUtility
Definition: MathUtility.php:24
‪TYPO3\CMS\Core\Resource\Folder\getCombinedIdentifier
‪string getCombinedIdentifier()
Definition: Folder.php:165
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:46
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:51
‪TYPO3\CMS\Backend\Clipboard
Definition: Clipboard.php:18
‪TYPO3\CMS\Backend\Clipboard\Clipboard\getLocalizations
‪array getLocalizations(string $table, array $parentRecord, bool $isRequestedTable)
Definition: Clipboard.php:385
‪TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange
‪static int forceIntegerInRange(mixed $theInt, int $min, int $max=2000000000, int $defaultValue=0)
Definition: MathUtility.php:34
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:51
‪TYPO3\CMS\Backend\Clipboard\Clipboard\getBackendUser
‪getBackendUser()
Definition: Clipboard.php:774
‪TYPO3\CMS\Backend\Clipboard\Clipboard\confirmMsgText
‪string confirmMsgText(string $table, $reference, string $type, array $selectedElements, string $columnLabel='')
Definition: Clipboard.php:564
‪TYPO3\CMS\Backend\Clipboard\Clipboard\setCmd
‪setCmd(array $cmd)
Definition: Clipboard.php:147
‪TYPO3\CMS\Backend\Clipboard\Clipboard\elFromTable
‪array elFromTable(string $matchTable='', string $padIdentifier='')
Definition: Clipboard.php:699
‪TYPO3\CMS\Backend\Clipboard\Clipboard\hasElements
‪hasElements()
Definition: Clipboard.php:367
‪TYPO3\CMS\Core\Authentication\JsConfirmation\COPY_MOVE_PASTE
‪const COPY_MOVE_PASTE
Definition: JsConfirmation.php:30
‪TYPO3\CMS\Webhooks\Message\$identifier
‪identifier readonly string $identifier
Definition: FileAddedMessage.php:37
‪TYPO3\CMS\Backend\Clipboard\Clipboard\buildUrl
‪buildUrl(array $parameters=[])
Definition: Clipboard.php:783
‪TYPO3\CMS\Core\Database\Query\Restriction\WorkspaceRestriction
Definition: WorkspaceRestriction.php:39