Skip to content

Commit

Permalink
[TASK] View more extension for asset types
Browse files Browse the repository at this point in the history
TODO: Refactor to retrieve asset type extensions from configuration
  • Loading branch information
bmoex committed Jul 4, 2018
1 parent f900d47 commit 6e16b67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions Classes/Backend/InlineControlContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ protected function bynderStorageAvailable(): bool
}

/**
* @param array $allowedElements
* @param string $allowedElements
* @return string
*/
protected function getAssetTypesByAllowedElements($allowedElements): string
Expand All @@ -120,9 +120,12 @@ protected function getAssetTypesByAllowedElements($allowedElements): string
if (empty($allowedElements)) {
$assetTypes = [BynderDriver::ASSET_TYPE_IMAGE, BynderDriver::ASSET_TYPE_VIDEO];
} else {
$allowedElements = GeneralUtility::trimExplode(',', $allowedElements);
if (in_array('png', $allowedElements)) {
$assetTypes[] = BynderDriver::ASSET_TYPE_IMAGE;
$allowedElements = GeneralUtility::trimExplode(',', strtolower($allowedElements), true);
foreach (['jpg', 'png', 'gif'] as $element) {
if (in_array($element, $allowedElements)) {
$assetTypes[] = BynderDriver::ASSET_TYPE_VIDEO;
break;
}
}

if (in_array('mp4', $allowedElements)) {
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Templates/CompactView/Index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div id="bynder-compactview"
data-assetTypes="{assetTypes}"
data-autoload="true"
data-collections="true"
data-collections="false"

This comment has been minimized.

Copy link
@frans-beech-it

frans-beech-it Jul 4, 2018

Contributor

if it works, please set it to true

data-defaultEnvironment="{apiBaseUrl}"
data-folder="bynder-compactview"
data-fullScreen="true"
Expand Down

0 comments on commit 6e16b67

Please sign in to comment.