diff options
| author | David Siegfried <david.siegfried@uni-vechta.de> | 2023-05-08 12:13:03 +0000 |
|---|---|---|
| committer | David Siegfried <david.siegfried@uni-vechta.de> | 2023-05-08 12:13:03 +0000 |
| commit | 244d00ed91ad2b4b83e902a45cd6def3d7bc7e86 (patch) | |
| tree | 8467e16903323adafab5485eb0b41f6b15d11c1a | |
| parent | fd50b7a4f82b37d75b9bfe2cfa560df0c6710845 (diff) | |
prevent php8-warnings, closes #2612
Closes #2612
Merge request studip/studip!1762
| -rw-r--r-- | templates/courseware/block_types/image_map.php | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/templates/courseware/block_types/image_map.php b/templates/courseware/block_types/image_map.php index f3d3518..b222d6a 100644 --- a/templates/courseware/block_types/image_map.php +++ b/templates/courseware/block_types/image_map.php @@ -1,20 +1,22 @@ <div style="font-size: 12px;"> - <p style="font-weight: bold;"><?= _('Verweissensitive Grafik') . ': ' ?></p> + <p style="font-weight: bold;"><?= _('Verweissensitive Grafik') ?>: </p> <p style="font-style: italic; font-size: 10px;"><?= _('Hinweis: Positionen der Verweise können nicht dargestellt werden.')?></p> <p> - <? if ($files[0]): ?> - <img src="<?= htmlReady($files[0]->getDownloadURL()); ?>"> - <span style="font-style:italic"><?= htmlReady($files[0]->name); ?></span> - <? endif; ?> + <? if (isset($files[0])): ?> + <img src="<?= htmlReady($files[0]->getDownloadURL()); ?>" alt="<?= htmlReady($files[0]->name) ?>"> + <span style="font-style:italic"><?= htmlReady($files[0]->name) ?></span> + <? endif ?> </p> - <p><?= _('Verweise'). ': ' ?></p> - <ul> - <? foreach($payload['shapes'] as $shape): ?> - <li> - <?= htmlReady($shape['title']); ?>,<?= htmlReady($shape['data']['text']); ?><? if ($shape['link_type'] === 'external'): ?>, - <a href="<?= htmlReady($shape['target_external']); ?>"><?= htmlReady($shape['target_external']); ?></a> - <? endif; ?> - </li> - <? endforeach; ?> - </ul> -</div>
\ No newline at end of file + <? if (!empty($payload['shapes'])) : ?> + <p><?= _('Verweise') ?>: </p> + <ul> + <? foreach($payload['shapes'] as $shape): ?> + <li> + <?= htmlReady($shape['title']) ?>,<?= htmlReady($shape['data']['text']) ?><? if ($shape['link_type'] === 'external'): ?>, + <a href="<?= htmlReady($shape['target_external']); ?>"><?= htmlReady($shape['target_external']) ?></a> + <? endif ?> + </li> + <? endforeach ?> + </ul> + <? endif ?> +</div> |
