18c2e8227SGreg Roach<?php 28c2e8227SGreg Roachnamespace Fisharebest\Webtrees; 38c2e8227SGreg Roach 48c2e8227SGreg Roach/** 58c2e8227SGreg Roach * webtrees: online genealogy 68c2e8227SGreg Roach * Copyright (C) 2015 webtrees development team 78c2e8227SGreg Roach * This program is free software: you can redistribute it and/or modify 88c2e8227SGreg Roach * it under the terms of the GNU General Public License as published by 98c2e8227SGreg Roach * the Free Software Foundation, either version 3 of the License, or 108c2e8227SGreg Roach * (at your option) any later version. 118c2e8227SGreg Roach * This program is distributed in the hope that it will be useful, 128c2e8227SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of 138c2e8227SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 148c2e8227SGreg Roach * GNU General Public License for more details. 158c2e8227SGreg Roach * You should have received a copy of the GNU General Public License 168c2e8227SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>. 178c2e8227SGreg Roach */ 188c2e8227SGreg Roach 198c2e8227SGreg Roachuse Zend_Session; 208c2e8227SGreg Roach 218c2e8227SGreg Roach/** 228c2e8227SGreg Roach * Class ClippingsCartModule 238c2e8227SGreg Roach */ 24e2a378d3SGreg Roachclass ClippingsCartModule extends AbstractModule implements ModuleMenuInterface, ModuleSidebarInterface { 258c2e8227SGreg Roach 268c2e8227SGreg Roach /** {@inheritdoc} */ 278c2e8227SGreg Roach public function getTitle() { 288c2e8227SGreg Roach return /* I18N: Name of a module */ I18N::translate('Clippings cart'); 298c2e8227SGreg Roach } 308c2e8227SGreg Roach 318c2e8227SGreg Roach /** {@inheritdoc} */ 328c2e8227SGreg Roach public function getDescription() { 338c2e8227SGreg Roach return /* I18N: Description of the “Clippings cart” module */ I18N::translate('Select records from your family tree and save them as a GEDCOM file.'); 348c2e8227SGreg Roach } 358c2e8227SGreg Roach 368c2e8227SGreg Roach /** {@inheritdoc} */ 378c2e8227SGreg Roach public function defaultAccessLevel() { 384b9ff166SGreg Roach return Auth::PRIV_USER; 398c2e8227SGreg Roach } 408c2e8227SGreg Roach 418c2e8227SGreg Roach /** {@inheritdoc} */ 428c2e8227SGreg Roach public function modAction($mod_action) { 438c2e8227SGreg Roach switch ($mod_action) { 448c2e8227SGreg Roach case 'ajax': 458c2e8227SGreg Roach $html = $this->getSidebarAjaxContent(); 468c2e8227SGreg Roach Zend_Session::writeClose(); 478c2e8227SGreg Roach header('Content-Type: text/html; charset=UTF-8'); 488c2e8227SGreg Roach echo $html; 498c2e8227SGreg Roach break; 508c2e8227SGreg Roach case 'index': 518c2e8227SGreg Roach global $controller, $WT_SESSION, $WT_TREE; 528c2e8227SGreg Roach 538c2e8227SGreg Roach $MAX_PEDIGREE_GENERATIONS = $WT_TREE->getPreference('MAX_PEDIGREE_GENERATIONS'); 548c2e8227SGreg Roach 558c2e8227SGreg Roach $clip_ctrl = new ClippingsCart; 568c2e8227SGreg Roach 578c2e8227SGreg Roach $controller = new PageController; 588c2e8227SGreg Roach $controller 598c2e8227SGreg Roach ->setPageTitle($this->getTitle()) 608c2e8227SGreg Roach ->PageHeader() 618c2e8227SGreg Roach ->addExternalJavascript(WT_AUTOCOMPLETE_JS_URL) 628c2e8227SGreg Roach ->addInlineJavascript('autocomplete();'); 638c2e8227SGreg Roach 648c2e8227SGreg Roach echo '<script>'; 658c2e8227SGreg Roach echo 'function radAncestors(elementid) {var radFamilies=document.getElementById(elementid);radFamilies.checked=true;}'; 668c2e8227SGreg Roach echo '</script>'; 678c2e8227SGreg Roach 6824ec66ceSGreg Roach if (!$WT_SESSION->cart[$WT_TREE->getTreeId()]) { 698c2e8227SGreg Roach echo '<h2>', I18N::translate('Family tree clippings cart'), '</h2>'; 708c2e8227SGreg Roach } 718c2e8227SGreg Roach 728c2e8227SGreg Roach if ($clip_ctrl->action == 'add') { 73*4e3c4966SGreg Roach $record = GedcomRecord::getInstance($clip_ctrl->id, $WT_TREE); 748c2e8227SGreg Roach if ($clip_ctrl->type === 'FAM') { ?> 758c2e8227SGreg Roach <form action="module.php" method="get"> 768c2e8227SGreg Roach <input type="hidden" name="mod" value="clippings"> 778c2e8227SGreg Roach <input type="hidden" name="mod_action" value="index"> 788c2e8227SGreg Roach <input type="hidden" name="id" value="<?php echo $clip_ctrl->id; ?>"> 798c2e8227SGreg Roach <input type="hidden" name="type" value="<?php echo $clip_ctrl->type; ?>"> 80*4e3c4966SGreg Roach <input type="hidden" name="action" value="add1"> 81*4e3c4966SGreg Roach <table> 82*4e3c4966SGreg Roach <thead> 83*4e3c4966SGreg Roach <tr> 84*4e3c4966SGreg Roach <td class="topbottombar"> 85*4e3c4966SGreg Roach <?php echo I18N::translate('Add to the clippings cart'); ?> 86*4e3c4966SGreg Roach </td> 87*4e3c4966SGreg Roach </tr> 88*4e3c4966SGreg Roach </thead> 89*4e3c4966SGreg Roach <tbody> 90*4e3c4966SGreg Roach <tr> 91*4e3c4966SGreg Roach <td class="optionbox"> 92*4e3c4966SGreg Roach <input type="radio" name="others" value="parents"> 93*4e3c4966SGreg Roach <?php echo $record->getFullName(); ?> 94*4e3c4966SGreg Roach </td> 95*4e3c4966SGreg Roach </tr> 96*4e3c4966SGreg Roach <tr> 97*4e3c4966SGreg Roach <td class="optionbox"> 98*4e3c4966SGreg Roach <input type="radio" name="others" value="members" checked> 99*4e3c4966SGreg Roach <?php echo /* I18N: %s is a family (husband + wife) */ I18N::translate('%s and their children', $record->getFullName()); ?> 100*4e3c4966SGreg Roach </td> 101*4e3c4966SGreg Roach </tr> 102*4e3c4966SGreg Roach <tr> 103*4e3c4966SGreg Roach <td class="optionbox"> 104*4e3c4966SGreg Roach <input type="radio" name="others" value="descendants"> 105*4e3c4966SGreg Roach <?php echo /* I18N: %s is a family (husband + wife) */ I18N::translate('%s and their descendants', $record->getFullName()); ?> 106*4e3c4966SGreg Roach </td> 107*4e3c4966SGreg Roach </tr> 108*4e3c4966SGreg Roach </tbody> 109*4e3c4966SGreg Roach <tfoot> 110*4e3c4966SGreg Roach <tr> 111*4e3c4966SGreg Roach <td class="topbottombar"><input type="submit" value="<?php echo I18N::translate('continue'); ?>"> 112*4e3c4966SGreg Roach </td> 113*4e3c4966SGreg Roach </tr> 114*4e3c4966SGreg Roach </tfoot> 1158c2e8227SGreg Roach </table> 1168c2e8227SGreg Roach </form> 1178c2e8227SGreg Roach <?php } elseif ($clip_ctrl->type === 'INDI') { ?> 1188c2e8227SGreg Roach <form action="module.php" method="get"> 1198c2e8227SGreg Roach <input type="hidden" name="mod" value="clippings"> 1208c2e8227SGreg Roach <input type="hidden" name="mod_action" value="index"> 1218c2e8227SGreg Roach <input type="hidden" name="id" value="<?php echo $clip_ctrl->id; ?>"> 1228c2e8227SGreg Roach <input type="hidden" name="type" value="<?php echo $clip_ctrl->type; ?>"> 1238c2e8227SGreg Roach <input type="hidden" name="action" value="add1"></td></tr> 124*4e3c4966SGreg Roach <table> 125*4e3c4966SGreg Roach <thead> 126*4e3c4966SGreg Roach <tr> 127*4e3c4966SGreg Roach <td class="topbottombar"> 128*4e3c4966SGreg Roach <?php echo I18N::translate('Add to the clippings cart'); ?> 129*4e3c4966SGreg Roach </td> 130*4e3c4966SGreg Roach </tr> 131*4e3c4966SGreg Roach </thead> 132*4e3c4966SGreg Roach <tbody> 133*4e3c4966SGreg Roach <tr> 134*4e3c4966SGreg Roach <td class="optionbox"> 135*4e3c4966SGreg Roach <label> 136*4e3c4966SGreg Roach <input type="radio" name="others" checked value="none"> 137*4e3c4966SGreg Roach <?php echo $record->getFullName(); ?> 138*4e3c4966SGreg Roach </label> 139*4e3c4966SGreg Roach </td> 140*4e3c4966SGreg Roach </tr> 141*4e3c4966SGreg Roach <tr> 142*4e3c4966SGreg Roach <td class="optionbox"> 143*4e3c4966SGreg Roach <label> 144*4e3c4966SGreg Roach <input type="radio" name="others" value="parents"> 145*4e3c4966SGreg Roach <?php 146*4e3c4966SGreg Roach if ($record->getSex() === 'F') { 147*4e3c4966SGreg Roach echo /* I18N: %s is a woman's name */ I18N::translate('%s, her parents and siblings', $record->getFullName()); 148*4e3c4966SGreg Roach } else { 149*4e3c4966SGreg Roach echo /* I18N: %s is a man's name */ I18N::translate('%s, his parents and siblings', $record->getFullName()); 150*4e3c4966SGreg Roach } 151*4e3c4966SGreg Roach ?> 152*4e3c4966SGreg Roach </label> 153*4e3c4966SGreg Roach </td> 154*4e3c4966SGreg Roach </tr> 155*4e3c4966SGreg Roach <tr> 156*4e3c4966SGreg Roach <td class="optionbox"> 157*4e3c4966SGreg Roach <label> 158*4e3c4966SGreg Roach <input type="radio" name="others" value="members"> 159*4e3c4966SGreg Roach <?php 160*4e3c4966SGreg Roach if ($record->getSex() === 'F') { 161*4e3c4966SGreg Roach echo /* I18N: %s is a woman's name */ I18N::translate('%s, her spouses and children', $record->getFullName()); 162*4e3c4966SGreg Roach } else { 163*4e3c4966SGreg Roach echo /* I18N: %s is a man's name */ I18N::translate('%s, his spouses and children', $record->getFullName()); 164*4e3c4966SGreg Roach } 165*4e3c4966SGreg Roach ?> 166*4e3c4966SGreg Roach </label> 167*4e3c4966SGreg Roach </td> 168*4e3c4966SGreg Roach </tr> 169*4e3c4966SGreg Roach <tr> 170*4e3c4966SGreg Roach <td class="optionbox"> 171*4e3c4966SGreg Roach <label> 172*4e3c4966SGreg Roach <input type="radio" name="others" value="ancestors" id="ancestors"> 173*4e3c4966SGreg Roach <?php 174*4e3c4966SGreg Roach if ($record->getSex() === 'F') { 175*4e3c4966SGreg Roach echo /* I18N: %s is a woman's name */ I18N::translate('%s and her ancestors', $record->getFullName()); 176*4e3c4966SGreg Roach } else { 177*4e3c4966SGreg Roach echo /* I18N: %s is a man's name */ I18N::translate('%s and his ancestors', $record->getFullName()); 178*4e3c4966SGreg Roach } 179*4e3c4966SGreg Roach ?> 180*4e3c4966SGreg Roach </label> 181*4e3c4966SGreg Roach <br> 182*4e3c4966SGreg Roach 183*4e3c4966SGreg Roach <?php echo I18N::translate('Number of generations'); ?> 184*4e3c4966SGreg Roach <input type="text" size="5" name="level1" value="<?php echo $MAX_PEDIGREE_GENERATIONS; ?>" onfocus="radAncestors('ancestors');"> 185*4e3c4966SGreg Roach </td> 186*4e3c4966SGreg Roach </tr> 187*4e3c4966SGreg Roach <tr> 188*4e3c4966SGreg Roach <td class="optionbox"> 189*4e3c4966SGreg Roach <label> 190*4e3c4966SGreg Roach <input type="radio" name="others" value="ancestorsfamilies" id="ancestorsfamilies"> 191*4e3c4966SGreg Roach <?php 192*4e3c4966SGreg Roach if ($record->getSex() === 'F') { 193*4e3c4966SGreg Roach echo /* I18N: %s is a woman's name */ I18N::translate('%s, her ancestors and their families', $record->getFullName()); 194*4e3c4966SGreg Roach } else { 195*4e3c4966SGreg Roach echo /* I18N: %s is a man's name */ I18N::translate('%s, his ancestors and their families', $record->getFullName()); 196*4e3c4966SGreg Roach } 197*4e3c4966SGreg Roach ?> 198*4e3c4966SGreg Roach </label> 199*4e3c4966SGreg Roach <br > 200*4e3c4966SGreg Roach 201*4e3c4966SGreg Roach <?php echo I18N::translate('Number of generations'); ?> 202*4e3c4966SGreg Roach <input type="text" size="5" name="level2" value="<?php echo $MAX_PEDIGREE_GENERATIONS; ?>" onfocus="radAncestors('ancestorsfamilies');"> 203*4e3c4966SGreg Roach </td> 204*4e3c4966SGreg Roach </tr> 205*4e3c4966SGreg Roach <tr> 206*4e3c4966SGreg Roach <td class="optionbox"> 207*4e3c4966SGreg Roach <label> 208*4e3c4966SGreg Roach <input type="radio" name="others" value="descendants" id="descendants"> 209*4e3c4966SGreg Roach <?php 210*4e3c4966SGreg Roach if ($record->getSex() === 'F') { 211*4e3c4966SGreg Roach echo /* I18N: %s is a woman's name */ I18N::translate('%s, her spouses and descendants', $record->getFullName()); 212*4e3c4966SGreg Roach } else { 213*4e3c4966SGreg Roach echo /* I18N: %s is a man's name */ I18N::translate('%s, his spouses and descendants', $record->getFullName()); 214*4e3c4966SGreg Roach } 215*4e3c4966SGreg Roach ?> 216*4e3c4966SGreg Roach </label> 217*4e3c4966SGreg Roach <br > 218*4e3c4966SGreg Roach 219*4e3c4966SGreg Roach <?php echo I18N::translate('Number of generations'); ?> 220*4e3c4966SGreg Roach <input type="text" size="5" name="level3" value="<?php echo $MAX_PEDIGREE_GENERATIONS; ?>" onfocus="radAncestors('descendants');"> 221*4e3c4966SGreg Roach </td> 222*4e3c4966SGreg Roach </tr> 223*4e3c4966SGreg Roach </tbody> 224*4e3c4966SGreg Roach <tfoot> 225*4e3c4966SGreg Roach <tr> 226*4e3c4966SGreg Roach <td class="topbottombar"> 227*4e3c4966SGreg Roach <input type="submit" value="<?php echo I18N::translate('continue'); ?>"> 228*4e3c4966SGreg Roach </td> 229*4e3c4966SGreg Roach </tr> 230*4e3c4966SGreg Roach </tfoot> 2318c2e8227SGreg Roach </table> 2328c2e8227SGreg Roach </form> 2338c2e8227SGreg Roach <?php } elseif ($clip_ctrl->type === 'SOUR') { ?> 2348c2e8227SGreg Roach <form action="module.php" method="get"> 2358c2e8227SGreg Roach <input type="hidden" name="mod" value="clippings"> 2368c2e8227SGreg Roach <input type="hidden" name="mod_action" value="index"> 2378c2e8227SGreg Roach <input type="hidden" name="id" value="<?php echo $clip_ctrl->id; ?>"> 2388c2e8227SGreg Roach <input type="hidden" name="type" value="<?php echo $clip_ctrl->type; ?>"> 2398c2e8227SGreg Roach <input type="hidden" name="action" value="add1"></td></tr> 240*4e3c4966SGreg Roach <table> 241*4e3c4966SGreg Roach <thead> 242*4e3c4966SGreg Roach <tr> 243*4e3c4966SGreg Roach <td class="topbottombar"> 244*4e3c4966SGreg Roach <?php echo I18N::translate('Add to the clippings cart'); ?> 245*4e3c4966SGreg Roach </td> 246*4e3c4966SGreg Roach </tr> 247*4e3c4966SGreg Roach </thead> 248*4e3c4966SGreg Roach <tbody> 249*4e3c4966SGreg Roach <tr> 250*4e3c4966SGreg Roach <td class="optionbox"> 251*4e3c4966SGreg Roach <label> 252*4e3c4966SGreg Roach <input type="radio" name="others" checked value="none"> 253*4e3c4966SGreg Roach <?php echo $record->getFullName(); ?> 254*4e3c4966SGreg Roach </label> 255*4e3c4966SGreg Roach </td> 256*4e3c4966SGreg Roach </tr> 257*4e3c4966SGreg Roach <tr> 258*4e3c4966SGreg Roach <td class="optionbox"> 259*4e3c4966SGreg Roach <label> 260*4e3c4966SGreg Roach <input type="radio" name="others" value="linked"> 261*4e3c4966SGreg Roach <?php echo /* I18N: %s is the name of a source */ I18N::translate('%s and the individuals that reference it.', $record->getFullName()); ?> 262*4e3c4966SGreg Roach </label> 263*4e3c4966SGreg Roach </td> 264*4e3c4966SGreg Roach </tr> 265*4e3c4966SGreg Roach </tbody> 266*4e3c4966SGreg Roach <tfoot> 267*4e3c4966SGreg Roach <tr> 268*4e3c4966SGreg Roach <td class="topbottombar"> 269*4e3c4966SGreg Roach <input type="submit" value="<?php echo I18N::translate('continue'); ?>"> 270*4e3c4966SGreg Roach </td> 271*4e3c4966SGreg Roach </tr> 272*4e3c4966SGreg Roach </tfoot> 2738c2e8227SGreg Roach </table> 2748c2e8227SGreg Roach </form> 2758c2e8227SGreg Roach <?php } 2768c2e8227SGreg Roach } 2778c2e8227SGreg Roach 27824ec66ceSGreg Roach if (!$WT_SESSION->cart[$WT_TREE->getTreeId()]) { 2798c2e8227SGreg Roach if ($clip_ctrl->action != 'add') { 2808c2e8227SGreg Roach echo I18N::translate('The clippings cart allows you to take extracts (“clippings”) from this family tree and bundle them up into a single file for downloading and subsequent importing into your own genealogy program. The downloadable file is recorded in GEDCOM format.<br><ul><li>How to take clippings?<br>This is really simple. Whenever you see a clickable name (individual, family, or source) you can go to the Details page of that name. There you will see the <b>Add to clippings cart</b> option. When you click that link you will be offered several options to download.</li><li>How to download?<br>Once you have items in your cart, you can download them just by clicking the “Download” link. Follow the instructions and links.</li></ul>'); 2818c2e8227SGreg Roach ?> 2828c2e8227SGreg Roach <form method="get" name="addin" action="module.php"> 2838c2e8227SGreg Roach <input type="hidden" name="mod" value="clippings"> 2848c2e8227SGreg Roach <input type="hidden" name="mod_action" value="index"> 2858c2e8227SGreg Roach <table> 286*4e3c4966SGreg Roach <thead> 2878c2e8227SGreg Roach <tr> 288*4e3c4966SGreg Roach <td colspan="2" class="topbottombar"> 289*4e3c4966SGreg Roach <?php echo I18N::translate('Add to the clippings cart'); ?> 2908c2e8227SGreg Roach </td> 2918c2e8227SGreg Roach </tr> 292*4e3c4966SGreg Roach </thead> 293*4e3c4966SGreg Roach <tbody> 2948c2e8227SGreg Roach <tr> 2958c2e8227SGreg Roach <td class="optionbox"> 2968c2e8227SGreg Roach <input type="hidden" name="action" value="add"> 2978c2e8227SGreg Roach <input type="text" data-autocomplete-type="IFSRO" name="id" id="cart_item_id" size="5"> 2988c2e8227SGreg Roach </td> 2998c2e8227SGreg Roach <td class="optionbox"> 3008c2e8227SGreg Roach <?php echo print_findindi_link('cart_item_id'); ?> 3018c2e8227SGreg Roach <?php echo print_findfamily_link('cart_item_id'); ?> 3028c2e8227SGreg Roach <?php echo print_findsource_link('cart_item_id', ''); ?> 3038c2e8227SGreg Roach <input type="submit" value="<?php echo I18N::translate('Add'); ?>"> 3048c2e8227SGreg Roach </td> 3058c2e8227SGreg Roach </tr> 306*4e3c4966SGreg Roach </tbody> 3078c2e8227SGreg Roach </table> 3088c2e8227SGreg Roach </form> 3098c2e8227SGreg Roach <?php 3108c2e8227SGreg Roach } 3118c2e8227SGreg Roach 3128c2e8227SGreg Roach // -- end new lines 3138c2e8227SGreg Roach echo I18N::translate('Your clippings cart is empty.'); 3148c2e8227SGreg Roach } else { 3158c2e8227SGreg Roach // Keep track of the INDI from the parent page, otherwise it will 3168c2e8227SGreg Roach // get lost after ajax updates 3178c2e8227SGreg Roach $pid = Filter::get('pid', WT_REGEX_XREF); 3188c2e8227SGreg Roach 3198c2e8227SGreg Roach if ($clip_ctrl->action != 'download' && $clip_ctrl->action != 'add') { ?> 3208c2e8227SGreg Roach <table><tr><td class="width33" valign="top" rowspan="3"> 3218c2e8227SGreg Roach <form method="get" action="module.php"> 3228c2e8227SGreg Roach <input type="hidden" name="mod" value="clippings"> 3238c2e8227SGreg Roach <input type="hidden" name="mod_action" value="index"> 3248c2e8227SGreg Roach <input type="hidden" name="action" value="download"> 3258c2e8227SGreg Roach <input type="hidden" name="pid" value="<?php echo $pid; ?>"> 3268c2e8227SGreg Roach <table> 3278c2e8227SGreg Roach <tr><td colspan="2" class="topbottombar"><h2><?php echo I18N::translate('Download'); ?></h2></td></tr> 3286fd6cde8SGreg Roach <tr> 3296fd6cde8SGreg Roach <td class="descriptionbox width50 wrap"> 3306fd6cde8SGreg Roach <?php echo I18N::translate('To reduce the size of the download, you can compress the data into a .ZIP file. You will need to uncompress the .ZIP file before you can use it.'); ?> 3316fd6cde8SGreg Roach </td> 3326fd6cde8SGreg Roach <td class="optionbox wrap"> 3336fd6cde8SGreg Roach <input type="checkbox" name="Zip" value="yes"> 3346fd6cde8SGreg Roach <?php echo I18N::translate('Zip file(s)'); ?> 3356fd6cde8SGreg Roach </td> 3366fd6cde8SGreg Roach </tr> 3376fd6cde8SGreg Roach <tr> 3386fd6cde8SGreg Roach <td class="descriptionbox width50 wrap"> 3396fd6cde8SGreg Roach <?php echo I18N::translate('Include media (automatically zips files)'), help_link('include_media'); ?> 3406fd6cde8SGreg Roach </td> 3418c2e8227SGreg Roach <td class="optionbox"><input type="checkbox" name="IncludeMedia" value="yes"></td></tr> 3428c2e8227SGreg Roach 3434b9ff166SGreg Roach <?php if (Auth::isManager($WT_TREE)) { ?> 3448c2e8227SGreg Roach <tr><td class="descriptionbox width50 wrap"><?php echo I18N::translate('Apply privacy settings'), help_link('apply_privacy'); ?></td> 3458c2e8227SGreg Roach <td class="optionbox"> 3468c2e8227SGreg Roach <input type="radio" name="privatize_export" value="none" checked> <?php echo I18N::translate('None'); ?><br> 3478c2e8227SGreg Roach <input type="radio" name="privatize_export" value="gedadmin"> <?php echo I18N::translate('Manager'); ?><br> 3488c2e8227SGreg Roach <input type="radio" name="privatize_export" value="user"> <?php echo I18N::translate('Member'); ?><br> 3498c2e8227SGreg Roach <input type="radio" name="privatize_export" value="visitor"> <?php echo I18N::translate('Visitor'); ?> 3508c2e8227SGreg Roach </td></tr> 3514b9ff166SGreg Roach <?php } elseif (Auth::isMember($WT_TREE)) { ?> 3528c2e8227SGreg Roach <tr><td class="descriptionbox width50 wrap"><?php echo I18N::translate('Apply privacy settings'), help_link('apply_privacy'); ?></td> 3538c2e8227SGreg Roach <td class="optionbox"> 3548c2e8227SGreg Roach <input type="radio" name="privatize_export" value="user" checked> <?php echo I18N::translate('Member'); ?><br> 3558c2e8227SGreg Roach <input type="radio" name="privatize_export" value="visitor"> <?php echo I18N::translate('Visitor'); ?> 3568c2e8227SGreg Roach </td></tr> 3578c2e8227SGreg Roach <?php } ?> 3588c2e8227SGreg Roach 3598c2e8227SGreg Roach <tr><td class="descriptionbox width50 wrap"><?php echo I18N::translate('Convert from UTF-8 to ISO-8859-1'), help_link('utf8_ansi'); ?></td> 3608c2e8227SGreg Roach <td class="optionbox"><input type="checkbox" name="convert" value="yes"></td></tr> 3618c2e8227SGreg Roach 3628c2e8227SGreg Roach <tr><td class="descriptionbox width50 wrap"><?php echo I18N::translate('Add the GEDCOM media path to filenames'), help_link('GEDCOM_MEDIA_PATH'); ?></td> 3638c2e8227SGreg Roach <td class="optionbox"> 3648c2e8227SGreg Roach <input type="checkbox" name="conv_path" value="<?php echo Filter::escapeHtml($WT_TREE->getPreference('GEDCOM_MEDIA_PATH')); ?>"> 3658c2e8227SGreg Roach <span dir="auto"><?php echo Filter::escapeHtml($WT_TREE->getPreference('GEDCOM_MEDIA_PATH')); ?></span> 3668c2e8227SGreg Roach </td></tr> 3678c2e8227SGreg Roach 3688c2e8227SGreg Roach <tr><td class="topbottombar" colspan="2"> 3698c2e8227SGreg Roach <input type="submit" value="<?php echo I18N::translate('Download'); ?>"> 3708c2e8227SGreg Roach </form> 3718c2e8227SGreg Roach </td></tr> 3728c2e8227SGreg Roach </table> 3738c2e8227SGreg Roach </td></tr> 3748c2e8227SGreg Roach </table> 3758c2e8227SGreg Roach <br> 3768c2e8227SGreg Roach 3778c2e8227SGreg Roach <form method="get" name="addin" action="module.php"> 3788c2e8227SGreg Roach <input type="hidden" name="mod" value="clippings"> 3798c2e8227SGreg Roach <input type="hidden" name="mod_action" value="index"> 3808c2e8227SGreg Roach <table> 381*4e3c4966SGreg Roach <thead> 3828c2e8227SGreg Roach <tr> 3838c2e8227SGreg Roach <td colspan="2" class="topbottombar" style="text-align:center; "> 384*4e3c4966SGreg Roach <?php echo I18N::translate('Add to the clippings cart'); ?> 3858c2e8227SGreg Roach </td> 3868c2e8227SGreg Roach </tr> 387*4e3c4966SGreg Roach </thead> 388*4e3c4966SGreg Roach <tbody> 3898c2e8227SGreg Roach <tr> 3908c2e8227SGreg Roach <td class="optionbox"> 3918c2e8227SGreg Roach <input type="hidden" name="action" value="add"> 3928c2e8227SGreg Roach <input type="text" data-autocomplete-type="IFSRO" name="id" id="cart_item_id" size="8"> 3938c2e8227SGreg Roach </td> 3948c2e8227SGreg Roach <td class="optionbox"> 3958c2e8227SGreg Roach <?php echo print_findindi_link('cart_item_id'); ?> 3968c2e8227SGreg Roach <?php echo print_findfamily_link('cart_item_id'); ?> 3978c2e8227SGreg Roach <?php echo print_findsource_link('cart_item_id'); ?> 3988c2e8227SGreg Roach <input type="submit" value="<?php echo I18N::translate('Add'); ?>"> 3998c2e8227SGreg Roach </td> 4008c2e8227SGreg Roach </tr> 401*4e3c4966SGreg Roach </tbody> 4028c2e8227SGreg Roach </table> 4038c2e8227SGreg Roach </form> 4048c2e8227SGreg Roach 4058c2e8227SGreg Roach 4068c2e8227SGreg Roach <?php } ?> 4078c2e8227SGreg Roach <br><a href="module.php?mod=clippings&mod_action=index&action=empty"><?php echo I18N::translate('Empty the clippings cart'); ?></a> 4088c2e8227SGreg Roach </td></tr> 4098c2e8227SGreg Roach 4108c2e8227SGreg Roach <tr><td class="topbottombar"><h2><?php echo I18N::translate('Family tree clippings cart'); ?></h2></td></tr> 4118c2e8227SGreg Roach 4128c2e8227SGreg Roach <tr><td valign="top"> 4138c2e8227SGreg Roach <table id="mycart" class="sortable list_table width100"> 4148c2e8227SGreg Roach <tr> 4158c2e8227SGreg Roach <th class="list_label"><?php echo I18N::translate('Record'); ?></th> 4168c2e8227SGreg Roach <th class="list_label"><?php echo I18N::translate('Remove'); ?></th> 4178c2e8227SGreg Roach </tr> 4188c2e8227SGreg Roach <?php 41924ec66ceSGreg Roach foreach (array_keys($WT_SESSION->cart[$WT_TREE->getTreeId()]) as $xref) { 42024ec66ceSGreg Roach $record = GedcomRecord::getInstance($xref, $WT_TREE); 4218c2e8227SGreg Roach if ($record) { 4228c2e8227SGreg Roach switch ($record::RECORD_TYPE) { 4238c2e8227SGreg Roach case 'INDI': $icon = 'icon-indis'; break; 4248c2e8227SGreg Roach case 'FAM': $icon = 'icon-sfamily'; break; 4258c2e8227SGreg Roach case 'SOUR': $icon = 'icon-source'; break; 4268c2e8227SGreg Roach case 'REPO': $icon = 'icon-repository'; break; 4278c2e8227SGreg Roach case 'NOTE': $icon = 'icon-note'; break; 4288c2e8227SGreg Roach case 'OBJE': $icon = 'icon-media'; break; 4298c2e8227SGreg Roach default: $icon = 'icon-clippings'; break; 4308c2e8227SGreg Roach } 4318c2e8227SGreg Roach ?> 4328c2e8227SGreg Roach <tr><td class="list_value"> 4338c2e8227SGreg Roach <i class="<?php echo $icon; ?>"></i> 4348c2e8227SGreg Roach <?php 4358c2e8227SGreg Roach echo '<a href="', $record->getHtmlUrl(), '">', $record->getFullName(), '</a>'; 4368c2e8227SGreg Roach ?> 4378c2e8227SGreg Roach </td> 4388c2e8227SGreg Roach <td class="list_value center vmiddle"><a href="module.php?mod=clippings&mod_action=index&action=remove&id=<?php echo $xref; ?>" class="icon-remove" title="<?php echo I18N::translate('Remove'); ?>"></a></td> 4398c2e8227SGreg Roach </tr> 4408c2e8227SGreg Roach <?php 4418c2e8227SGreg Roach } 4428c2e8227SGreg Roach } 4438c2e8227SGreg Roach ?> 4448c2e8227SGreg Roach </table> 4458c2e8227SGreg Roach </td></tr></table> 4468c2e8227SGreg Roach <?php 4478c2e8227SGreg Roach } 4488c2e8227SGreg Roach break; 4498c2e8227SGreg Roach default: 4508c2e8227SGreg Roach http_response_code(404); 4518c2e8227SGreg Roach break; 4528c2e8227SGreg Roach } 4538c2e8227SGreg Roach } 4548c2e8227SGreg Roach 4558c2e8227SGreg Roach /** {@inheritdoc} */ 4568c2e8227SGreg Roach public function defaultMenuOrder() { 4578c2e8227SGreg Roach return 20; 4588c2e8227SGreg Roach } 4598c2e8227SGreg Roach 4608c2e8227SGreg Roach /** {@inheritdoc} */ 4618c2e8227SGreg Roach public function getMenu() { 4624b9ff166SGreg Roach global $controller, $WT_TREE; 4638c2e8227SGreg Roach 4648c2e8227SGreg Roach if (Auth::isSearchEngine()) { 4658c2e8227SGreg Roach return null; 4668c2e8227SGreg Roach } 4678c2e8227SGreg Roach //-- main clippings menu item 4684b9ff166SGreg Roach $menu = new Menu($this->getTitle(), 'module.php?mod=clippings&mod_action=index&ged=' . $WT_TREE->getNameUrl(), 'menu-clippings'); 4698c2e8227SGreg Roach if (isset($controller->record)) { 4704b9ff166SGreg Roach $submenu = new Menu($this->getTitle(), 'module.php?mod=clippings&mod_action=index&ged=' . $WT_TREE->getNameUrl(), 'menu-clippingscart'); 4718c2e8227SGreg Roach $menu->addSubmenu($submenu); 4728c2e8227SGreg Roach } 4738c2e8227SGreg Roach if (!empty($controller->record) && $controller->record->canShow()) { 474*4e3c4966SGreg Roach $submenu = new Menu(I18N::translate('Add to the clippings cart'), 'module.php?mod=clippings&mod_action=index&action=add&id=' . $controller->record->getXref(), 'menu-clippingsadd'); 4758c2e8227SGreg Roach $menu->addSubmenu($submenu); 4768c2e8227SGreg Roach } 4778c2e8227SGreg Roach return $menu; 4788c2e8227SGreg Roach } 4798c2e8227SGreg Roach 4808c2e8227SGreg Roach /** {@inheritdoc} */ 4818c2e8227SGreg Roach public function defaultSidebarOrder() { 4828c2e8227SGreg Roach return 60; 4838c2e8227SGreg Roach } 4848c2e8227SGreg Roach 4858c2e8227SGreg Roach /** {@inheritdoc} */ 4868c2e8227SGreg Roach public function hasSidebarContent() { 4878c2e8227SGreg Roach if (Auth::isSearchEngine()) { 4888c2e8227SGreg Roach return false; 4898c2e8227SGreg Roach } else { 4908c2e8227SGreg Roach // Creating a controller has the side effect of initialising the cart 4918c2e8227SGreg Roach new ClippingsCart; 4928c2e8227SGreg Roach 4938c2e8227SGreg Roach return true; 4948c2e8227SGreg Roach } 4958c2e8227SGreg Roach } 4968c2e8227SGreg Roach 4978c2e8227SGreg Roach /** {@inheritdoc} */ 4988c2e8227SGreg Roach public function getSidebarContent() { 4998c2e8227SGreg Roach global $controller; 5008c2e8227SGreg Roach 5018c2e8227SGreg Roach $controller->addInlineJavascript(' 5028c2e8227SGreg Roach jQuery("#sb_clippings_content").on("click", ".add_cart, .remove_cart", function() { 5038c2e8227SGreg Roach jQuery("#sb_clippings_content").load(this.href); 5048c2e8227SGreg Roach return false; 5058c2e8227SGreg Roach }); 5068c2e8227SGreg Roach '); 5078c2e8227SGreg Roach 5088c2e8227SGreg Roach return '<div id="sb_clippings_content">' . $this->getCartList() . '</div>'; 5098c2e8227SGreg Roach } 5108c2e8227SGreg Roach 5118c2e8227SGreg Roach /** {@inheritdoc} */ 5128c2e8227SGreg Roach public function getSidebarAjaxContent() { 51324ec66ceSGreg Roach global $WT_SESSION, $WT_TREE; 5148c2e8227SGreg Roach 5158c2e8227SGreg Roach $clip_ctrl = new ClippingsCart; 5168c2e8227SGreg Roach $add = Filter::get('add', WT_REGEX_XREF); 5178c2e8227SGreg Roach $add1 = Filter::get('add1', WT_REGEX_XREF); 5188c2e8227SGreg Roach $remove = Filter::get('remove', WT_REGEX_XREF); 5198c2e8227SGreg Roach $others = Filter::get('others'); 5208c2e8227SGreg Roach $clip_ctrl->level1 = Filter::getInteger('level1'); 5218c2e8227SGreg Roach $clip_ctrl->level2 = Filter::getInteger('level2'); 5228c2e8227SGreg Roach $clip_ctrl->level3 = Filter::getInteger('level3'); 5238c2e8227SGreg Roach if ($add) { 52424ec66ceSGreg Roach $record = GedcomRecord::getInstance($add, $WT_TREE); 5258c2e8227SGreg Roach if ($record) { 5268c2e8227SGreg Roach $clip_ctrl->id = $record->getXref(); 5278c2e8227SGreg Roach $clip_ctrl->type = $record::RECORD_TYPE; 5288c2e8227SGreg Roach $clip_ctrl->addClipping($record); 5298c2e8227SGreg Roach } 5308c2e8227SGreg Roach } elseif ($add1) { 53124ec66ceSGreg Roach $record = Individual::getInstance($add1, $WT_TREE); 5328c2e8227SGreg Roach if ($record) { 5338c2e8227SGreg Roach $clip_ctrl->id = $record->getXref(); 5348c2e8227SGreg Roach $clip_ctrl->type = $record::RECORD_TYPE; 5358c2e8227SGreg Roach if ($others == 'parents') { 5368c2e8227SGreg Roach foreach ($record->getChildFamilies() as $family) { 5378c2e8227SGreg Roach $clip_ctrl->addClipping($family); 5388c2e8227SGreg Roach $clip_ctrl->addFamilyMembers($family); 5398c2e8227SGreg Roach } 5408c2e8227SGreg Roach } elseif ($others == 'ancestors') { 5418c2e8227SGreg Roach $clip_ctrl->addAncestorsToCart($record, $clip_ctrl->level1); 5428c2e8227SGreg Roach } elseif ($others == 'ancestorsfamilies') { 5438c2e8227SGreg Roach $clip_ctrl->addAncestorsToCartFamilies($record, $clip_ctrl->level2); 5448c2e8227SGreg Roach } elseif ($others == 'members') { 5458c2e8227SGreg Roach foreach ($record->getSpouseFamilies() as $family) { 5468c2e8227SGreg Roach $clip_ctrl->addClipping($family); 5478c2e8227SGreg Roach $clip_ctrl->addFamilyMembers($family); 5488c2e8227SGreg Roach } 5498c2e8227SGreg Roach } elseif ($others == 'descendants') { 5508c2e8227SGreg Roach foreach ($record->getSpouseFamilies() as $family) { 5518c2e8227SGreg Roach $clip_ctrl->addClipping($family); 5528c2e8227SGreg Roach $clip_ctrl->addFamilyDescendancy($family, $clip_ctrl->level3); 5538c2e8227SGreg Roach } 5548c2e8227SGreg Roach } 5558c2e8227SGreg Roach } 5568c2e8227SGreg Roach } elseif ($remove) { 55724ec66ceSGreg Roach unset ($WT_SESSION->cart[$WT_TREE->getTreeId()][$remove]); 5588c2e8227SGreg Roach } elseif (isset($_REQUEST['empty'])) { 55924ec66ceSGreg Roach $WT_SESSION->cart[$WT_TREE->getTreeId()] = array(); 5608c2e8227SGreg Roach } elseif (isset($_REQUEST['download'])) { 5618c2e8227SGreg Roach return $this->downloadForm($clip_ctrl); 5628c2e8227SGreg Roach } 5638c2e8227SGreg Roach return $this->getCartList(); 5648c2e8227SGreg Roach } 5658c2e8227SGreg Roach 5668c2e8227SGreg Roach /** 5678c2e8227SGreg Roach * A list for the side bar. 5688c2e8227SGreg Roach * 5698c2e8227SGreg Roach * @return string 5708c2e8227SGreg Roach */ 5718c2e8227SGreg Roach public function getCartList() { 57224ec66ceSGreg Roach global $WT_SESSION, $WT_TREE; 5738c2e8227SGreg Roach 5748c2e8227SGreg Roach // Keep track of the INDI from the parent page, otherwise it will 5758c2e8227SGreg Roach // get lost after ajax updates 5768c2e8227SGreg Roach $pid = Filter::get('pid', WT_REGEX_XREF); 5778c2e8227SGreg Roach 57824ec66ceSGreg Roach if (!$WT_SESSION->cart[$WT_TREE->getTreeId()]) { 5798c2e8227SGreg Roach $out = I18N::translate('Your clippings cart is empty.'); 5808c2e8227SGreg Roach } else { 5818c2e8227SGreg Roach $out = '<ul>'; 58224ec66ceSGreg Roach foreach (array_keys($WT_SESSION->cart[$WT_TREE->getTreeId()]) as $xref) { 58324ec66ceSGreg Roach $record = GedcomRecord::getInstance($xref, $WT_TREE); 5848c2e8227SGreg Roach if ($record instanceof Individual || $record instanceof Family) { 5858c2e8227SGreg Roach switch ($record::RECORD_TYPE) { 5868c2e8227SGreg Roach case 'INDI': 5878c2e8227SGreg Roach $icon = 'icon-indis'; 5888c2e8227SGreg Roach break; 5898c2e8227SGreg Roach case 'FAM': 5908c2e8227SGreg Roach $icon = 'icon-sfamily'; 5918c2e8227SGreg Roach break; 5928c2e8227SGreg Roach } 5938c2e8227SGreg Roach $out .= '<li>'; 5948c2e8227SGreg Roach if (!empty($icon)) { 5958c2e8227SGreg Roach $out .= '<i class="' . $icon . '"></i>'; 5968c2e8227SGreg Roach } 5978c2e8227SGreg Roach $out .= '<a href="' . $record->getHtmlUrl() . '">'; 5988c2e8227SGreg Roach if ($record instanceof Individual) { 5998c2e8227SGreg Roach $out .= $record->getSexImage(); 6008c2e8227SGreg Roach } 6018c2e8227SGreg Roach $out .= ' ' . $record->getFullName() . ' '; 6028c2e8227SGreg Roach if ($record instanceof Individual && $record->canShow()) { 6038c2e8227SGreg Roach $out .= ' (' . $record->getLifeSpan() . ')'; 6048c2e8227SGreg Roach } 6058c2e8227SGreg Roach $out .= '</a>'; 6068c2e8227SGreg Roach $out .= '<a class="icon-remove remove_cart" href="module.php?mod=' . $this->getName() . '&mod_action=ajax&sb_action=clippings&remove=' . $xref . '&pid=' . $pid . '" title="' . I18N::translate('Remove') . '"></a>'; 6078c2e8227SGreg Roach $out .= '</li>'; 6088c2e8227SGreg Roach } 6098c2e8227SGreg Roach } 6108c2e8227SGreg Roach $out .= '</ul>'; 6118c2e8227SGreg Roach } 6128c2e8227SGreg Roach 61324ec66ceSGreg Roach if ($WT_SESSION->cart[$WT_TREE->getTreeId()]) { 6148c2e8227SGreg Roach $out .= 6158c2e8227SGreg Roach '<br><a href="module.php?mod=' . $this->getName() . '&mod_action=ajax&sb_action=clippings&empty=true&pid=' . $pid . '" class="remove_cart">' . 6168c2e8227SGreg Roach I18N::translate('Empty the clippings cart') . 6178c2e8227SGreg Roach '</a>' . 6188c2e8227SGreg Roach '<br>' . 6198c2e8227SGreg Roach '<a href="module.php?mod=' . $this->getName() . '&mod_action=ajax&sb_action=clippings&download=true&pid=' . $pid . '" class="add_cart">' . 6208c2e8227SGreg Roach I18N::translate('Download') . 6218c2e8227SGreg Roach '</a>'; 6228c2e8227SGreg Roach } 62324ec66ceSGreg Roach $record = Individual::getInstance($pid, $WT_TREE); 62424ec66ceSGreg Roach if ($record && !array_key_exists($record->getXref(), $WT_SESSION->cart[$WT_TREE->getTreeId()])) { 6258c2e8227SGreg Roach $out .= '<br><a href="module.php?mod=' . $this->getName() . '&mod_action=ajax&sb_action=clippings&add=' . $pid . '&pid=' . $pid . '" class="add_cart"><i class="icon-clippings"></i> ' . I18N::translate('Add %s to the clippings cart', $record->getFullName()) . '</a>'; 6268c2e8227SGreg Roach } 6278c2e8227SGreg Roach return $out; 6288c2e8227SGreg Roach } 6298c2e8227SGreg Roach 6308c2e8227SGreg Roach /** 6318c2e8227SGreg Roach * @param ClippingsCart $clip_ctrl 6328c2e8227SGreg Roach * 6338c2e8227SGreg Roach * @return string 6348c2e8227SGreg Roach */ 6358c2e8227SGreg Roach public function downloadForm(ClippingsCart $clip_ctrl) { 6368c2e8227SGreg Roach global $WT_TREE; 6378c2e8227SGreg Roach 6388c2e8227SGreg Roach $pid = Filter::get('pid', WT_REGEX_XREF); 6398c2e8227SGreg Roach 6408c2e8227SGreg Roach $out = '<script>'; 6418c2e8227SGreg Roach $out .= 'function cancelDownload() { 6428c2e8227SGreg Roach var link = "module.php?mod=' . $this->getName() . '&mod_action=ajax&sb_action=clippings&pid=' . $pid . '"; 6438c2e8227SGreg Roach jQuery("#sb_clippings_content").load(link); 6448c2e8227SGreg Roach }'; 6458c2e8227SGreg Roach $out .= '</script>'; 6468c2e8227SGreg Roach $out .= '<form method="get" action="module.php"> 6478c2e8227SGreg Roach <input type="hidden" name="mod" value="clippings"> 6488c2e8227SGreg Roach <input type="hidden" name="mod_action" value="index"> 6498c2e8227SGreg Roach <input type="hidden" name="pid" value="' .$pid . '"> 6508c2e8227SGreg Roach <input type="hidden" name="action" value="download"> 6518c2e8227SGreg Roach <table> 6528c2e8227SGreg Roach <tr><td colspan="2" class="topbottombar"><h2>'. I18N::translate('Download') . '</h2></td></tr> 6536fd6cde8SGreg Roach <tr><td class="descriptionbox width50 wrap">'. I18N::translate('Zip file(s)') . '</td> 6548c2e8227SGreg Roach <td class="optionbox"><input type="checkbox" name="Zip" value="yes" checked></td></tr> 6558c2e8227SGreg Roach 6568c2e8227SGreg Roach <tr><td class="descriptionbox width50 wrap">'. I18N::translate('Include media (automatically zips files)') . help_link('include_media') . '</td> 6578c2e8227SGreg Roach <td class="optionbox"><input type="checkbox" name="IncludeMedia" value="yes" checked></td></tr> 6588c2e8227SGreg Roach '; 6598c2e8227SGreg Roach 6604b9ff166SGreg Roach if (Auth::isManager($WT_TREE)) { 6618c2e8227SGreg Roach $out .= 6628c2e8227SGreg Roach '<tr><td class="descriptionbox width50 wrap">' . I18N::translate('Apply privacy settings') . help_link('apply_privacy') . '</td>' . 6638c2e8227SGreg Roach '<td class="optionbox">' . 6648c2e8227SGreg Roach ' <input type="radio" name="privatize_export" value="none" checked> ' . I18N::translate('None') . '<br>' . 6658c2e8227SGreg Roach ' <input type="radio" name="privatize_export" value="gedadmin"> ' . I18N::translate('Manager') . '<br>' . 6668c2e8227SGreg Roach ' <input type="radio" name="privatize_export" value="user"> ' . I18N::translate('Member') . '<br>' . 6678c2e8227SGreg Roach ' <input type="radio" name="privatize_export" value="visitor"> ' . I18N::translate('Visitor') . 6688c2e8227SGreg Roach '</td></tr>'; 6694b9ff166SGreg Roach } elseif (Auth::isMember($WT_TREE)) { 6708c2e8227SGreg Roach $out .= 6718c2e8227SGreg Roach '<tr><td class="descriptionbox width50 wrap">' . I18N::translate('Apply privacy settings') . help_link('apply_privacy') . '</td>' . 6728c2e8227SGreg Roach '<td class="list_value">' . 6738c2e8227SGreg Roach ' <input type="radio" name="privatize_export" value="user" checked> ' . I18N::translate('Member') . '<br>' . 6748c2e8227SGreg Roach ' <input type="radio" name="privatize_export" value="visitor"> ' . I18N::translate('Visitor') . 6758c2e8227SGreg Roach '</td></tr>'; 6768c2e8227SGreg Roach } 6778c2e8227SGreg Roach 6788c2e8227SGreg Roach $out .= ' 6798c2e8227SGreg Roach <tr><td class="descriptionbox width50 wrap">'. I18N::translate('Convert from UTF-8 to ISO-8859-1') . help_link('utf8_ansi') . '</td> 6808c2e8227SGreg Roach <td class="optionbox"><input type="checkbox" name="convert" value="yes"></td></tr> 6818c2e8227SGreg Roach 6828c2e8227SGreg Roach <tr> 6838c2e8227SGreg Roach <td class="descriptionbox width50 wrap">'. I18N::translate('Add the GEDCOM media path to filenames') . help_link('GEDCOM_MEDIA_PATH') . '</td> 6848c2e8227SGreg Roach <td class="optionbox"> 6858c2e8227SGreg Roach <input type="checkbox" name="conv_path" value="' . Filter::escapeHtml($WT_TREE->getPreference('GEDCOM_MEDIA_PATH')) . '"> 6868c2e8227SGreg Roach <span dir="auto">' . Filter::escapeHtml($WT_TREE->getPreference('GEDCOM_MEDIA_PATH')) . '</span></td> 6878c2e8227SGreg Roach </tr> 6888c2e8227SGreg Roach 6898c2e8227SGreg Roach <input type="hidden" name="conv_path" value="'.$clip_ctrl->conv_path . '"> 6908c2e8227SGreg Roach 6918c2e8227SGreg Roach </td></tr> 6928c2e8227SGreg Roach 6938c2e8227SGreg Roach <tr><td class="topbottombar" colspan="2"> 6948c2e8227SGreg Roach <input type="button" value="'. I18N::translate('Cancel') . '" onclick="cancelDownload();"> 6958c2e8227SGreg Roach <input type="submit" value="'. I18N::translate('Download') . '"> 6968c2e8227SGreg Roach </form>'; 6978c2e8227SGreg Roach 6988c2e8227SGreg Roach return $out; 6998c2e8227SGreg Roach } 7008c2e8227SGreg Roach 7018c2e8227SGreg Roach} 702