xref: /webtrees/resources/views/admin/trees-export.phtml (revision ac71572d8462e396ed5a307f05b29381e49f9e6e)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
6use Fisharebest\Webtrees\Http\RequestHandlers\ExportGedcomClient;
7use Fisharebest\Webtrees\Http\RequestHandlers\ExportGedcomServer;
8use Fisharebest\Webtrees\Http\RequestHandlers\ManageTrees;
9use Fisharebest\Webtrees\I18N;
10use Fisharebest\Webtrees\Tree;
11
12/**
13 * @var array<string> $download_filenames
14 * @var string        $filename
15 * @var string        $title
16 * @var Tree          $tree
17 * @var bool          $zip_available
18 */
19
20?>
21
22<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), route(ManageTrees::class, ['tree' => $tree->name()]) => I18N::translate('Manage family trees'), $title]]) ?>
23
24<h1><?= $title ?></h1>
25
26<div class="row">
27    <div class="col-sm-6">
28        <div class="card">
29            <div class="card-header">
30                <?= I18N::translate('A file on the server') ?>
31            </div>
32            <div class="card-body">
33                <form method="post" action="<?= e(route(ExportGedcomServer::class, ['tree' => $tree->name()])) ?>" class="form form-horizontal">
34                    <div class="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('save') ?>
43                    </button>
44
45                    <?= csrf_field() ?>
46                </form>
47            </div>
48        </div>
49    </div>
50
51    <div class="col-sm-6">
52        <div class="card">
53            <div class="card-header">
54                <?= I18N::translate('A file on your computer') ?>
55            </div>
56
57            <div class="card-body">
58                <form method="post" action="<?= e(route(ExportGedcomClient::class, ['tree' => $tree->name()])) ?>" class="form form-horizontal">
59                    <p class="card-title">
60                        <?= I18N::translate('Export preferences') ?>
61                    </p>
62
63                    <?= view('admin/gedcom-export-options', ['download_filenames' => $download_filenames, 'tree' => $tree, 'zip_available' => $zip_available]) ?>
64
65                    <button type="submit" class="btn btn-primary">
66                        <?= view('icons/download') ?>
67                        <?= /* I18N: A button label. */
68                        I18N::translate('download') ?>
69                    </button>
70
71                    <?= csrf_field() ?>
72                </form>
73            </div>
74        </div>
75    </div>
76</div>
77
78<?= view('modals/ajax') ?>
79