Skip to content

Commit

Permalink
Add changes from #45
Browse files Browse the repository at this point in the history
  • Loading branch information
zonky2 committed Jul 25, 2024
1 parent 3c2b639 commit 32a6fa3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<ul id="files_<?= $this->id ?>" class="files">
<?php /** @var stdClass $file */ ?>
<?php foreach ($this->files as $key => $file): ?>
<li class="file-element ext-<?= $file['extension'] ?>">
<li class="file-element<?php if (!$this->showThumbnail): ?> download-element ext-<?= $file['extension'] ?><?php endif ?>">
<?php if ($this->showThumbnail): ?>
<?= sprintf(
'<img src="%s" width="%s" height="%s" alt="%s" itemprop="image">',
Expand All @@ -26,7 +26,7 @@
$file['thumbnail']['height'],
$file['name']
) ?>
<p class="file-name"><?= $file['name'] ?></p>
<br><span class="file-name"><?= $file['name'] ?></span>
<?php else: ?>
<span class="file-name"><?= $file['name'] ?></span>
<?php endif; ?>
Expand Down
6 changes: 3 additions & 3 deletions src/Widgets/UploadOnSteroids.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ private function validateMultipleUpload(): void
}

$inputName = $this->name;
$values = \array_map('\Contao\StringUtil::binToUuid', $this->value);
$values = \array_map('\Contao\StringUtil::binToUuid', (array) $this->value);

$files = [];
$inputFiles = $this->getMultipleUploadedFiles();
Expand Down Expand Up @@ -367,7 +367,7 @@ private function deselectFile(string $inputName): void
return;
}

$values = \array_map('\Contao\StringUtil::binToUuid', $this->value);
$values = \array_map('\Contao\StringUtil::binToUuid', (array) $this->value);
$diffValues = \array_values(\array_diff($values, $post['reset']));

$this->value = \array_map('\Contao\StringUtil::uuidToBin', $diffValues);
Expand Down Expand Up @@ -408,7 +408,7 @@ private function deleteFile(string $inputName): void
return;
}

$values = \array_map('\Contao\StringUtil::binToUuid', $this->value);
$values = \array_map('\Contao\StringUtil::binToUuid', (array) $this->value);
$diffValues = \array_values(\array_diff($values, $post['delete']));

foreach ($post['delete'] as $delete) {
Expand Down

0 comments on commit 32a6fa3

Please sign in to comment.