Skip to content

Commit

Permalink
Add a place holder for when there is no group
Browse files Browse the repository at this point in the history
  • Loading branch information
Astu04 authored Jul 25, 2023
1 parent c96c414 commit 4d4ee0d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modal/areas_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,15 @@
echo "<div class='accordion' id='accordion'>";

foreach ($areas as $group => $areaList) {
// Check if $group is empty or null, and set the default text accordingly
$buttonText = !empty($group) ? $group : "No group";
$updatedGroup = str_replace(' ', '_', $group);

echo "<div class='card'>
<div class='card-header' id='heading$updatedGroup'>
<h5 class='mb-0'>
<button class='btn btn-link $collapsedState' type='button' data-toggle='collapse' data-target='#collapse$updatedGroup' aria-expanded='false' aria-controls='collapse$updatedGroup'>
$group
$buttonText
</button>
</h5>
</div>
Expand Down

0 comments on commit 4d4ee0d

Please sign in to comment.