Enable sorting of header slides

This commit is contained in:
Björn Fromme
2018-06-08 10:23:17 +02:00
parent b75a8db313
commit 27edc41b74
@@ -27,6 +27,7 @@ namespace EP\EpTheme\DataProcessing;
* This copyright notice MUST APPEAR in all copies of the script! * This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/ ***************************************************************/
use EP\EpProducts\Utility\DbUtility;
use TYPO3\CMS\Core\Resource\FileRepository; use TYPO3\CMS\Core\Resource\FileRepository;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
@@ -60,13 +61,20 @@ class SliderProcessor implements DataProcessorInterface
return $processedData; return $processedData;
} }
$slides = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( $qb = DbUtility::getDbConnection()->createQueryBuilder();
'uid, headline, subline, button, page_uid', $query = $qb
'tx_eptheme_domain_model_slide', ->select('uid', 'headline', 'subline', 'button', 'page_uid')
'page=' . $pageUid . $GLOBALS['TSFE']->sys_page->enableFields('tx_eptheme_domain_model_slide') ->from('tx_eptheme_domain_model_slide')
); ->where('page = :pageUid')
->andWhere('deleted = 0')
->andWhere('hidden = 0')
->orderBy('sorting')
->setParameter('pageUid', $pageUid)
;
if (is_array($slides) && count($slides) > 0) { $slides = $query->execute()->fetchAll();
if ($slides) {
$fileRepository = GeneralUtility::makeInstance(FileRepository::class); $fileRepository = GeneralUtility::makeInstance(FileRepository::class);
foreach ($slides as $slide) foreach ($slides as $slide)
{ {