summaryrefslogtreecommitdiff
path: root/resources/views/fact-media.phtml
diff options
context:
space:
mode:
Diffstat (limited to 'resources/views/fact-media.phtml')
-rw-r--r--resources/views/fact-media.phtml17
1 files changed, 17 insertions, 0 deletions
diff --git a/resources/views/fact-media.phtml b/resources/views/fact-media.phtml
new file mode 100644
index 0000000000..78095a3564
--- /dev/null
+++ b/resources/views/fact-media.phtml
@@ -0,0 +1,17 @@
+<?php
+
+use Fisharebest\Webtrees\Fact;
+
+/**
+ * @var Fact $fact
+ */
+
+?>
+
+<?php if (preg_match_all('/\n(2 OBJE\b.*(?:\n[^2].*)*)/', $fact->gedcom(), $matches, PREG_SET_ORDER) > 0) : ?>
+ <div class="wt-fact-media mt-2">
+ <?php foreach ($matches as $match) : ?>
+ <?= view('fact-gedcom-fields', ['gedcom' => $match[1], 'parent' => $fact->tag(), 'tree' => $fact->record()->tree()]) ?>
+ <?php endforeach ?>
+ </div>
+<?php endif ?>