Feature #76859
closedWouldnt it be nice to have onlyLinkOptions in wizard_link
0%
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; }
Updated by Markus Klein over 8 years ago
- Assignee deleted (
Riccardo De Contardi) - Target version deleted (
next-patchlevel)
Not sure what you mean with
'spec' is not enough to blind
The linkhandler extension may register multiple tabs, each with a dedicated key, eg. tx_news.
You need to blind those keys.
Updated by Claus Harup over 8 years ago
Hi again
"_The linkhandler extension may register multiple tabs, each with a dedicated key, eg. tx_news. You need to blind those keys._"
That is exactly what I meant :-)
Lets us say I have an extension only needed to have the folder tab in the link wizard I would have to blind all linkhandler tabs - the problem is when another extension is loded using another linkhandler tab - I would then have to go back to my original extension and blind those tabs as well :-(
I thought the smart thing here, would be to specify EXACTLY the tabs you need for the link wizard....
Does it give any scence?? :-)
/Claus
Updated by Markus Klein over 8 years ago
- Target version set to 8 LTS
Yes this makes sense. Can you push a patch including documentation?
Keep in mind though that new features can only go into master and not into released versions.
Updated by Claus Harup over 8 years ago
Hi Markus
I fixed it using the hook:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['LinkBrowser']['hooks']['modifyAllowedItems']['handler']
Updated by Riccardo De Contardi over 7 years ago
- Target version changed from 8 LTS to 9.0
Updated by Josef Glatz over 7 years ago
Claus, please can you provide a sample of how you using the hook?
Updated by Claus Harup over 7 years ago
class BrowseLinks{
public function modifyAllowedItems($allowedItems, $currentLinkParts){
$P = GeneralUtility::_GET('P');
if(isset($P['params'])){
if(isset($P['params']['onlyLinkOptions'])){
$allowedItems = GeneralUtility::trimExplode(',', $P['params']['onlyLinkOptions'], TRUE);
}
}
return $allowedItems;
}
}
Updated by Benni Mack about 2 years ago
- Related to Feature #97159: Introduce TCA type "link" added
Updated by Benni Mack about 2 years ago
- Status changed from New to Closed
We've implemented this (finally) in TYPO3 v12.0 with the new option "TCA Type=link". https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Feature-97159-NewTCATypeLink.html
Will close the issue now, if you have any further questions, let me know.