summaryrefslogtreecommitdiff
path: root/resources/views/cards/add-source-citation.php
blob: cf495345c86c3712b0fdcb989e523d6e34fb68ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php use Fisharebest\Webtrees\GedcomTag; ?>
<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>

<div class="card mb-4">
	<div class="card-header">
		<a href="#" data-toggle="collapse" data-target="#add-source-citation" aria-expanded="false" aria-controls="add-source-citation">
			<?= I18N::translate('Add a source citation') ?>
		</a>
	</div>

	<div class="card-body collapse" id="add-source-citation">
		<?= FunctionsEdit::addSimpleTag($tree, $level . ' SOUR @') ?>

		<?php if ($level === 1): ?>
			<div class="row">
				<div class="col-sm-3"></div>
				<div class="col-sm-9">
					<?php if (strpos($bdm, 'B') !== false): ?>
						<label>
							<input type="checkbox" name="SOUR_INDI" <?= $prefer_level2_sources === '2' ? 'checked' : '' ?> value="1">
							<?= I18N::translate('Individual') ?>
						</label>
						<?php if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $quick_required_facts, $matches)): ?>
							<?php foreach ($matches[1] as $match): ?>
								<?php if (!in_array($match, explode('|', WT_EVENTS_DEAT))): ?>
									<label>
										<input type="checkbox" name="SOUR_<?= $match ?>" <?= $prefer_level2_sources === '1' ? 'checked' : '' ?> value="1">
										<?= GedcomTag::getLabel($match) ?>
									</label>
								<?php endif ?>
							<?php endforeach ?>
						<?php endif ?>
					<?php endif ?>

					<?php if (strpos($bdm, 'D') !== false): ?>
						<?php if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $quick_required_facts, $matches)): ?>
							<?php foreach ($matches[1] as $match): ?>
								<?php if (in_array($match, explode('|', WT_EVENTS_DEAT))): ?>
									<label>
										<input type="checkbox" name="SOUR_<?= $match ?>" <?= $prefer_level2_sources === '1' ? 'checked' : '' ?> value="1">
										<?= GedcomTag::getLabel($match) ?>
									</label>
								<?php endif ?>
							<?php endforeach ?>
						<?php endif ?>
					<?php endif ?>

					<?php if (strpos($bdm, 'M') !== false): ?>
						<label>
							<input type="checkbox" name="SOUR_FAM" <?= $prefer_level2_sources === '2' ? 'checked' : '' ?> value="1">
							<?= I18N::translate('Family') ?>
						</label>
						<?php if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $quick_required_famfacts, $matches)): ?>
							<?php foreach ($matches[1] as $match): ?>
								<label>
									<input type="checkbox" name="SOUR_<?= $match ?>" <?= $prefer_level2_sources === '1' ? 'checked' : '' ?> value="1">
									<?= GedcomTag::getLabel($match) ?>
								</label>
							<?php endforeach ?>
						<?php endif ?>
					<?php endif ?>
				</div>
			</div>
		<?php endif ?>

		<?= FunctionsEdit::addSimpleTag($tree, ($level + 1) . ' PAGE') ?>
		<?= FunctionsEdit::addSimpleTag($tree, ($level + 1) . ' DATA') ?>
		<?= FunctionsEdit::addSimpleTag($tree, ($level + 2) . ' TEXT') ?>

		<?php if ($full_citations): ?>
			<?= FunctionsEdit::addSimpleTag($tree, ($level + 2) . ' DATE', '', I18N::translate('Date of entry in original source')) ?>
			<?= FunctionsEdit::addSimpleTag($tree, ($level + 1) . ' QUAY') ?>
		<?php endif ?>

		<?= FunctionsEdit::addSimpleTag($tree, ($level + 1) . ' OBJE') ?>
		<?= FunctionsEdit::addSimpleTag($tree, ($level + 1) . ' SHARED_NOTE') ?>
	</div>
</div>