Revert "add order to additional images"
This reverts commit 0dc72ef5b1.
This commit is contained in:
31
src/News.php
31
src/News.php
@@ -80,37 +80,6 @@ class News extends \Contao\News
|
|||||||
/** @var \PageModel $objPage */
|
/** @var \PageModel $objPage */
|
||||||
global $objPage;
|
global $objPage;
|
||||||
|
|
||||||
if ($arrItem['orderSRC'])
|
|
||||||
{
|
|
||||||
$tmp = StringUtil::deserialize($arrItem['orderSRC']);
|
|
||||||
|
|
||||||
if (!empty($tmp) && \is_array($tmp))
|
|
||||||
{
|
|
||||||
// Remove all values
|
|
||||||
$arrOrder = array_map(static function () {}, array_flip($tmp));
|
|
||||||
|
|
||||||
// Move the matching elements to their position in $arrOrder
|
|
||||||
foreach ($arrItem['multiSRC'] as $k=>$v)
|
|
||||||
{
|
|
||||||
if (\array_key_exists($v['uuid'], $arrOrder))
|
|
||||||
{
|
|
||||||
$arrOrder[$v['uuid']] = $v;
|
|
||||||
unset($arrItem['multiSRC'][$k]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Append the left-over images at the end
|
|
||||||
if (!empty($arrItem['multiSRC']))
|
|
||||||
{
|
|
||||||
$arrOrder = array_merge($arrOrder, array_values($arrItem['multiSRC']));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove empty (unreplaced) entries
|
|
||||||
$arrItem['multiSRC'] = array_values(array_filter($arrOrder));
|
|
||||||
unset($arrOrder);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$pictures = array();
|
$pictures = array();
|
||||||
foreach ($arrItem['multiSRC'] as $path => $objFile)
|
foreach ($arrItem['multiSRC'] as $path => $objFile)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user