Actions
Feature #76859
closedWouldnt it be nice to have onlyLinkOptions in wizard_link
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; }
Actions