Skip to content

Commit

Permalink
#340 add support for security policy header
Browse files Browse the repository at this point in the history
  • Loading branch information
digedag committed Nov 19, 2023
1 parent c08035a commit 4389c6c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Classes/Backend/Form/ToolBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,19 +395,22 @@ public function createInfoLink($editTable, $editUid, $label = 'Info', $options =
*/
public function createMoveLink($editTable, $recordUid, $currentPid, $label = '')
{
$this->initClipboard();
$clipObj = $this->initClipboard();
$isSel = (string) $clipObj->isSelected($editTable, $recordUid);
$options = [];
$isSel = (string) $this->clipObj->isSelected($editTable, $recordUid);
$options[self::OPTION_ICON_NAME] = 'actions-edit-cut'.($isSel ? '-release' : '');
$tooltip = $isSel ? 'paste' : 'cut';
$options[self::OPTION_HOVER_TEXT] = $this->getLanguageService()->sl('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:cm.'.$tooltip);

$uri = $this->clipObj->selUrlDB($editTable, $recordUid, 0, 'cut' === $isSel, ['returnUrl' => '']);
$uri = $clipObj->selUrlDB($editTable, $recordUid, 0, 'cut' === $isSel, ['returnUrl' => '']);
$btn = $this->createModuleButton($uri, $label, $options);

return $btn->render();
}

/**
* @return \TYPO3\CMS\Backend\Clipboard\Clipboard
*/
private function initClipboard()
{
if (!$this->clipObj) {
Expand All @@ -422,6 +425,8 @@ private function initClipboard()
// Save the clipboard content
$this->clipObj->endClipboard();
}

return $this->clipObj;
}

/**
Expand Down Expand Up @@ -1263,7 +1268,10 @@ protected function buildDataHandlerUri(string $params, $redirect)
return BackendUtility::getLinkToDataHandlerAction('&'.$params, $redirect);
}

public function getLanguageService(): LanguageService
/**
* @return TYPO3\CMS\Core\Localization\LanguageService|TYPO3\CMS\Lang\LanguageService
*/
public function getLanguageService()
{
return $this->lang;
}
Expand Down

0 comments on commit 4389c6c

Please sign in to comment.