xref: /webtrees/app/Module/ClippingsCartModule.php (revision c775d8732eade73a612a956ad390833fcb5378b1)
18c2e8227SGreg Roach<?php
28c2e8227SGreg Roach/**
38c2e8227SGreg Roach * webtrees: online genealogy
46bdf7674SGreg Roach * Copyright (C) 2017 webtrees development team
58c2e8227SGreg Roach * This program is free software: you can redistribute it and/or modify
68c2e8227SGreg Roach * it under the terms of the GNU General Public License as published by
78c2e8227SGreg Roach * the Free Software Foundation, either version 3 of the License, or
88c2e8227SGreg Roach * (at your option) any later version.
98c2e8227SGreg Roach * This program is distributed in the hope that it will be useful,
108c2e8227SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
118c2e8227SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
128c2e8227SGreg Roach * GNU General Public License for more details.
138c2e8227SGreg Roach * You should have received a copy of the GNU General Public License
148c2e8227SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
158c2e8227SGreg Roach */
1676692c8bSGreg Roachnamespace Fisharebest\Webtrees\Module;
1776692c8bSGreg Roach
180e62c4b8SGreg Roachuse Fisharebest\Webtrees\Auth;
190e62c4b8SGreg Roachuse Fisharebest\Webtrees\Controller\PageController;
200e62c4b8SGreg Roachuse Fisharebest\Webtrees\Family;
210e62c4b8SGreg Roachuse Fisharebest\Webtrees\Filter;
220e62c4b8SGreg Roachuse Fisharebest\Webtrees\GedcomRecord;
23047f239bSGreg Roachuse Fisharebest\Webtrees\Html;
240e62c4b8SGreg Roachuse Fisharebest\Webtrees\I18N;
250e62c4b8SGreg Roachuse Fisharebest\Webtrees\Individual;
260e62c4b8SGreg Roachuse Fisharebest\Webtrees\Menu;
270e62c4b8SGreg Roachuse Fisharebest\Webtrees\Module\ClippingsCart\ClippingsCartController;
280e62c4b8SGreg Roachuse Fisharebest\Webtrees\Session;
298c2e8227SGreg Roach
308c2e8227SGreg Roach/**
318c2e8227SGreg Roach * Class ClippingsCartModule
328c2e8227SGreg Roach */
33e2a378d3SGreg Roachclass ClippingsCartModule extends AbstractModule implements ModuleMenuInterface, ModuleSidebarInterface {
348c2e8227SGreg Roach	/** {@inheritdoc} */
358c2e8227SGreg Roach	public function getTitle() {
36a86dd8b1SGreg Roach		return /* I18N: Name of a module */
37a86dd8b1SGreg Roach			I18N::translate('Clippings cart');
388c2e8227SGreg Roach	}
398c2e8227SGreg Roach
408c2e8227SGreg Roach	/** {@inheritdoc} */
418c2e8227SGreg Roach	public function getDescription() {
42a86dd8b1SGreg Roach		return /* I18N: Description of the “Clippings cart” module */
433bf19670SGreg Roach			I18N::translate('Select records from your family tree and save them as a GEDCOM file.');
448c2e8227SGreg Roach	}
458c2e8227SGreg Roach
460ee13198SGreg Roach	/**
470ee13198SGreg Roach	 * What is the default access level for this module?
480ee13198SGreg Roach	 *
490ee13198SGreg Roach	 * Some modules are aimed at admins or managers, and are not generally shown to users.
500ee13198SGreg Roach	 *
510ee13198SGreg Roach	 * @return int
520ee13198SGreg Roach	 */
538c2e8227SGreg Roach	public function defaultAccessLevel() {
544b9ff166SGreg Roach		return Auth::PRIV_USER;
558c2e8227SGreg Roach	}
568c2e8227SGreg Roach
5776692c8bSGreg Roach	/**
5876692c8bSGreg Roach	 * This is a general purpose hook, allowing modules to respond to routes
5976692c8bSGreg Roach	 * of the form module.php?mod=FOO&mod_action=BAR
6076692c8bSGreg Roach	 *
6176692c8bSGreg Roach	 * @param string $mod_action
6276692c8bSGreg Roach	 */
638c2e8227SGreg Roach	public function modAction($mod_action) {
648c2e8227SGreg Roach		switch ($mod_action) {
658c2e8227SGreg Roach		case 'ajax':
668c2e8227SGreg Roach			$html = $this->getSidebarAjaxContent();
678c2e8227SGreg Roach			header('Content-Type: text/html; charset=UTF-8');
688c2e8227SGreg Roach			echo $html;
698c2e8227SGreg Roach			break;
708c2e8227SGreg Roach		case 'index':
7131bc7874SGreg Roach			global $controller, $WT_TREE;
728c2e8227SGreg Roach
738c2e8227SGreg Roach			$MAX_PEDIGREE_GENERATIONS = $WT_TREE->getPreference('MAX_PEDIGREE_GENERATIONS');
748c2e8227SGreg Roach
750e62c4b8SGreg Roach			$clip_ctrl = new ClippingsCartController;
767bd2dc19SGreg Roach			$cart      = Session::get('cart');
778c2e8227SGreg Roach
788c2e8227SGreg Roach			$controller = new PageController;
798c2e8227SGreg Roach			$controller
808c2e8227SGreg Roach				->setPageTitle($this->getTitle())
8115d603e7SGreg Roach				->pageHeader();
828c2e8227SGreg Roach
838c2e8227SGreg Roach			echo '<script>';
848c2e8227SGreg Roach			echo 'function radAncestors(elementid) {var radFamilies=document.getElementById(elementid);radFamilies.checked=true;}';
858c2e8227SGreg Roach			echo '</script>';
86*c775d873Smakitso			echo '<div class="clipping-cart">';
878c2e8227SGreg Roach
8831bc7874SGreg Roach			if (!$cart[$WT_TREE->getTreeId()]) {
898c2e8227SGreg Roach				echo '<h2>', I18N::translate('Family tree clippings cart'), '</h2>';
908c2e8227SGreg Roach			}
918c2e8227SGreg Roach
928c2e8227SGreg Roach			if ($clip_ctrl->action == 'add') {
934e3c4966SGreg Roach				$record = GedcomRecord::getInstance($clip_ctrl->id, $WT_TREE);
948c2e8227SGreg Roach				if ($clip_ctrl->type === 'FAM') { ?>
95742a5f30Smakitso					<form class="wt-page-options wt-page-options-clipping-cart hidden-print" action="module.php">
968c2e8227SGreg Roach						<input type="hidden" name="mod" value="clippings">
978c2e8227SGreg Roach						<input type="hidden" name="mod_action" value="index">
9815d603e7SGreg Roach						<input type="hidden" name="id" value="<?= $clip_ctrl->id ?>">
9915d603e7SGreg Roach						<input type="hidden" name="type" value="<?= $clip_ctrl->type ?>">
1004e3c4966SGreg Roach						<input type="hidden" name="action" value="add1">
101742a5f30Smakitso						<table class="add-to center">
1024e3c4966SGreg Roach							<thead>
1034e3c4966SGreg Roach								<tr>
1044e3c4966SGreg Roach									<td class="topbottombar">
10515d603e7SGreg Roach										<?= I18N::translate('Add to the clippings cart') ?>
1064e3c4966SGreg Roach									</td>
1074e3c4966SGreg Roach								</tr>
1084e3c4966SGreg Roach							</thead>
1094e3c4966SGreg Roach							<tbody>
1104e3c4966SGreg Roach								<tr>
1114e3c4966SGreg Roach									<td class="optionbox">
1124e3c4966SGreg Roach										<input type="radio" name="others" value="parents">
11315d603e7SGreg Roach										<?= $record->getFullName() ?>
1144e3c4966SGreg Roach									</td>
1154e3c4966SGreg Roach								</tr>
1164e3c4966SGreg Roach								<tr>
1174e3c4966SGreg Roach									<td class="optionbox">
1184e3c4966SGreg Roach										<input type="radio" name="others" value="members" checked>
11915d603e7SGreg Roach										<?= /* I18N: %s is a family (husband + wife) */
12015d603e7SGreg Roach										I18N::translate('%s and their children', $record->getFullName()) ?>
1214e3c4966SGreg Roach									</td>
1224e3c4966SGreg Roach								</tr>
1234e3c4966SGreg Roach								<tr>
1244e3c4966SGreg Roach									<td class="optionbox">
1254e3c4966SGreg Roach										<input type="radio" name="others" value="descendants">
12615d603e7SGreg Roach										<?= /* I18N: %s is a family (husband + wife) */
12715d603e7SGreg Roach										I18N::translate('%s and their descendants', $record->getFullName()) ?>
1284e3c4966SGreg Roach									</td>
1294e3c4966SGreg Roach								</tr>
1304e3c4966SGreg Roach							</tbody>
1314e3c4966SGreg Roach							<tfoot>
1324e3c4966SGreg Roach								<tr>
13315d603e7SGreg Roach									<td class="topbottombar"><input type="submit" value="<?= I18N::translate('continue') ?>">
1344e3c4966SGreg Roach									</td>
1354e3c4966SGreg Roach								</tr>
1364e3c4966SGreg Roach							</tfoot>
1378c2e8227SGreg Roach						</table>
1388c2e8227SGreg Roach					</form>
139742a5f30Smakitso				</div>
1408c2e8227SGreg Roach				<?php } elseif ($clip_ctrl->type === 'INDI') { ?>
141742a5f30Smakitso					<form class="wt-page-options wt-page-options-clipping-cart hidden-print" action="module.php">
1428c2e8227SGreg Roach						<input type="hidden" name="mod" value="clippings">
1438c2e8227SGreg Roach						<input type="hidden" name="mod_action" value="index">
14415d603e7SGreg Roach						<input type="hidden" name="id" value="<?= $clip_ctrl->id ?>">
14515d603e7SGreg Roach						<input type="hidden" name="type" value="<?= $clip_ctrl->type ?>">
146a86dd8b1SGreg Roach						<input type="hidden" name="action" value="add1">
147742a5f30Smakitso						<table class="add-to center">
1484e3c4966SGreg Roach							<thead>
1494e3c4966SGreg Roach								<tr>
1504e3c4966SGreg Roach									<td class="topbottombar">
15115d603e7SGreg Roach										<?= I18N::translate('Add to the clippings cart') ?>
1524e3c4966SGreg Roach									</td>
1534e3c4966SGreg Roach								</tr>
1544e3c4966SGreg Roach							</thead>
1554e3c4966SGreg Roach							<tbody>
1564e3c4966SGreg Roach								<tr>
1574e3c4966SGreg Roach									<td class="optionbox">
1584e3c4966SGreg Roach										<label>
1594e3c4966SGreg Roach											<input type="radio" name="others" checked value="none">
16015d603e7SGreg Roach											<?= $record->getFullName() ?>
1614e3c4966SGreg Roach										</label>
1624e3c4966SGreg Roach									</td>
1634e3c4966SGreg Roach								</tr>
1644e3c4966SGreg Roach								<tr>
1654e3c4966SGreg Roach									<td class="optionbox">
1664e3c4966SGreg Roach										<label>
1674e3c4966SGreg Roach											<input type="radio" name="others" value="parents">
1684e3c4966SGreg Roach											<?php
1694e3c4966SGreg Roach											if ($record->getSex() === 'F') {
170a86dd8b1SGreg Roach												echo /* I18N: %s is a woman's name */
171a86dd8b1SGreg Roach												I18N::translate('%s, her parents and siblings', $record->getFullName());
1724e3c4966SGreg Roach											} else {
173a86dd8b1SGreg Roach												echo /* I18N: %s is a man's name */
174a86dd8b1SGreg Roach												I18N::translate('%s, his parents and siblings', $record->getFullName());
1754e3c4966SGreg Roach											}
1764e3c4966SGreg Roach											?>
1774e3c4966SGreg Roach										</label>
1784e3c4966SGreg Roach									</td>
1794e3c4966SGreg Roach								</tr>
1804e3c4966SGreg Roach								<tr>
1814e3c4966SGreg Roach									<td class="optionbox">
1824e3c4966SGreg Roach										<label>
1834e3c4966SGreg Roach											<input type="radio" name="others" value="members">
1844e3c4966SGreg Roach											<?php
1854e3c4966SGreg Roach											if ($record->getSex() === 'F') {
186a86dd8b1SGreg Roach												echo /* I18N: %s is a woman's name */
187a86dd8b1SGreg Roach												I18N::translate('%s, her spouses and children', $record->getFullName());
1884e3c4966SGreg Roach											} else {
189a86dd8b1SGreg Roach												echo /* I18N: %s is a man's name */
190a86dd8b1SGreg Roach												I18N::translate('%s, his spouses and children', $record->getFullName());
1914e3c4966SGreg Roach											}
1924e3c4966SGreg Roach											?>
1934e3c4966SGreg Roach										</label>
1944e3c4966SGreg Roach									</td>
1954e3c4966SGreg Roach								</tr>
1964e3c4966SGreg Roach								<tr>
1974e3c4966SGreg Roach									<td class="optionbox">
1984e3c4966SGreg Roach										<label>
1994e3c4966SGreg Roach											<input type="radio" name="others" value="ancestors" id="ancestors">
2004e3c4966SGreg Roach											<?php
2014e3c4966SGreg Roach											if ($record->getSex() === 'F') {
202a86dd8b1SGreg Roach												echo /* I18N: %s is a woman's name */
203a86dd8b1SGreg Roach												I18N::translate('%s and her ancestors', $record->getFullName());
2044e3c4966SGreg Roach											} else {
205a86dd8b1SGreg Roach												echo /* I18N: %s is a man's name */
206a86dd8b1SGreg Roach												I18N::translate('%s and his ancestors', $record->getFullName());
2074e3c4966SGreg Roach											}
2084e3c4966SGreg Roach											?>
2094e3c4966SGreg Roach										</label>
2104e3c4966SGreg Roach										<br>
21115d603e7SGreg Roach										<?= I18N::translate('Number of generations') ?>
21215d603e7SGreg Roach										<input type="text" size="5" name="level1" value="<?= $MAX_PEDIGREE_GENERATIONS ?>" onfocus="radAncestors('ancestors');">
2134e3c4966SGreg Roach									</td>
2144e3c4966SGreg Roach								</tr>
2154e3c4966SGreg Roach								<tr>
2164e3c4966SGreg Roach									<td class="optionbox">
2174e3c4966SGreg Roach										<label>
2184e3c4966SGreg Roach											<input type="radio" name="others" value="ancestorsfamilies" id="ancestorsfamilies">
2194e3c4966SGreg Roach											<?php
2204e3c4966SGreg Roach											if ($record->getSex() === 'F') {
221a86dd8b1SGreg Roach												echo /* I18N: %s is a woman's name */
222a86dd8b1SGreg Roach												I18N::translate('%s, her ancestors and their families', $record->getFullName());
2234e3c4966SGreg Roach											} else {
224a86dd8b1SGreg Roach												echo /* I18N: %s is a man's name */
225a86dd8b1SGreg Roach												I18N::translate('%s, his ancestors and their families', $record->getFullName());
2264e3c4966SGreg Roach											}
2274e3c4966SGreg Roach											?>
2284e3c4966SGreg Roach										</label>
2294e3c4966SGreg Roach										<br>
23015d603e7SGreg Roach										<?= I18N::translate('Number of generations') ?>
23115d603e7SGreg Roach										<input type="text" size="5" name="level2" value="<?= $MAX_PEDIGREE_GENERATIONS ?>" onfocus="radAncestors('ancestorsfamilies');">
2324e3c4966SGreg Roach									</td>
2334e3c4966SGreg Roach								</tr>
2344e3c4966SGreg Roach								<tr>
2354e3c4966SGreg Roach									<td class="optionbox">
2364e3c4966SGreg Roach										<label>
2374e3c4966SGreg Roach											<input type="radio" name="others" value="descendants" id="descendants">
2384e3c4966SGreg Roach											<?php
2394e3c4966SGreg Roach											if ($record->getSex() === 'F') {
240a86dd8b1SGreg Roach												echo /* I18N: %s is a woman's name */
241a86dd8b1SGreg Roach												I18N::translate('%s, her spouses and descendants', $record->getFullName());
2424e3c4966SGreg Roach											} else {
243a86dd8b1SGreg Roach												echo /* I18N: %s is a man's name */
244a86dd8b1SGreg Roach												I18N::translate('%s, his spouses and descendants', $record->getFullName());
2454e3c4966SGreg Roach											}
2464e3c4966SGreg Roach											?>
2474e3c4966SGreg Roach										</label>
2484e3c4966SGreg Roach										<br>
24915d603e7SGreg Roach										<?= I18N::translate('Number of generations') ?>
25015d603e7SGreg Roach										<input type="text" size="5" name="level3" value="<?= $MAX_PEDIGREE_GENERATIONS ?>" onfocus="radAncestors('descendants');">
2514e3c4966SGreg Roach									</td>
2524e3c4966SGreg Roach								</tr>
2534e3c4966SGreg Roach							</tbody>
2544e3c4966SGreg Roach							<tfoot>
2554e3c4966SGreg Roach								<tr>
2564e3c4966SGreg Roach									<td class="topbottombar">
25715d603e7SGreg Roach										<input type="submit" value="<?= I18N::translate('continue') ?>">
2584e3c4966SGreg Roach									</td>
2594e3c4966SGreg Roach								</tr>
2604e3c4966SGreg Roach							</tfoot>
2618c2e8227SGreg Roach						</table>
2628c2e8227SGreg Roach					</form>
263742a5f30Smakitso				</div>
2648c2e8227SGreg Roach				<?php } elseif ($clip_ctrl->type === 'SOUR') { ?>
265742a5f30Smakitso					<form class="wt-page-options wt-page-options-clipping-cart hidden-print" action="module.php">
2668c2e8227SGreg Roach						<input type="hidden" name="mod" value="clippings">
2678c2e8227SGreg Roach						<input type="hidden" name="mod_action" value="index">
26815d603e7SGreg Roach						<input type="hidden" name="id" value="<?= $clip_ctrl->id ?>">
26915d603e7SGreg Roach						<input type="hidden" name="type" value="<?= $clip_ctrl->type ?>">
270a86dd8b1SGreg Roach						<input type="hidden" name="action" value="add1">
271742a5f30Smakitso						<table class="add-to center">
2724e3c4966SGreg Roach							<thead>
2734e3c4966SGreg Roach								<tr>
2744e3c4966SGreg Roach									<td class="topbottombar">
27515d603e7SGreg Roach										<?= I18N::translate('Add to the clippings cart') ?>
2764e3c4966SGreg Roach									</td>
2774e3c4966SGreg Roach								</tr>
2784e3c4966SGreg Roach							</thead>
2794e3c4966SGreg Roach							<tbody>
2804e3c4966SGreg Roach								<tr>
2814e3c4966SGreg Roach									<td class="optionbox">
2824e3c4966SGreg Roach										<label>
2834e3c4966SGreg Roach											<input type="radio" name="others" checked value="none">
28415d603e7SGreg Roach											<?= $record->getFullName() ?>
2854e3c4966SGreg Roach										</label>
2864e3c4966SGreg Roach									</td>
2874e3c4966SGreg Roach								</tr>
2884e3c4966SGreg Roach								<tr>
2894e3c4966SGreg Roach									<td class="optionbox">
2904e3c4966SGreg Roach										<label>
2914e3c4966SGreg Roach											<input type="radio" name="others" value="linked">
29215d603e7SGreg Roach											<?= /* I18N: %s is the name of a source */
29315d603e7SGreg Roach											I18N::translate('%s and the individuals that reference it.', $record->getFullName()) ?>
2944e3c4966SGreg Roach										</label>
2954e3c4966SGreg Roach									</td>
2964e3c4966SGreg Roach								</tr>
2974e3c4966SGreg Roach							</tbody>
2984e3c4966SGreg Roach							<tfoot>
2994e3c4966SGreg Roach								<tr>
3004e3c4966SGreg Roach									<td class="topbottombar">
30115d603e7SGreg Roach										<input type="submit" value="<?= I18N::translate('continue') ?>">
3024e3c4966SGreg Roach									</td>
3034e3c4966SGreg Roach								</tr>
3044e3c4966SGreg Roach							</tfoot>
3058c2e8227SGreg Roach						</table>
3068c2e8227SGreg Roach					</form>
307742a5f30Smakitso				</div>
3088c2e8227SGreg Roach				<?php }
3098c2e8227SGreg Roach			}
3108c2e8227SGreg Roach
31131bc7874SGreg Roach			if (!$cart[$WT_TREE->getTreeId()]) {
3128c2e8227SGreg Roach				if ($clip_ctrl->action != 'add') {
313742a5f30Smakitso					echo '<div class="center">';
3142a277e58SGreg Roach					echo I18N::translate('The clippings cart allows you to take extracts from this family tree and download them as a GEDCOM file.');
315742a5f30Smakitso					echo '</div>';
3168c2e8227SGreg Roach					?>
317742a5f30Smakitso					<form class="wt-page-options wt-page-options-clipping-cart hidden-print" name="addin" action="module.php">
3188c2e8227SGreg Roach						<input type="hidden" name="mod" value="clippings">
3198c2e8227SGreg Roach						<input type="hidden" name="mod_action" value="index">
320742a5f30Smakitso						<table class="add-to center">
3214e3c4966SGreg Roach							<thead>
3228c2e8227SGreg Roach								<tr>
3234e3c4966SGreg Roach									<td colspan="2" class="topbottombar">
32415d603e7SGreg Roach										<?= I18N::translate('Add to the clippings cart') ?>
3258c2e8227SGreg Roach									</td>
3268c2e8227SGreg Roach								</tr>
3274e3c4966SGreg Roach							</thead>
3284e3c4966SGreg Roach							<tbody>
3298c2e8227SGreg Roach								<tr>
3308c2e8227SGreg Roach									<td class="optionbox">
3318c2e8227SGreg Roach										<input type="hidden" name="action" value="add">
3328c2e8227SGreg Roach										<input type="text" data-autocomplete-type="IFSRO" name="id" id="cart_item_id" size="5">
3338c2e8227SGreg Roach									</td>
3348c2e8227SGreg Roach									<td class="optionbox">
33515d603e7SGreg Roach										<input type="submit" value="<?= /* I18N: A button label. */ I18N::translate('add') ?>">
3368c2e8227SGreg Roach									</td>
3378c2e8227SGreg Roach								</tr>
3384e3c4966SGreg Roach							</tbody>
3398c2e8227SGreg Roach						</table>
3408c2e8227SGreg Roach					</form>
341742a5f30Smakitso				</div>
3428c2e8227SGreg Roach					<?php
3438c2e8227SGreg Roach				}
344742a5f30Smakitso				echo '<div class="center">';
3458c2e8227SGreg Roach				// -- end new lines
3468c2e8227SGreg Roach				echo I18N::translate('Your clippings cart is empty.');
347742a5f30Smakitso				echo '</div>';
3488c2e8227SGreg Roach			} else {
3498c2e8227SGreg Roach				// Keep track of the INDI from the parent page, otherwise it will
3508c2e8227SGreg Roach				// get lost after ajax updates
3518c2e8227SGreg Roach				$pid = Filter::get('pid', WT_REGEX_XREF);
3528c2e8227SGreg Roach
353a86dd8b1SGreg Roach				if ($clip_ctrl->action !== 'download' && $clip_ctrl->action !== 'add') { ?>
354742a5f30Smakitso					<form class="wt-page-options wt-page-options-clipping-cart hidden-print" action="module.php">
3558c2e8227SGreg Roach						<input type="hidden" name="mod" value="clippings">
3568c2e8227SGreg Roach						<input type="hidden" name="mod_action" value="index">
3578c2e8227SGreg Roach						<input type="hidden" name="action" value="download">
35815d603e7SGreg Roach						<input type="hidden" name="pid" value="<?= $pid ?>">
359742a5f30Smakitso						<table class="add-to center">
360a86dd8b1SGreg Roach							<tr>
361a86dd8b1SGreg Roach								<td colspan="2" class="topbottombar">
36215d603e7SGreg Roach									<h2><?= I18N::translate('Download') ?></h2>
363a86dd8b1SGreg Roach								</td>
364a86dd8b1SGreg Roach							</tr>
3654b9ff166SGreg Roach							<?php if (Auth::isManager($WT_TREE)) { ?>
366a86dd8b1SGreg Roach								<tr>
367a86dd8b1SGreg Roach									<td class="descriptionbox width50 wrap">
36815d603e7SGreg Roach										<?= I18N::translate('Apply privacy settings') ?>
369a86dd8b1SGreg Roach									</td>
3708c2e8227SGreg Roach									<td class="optionbox">
371a86dd8b1SGreg Roach										<input type="radio" name="privatize_export" value="none" checked>
37215d603e7SGreg Roach										<?= I18N::translate('None') ?>
373a86dd8b1SGreg Roach										<br>
374a86dd8b1SGreg Roach										<input type="radio" name="privatize_export" value="gedadmin">
37515d603e7SGreg Roach										<?= I18N::translate('Manager') ?>
376a86dd8b1SGreg Roach										<br>
377a86dd8b1SGreg Roach										<input type="radio" name="privatize_export" value="user">
37815d603e7SGreg Roach										<?= I18N::translate('Member') ?>
379a86dd8b1SGreg Roach										<br>
380a86dd8b1SGreg Roach										<input type="radio" name="privatize_export" value="visitor">
38115d603e7SGreg Roach										<?= I18N::translate('Visitor') ?>
382a86dd8b1SGreg Roach									</td>
383a86dd8b1SGreg Roach								</tr>
3844b9ff166SGreg Roach							<?php } elseif (Auth::isMember($WT_TREE)) { ?>
385a86dd8b1SGreg Roach								<tr>
386a86dd8b1SGreg Roach									<td class="descriptionbox width50 wrap">
38715d603e7SGreg Roach										<?= I18N::translate('Apply privacy settings') ?>
388a86dd8b1SGreg Roach									</td>
3898c2e8227SGreg Roach									<td class="optionbox">
39015d603e7SGreg Roach										<input type="radio" name="privatize_export" value="user" checked> <?= I18N::translate('Member') ?><br>
39115d603e7SGreg Roach										<input type="radio" name="privatize_export" value="visitor"> <?= I18N::translate('Visitor') ?>
392a86dd8b1SGreg Roach									</td>
393a86dd8b1SGreg Roach								</tr>
3948c2e8227SGreg Roach							<?php } ?>
3958c2e8227SGreg Roach
396a86dd8b1SGreg Roach							<tr>
397a86dd8b1SGreg Roach								<td class="descriptionbox width50 wrap">
39815d603e7SGreg Roach									<?= I18N::translate('Convert from UTF-8 to ISO-8859-1') ?>
399a86dd8b1SGreg Roach								</td>
400a86dd8b1SGreg Roach								<td class="optionbox">
401a86dd8b1SGreg Roach									<input type="checkbox" name="convert" value="yes">
402a86dd8b1SGreg Roach								</td>
403a86dd8b1SGreg Roach							</tr>
4048c2e8227SGreg Roach
405a86dd8b1SGreg Roach							<tr>
406a86dd8b1SGreg Roach								<td class="topbottombar" colspan="2">
40715d603e7SGreg Roach									<input type="submit" value="<?= /* I18N: A button label. */ I18N::translate('download') ?>">
408a86dd8b1SGreg Roach								</td>
409a86dd8b1SGreg Roach							</tr>
410a86dd8b1SGreg Roach						</table>
4118c2e8227SGreg Roach					</form>
412742a5f30Smakitso				</div>
4138c2e8227SGreg Roach					<br>
4148c2e8227SGreg Roach
415742a5f30Smakitso					<form class="wt-page-options wt-page-options-clipping-cart hidden-print" name="addin" action="module.php">
4168c2e8227SGreg Roach						<input type="hidden" name="mod" value="clippings">
4178c2e8227SGreg Roach						<input type="hidden" name="mod_action" value="index">
418742a5f30Smakitso						<table class="add-to center">
4194e3c4966SGreg Roach							<thead>
4208c2e8227SGreg Roach								<tr>
4218c2e8227SGreg Roach									<td colspan="2" class="topbottombar" style="text-align:center; ">
42215d603e7SGreg Roach										<?= I18N::translate('Add to the clippings cart') ?>
4238c2e8227SGreg Roach									</td>
4248c2e8227SGreg Roach								</tr>
4254e3c4966SGreg Roach							</thead>
4264e3c4966SGreg Roach							<tbody>
4278c2e8227SGreg Roach								<tr>
4288c2e8227SGreg Roach									<td class="optionbox">
4298c2e8227SGreg Roach										<input type="hidden" name="action" value="add">
4308c2e8227SGreg Roach										<input type="text" data-autocomplete-type="IFSRO" name="id" id="cart_item_id" size="8">
4318c2e8227SGreg Roach									</td>
4328c2e8227SGreg Roach									<td class="optionbox">
43315d603e7SGreg Roach										<input type="submit" value="<?= /* I18N: A button label. */ I18N::translate('add') ?>">
4348c2e8227SGreg Roach									</td>
4358c2e8227SGreg Roach								</tr>
4364e3c4966SGreg Roach							</tbody>
437a86dd8b1SGreg Roach							<tfoot>
438a86dd8b1SGreg Roach								<tr>
439a86dd8b1SGreg Roach									<th colspan="2">
440a86dd8b1SGreg Roach										<a href="module.php?mod=clippings&amp;mod_action=index&amp;action=empty">
44115d603e7SGreg Roach											<?= I18N::translate('Empty the clippings cart') ?>
442a86dd8b1SGreg Roach										</a>
443a86dd8b1SGreg Roach									</th>
444a86dd8b1SGreg Roach								</tr>
445a86dd8b1SGreg Roach							</tfoot>
4468c2e8227SGreg Roach						</table>
4478c2e8227SGreg Roach					</form>
448742a5f30Smakitso				</div>
4498c2e8227SGreg Roach				<?php } ?>
450*c775d873Smakitso				<div class="clipping-cart">
451a86dd8b1SGreg Roach				<h2>
45215d603e7SGreg Roach					<?= I18N::translate('Family tree clippings cart') ?>
453a86dd8b1SGreg Roach				</h2>
454742a5f30Smakitso				<table id="mycart" class="sortable list_table width50">
455a86dd8b1SGreg Roach					<thead>
4568c2e8227SGreg Roach						<tr>
45715d603e7SGreg Roach							<th class="list_label"><?= I18N::translate('Record') ?></th>
45815d603e7SGreg Roach							<th class="list_label"><?= I18N::translate('Remove') ?></th>
4598c2e8227SGreg Roach						</tr>
460a86dd8b1SGreg Roach					</thead>
461a86dd8b1SGreg Roach					<tbody>
4628c2e8227SGreg Roach						<?php
46331bc7874SGreg Roach						foreach (array_keys($cart[$WT_TREE->getTreeId()]) as $xref) {
46424ec66ceSGreg Roach							$record = GedcomRecord::getInstance($xref, $WT_TREE);
4658c2e8227SGreg Roach							if ($record) {
4668c2e8227SGreg Roach								switch ($record::RECORD_TYPE) {
467a86dd8b1SGreg Roach								case 'INDI':
468a86dd8b1SGreg Roach									$icon = 'icon-indis';
469a86dd8b1SGreg Roach									break;
470a86dd8b1SGreg Roach								case 'FAM':
471a86dd8b1SGreg Roach									$icon = 'icon-sfamily';
472a86dd8b1SGreg Roach									break;
473a86dd8b1SGreg Roach								case 'SOUR':
474a86dd8b1SGreg Roach									$icon = 'icon-source';
475a86dd8b1SGreg Roach									break;
476a86dd8b1SGreg Roach								case 'REPO':
477a86dd8b1SGreg Roach									$icon = 'icon-repository';
478a86dd8b1SGreg Roach									break;
479a86dd8b1SGreg Roach								case 'NOTE':
480a86dd8b1SGreg Roach									$icon = 'icon-note';
481a86dd8b1SGreg Roach									break;
482a86dd8b1SGreg Roach								case 'OBJE':
483a86dd8b1SGreg Roach									$icon = 'icon-media';
484a86dd8b1SGreg Roach									break;
485a86dd8b1SGreg Roach								default:
486a86dd8b1SGreg Roach									$icon = 'icon-clippings';
487a86dd8b1SGreg Roach									break;
4888c2e8227SGreg Roach								}
4898c2e8227SGreg Roach								?>
490a86dd8b1SGreg Roach								<tr>
491a86dd8b1SGreg Roach									<td class="list_value">
49215d603e7SGreg Roach										<i class="<?= $icon ?>"></i>
4938c2e8227SGreg Roach										<?php
4948c2e8227SGreg Roach										echo '<a href="', $record->getHtmlUrl(), '">', $record->getFullName(), '</a>';
4958c2e8227SGreg Roach										?>
4968c2e8227SGreg Roach									</td>
49715d603e7SGreg Roach									<td class="list_value center vmiddle"><a href="module.php?mod=clippings&amp;mod_action=index&amp;action=remove&amp;id=<?= $xref ?>" class="icon-remove" title="<?= I18N::translate('Remove') ?>"></a></td>
4988c2e8227SGreg Roach								</tr>
4998c2e8227SGreg Roach								<?php
5008c2e8227SGreg Roach							}
5018c2e8227SGreg Roach						}
5028c2e8227SGreg Roach						?>
5038c2e8227SGreg Roach				</table>
504742a5f30Smakitso			</div>
5058c2e8227SGreg Roach				<?php
5068c2e8227SGreg Roach			}
5078c2e8227SGreg Roach			break;
5088c2e8227SGreg Roach		default:
5098c2e8227SGreg Roach			http_response_code(404);
5108c2e8227SGreg Roach			break;
5118c2e8227SGreg Roach		}
5128c2e8227SGreg Roach	}
5138c2e8227SGreg Roach
5140ee13198SGreg Roach	/**
5150ee13198SGreg Roach	 * The user can re-order menus. Until they do, they are shown in this order.
5160ee13198SGreg Roach	 *
5170ee13198SGreg Roach	 * @return int
5180ee13198SGreg Roach	 */
5198c2e8227SGreg Roach	public function defaultMenuOrder() {
5208c2e8227SGreg Roach		return 20;
5218c2e8227SGreg Roach	}
5228c2e8227SGreg Roach
5230ee13198SGreg Roach	/**
5240ee13198SGreg Roach	 * A menu, to be added to the main application menu.
5250ee13198SGreg Roach	 *
5260ee13198SGreg Roach	 * @return Menu|null
5270ee13198SGreg Roach	 */
5288c2e8227SGreg Roach	public function getMenu() {
5294b9ff166SGreg Roach		global $controller, $WT_TREE;
5308c2e8227SGreg Roach
53113abd6f3SGreg Roach		$submenus = [];
5328c2e8227SGreg Roach		if (isset($controller->record)) {
53315d603e7SGreg Roach			$submenus[] = new Menu($this->getTitle(), 'module.php?mod=clippings&amp;mod_action=index&amp;ged=' . $WT_TREE->getNameUrl(), 'menu-clippings-cart', ['rel' => 'nofollow']);
5348c2e8227SGreg Roach		}
5358c2e8227SGreg Roach		if (!empty($controller->record) && $controller->record->canShow()) {
53615d603e7SGreg Roach			$submenus[] = new Menu(I18N::translate('Add to the clippings cart'), 'module.php?mod=clippings&amp;mod_action=index&amp;action=add&amp;id=' . $controller->record->getXref(), 'menu-clippings-add', ['rel' => 'nofollow']);
5378c2e8227SGreg Roach		}
538cbc1590aSGreg Roach
539941edf23SGreg Roach		if ($submenus) {
54013abd6f3SGreg Roach			return new Menu($this->getTitle(), '#', 'menu-clippings', ['rel' => 'nofollow'], $submenus);
541941edf23SGreg Roach		} else {
54213abd6f3SGreg Roach			return new Menu($this->getTitle(), 'module.php?mod=clippings&amp;mod_action=index&amp;ged=' . $WT_TREE->getNameUrl(), 'menu-clippings', ['rel' => 'nofollow']);
543941edf23SGreg Roach		}
5448c2e8227SGreg Roach	}
5458c2e8227SGreg Roach
5468c2e8227SGreg Roach	/** {@inheritdoc} */
5478c2e8227SGreg Roach	public function defaultSidebarOrder() {
5488c2e8227SGreg Roach		return 60;
5498c2e8227SGreg Roach	}
5508c2e8227SGreg Roach
5518c2e8227SGreg Roach	/** {@inheritdoc} */
5528c2e8227SGreg Roach	public function hasSidebarContent() {
5538c2e8227SGreg Roach		// Creating a controller has the side effect of initialising the cart
5540e62c4b8SGreg Roach		new ClippingsCartController;
5558c2e8227SGreg Roach
5568c2e8227SGreg Roach		return true;
5578c2e8227SGreg Roach	}
5588c2e8227SGreg Roach
55976692c8bSGreg Roach	/**
56076692c8bSGreg Roach	 * Load this sidebar synchronously.
56176692c8bSGreg Roach	 *
56276692c8bSGreg Roach	 * @return string
56376692c8bSGreg Roach	 */
5648c2e8227SGreg Roach	public function getSidebarContent() {
5658c2e8227SGreg Roach		global $controller;
5668c2e8227SGreg Roach
5678c2e8227SGreg Roach		$controller->addInlineJavascript('
56815d603e7SGreg Roach				$("#sb_clippings_content").on("click", ".add_cart, .remove_cart", function() {
56915d603e7SGreg Roach					$("#sb_clippings_content").load(this.href);
5708c2e8227SGreg Roach					return false;
5718c2e8227SGreg Roach				});
5728c2e8227SGreg Roach			');
5738c2e8227SGreg Roach
5748c2e8227SGreg Roach		return '<div id="sb_clippings_content">' . $this->getCartList() . '</div>';
5758c2e8227SGreg Roach	}
5768c2e8227SGreg Roach
5778c2e8227SGreg Roach	/** {@inheritdoc} */
5788c2e8227SGreg Roach	public function getSidebarAjaxContent() {
57931bc7874SGreg Roach		global $WT_TREE;
58031bc7874SGreg Roach
58131bc7874SGreg Roach		$cart = Session::get('cart');
5828c2e8227SGreg Roach
5830e62c4b8SGreg Roach		$clip_ctrl         = new ClippingsCartController;
5848c2e8227SGreg Roach		$add               = Filter::get('add', WT_REGEX_XREF);
5858c2e8227SGreg Roach		$add1              = Filter::get('add1', WT_REGEX_XREF);
5868c2e8227SGreg Roach		$remove            = Filter::get('remove', WT_REGEX_XREF);
5878c2e8227SGreg Roach		$others            = Filter::get('others');
5888c2e8227SGreg Roach		$clip_ctrl->level1 = Filter::getInteger('level1');
5898c2e8227SGreg Roach		$clip_ctrl->level2 = Filter::getInteger('level2');
5908c2e8227SGreg Roach		$clip_ctrl->level3 = Filter::getInteger('level3');
5918c2e8227SGreg Roach		if ($add) {
59224ec66ceSGreg Roach			$record = GedcomRecord::getInstance($add, $WT_TREE);
5938c2e8227SGreg Roach			if ($record) {
5948c2e8227SGreg Roach				$clip_ctrl->id   = $record->getXref();
5958c2e8227SGreg Roach				$clip_ctrl->type = $record::RECORD_TYPE;
5968c2e8227SGreg Roach				$clip_ctrl->addClipping($record);
5978c2e8227SGreg Roach			}
5988c2e8227SGreg Roach		} elseif ($add1) {
59924ec66ceSGreg Roach			$record = Individual::getInstance($add1, $WT_TREE);
6008c2e8227SGreg Roach			if ($record) {
6018c2e8227SGreg Roach				$clip_ctrl->id   = $record->getXref();
6028c2e8227SGreg Roach				$clip_ctrl->type = $record::RECORD_TYPE;
6038c2e8227SGreg Roach				if ($others == 'parents') {
6048c2e8227SGreg Roach					foreach ($record->getChildFamilies() as $family) {
6058c2e8227SGreg Roach						$clip_ctrl->addClipping($family);
6068c2e8227SGreg Roach						$clip_ctrl->addFamilyMembers($family);
6078c2e8227SGreg Roach					}
6088c2e8227SGreg Roach				} elseif ($others == 'ancestors') {
6098c2e8227SGreg Roach					$clip_ctrl->addAncestorsToCart($record, $clip_ctrl->level1);
6108c2e8227SGreg Roach				} elseif ($others == 'ancestorsfamilies') {
6118c2e8227SGreg Roach					$clip_ctrl->addAncestorsToCartFamilies($record, $clip_ctrl->level2);
6128c2e8227SGreg Roach				} elseif ($others == 'members') {
6138c2e8227SGreg Roach					foreach ($record->getSpouseFamilies() as $family) {
6148c2e8227SGreg Roach						$clip_ctrl->addClipping($family);
6158c2e8227SGreg Roach						$clip_ctrl->addFamilyMembers($family);
6168c2e8227SGreg Roach					}
6178c2e8227SGreg Roach				} elseif ($others == 'descendants') {
6188c2e8227SGreg Roach					foreach ($record->getSpouseFamilies() as $family) {
6198c2e8227SGreg Roach						$clip_ctrl->addClipping($family);
6208c2e8227SGreg Roach						$clip_ctrl->addFamilyDescendancy($family, $clip_ctrl->level3);
6218c2e8227SGreg Roach					}
6228c2e8227SGreg Roach				}
6238c2e8227SGreg Roach			}
6248c2e8227SGreg Roach		} elseif ($remove) {
62531bc7874SGreg Roach			unset($cart[$WT_TREE->getTreeId()][$remove]);
62631bc7874SGreg Roach			Session::put('cart', $cart);
6278c2e8227SGreg Roach		} elseif (isset($_REQUEST['empty'])) {
62813abd6f3SGreg Roach			$cart[$WT_TREE->getTreeId()] = [];
62931bc7874SGreg Roach			Session::put('cart', $cart);
6308c2e8227SGreg Roach		} elseif (isset($_REQUEST['download'])) {
631b6468bb9SGreg Roach			return $this->downloadForm();
6328c2e8227SGreg Roach		}
63331bc7874SGreg Roach
6348c2e8227SGreg Roach		return $this->getCartList();
6358c2e8227SGreg Roach	}
6368c2e8227SGreg Roach
6378c2e8227SGreg Roach	/**
6388c2e8227SGreg Roach	 * A list for the side bar.
6398c2e8227SGreg Roach	 *
6408c2e8227SGreg Roach	 * @return string
6418c2e8227SGreg Roach	 */
6428c2e8227SGreg Roach	public function getCartList() {
64331bc7874SGreg Roach		global $WT_TREE;
6448c2e8227SGreg Roach
64513abd6f3SGreg Roach		$cart = Session::get('cart', []);
64631bc7874SGreg Roach		if (!array_key_exists($WT_TREE->getTreeId(), $cart)) {
64713abd6f3SGreg Roach			$cart[$WT_TREE->getTreeId()] = [];
64831bc7874SGreg Roach		}
6498c2e8227SGreg Roach		$pid = Filter::get('pid', WT_REGEX_XREF);
6508c2e8227SGreg Roach
65131bc7874SGreg Roach		if (!$cart[$WT_TREE->getTreeId()]) {
6528c2e8227SGreg Roach			$out = I18N::translate('Your clippings cart is empty.');
6538c2e8227SGreg Roach		} else {
654b6468bb9SGreg Roach			$out = '';
655b6468bb9SGreg Roach			if (!empty($cart[$WT_TREE->getTreeId()])) {
656b6468bb9SGreg Roach				$out .=
657b6468bb9SGreg Roach					'<a href="module.php?mod=' . $this->getName() . '&amp;mod_action=ajax&amp;empty=true&amp;pid=' . $pid . '" class="remove_cart">' .
658b6468bb9SGreg Roach					I18N::translate('Empty the clippings cart') .
659b6468bb9SGreg Roach					'</a>' .
660b6468bb9SGreg Roach					'<br>' .
661b6468bb9SGreg Roach					'<a href="module.php?mod=' . $this->getName() . '&amp;mod_action=ajax&amp;download=true&amp;pid=' . $pid . '" class="add_cart">' .
662b6468bb9SGreg Roach					I18N::translate('Download') .
663b6468bb9SGreg Roach					'</a><br><br>';
664b6468bb9SGreg Roach			}
665b6468bb9SGreg Roach			$out .= '<ul>';
66631bc7874SGreg Roach			foreach (array_keys($cart[$WT_TREE->getTreeId()]) as $xref) {
66724ec66ceSGreg Roach				$record = GedcomRecord::getInstance($xref, $WT_TREE);
6688c2e8227SGreg Roach				if ($record instanceof Individual || $record instanceof Family) {
6698c2e8227SGreg Roach					switch ($record::RECORD_TYPE) {
6708c2e8227SGreg Roach					case 'INDI':
6718c2e8227SGreg Roach						$icon = 'icon-indis';
6728c2e8227SGreg Roach						break;
6738c2e8227SGreg Roach					case 'FAM':
6748c2e8227SGreg Roach						$icon = 'icon-sfamily';
6758c2e8227SGreg Roach						break;
6768c2e8227SGreg Roach					}
6778c2e8227SGreg Roach					$out .= '<li>';
6788c2e8227SGreg Roach					if (!empty($icon)) {
6798c2e8227SGreg Roach						$out .= '<i class="' . $icon . '"></i>';
6808c2e8227SGreg Roach					}
6818c2e8227SGreg Roach					$out .= '<a href="' . $record->getHtmlUrl() . '">';
6828c2e8227SGreg Roach					if ($record instanceof Individual) {
6838c2e8227SGreg Roach						$out .= $record->getSexImage();
6848c2e8227SGreg Roach					}
6858c2e8227SGreg Roach					$out .= ' ' . $record->getFullName() . ' ';
6868c2e8227SGreg Roach					if ($record instanceof Individual && $record->canShow()) {
6878c2e8227SGreg Roach						$out .= ' (' . $record->getLifeSpan() . ')';
6888c2e8227SGreg Roach					}
6898c2e8227SGreg Roach					$out .= '</a>';
690cdaf7c6cSGreg Roach					$out .= '<a class="icon-remove remove_cart" href="module.php?mod=' . $this->getName() . '&amp;mod_action=ajax&amp;remove=' . $xref . '&amp;pid=' . $pid . '" title="' . I18N::translate('Remove') . '"></a>';
6918c2e8227SGreg Roach					$out .= '</li>';
6928c2e8227SGreg Roach				}
6938c2e8227SGreg Roach			}
6948c2e8227SGreg Roach			$out .= '</ul>';
6958c2e8227SGreg Roach		}
6968c2e8227SGreg Roach
69724ec66ceSGreg Roach		$record = Individual::getInstance($pid, $WT_TREE);
69831bc7874SGreg Roach		if ($record && !array_key_exists($record->getXref(), $cart[$WT_TREE->getTreeId()])) {
699beb9c394SGreg Roach			$out .= '<br><a href="module.php?mod=' . $this->getName() . '&amp;mod_action=ajax&amp;action=add1&amp;type=INDI&amp;id=' . $pid . '&amp;pid=' . $pid . '" class="add_cart"><i class="icon-clippings"></i> ' . I18N::translate('Add %s to the clippings cart', $record->getFullName()) . '</a>';
7008c2e8227SGreg Roach		}
701cbc1590aSGreg Roach
7028c2e8227SGreg Roach		return $out;
7038c2e8227SGreg Roach	}
7048c2e8227SGreg Roach
7058c2e8227SGreg Roach	/**
70676692c8bSGreg Roach	 * A form to choose the download options.
70776692c8bSGreg Roach	 *
7088c2e8227SGreg Roach	 * @return string
7098c2e8227SGreg Roach	 */
710b6468bb9SGreg Roach	public function downloadForm() {
7118c2e8227SGreg Roach		global $WT_TREE;
7128c2e8227SGreg Roach
7138c2e8227SGreg Roach		$pid = Filter::get('pid', WT_REGEX_XREF);
7148c2e8227SGreg Roach
7158c2e8227SGreg Roach		$out = '<script>';
7168c2e8227SGreg Roach		$out .= 'function cancelDownload() {
717cdaf7c6cSGreg Roach				var link = "module.php?mod=' . $this->getName() . '&mod_action=ajax&pid=' . $pid . '";
71815d603e7SGreg Roach				$("#sb_clippings_content").load(link);
7198c2e8227SGreg Roach			}';
7208c2e8227SGreg Roach		$out .= '</script>';
721742a5f30Smakitso		$out .= '<form class="wt-page-options wt-page-options-clipping-cart hidden-print" action="module.php">
7228c2e8227SGreg Roach		<input type="hidden" name="mod" value="clippings">
7238c2e8227SGreg Roach		<input type="hidden" name="mod_action" value="index">
7248c2e8227SGreg Roach		<input type="hidden" name="pid" value="' . $pid . '">
7258c2e8227SGreg Roach		<input type="hidden" name="action" value="download">
7268c2e8227SGreg Roach		<table>
7278c2e8227SGreg Roach		<tr><td colspan="2" class="topbottombar"><h2>' . I18N::translate('Download') . '</h2></td></tr>
7288c2e8227SGreg Roach		';
7298c2e8227SGreg Roach
7304b9ff166SGreg Roach		if (Auth::isManager($WT_TREE)) {
7318c2e8227SGreg Roach			$out .=
732d1928687SGreg Roach				'<tr><td class="descriptionbox width50 wrap">' . I18N::translate('Apply privacy settings') . '</td>' .
7338c2e8227SGreg Roach				'<td class="optionbox">' .
7348c2e8227SGreg Roach				'<input type="radio" name="privatize_export" value="none" checked> ' . I18N::translate('None') . '<br>' .
7358c2e8227SGreg Roach				'<input type="radio" name="privatize_export" value="gedadmin"> ' . I18N::translate('Manager') . '<br>' .
7368c2e8227SGreg Roach				'<input type="radio" name="privatize_export" value="user"> ' . I18N::translate('Member') . '<br>' .
7378c2e8227SGreg Roach				'<input type="radio" name="privatize_export" value="visitor"> ' . I18N::translate('Visitor') .
7388c2e8227SGreg Roach				'</td></tr>';
7394b9ff166SGreg Roach		} elseif (Auth::isMember($WT_TREE)) {
7408c2e8227SGreg Roach			$out .=
741d1928687SGreg Roach				'<tr><td class="descriptionbox width50 wrap">' . I18N::translate('Apply privacy settings') . '</td>' .
7428c2e8227SGreg Roach				'<td class="list_value">' .
7438c2e8227SGreg Roach				'<input type="radio" name="privatize_export" value="user" checked> ' . I18N::translate('Member') . '<br>' .
7448c2e8227SGreg Roach				'<input type="radio" name="privatize_export" value="visitor"> ' . I18N::translate('Visitor') .
7458c2e8227SGreg Roach				'</td></tr>';
7468c2e8227SGreg Roach		}
7478c2e8227SGreg Roach
7488c2e8227SGreg Roach		$out .= '
749d1928687SGreg Roach		<tr><td class="descriptionbox width50 wrap">' . I18N::translate('Convert from UTF-8 to ISO-8859-1') . '</td>
7508c2e8227SGreg Roach		<td class="optionbox"><input type="checkbox" name="convert" value="yes"></td></tr>
7518c2e8227SGreg Roach
7528c2e8227SGreg Roach		<tr><td class="topbottombar" colspan="2">
753b6468bb9SGreg Roach		<input type="button" class="btn btn-secondary" value="' . /* I18N: A button label. */ I18N::translate('cancel') . '" onclick="cancelDownload();">
754b6468bb9SGreg Roach		<input type="submit" class="btn btn-primary" value="' . /* I18N: A button label. */ I18N::translate('download') . '">
7558c2e8227SGreg Roach		</form>';
7568c2e8227SGreg Roach
7578c2e8227SGreg Roach		return $out;
7588c2e8227SGreg Roach	}
7598c2e8227SGreg Roach}
760