diff options
| author | Greg Roach <fisharebest@webtrees.net> | 2019-09-13 19:57:14 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@webtrees.net> | 2019-09-13 19:57:14 +0100 |
| commit | 0d45b3e3f693321cf25e3077e41d70907b9ed720 (patch) | |
| tree | 27a5dc586488eb299900f32b7e2885bd4c87901a | |
| parent | ca6809ad80b289742bfa8f2b83ec5a1b478bf018 (diff) | |
| download | webtrees-0d45b3e3f693321cf25e3077e41d70907b9ed720.tar.gz webtrees-0d45b3e3f693321cf25e3077e41d70907b9ed720.tar.bz2 webtrees-0d45b3e3f693321cf25e3077e41d70907b9ed720.zip | |
Fix: #2576 - show media title or filename, but not both on media tab
| -rw-r--r-- | app/Functions/FunctionsPrintFacts.php | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/app/Functions/FunctionsPrintFacts.php b/app/Functions/FunctionsPrintFacts.php index 7cba7b16d7..0d5b908054 100644 --- a/app/Functions/FunctionsPrintFacts.php +++ b/app/Functions/FunctionsPrintFacts.php @@ -42,6 +42,7 @@ use Fisharebest\Webtrees\Services\UserService; use Fisharebest\Webtrees\Source; use Fisharebest\Webtrees\Tree; use Ramsey\Uuid\Uuid; +use function e; use const PREG_SET_ORDER; /** @@ -1131,21 +1132,17 @@ class FunctionsPrintFacts echo '</th>'; echo '<td class="', $styleadd, '">'; if ($media) { - echo '<span class="field">'; foreach ($media->mediaFiles() as $media_file) { + echo '<div>'; echo $media_file->displayImage(100, 100, 'contain', []); + echo '<br>'; + echo '<a href="' . e($media->url()) . '"> '; + echo '<em>'; + echo $media_file->title() ?: $media_file->filename(); + echo '</em>'; + echo '</a>'; + echo '</div>'; } - echo '<a href="' . e($media->url()) . '"> '; - echo '<em>'; - foreach ($media->getAllNames() as $name) { - if ($name['type'] !== 'TITL') { - echo '<br>'; - } - echo $name['full']; - } - echo '</em>'; - echo '</a>'; - echo '</span>'; echo FunctionsPrint::printFactNotes($tree, $media->gedcom(), 1); echo self::printFactSources($tree, $media->gedcom(), 1); |
