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