diff options
| author | Greg Roach <fisharebest@webtrees.net> | 2018-06-18 12:11:22 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@webtrees.net> | 2018-06-18 17:04:13 +0100 |
| commit | a79ebb440d002378ab8a7447241da23d6aab0ee6 (patch) | |
| tree | 494fb54e25dc6e08dc88121d768bc020cdc6358c /resources | |
| parent | 3c515805baa6273a039f60b703833786656884b3 (diff) | |
| download | webtrees-a79ebb440d002378ab8a7447241da23d6aab0ee6.tar.gz webtrees-a79ebb440d002378ab8a7447241da23d6aab0ee6.tar.bz2 webtrees-a79ebb440d002378ab8a7447241da23d6aab0ee6.zip | |
Convert PGV import wizard to http/controller
Diffstat (limited to 'resources')
| -rw-r--r-- | resources/views/admin/phpgedview/steps.php | 35 | ||||
| -rw-r--r-- | resources/views/admin/phpgedview/wizard.php | 60 | ||||
| -rw-r--r-- | resources/views/admin/trees.php | 2 | ||||
| -rw-r--r-- | resources/views/admin/upgrade/steps.php | 25 | ||||
| -rw-r--r-- | resources/views/admin/upgrade/wizard.php | 60 |
5 files changed, 181 insertions, 1 deletions
diff --git a/resources/views/admin/phpgedview/steps.php b/resources/views/admin/phpgedview/steps.php new file mode 100644 index 0000000000..b5dcec3943 --- /dev/null +++ b/resources/views/admin/phpgedview/steps.php @@ -0,0 +1,35 @@ +<?php use Fisharebest\Webtrees\I18N; ?> +<?php use Fisharebest\Webtrees\View; ?> + +<?= view('admin/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('admin-trees') => I18N::translate('Manage family trees'), $title]]) ?> + +<h1><?= $title ?></h1> + +<dl> + <?php foreach ($steps as $url => $text): ?> + <dt><?= $text ?></dt> + <dd class="wt-ajax-load" data-url="<?= e($url) ?>"></dd> + <?php endforeach ?> +</dl> + +<?php View::push('javascript') ?> +<script> + function nextAjaxStep() { + $("dd:empty:first").each(function(n, el) { + $(el).load(el.dataset.url, {}, function (responseText, textStatus, req) { + el.innerHTML = responseText; + if (textStatus === "error") { + $(".wt-ajax-load").removeClass("wt-ajax-load"); + } else { + nextAjaxStep(); + } + }); + + // Only process one callback at a time. + return false; + }); + } + + nextAjaxStep(); +</script> +<?php View::endpush() ?> diff --git a/resources/views/admin/phpgedview/wizard.php b/resources/views/admin/phpgedview/wizard.php new file mode 100644 index 0000000000..f2ba85ab99 --- /dev/null +++ b/resources/views/admin/phpgedview/wizard.php @@ -0,0 +1,60 @@ +<?php use Fisharebest\Webtrees\I18N; ?> + +<?= view('admin/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('admin-trees') => I18N::translate('Manage family trees'), $title]]) ?> + +<h1><?= $title ?></h1> + +<form class="form-horizontal"> + <input type="hidden" name="route" value="phpgedview-wizard"> + <?php if (!empty($pgv_paths)): ?> + <div class="row form-group"> + <div class="col-sm-3 col-form-label"> + <?= I18N::translate('PhpGedView might be installed in one of these folders:') ?> + </div> + <div class="col-sm-9"> + <?php foreach ($pgv_paths as $pgv_path): ?> + <div> + <a href="#" onclick="document.getElementById('pgv_path').value=this.dataset.path; return false;" data-path="<?= e($pgv_path) ?>"> + <?= e($pgv_path) ?> + </a> + </div> + <?php endforeach ?> + </div> + </div> + <?php endif ?> + + <div class="row form-group"> + <label class="col-sm-3 col-form-label" for="pgv_path"> + <?= I18N::translate('Where is your PhpGedView installation?') ?> + </label> + <div class="col-sm-9"> + <div class="input-group"> + <div class="input-group-prepend"> + <span class="input-group-text"><?= e(WT_ROOT) ?></span> + </div> + <input + type="text" + class="form-control" + dir="ltr" + id="pgv_path" + name="pgv_path" + size="40" + placeholder="<?= I18N::translate('Installation folder') ?>" + value="<?= count($pgv_paths) === 1 ? $pgv_paths[0] : '' ?>" + required + > + <div class="input-group-append"> + <span class="input-group-text">config.php</span> + </div> + </div> + </div> + </div> + + <div class="row form-group"> + <div class="offset-sm-3 col-sm-9"> + <button type="submit" class="btn btn-primary"> + <?= I18N::translate('continue') ?> + </button> + </div> + </div> +</form> diff --git a/resources/views/admin/trees.php b/resources/views/admin/trees.php index 040486608d..016796a678 100644 --- a/resources/views/admin/trees.php +++ b/resources/views/admin/trees.php @@ -391,7 +391,7 @@ <?= I18N::translate('<b>Important note:</b> The transfer wizard is not able to assist with moving media items. You will need to set up and move or copy your media configuration and objects separately after the transfer wizard is finished.') ?> </p> <p> - <a href="admin_pgv_to_wt.php"> + <a href="<?= route('phpgedview-wizard') ?>"> <?= I18N::translate('PhpGedView to webtrees transfer wizard') ?> </a> </p> diff --git a/resources/views/admin/upgrade/steps.php b/resources/views/admin/upgrade/steps.php new file mode 100644 index 0000000000..76ca69556d --- /dev/null +++ b/resources/views/admin/upgrade/steps.php @@ -0,0 +1,25 @@ +<?php use Fisharebest\Webtrees\I18N; ?> +<?php use Fisharebest\Webtrees\View; ?> + +<?= view('admin/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('admin-trees') => I18N::translate('Manage family trees'), $title]]) ?> + +<h1><?= $title ?></h1> + +<dl> + <?php foreach ($steps as $url => $text): ?> + <dt><?= $text ?></dt> + <dd class="wt-ajax-load" data-url="<?= e($url) ?>"></dd> + <?php endforeach ?> +</dl> + +<?php View::push('javascript') ?> +<script> + function nextUpgradeStep() { + $("dd:empty:first").each(function(el) { + $(el).load(el.dataset.url, {}, nextUpgradeStep); + }); + } + + nextUpgradeStep(); +</script> +<?php View::endpush() ?> diff --git a/resources/views/admin/upgrade/wizard.php b/resources/views/admin/upgrade/wizard.php new file mode 100644 index 0000000000..3f90f8d555 --- /dev/null +++ b/resources/views/admin/upgrade/wizard.php @@ -0,0 +1,60 @@ +<?php use Fisharebest\Webtrees\I18N; ?> + +<?= view('admin/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('admin-trees') => I18N::translate('Manage family trees'), $title]]) ?> + +<h1><?= $title ?></h1> + +<form class="form-horizontal"> + <input type="hidden" name="route" value="phpgedview-wizard"> + <?php if (!empty($pgv_paths)): ?> + <div class="row form-group"> + <div class="col-sm-3 col-form-label"> + <?= I18N::translate('PhpGedView might be installed in one of these folders:') ?> + </div> + <div class="col-sm-9"> + <?php foreach ($pgv_paths as $pgv_path): ?> + <div> + <a href="#" onclick="document.getElementById('pgv_path').value=this.dataset.path" data-path="<?= e($pgv_path) ?>"> + <?= e($pgv_path) ?> + </a> + </div> + <?php endforeach ?> + </div> + </div> + <?php endif ?> + + <div class="row form-group"> + <label class="col-sm-3 col-form-label" for="pgv_path"> + <?= I18N::translate('Where is your PhpGedView installation?') ?> + </label> + <div class="col-sm-9"> + <div class="input-group"> + <div class="input-group-prepend"> + <span class="input-group-text"><?= e(WT_ROOT) ?></span> + </div> + <input + type="text" + class="form-control" + dir="ltr" + id="pgv_path" + name="pgv_path" + size="40" + placeholder="<?= I18N::translate('Installation folder') ?>" + value="<?= count($pgv_paths) === 1 ? $pgv_paths[0] : '' ?>" + required + > + <div class="input-group-append"> + <span class="input-group-text">config.php</span> + </div> + </div> + </div> + </div> + + <div class="row form-group"> + <div class="offset-sm-3 col-sm-9"> + <button type="submit" class="btn btn-primary"> + <?= I18N::translate('continue') ?> + </button> + </div> + </div> +</form> |
