Skip to content

Commit

Permalink
[TASK] Add qbank-specific configuration of allowed extensions (#9)
Browse files Browse the repository at this point in the history
Introduces configuration option `qbankBrowserAllowed`, a comma-separated list of file extensions similar to TYPO3 core's `elementBrowserAllowed`.
  • Loading branch information
mabolek authored May 6, 2021
1 parent bcb09d8 commit 49e8acd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Classes/FormEngine/Container/QbankSelectorButtonContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ protected function renderQbankButton(array $inlineConfiguration): string
$this->addJavaScriptConfiguration($accessToken);
$this->javaScriptLocalization();

$allowed
= $inlineConfiguration['selectorOrUniqueConfiguration']['config']['appearance']['elementBrowserAllowed'];
$appearanceConfiguration = $inlineConfiguration['selectorOrUniqueConfiguration']['config']['appearance'];

$allowed = $appearanceConfiguration['qbankBrowserAllowed'] ?? $appearanceConfiguration['elementBrowserAllowed'];

$allowedArray = GeneralUtility::trimExplode(',', $allowed, true);
if (empty($allowedArray)) {
$allowedArray = GeneralUtility::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'], true);
Expand Down

0 comments on commit 49e8acd

Please sign in to comment.