Project

General

Profile

Actions

Feature #76859

closed

Wouldnt it be nice to have onlyLinkOptions in wizard_link

Added by Claus Harup over 8 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Could have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2016-06-28
Due date:
% Done:

0%

Estimated time:
PHP Version:
7.0
Tags:
Complexity:
Sprint Focus:

Description

Having the following gives us functionality to blind certain link options, but with the new linkhandler configuration 'spec' is not enough to blind, hence the config is:

TCEMAIN.linkHandler.extkey.handler = Cobweb\Linkhandler\RecordLinkHandler....

'wizards'  => [
    'link' => [
    'type' => 'popup',
    'title' => 'Folder',
    'icon' => 'actions-open',
    'JSopenParams' => 'height=800,width=800,status=0,menubar=0,scrollbars=1',
    'module' => [
        'name' => 'wizard_link',
        'urlParameters' => ['mode' => 'wizard']
    ],
    'params' => ['blindLinkOptions' => 'page,mail,url,file,spec']
    ]
]

.....so it would be nice to have:

'wizards'  => [
    'link' => [
    'type' => 'popup',
    'title' => 'Folder',
    'icon' => 'actions-open',
    'JSopenParams' => 'height=800,width=800,status=0,menubar=0,scrollbars=1',
    'module' => [
        'name' => 'wizard_link',
        'urlParameters' => ['mode' => 'wizard']
    ],
    'params' => ['onlyLinkOptions' => 'folder']
    ]
]

In BrowseLinksController.php - we could do something like this:

protected function getAllowedItems()
    {
        $allowedItems = parent::getAllowedItems();

        $blindLinkOptions = isset($this->thisConfig['blindLinkOptions'])
            ? GeneralUtility::trimExplode(',', $this->thisConfig['blindLinkOptions'], true)
            : [];
        $allowedItems = array_diff($allowedItems, $blindLinkOptions);

        if (is_array($this->buttonConfig['options.']) && $this->buttonConfig['options.']['removeItems']) {
            $allowedItems = array_diff($allowedItems, GeneralUtility::trimExplode(',', $this->buttonConfig['options.']['removeItems'], true));
        }

        if(isset($this->thisConfig['onlyLinkOptions'])){
            $onlyLinkOptions = GeneralUtility::trimExplode(',', $this->thisConfig['onlyLinkOptions'], true);

            $allowedItems = array_diff($allowedItems, $onlyLinkOptions);
        }

        return $allowedItems;
    }

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Feature #79626: Integrate linkhandler into coreClosed2017-02-04

Actions
Related to TYPO3 Core - Feature #97159: Introduce TCA type "link"ClosedOliver Bartsch2022-03-09

Actions
Actions

Also available in: Atom PDF