xref: /webtrees/resources/views/admin/trees-export.phtml (revision 9bf16a00403d0095ce5486d5759e9ae53c03ef9a)
1<?php
2
3use Fisharebest\Webtrees\Encodings\UTF8;
4use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
5use Fisharebest\Webtrees\Http\RequestHandlers\ExportGedcomClient;
6use Fisharebest\Webtrees\Http\RequestHandlers\ExportGedcomServer;
7use Fisharebest\Webtrees\Http\RequestHandlers\ManageTrees;
8use Fisharebest\Webtrees\I18N;
9use Fisharebest\Webtrees\Tree;
10
11/**
12 * @var string $filename
13 * @var string $title
14 * @var Tree   $tree
15 */
16
17?>
18
19<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), route(ManageTrees::class, ['tree' => $tree->name()]) => I18N::translate('Manage family trees'), $title]]) ?>
20
21<h1><?= $title ?></h1>
22
23<div class="row">
24    <div class="col-sm-6">
25        <div class="card">
26            <div class="card-header">
27                <?= I18N::translate('A file on the server') ?>
28            </div>
29            <div class="card-body">
30                <form method="post" action="<?= e(route(ExportGedcomServer::class, ['tree' => $tree->name()])) ?>" class="form form-horizontal">
31                    <?= csrf_field() ?>
32
33
34                    <div class="form-group mb-3">
35                        <label for="filename"><?= I18N::translate('Filename') ?></label>
36                        <input type="text" class="form-control" id="filename" name="filename" value="<?= e($filename) ?>">
37                    </div>
38
39                    <button type="submit" class="btn btn-primary">
40                        <?= view('icons/save') ?>
41                        <?= /* I18N: A button label. */
42                        I18N::translate('continue') ?>
43                    </button>
44                </form>
45            </div>
46        </div>
47    </div>
48
49    <div class="col-sm-6">
50        <div class="card">
51            <div class="card-header">
52                <?= I18N::translate('A file on your computer') ?>
53            </div>
54
55            <div class="card-body">
56                <form method="post" action="<?= e(route(ExportGedcomClient::class, ['tree' => $tree->name()])) ?>" class="form form-horizontal">
57                    <?= csrf_field() ?>
58
59                    <p class="card-title">
60                        <?= I18N::translate('Export preferences') ?>
61                    </p>
62
63                    <?= view('admin/gedcom-export-options', ['tree' => $tree]) ?>
64
65                    <?php if ($tree->getPreference('GEDCOM_MEDIA_PATH')) : ?>
66                        <div class="row mb-3">
67                            <label class="col-sm-3" for="media-path">
68                                <?= /* I18N: A media path (e.g. C:\aaa\bbb\ccc\) in a GEDCOM file */ I18N::translate('Add the GEDCOM media path to filenames') ?>
69                            </label>
70
71                            <div class="col-sm-9">
72                                <div class="form-check">
73                                    <input class="form-check-input" type="checkbox" id="media-path" name="media_path">
74                                    <label class="form-check-label" for="media-path">
75                                        <?= /* I18N: %s is the name of a folder. */ I18N::translate('Media filenames will be prefixed by %s.', '<code dir="ltr">' . e($tree->getPreference('GEDCOM_MEDIA_PATH')) . '</code>') ?>
76                                    </label>
77                                </div>
78                            </div>
79                        </div>
80                    <?php endif ?>
81
82                    <button type="submit" class="btn btn-primary">
83                        <?= view('icons/download') ?>
84                        <?= /* I18N: A button label. */
85                        I18N::translate('continue') ?>
86                    </button>
87                </form>
88            </div>
89        </div>
90    </div>
91</div>
92
93<?= view('modals/ajax') ?>
94