Skip to content

Commit f2ef11a

Browse files
markusweigeltwebpack-builder[bot]sebastian-meyer
authored
[BUGFIX] Migrate kitodo#1723 to main branch (kitodo#1734)
Co-authored-by: webpack-builder[bot] <webpack-builder[bot]@users.noreply.github.com> Co-authored-by: Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
1 parent eab5b4a commit f2ef11a

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

Classes/Controller/AbstractController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ protected function buildMultiView(AbstractDocument $doc): void
183183
foreach ($this->requestData['multipleSource'] as $location) {
184184
$document = AbstractDocument::getInstance($location, $this->settings);
185185
if ($document !== null) {
186-
$this->documentArray['extra_' . $i] = $document;
186+
$this->documentArray['multipleSource_' . $i] = $document;
187187
}
188188
$i++;
189189
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
/**
3+
* (c) Kitodo. Key to digital objects e.V. <contact@kitodo.org>
4+
*
5+
* This file is part of the Kitodo and TYPO3 projects.
6+
*
7+
* @license GNU General Public License version 3 or later.
8+
* For the full copyright and license information, please read the
9+
* LICENSE.txt file that was distributed with this source code.
10+
*/
11+
12+
namespace Kitodo\Dlf\ViewHelpers;
13+
14+
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
15+
16+
class MultipleSourceViewHelper extends AbstractViewHelper
17+
{
18+
public function initializeArguments()
19+
{
20+
parent::initializeArguments();
21+
$this->registerArgument('docArrayKey', 'string', 'The array key of the doc array', true);
22+
}
23+
24+
/**
25+
* Checks whether docArray starts with the prefix multipleSource_ and returns the numeric postfix.
26+
*
27+
* @return int
28+
*/
29+
public function render()
30+
{
31+
if (preg_match('/^multipleSource_(\d+)$/', $this->arguments['docArrayKey'], $matches)) {
32+
return (int) $matches[1];
33+
}
34+
return -1;
35+
}
36+
}

Resources/Public/Css/DlfMediaVendor.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)