29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-08-03 17:50:26 +00:00

[4.3] guided tours module count (#40447)

This commit is contained in:
Brian Teeman 2023-07-14 22:23:30 +01:00 committed by GitHub
parent 955e4d6c4e
commit c0b1cbc56d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,16 +25,16 @@ $app->getDocument()
->getWebAssetManager()
->useScript('bootstrap.dropdown');
$lang = $app->getLanguage();
$extension = $app->getInput()->get('option');
$listTours = [];
$allTours = [];
$lang = $app->getLanguage();
$extension = $app->getInput()->get('option');
$listTours = [];
$allTours = [];
$toursCount = $params->get('tourscount', 7);
foreach ($tours as $tour) :
if (count(array_intersect(['*', $extension], $tour->extensions))) :
if ($toursCount > 0 && count(array_intersect(['*', $extension], $tour->extensions))) :
$listTours[] = $tour;
$toursCount--;
endif;
$uri = new Uri($tour->url);
@ -64,10 +64,7 @@ endforeach;
<span class="icon-angle-down" aria-hidden="true"></span>
</button>
<div class="dropdown-menu dropdown-menu-end">
<?php foreach ($listTours as $i => $tour) : ?>
<?php if ($i >= $params->get('tourscount', 7)) : ?>
<?php break; ?>
<?php endif; ?>
<?php foreach ($listTours as $tour) : ?>
<button type="button" class="button-start-guidedtour dropdown-item" data-id="<?php echo $tour->id ?>">
<span class="icon-map-signs" aria-hidden="true"></span>
<?php echo $tour->title; ?>