private function pageBody(PageController $controller) { ?> <!-- ADMIN PAGE CONTENT --> <ol class="breadcrumb small"> <li><a href="admin.php"><?php echo I18N::translate('Control panel'); ?> </a></li> <li><a href="admin_modules.php"><?php echo I18N::translate('Module administration'); ?> </a></li> <li class="active"><?php echo $controller->getPageTitle(); ?> </li> </ol> <h2><?php echo $controller->getPageTitle(); ?> </h2> <form class="form-inline" method="post"> <?php echo Filter::getCsrf(); ?> <input type="hidden" name="save" value="1"> <!-- SHOW PDF --> <div class="form-group"> <label class="control-label"> <?php echo I18N::translate('Access level'); ?> </label> <?php echo FunctionsEdit::editFieldAccessLevel('NEW_FTV_PDF_ACCESS_LEVEL', $this->getSetting('FTV_PDF_ACCESS_LEVEL'), 'class="form-control"'); ?> </div> <!-- BUTTONS --> <button class="btn btn-primary" type="submit"> <i class="fa fa-check"></i> <?php echo I18N::translate('save'); ?> </button> </form> <?php }
?> </a></li> <li class="active"><?php echo $controller->getPageTitle(); ?> </li> </ol> <h1><?php echo $controller->getPageTitle(); ?> </h1> <form class="form form-horizontal" method="post" action="admin_trees_export.php"> <?php echo Filter::getCsrf(); ?> <input type="hidden" name="ged" value="<?php echo $WT_TREE->getNameHtml(); ?> "> <div class="form-group"> <label for="submit-export" class="col-sm-3 control-label"> <?php echo I18N::translate('A file on the server'); ?> </label> <div class="col-sm-9"> <button id="submit-export" type="submit" class="btn btn-primary"> <?php
private function edit() { global $WT_TREE; if (webtrees\Filter::postBool('save') && webtrees\Filter::checkCsrf()) { $block_id = webtrees\Filter::post('block_id'); if ($block_id) { webtrees\Database::prepare("UPDATE `##block` SET gedcom_id=NULLIF(?, ''), block_order=? WHERE block_id=?")->execute(array(webtrees\Filter::post('gedcom_id'), (int) webtrees\Filter::post('block_order'), $block_id)); } else { webtrees\Database::prepare("INSERT INTO `##block` (gedcom_id, module_name, block_order) VALUES (NULLIF(?, ''), ?, ?)")->execute(array(webtrees\Filter::post('gedcom_id'), $this->getName(), (int) webtrees\Filter::post('block_order'))); $block_id = webtrees\Database::getInstance()->lastInsertId(); } $this->setBlockSetting($block_id, 'menu_title', webtrees\Filter::post('menu_title')); $this->setBlockSetting($block_id, 'menu_address', webtrees\Filter::post('menu_address')); $this->setBlockSetting($block_id, 'menu_access', webtrees\Filter::post('menu_access')); $languages = array(); foreach (webtrees\I18N::installedLocales() as $locale) { if (webtrees\Filter::postBool('lang_' . $locale->languageTag())) { $languages[] = $locale->languageTag(); } } $this->setBlockSetting($block_id, 'languages', implode(',', $languages)); $this->config(); } else { $block_id = webtrees\Filter::get('block_id'); $controller = new webtrees\Controller\PageController(); $controller->restrictAccess(webtrees\Auth::isEditor($WT_TREE)); if ($block_id) { $controller->setPageTitle(webtrees\I18N::translate('Edit menu')); $menu_title = $this->getBlockSetting($block_id, 'menu_title'); $menu_address = $this->getBlockSetting($block_id, 'menu_address'); $menu_access = $this->getBlockSetting($block_id, 'menu_access'); $block_order = webtrees\Database::prepare("SELECT block_order FROM `##block` WHERE block_id=?")->execute(array($block_id))->fetchOne(); $gedcom_id = webtrees\Database::prepare("SELECT gedcom_id FROM `##block` WHERE block_id=?")->execute(array($block_id))->fetchOne(); } else { $controller->setPageTitle(webtrees\I18N::translate('Add menu')); $menu_access = 1; $menu_title = ''; $menu_address = ''; $block_order = webtrees\Database::prepare("SELECT IFNULL(MAX(block_order)+1, 0) FROM `##block` WHERE module_name=?")->execute(array($this->getName()))->fetchOne(); $gedcom_id = $WT_TREE->getTreeId(); } $controller->pageHeader(); ?> <ol class="breadcrumb small"> <li><a href="admin.php"><?php echo webtrees\I18N::translate('Control panel'); ?> </a></li> <li><a href="admin_modules.php"><?php echo webtrees\I18N::translate('Module administration'); ?> </a></li> <li><a href="module.php?mod=<?php echo $this->getName(); ?> &mod_action=admin_config"><?php echo webtrees\I18N::translate($this->getTitle()); ?> </a></li> <li class="active"><?php echo $controller->getPageTitle(); ?> </li> </ol> <form class="form-horizontal" method="POST" action="#" name="menu" id="menuForm"> <?php echo webtrees\Filter::getCsrf(); ?> <input type="hidden" name="save" value="1"> <input type="hidden" name="block_id" value="<?php echo $block_id; ?> "> <h3><?php echo webtrees\I18N::translate('General'); ?> </h3> <div class="form-group"> <label class="control-label col-sm-3" for="menu_title"> <?php echo webtrees\I18N::translate('Title'); ?> </label> <div class="col-sm-9"> <input class="form-control" id="menu_title" size="90" name="menu_title" required type="text" value="<?php echo webtrees\Filter::escapeHtml($menu_title); ?> " > </div> <span class="help-block col-sm-9 col-sm-offset-3 small text-muted"> <?php echo webtrees\I18N::translate('Add your menu title here'); ?> </span> </div> <div class="form-group"> <label class="control-label col-sm-3" for="menu_address"> <?php echo webtrees\I18N::translate('Menu address'); ?> </label> <div class="col-sm-9"> <input class="form-control" id="menu_address" size="90" name="menu_address" required type="text" value="<?php echo webtrees\Filter::escapeHtml($menu_address); ?> " > </div> <span class="help-block col-sm-9 col-sm-offset-3 small text-muted"> <?php echo webtrees\I18N::translate('Add your menu address here'); ?> </span> </div> <h3><?php echo webtrees\I18N::translate('Languages'); ?> </h3> <div class="form-group"> <label class="control-label col-sm-3" for="lang_*"> <?php echo webtrees\I18N::translate('Show this menu for which languages?'); ?> </label> <div class="col-sm-9"> <?php $accepted_languages = explode(',', $this->getBlockSetting($block_id, 'languages')); foreach (webtrees\I18N::installedLocales() as $locale) { ?> <div class="checkbox"> <label title="<?php echo $locale->languageTag(); ?> "> <input type="checkbox" name="lang_<?php echo $locale->languageTag(); ?> " <?php echo in_array($locale->languageTag(), $accepted_languages) ? 'checked' : ''; ?> ><?php echo $locale->endonym(); ?> </label> </div> <?php } ?> </div> </div> <h3><?php echo webtrees\I18N::translate('Visibility and Access'); ?> </h3> <div class="form-group"> <label class="control-label col-sm-3" for="block_order"> <?php echo webtrees\I18N::translate('Menu position'); ?> </label> <div class="col-sm-9"> <input class="form-control" id="position" name="block_order" size="3" required type="number" value="<?php echo webtrees\Filter::escapeHtml($block_order); ?> " > </div> <span class="help-block col-sm-9 col-sm-offset-3 small text-muted"> <?php echo webtrees\I18N::translate('This field controls the order in which the menu items are displayed.'), '<br><br>', webtrees\I18N::translate('You do not have to enter the numbers sequentially. If you leave holes in the numbering scheme, you can insert other menu items later. For example, if you use the numbers 1, 6, 11, 16, you can later insert menu items with the missing sequence numbers. Negative numbers and zero are allowed, and can be used to insert menu items in front of the first one.'), '<br><br>', webtrees\I18N::translate('When more than one menu item has the same position number, only one of these menu items will be visible.'); ?> </span> </div> <div class="form-group"> <label class="control-label col-sm-3" for="block_order"> <?php echo webtrees\I18N::translate('Menu visibility'); ?> </label> <div class="col-sm-9"> <?php echo webtrees\Functions\FunctionsEdit::selectEditControl('gedcom_id', webtrees\Tree::getIdList(), webtrees\I18N::translate('All'), $WT_TREE->getTreeId(), 'class="form-control"'); ?> </div> <span class="help-block col-sm-9 col-sm-offset-3 small text-muted"> <?php echo webtrees\I18N::translate('You can determine whether this menu item will be visible regardless of family tree, or whether it will be visible only to the current family tree.'); ?> </span> </div> <div class="form-group"> <label class="control-label col-sm-3" for="menu_access"> <?php echo webtrees\I18N::translate('Access level'); ?> </label> <div class="col-sm-9"> <?php echo webtrees\Functions\FunctionsEdit::editFieldAccessLevel('menu_access', $menu_access, 'class="form-control"'); ?> </div> </div> <div class="row col-sm-9 col-sm-offset-3"> <button class="btn btn-primary" type="submit"> <i class="fa fa-check"></i> <?php echo webtrees\I18N::translate('save'); ?> </button> <button class="btn" type="button" onclick="window.location='<?php echo $this->getConfigLink(); ?> ';"> <i class="fa fa-close"></i> <?php echo webtrees\I18N::translate('cancel'); ?> </button> </div> </form> <?php } }
/** * Print a form to add an individual or edit an individual’s name * * @param string $nextaction * @param Individual $person * @param Family $family * @param Fact $name_fact * @param string $famtag * @param string $gender */ function print_indi_form($nextaction, Individual $person = null, Family $family = null, Fact $name_fact = null, $famtag = 'CHIL', $gender = 'U') { global $WT_TREE, $bdm, $controller; if ($person) { $xref = $person->getXref(); } elseif ($family) { $xref = $family->getXref(); } else { $xref = 'new'; } // Different cultures do surnames differently $surname_tradition = SurnameTradition::create($WT_TREE->getPreference('SURNAME_TRADITION')); $name_fields = array(); if ($name_fact) { // Editing an existing name $name_fact_id = $name_fact->getFactId(); $name_type = $name_fact->getAttribute('TYPE'); $namerec = $name_fact->getGedcom(); foreach (Config::standardNameFacts() as $tag) { if ($tag === 'NAME') { $name_fields[$tag] = $name_fact->getValue(); } else { $name_fields[$tag] = $name_fact->getAttribute($tag); } } // Populate any missing 2 XXXX fields from the 1 NAME field $npfx_accept = implode('|', Config::namePrefixes()); if (preg_match('/(((' . $npfx_accept . ')\\.? +)*)([^\\n\\/"]*)("(.*)")? *\\/(([a-z]{2,3} +)*)(.*)\\/ *(.*)/i', $name_fields['NAME'], $name_bits)) { if (empty($name_fields['NPFX'])) { $name_fields['NPFX'] = $name_bits[1]; } if (empty($name_fields['SPFX']) && empty($name_fields['SURN'])) { $name_fields['SPFX'] = trim($name_bits[7]); // For names with two surnames, there will be four slashes. // Turn them into a list $name_fields['SURN'] = preg_replace('~/[^/]*/~', ',', $name_bits[9]); } if (empty($name_fields['GIVN'])) { $name_fields['GIVN'] = $name_bits[4]; } if (empty($name_fields['NICK']) && !empty($name_bits[6]) && !preg_match('/^2 NICK/m', $namerec)) { $name_fields['NICK'] = $name_bits[6]; } } } else { // Creating a new name $name_fact_id = null; $name_type = null; $namerec = null; // Populate the standard NAME field and subfields foreach (Config::standardNameFacts() as $tag) { $name_fields[$tag] = ''; } // Inherit surname from parents, spouse or child if ($family) { $father = $family->getHusband(); if ($father && $father->getFirstFact('NAME')) { $father_name = $father->getFirstFact('NAME')->getValue(); } else { $father_name = ''; } $mother = $family->getWife(); if ($mother && $mother->getFirstFact('NAME')) { $mother_name = $mother->getFirstFact('NAME')->getValue(); } else { $mother_name = ''; } } else { $father = null; $mother = null; $father_name = ''; $mother_name = ''; } if ($person && $person->getFirstFact('NAME')) { $indi_name = $person->getFirstFact('NAME')->getValue(); } else { $indi_name = ''; } switch ($nextaction) { case 'add_child_to_family_action': $name_fields = $surname_tradition->newChildNames($father_name, $mother_name, $gender) + $name_fields; break; case 'add_child_to_individual_action': if ($person->getSex() === 'F') { $name_fields = $surname_tradition->newChildNames('', $indi_name, $gender) + $name_fields; } else { $name_fields = $surname_tradition->newChildNames($indi_name, '', $gender) + $name_fields; } break; case 'add_parent_to_individual_action': $name_fields = $surname_tradition->newParentNames($indi_name, $gender) + $name_fields; break; case 'add_spouse_to_family_action': if ($father) { $name_fields = $surname_tradition->newSpouseNames($father_name, $gender) + $name_fields; } else { $name_fields = $surname_tradition->newSpouseNames($mother_name, $gender) + $name_fields; } break; case 'add_spouse_to_individual_action': $name_fields = $surname_tradition->newSpouseNames($indi_name, $gender) + $name_fields; break; case 'add_unlinked_indi_action': case 'update': if ($surname_tradition->hasSurnames()) { $name_fields['NAME'] = '//'; } break; } } $bdm = ''; // used to copy '1 SOUR' to '2 SOUR' for BIRT DEAT MARR echo '<div id="edit_interface-page">'; echo '<h4>', $controller->getPageTitle(), '</h4>'; FunctionsPrint::initializeCalendarPopup(); echo '<form method="post" name="addchildform" onsubmit="return checkform();">'; echo '<input type="hidden" name="ged" value="', $WT_TREE->getNameHtml(), '">'; echo '<input type="hidden" name="action" value="', $nextaction, '">'; echo '<input type="hidden" name="fact_id" value="', $name_fact_id, '">'; echo '<input type="hidden" name="xref" value="', $xref, '">'; echo '<input type="hidden" name="famtag" value="', $famtag, '">'; echo '<input type="hidden" name="gender" value="', $gender, '">'; echo '<input type="hidden" name="goto" value="">'; // set by javascript echo Filter::getCsrf(); echo '<table class="facts_table">'; switch ($nextaction) { case 'add_child_to_family_action': case 'add_child_to_individual_action': // When adding a new child, specify the pedigree FunctionsEdit::addSimpleTag('0 PEDI'); break; case 'update': // When adding/editing a name, specify the type FunctionsEdit::addSimpleTag('0 TYPE ' . $name_type, '', '', null, $person); break; } // First - new/existing standard name fields foreach ($name_fields as $tag => $value) { if (substr_compare($tag, '_', 0, 1) !== 0) { FunctionsEdit::addSimpleTag('0 ' . $tag . ' ' . $value); } } // Second - new/existing advanced name fields if ($surname_tradition->hasMarriedNames() || preg_match('/\\n2 _MARNM /', $namerec)) { $adv_name_fields = array('_MARNM' => ''); } else { $adv_name_fields = array(); } if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $WT_TREE->getPreference('ADVANCED_NAME_FACTS'), $match)) { foreach ($match[1] as $tag) { $adv_name_fields[$tag] = ''; } } foreach (array_keys($adv_name_fields) as $tag) { // Edit existing tags, grouped together if (preg_match_all('/2 ' . $tag . ' (.+)/', $namerec, $match)) { foreach ($match[1] as $value) { FunctionsEdit::addSimpleTag('2 ' . $tag . ' ' . $value, '', GedcomTag::getLabel('NAME:' . $tag, $person)); if ($tag === '_MARNM') { preg_match_all('/\\/([^\\/]*)\\//', $value, $matches); FunctionsEdit::addSimpleTag('2 _MARNM_SURN ' . implode(',', $matches[1])); } } } // Allow a new tag to be entered if (!array_key_exists($tag, $name_fields)) { FunctionsEdit::addSimpleTag('0 ' . $tag, '', GedcomTag::getLabel('NAME:' . $tag, $person)); if ($tag === '_MARNM') { FunctionsEdit::addSimpleTag('0 _MARNM_SURN'); } } } // Third - new/existing custom name fields foreach ($name_fields as $tag => $value) { if (substr_compare($tag, '_', 0, 1) === 0) { FunctionsEdit::addSimpleTag('0 ' . $tag . ' ' . $value); if ($tag === '_MARNM') { preg_match_all('/\\/([^\\/]*)\\//', $value, $matches); FunctionsEdit::addSimpleTag('2 _MARNM_SURN ' . implode(',', $matches[1])); } } } // Fourth - SOUR, NOTE, _CUSTOM, etc. if ($namerec) { $gedlines = explode("\n", $namerec); // -- find the number of lines in the record $fields = explode(' ', $gedlines[0]); $glevel = $fields[0]; $level = $glevel; $type = trim($fields[1]); $tags = array(); $i = 0; do { if ($type !== 'TYPE' && !array_key_exists($type, $name_fields) && !array_key_exists($type, $adv_name_fields)) { $text = ''; for ($j = 2; $j < count($fields); $j++) { if ($j > 2) { $text .= ' '; } $text .= $fields[$j]; } while ($i + 1 < count($gedlines) && preg_match('/' . ($level + 1) . ' CONT ?(.*)/', $gedlines[$i + 1], $cmatch) > 0) { $text .= "\n" . $cmatch[2]; $i++; } FunctionsEdit::addSimpleTag($level . ' ' . $type . ' ' . $text); } $tags[] = $type; $i++; if (isset($gedlines[$i])) { $fields = explode(' ', $gedlines[$i]); $level = $fields[0]; if (isset($fields[1])) { $type = $fields[1]; } } } while ($level > $glevel && $i < count($gedlines)); } // If we are adding a new individual, add the basic details if ($nextaction !== 'update') { echo '</table><br><table class="facts_table">'; // 1 SEX if ($famtag === 'HUSB' || $gender === 'M') { FunctionsEdit::addSimpleTag("0 SEX M"); } elseif ($famtag === 'WIFE' || $gender === 'F') { FunctionsEdit::addSimpleTag('0 SEX F'); } else { FunctionsEdit::addSimpleTag('0 SEX'); } $bdm = 'BD'; if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $WT_TREE->getPreference('QUICK_REQUIRED_FACTS'), $matches)) { foreach ($matches[1] as $match) { if (!in_array($match, explode('|', WT_EVENTS_DEAT))) { FunctionsEdit::addSimpleTags($match); } } } //-- if adding a spouse add the option to add a marriage fact to the new family if ($nextaction === 'add_spouse_to_individual_action' || $nextaction === 'add_spouse_to_family_action') { $bdm .= 'M'; if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $WT_TREE->getPreference('QUICK_REQUIRED_FAMFACTS'), $matches)) { foreach ($matches[1] as $match) { FunctionsEdit::addSimpleTags($match); } } } if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $WT_TREE->getPreference('QUICK_REQUIRED_FACTS'), $matches)) { foreach ($matches[1] as $match) { if (in_array($match, explode('|', WT_EVENTS_DEAT))) { FunctionsEdit::addSimpleTags($match); } } } } echo keep_chan($person); echo '</table>'; if ($nextaction === 'update') { // GEDCOM 5.5.1 spec says NAME doesn’t get a OBJE FunctionsEdit::printAddLayer('SOUR'); FunctionsEdit::printAddLayer('NOTE'); FunctionsEdit::printAddLayer('SHARED_NOTE'); FunctionsEdit::printAddLayer('RESN'); } else { FunctionsEdit::printAddLayer('SOUR', 1); FunctionsEdit::printAddLayer('NOTE', 1); FunctionsEdit::printAddLayer('SHARED_NOTE', 1); FunctionsEdit::printAddLayer('RESN', 1); } // If we are editing an existing name, allow raw GEDCOM editing if ($name_fact && (Auth::isAdmin() || $WT_TREE->getPreference('SHOW_GEDCOM_RECORD'))) { echo '<br><br><a href="edit_interface.php?action=editrawfact&xref=', $xref, '&fact_id=', $name_fact->getFactId(), '&ged=', $WT_TREE->getNameUrl(), '">', I18N::translate('Edit raw GEDCOM'), '</a>'; } echo '<p id="save-cancel">'; echo '<input type="submit" class="save" value="', I18N::translate('save'), '">'; if (preg_match('/^add_(child|spouse|parent|unlinked_indi)/', $nextaction)) { echo '<input type="submit" class="save" value="', I18N::translate('go to new individual'), '" onclick="document.addchildform.goto.value=\'new\';">'; } echo '<input type="button" class="cancel" value="', I18N::translate('close'), '" onclick="window.close();">'; echo '</p>'; echo '</form>'; $controller->addInlineJavascript(' SURNAME_TRADITION="' . $WT_TREE->getPreference('SURNAME_TRADITION') . '"; gender="' . $gender . '"; famtag="' . $famtag . '"; function trim(str) { str=str.replace(/\\s\\s+/g, " "); return str.replace(/(^\\s+)|(\\s+$)/g, ""); } function lang_class(str) { if (str.match(/[\\u0370-\\u03FF]/)) return "greek"; if (str.match(/[\\u0400-\\u04FF]/)) return "cyrillic"; if (str.match(/[\\u0590-\\u05FF]/)) return "hebrew"; if (str.match(/[\\u0600-\\u06FF]/)) return "arabic"; return "latin"; // No matched text implies latin :-) } // Generate a full name from the name components function generate_name() { var npfx = jQuery("#NPFX").val(); var givn = jQuery("#GIVN").val(); var spfx = jQuery("#SPFX").val(); var surn = jQuery("#SURN").val(); var nsfx = jQuery("#NSFX").val(); if (SURNAME_TRADITION === "polish" && (gender === "F" || famtag === "WIFE")) { surn = surn.replace(/ski$/, "ska"); surn = surn.replace(/cki$/, "cka"); surn = surn.replace(/dzki$/, "dzka"); surn = surn.replace(/żki$/, "żka"); } // Commas are used in the GIVN and SURN field to separate lists of surnames. // For example, to differentiate the two Spanish surnames from an English // double-barred name. // Commas *may* be used in other fields, and will form part of the NAME. if (WT_LOCALE=="vi" || WT_LOCALE=="hu") { // Default format: /SURN/ GIVN return trim(npfx+" /"+trim(spfx+" "+surn).replace(/ *, */g, " ")+"/ "+givn.replace(/ *, */g, " ")+" "+nsfx); } else if (WT_LOCALE=="zh") { // Default format: /SURN/GIVN return trim(npfx+" /"+trim(spfx+" "+surn).replace(/ *, */g, " ")+"/"+givn.replace(/ *, */g, " ")+" "+nsfx); } else { // Default format: GIVN /SURN/ return trim(npfx+" "+givn.replace(/ *, */g, " ")+" /"+trim(spfx+" "+surn).replace(/ *, */g, " ")+"/ "+nsfx); } } // Update the NAME and _MARNM fields from the name components // and also display the value in read-only "gedcom" format. function updatewholename() { // Don’t update the name if the user manually changed it if (manualChange) { return; } var npfx = jQuery("#NPFX").val(); var givn = jQuery("#GIVN").val(); var spfx = jQuery("#SPFX").val(); var surn = jQuery("#SURN").val(); var nsfx = jQuery("#NSFX").val(); var name = generate_name(); jQuery("#NAME").val(name); jQuery("#NAME_display").text(name); // Married names inherit some NSFX values, but not these nsfx = nsfx.replace(/^(I|II|III|IV|V|VI|Junior|Jr\\.?|Senior|Sr\\.?)$/i, ""); // Update _MARNM field from _MARNM_SURN field and display it // Be careful of mixing latin/hebrew/etc. character sets. var ip = document.getElementsByTagName("input"); var marnm_id = ""; var romn = ""; var heb = ""; for (var i = 0; i < ip.length; i++) { var val = trim(ip[i].value); if (ip[i].id.indexOf("_HEB") === 0) heb = val; if (ip[i].id.indexOf("ROMN") === 0) romn = val; if (ip[i].id.indexOf("_MARNM") === 0) { if (ip[i].id.indexOf("_MARNM_SURN") === 0) { var msurn = ""; if (val !== "") { var lc = lang_class(document.getElementById(ip[i].id).value); if (lang_class(name) === lc) msurn = trim(npfx + " " + givn + " /" + val + "/ " + nsfx); else if (lc === "hebrew") msurn = heb.replace(/\\/.*\\//, "/" + val + "/"); else if (lang_class(romn) === lc) msurn = romn.replace(/\\/.*\\//, "/" + val + "/"); } document.getElementById(marnm_id).value = msurn; document.getElementById(marnm_id+"_display").innerHTML = msurn; } else { marnm_id = ip[i].id; } } } } // Toggle the name editor fields between // <input type="hidden"> <span style="display:inline"> // <input type="text"> <span style="display:hidden"> var oldName = ""; // Calls to generate_name() trigger an update - hence need to // set the manual change to true first. We are probably // listening to the wrong events on the input fields... var manualChange = true; manualChange = generate_name() !== jQuery("#NAME").val(); function convertHidden(eid) { var input1 = jQuery("#" + eid); var input2 = jQuery("#" + eid + "_display"); // Note that IE does not allow us to change the type of an input, so we must create a new one. if (input1.attr("type")=="hidden") { input1.replaceWith(input1.clone().attr("type", "text")); input2.hide(); } else { input1.replaceWith(input1.clone().attr("type", "hidden")); input2.show(); } } /** * if the user manually changed the NAME field, then update the textual * HTML representation of it * If the value changed set manualChange to true so that changing * the other fields doesn’t change the NAME line */ function updateTextName(eid) { var element = document.getElementById(eid); if (element) { if (element.value!=oldName) manualChange = true; var delement = document.getElementById(eid+"_display"); if (delement) { delement.innerHTML = element.value; } } } function checkform() { var ip=document.getElementsByTagName("input"); for (var i=0; i<ip.length; i++) { // ADD slashes to _HEB and _AKA names if (ip[i].id.indexOf("_AKA")==0 || ip[i].id.indexOf("_HEB")==0 || ip[i].id.indexOf("ROMN")==0) if (ip[i].value.indexOf("/")<0 && ip[i].value!="") ip[i].value=ip[i].value.replace(/([^\\s]+)\\s*$/, "/$1/"); // Blank out temporary _MARNM_SURN if (ip[i].id.indexOf("_MARNM_SURN")==0) ip[i].value=""; // Convert "xxx yyy" and "xxx y yyy" surnames to "xxx,yyy" if ((SURNAME_TRADITION=="spanish" || "SURNAME_TRADITION"=="portuguese") && ip[i].id.indexOf("SURN")==0) { ip[i].value=document.forms[0].SURN.value.replace(/^\\s*([^\\s,]{2,})\\s+([iIyY] +)?([^\\s,]{2,})\\s*$/, "$1,$3"); } } return true; } // If the name isn’t initially formed from the components in a standard way, // then don’t automatically update it. if (document.getElementById("NAME").value!=generate_name() && document.getElementById("NAME").value!="//") { convertHidden("NAME"); } '); echo '</div>'; }
/** * {@inhericDoc} * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() */ protected function renderContent() { /** @var GeoAnalysis $ga */ $ga = $this->data->get('geo_analysis'); $is_new = is_null($ga); $places_hierarchy = $this->data->get('places_hierarchy'); ?> <ol class="breadcrumb small"> <li><a href="admin.php"><?php echo I18N::translate('Control panel'); ?> </a></li> <li><a href="admin_modules.php"><?php echo I18N::translate('Module administration'); ?> </a></li> <li><a href="<?php echo $this->data->get('admin_config_url'); ?> "><?php echo $this->data->get('module_title'); ?> </a></li> <li class="active"><?php echo $this->data->get('title'); ?> </li> </ol> <h1><?php echo $this->data->get('title'); ?> </h1> <form class="form-horizontal" name="newform" method="post" role="form" action="<?php echo $this->data->get('save_url'); ?> " autocomplete="off"> <?php echo Filter::getCsrf(); ?> <?php if (!$is_new) { ?> <input type="hidden" name="ga_id" value="<?php echo $ga->getId(); ?> "> <?php } ?> <!-- DESCRIPTION --> <div class="form-group"> <label class="control-label col-sm-3" for="description"> <?php echo I18N::translate('Description'); ?> </label> <div class="col-sm-9"> <input class="form-control" type="text" id="description" name="description" required maxlength="70" <?php if (!$is_new) { echo 'value="' . Filter::escapeHtml($ga->getTitle()) . '"'; } ?> dir="auto"> <p class="small text-muted"> <?php echo I18N::translate('Description to be given to the geographical dispersion analysis. It will be used as the page title for it.'); ?> </p> </div> </div> <!-- ANALYSIS LEVEL --> <div class="form-group"> <label class="control-label col-sm-3" for="analysislevel"> <?php echo I18N::translate('Analysis level'); ?> </label> <div class="col-sm-9"> <?php echo FunctionsEdit::selectEditControl('analysislevel', $places_hierarchy['hierarchy'], null, $is_new ? '' : $ga->getAnalysisLevel() - 1, 'class="form-control"'); ?> <p class="small text-muted"> <?php echo I18N::translate('Subdivision level used for the analysis.'); ?> </p> </div> </div> <h3><?php echo I18N::translate('Display options'); ?> </h3> <!-- USE MAP --> <div class="form-group"> <label class="control-label col-sm-3" for="use_map"> <?php echo I18N::translate('Use map'); ?> </label> <div class="col-sm-9"> <?php echo FunctionsEdit::editFieldYesNo('use_map', !$is_new && ($ga && $ga->hasMap()) ? 1 : 0, 'class="radio-inline"'); ?> <p class="small text-muted"> <?php echo I18N::translate('Displays the results on a map.'); ?> </p> </div> </div> <div id="map_options"> <!-- MAP --> <div class="form-group"> <label class="control-label col-sm-3" for="map_file"> <?php echo I18N::translate('Map'); ?> </label> <div class="col-sm-9"> <?php echo FunctionsEdit::selectEditControl('map_file', $this->data->get('map_list'), null, $is_new || !$ga->hasMap() ? '' : base64_encode($ga->getOptions()->getMap()->getFileName()), 'class="form-control"'); ?> <p class="small text-muted"> <?php echo I18N::translate('Map outline to be used for the result display.'); ?> </p> </div> </div> <!-- MAP TOP LEVEL --> <div class="form-group"> <label class="control-label col-sm-3" for="map_top_level"> <?php echo I18N::translate('Map parent level'); ?> </label> <div class="col-sm-9"> <?php echo FunctionsEdit::selectEditControl('map_top_level', $places_hierarchy['hierarchy'], null, $is_new || !$ga->hasMap() ? '' : $ga->getOptions()->getMapLevel() - 1, 'class="form-control"'); ?> <p class="small text-muted"> <?php echo I18N::translate('Subdivision level of the parent subdivision(s) represented by the map.'); ?> <br /> <?php echo I18N::translate('For instance, if the map is intended to represent a country by county analysis, then the map parent level would be “Country”, and the analysis level would be “County”.'); ?> </p> </div> </div> </div> <!-- USE FLAGS --> <div class="form-group"> <label class="control-label col-sm-3" for="use_flags"> <?php echo I18N::translate('Use flags'); ?> </label> <div class="col-sm-9"> <?php echo FunctionsEdit::editFieldYesNo('use_flags', !$is_new && ($ga && $ga->getOptions()->isUsingFlags()) ? 1 : 0, 'class="radio-inline"'); ?> <p class="small text-muted"> <?php echo I18N::translate('Display the place\'s flag, instead of or in addition to the place name.'); ?> </p> </div> </div> <!-- GENERATION DETAILS --> <div class="form-group"> <label class="control-label col-sm-3" for="gen_details"> <?php echo I18N::translate('Top places number'); ?> </label> <div class="col-sm-9"> <?php echo FunctionsEdit::selectEditControl('gen_details', $this->data->get('generation_details'), null, !$is_new && ($ga && $ga->getOptions()) ? $ga->getOptions()->getMaxDetailsInGen() : 0, 'class="form-control"'); ?> <p class="small text-muted"> <?php echo I18N::translate('Set the number of top places to display in the generation breakdown view.'); ?> </p> </div> </div> <div class="form-group"> <div class="col-sm-offset-3 col-sm-9"> <button type="submit" class="btn btn-primary"> <?php echo $is_new ? I18N::translate('Add') : I18N::translate('save'); ?> </button> </div> </div> </form> <?php }
/** * Action from the configuration page */ private function edit() { global $WT_TREE; if (Filter::postBool('save') && Filter::checkCsrf()) { $block_id = Filter::postInteger('block_id'); if ($block_id) { Database::prepare("UPDATE `##block` SET gedcom_id = NULLIF(:tree_id, '0'), block_order = :block_order WHERE block_id = :block_id")->execute(array('tree_id' => Filter::postInteger('gedcom_id'), 'block_order' => Filter::postInteger('block_order'), 'block_id' => $block_id)); } else { Database::prepare("INSERT INTO `##block` (gedcom_id, module_name, block_order) VALUES (NULLIF(:tree_id, '0'), :module_name, :block_order)")->execute(array('tree_id' => Filter::postInteger('gedcom_id'), 'module_name' => $this->getName(), 'block_order' => Filter::postInteger('block_order'))); $block_id = Database::getInstance()->lastInsertId(); } $this->setBlockSetting($block_id, 'header', Filter::post('header')); $this->setBlockSetting($block_id, 'faqbody', Filter::post('faqbody')); $languages = Filter::postArray('lang'); $this->setBlockSetting($block_id, 'languages', implode(',', $languages)); $this->config(); } else { $block_id = Filter::getInteger('block_id'); $controller = new PageController(); if ($block_id) { $controller->setPageTitle(I18N::translate('Edit FAQ item')); $header = $this->getBlockSetting($block_id, 'header'); $faqbody = $this->getBlockSetting($block_id, 'faqbody'); $block_order = Database::prepare("SELECT block_order FROM `##block` WHERE block_id = :block_id")->execute(array('block_id' => $block_id))->fetchOne(); $gedcom_id = Database::prepare("SELECT gedcom_id FROM `##block` WHERE block_id = :block_id")->execute(array('block_id' => $block_id))->fetchOne(); } else { $controller->setPageTitle(I18N::translate('Add an FAQ item')); $header = ''; $faqbody = ''; $block_order = Database::prepare("SELECT IFNULL(MAX(block_order)+1, 0) FROM `##block` WHERE module_name = :module_name")->execute(array('module_name' => $this->getName()))->fetchOne(); $gedcom_id = $WT_TREE->getTreeId(); } $controller->pageHeader(); if (Module::getModuleByName('ckeditor')) { CkeditorModule::enableEditor($controller); } ?> <ol class="breadcrumb small"> <li><a href="admin.php"><?php echo I18N::translate('Control panel'); ?> </a></li> <li><a href="admin_modules.php"><?php echo I18N::translate('Module administration'); ?> </a></li> <li><a href="module.php?mod=<?php echo $this->getName(); ?> &mod_action=admin_config"><?php echo I18N::translate('Frequently asked questions'); ?> </a> </li> <li class="active"><?php echo $controller->getPageTitle(); ?> </li> </ol> <h1><?php echo $controller->getPageTitle(); ?> </h1> <form name="faq" class="form-horizontal" method="post" action="module.php?mod=<?php echo $this->getName(); ?> &mod_action=admin_edit"> <?php echo Filter::getCsrf(); ?> <input type="hidden" name="save" value="1"> <input type="hidden" name="block_id" value="<?php echo $block_id; ?> "> <div class="form-group"> <label for="header" class="col-sm-3 control-label"> <?php echo I18N::translate('Question'); ?> </label> <div class="col-sm-9"> <input type="text" class="form-control" name="header" id="header" value="<?php echo Filter::escapeHtml($header); ?> "> </div> </div> <div class="form-group"> <label for="faqbody" class="col-sm-3 control-label"> <?php echo I18N::translate('Answer'); ?> </label> <div class="col-sm-9"> <textarea name="faqbody" id="faqbody" class="form-control html-edit" rows="10"><?php echo Filter::escapeHtml($faqbody); ?> </textarea> </div> </div> <div class="form-group"> <label for="xref" class="col-sm-3 control-label"> <?php echo I18N::translate('Show this block for which languages?'); ?> </label> <div class="col-sm-9"> <?php echo FunctionsEdit::editLanguageCheckboxes('lang', explode(',', $this->getBlockSetting($block_id, 'languages'))); ?> </div> </div> <div class="form-group"> <label for="block_order" class="col-sm-3 control-label"> <?php echo I18N::translate('FAQ position'); ?> </label> <div class="col-sm-9"> <input type="text" name="block_order" id="block_order" class="form-control" value="<?php echo $block_order; ?> "> </div> </div> <div class="form-group"> <label for="gedcom_id" class="col-sm-3 control-label"> <?php echo I18N::translate('FAQ visibility'); ?> </label> <div class="col-sm-9"> <?php echo FunctionsEdit::selectEditControl('gedcom_id', Tree::getIdList(), I18N::translate('All'), $gedcom_id, 'class="form-control"'); ?> <p class="small text-muted"> <?php echo I18N::translate('A FAQ item can be displayed on just one of the family trees, or on all the family trees.'); ?> </p> </div> </div> <div class="form-group"> <div class="col-sm-offset-3 col-sm-9"> <button type="submit" class="btn btn-primary"> <i class="fa fa-check"></i> <?php echo I18N::translate('save'); ?> </button> </div> </div> </form> <?php } }
/** * {@inhericDoc} * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() */ protected function renderContent() { if (Module::getModuleByName('ckeditor')) { CkeditorModule::enableEditor($this->ctrl); } /** @var AbstractModule $module */ $module = $this->data->get('module'); ?> <ol class="breadcrumb small"> <li><a href="admin.php"><?php echo I18N::translate('Control panel'); ?> </a></li> <li><a href="admin_modules.php"><?php echo I18N::translate('Module administration'); ?> </a></li> <li class="active"><?php echo $this->data->get('title'); ?> </li> </ol> <h1><?php echo $this->data->get('title'); ?> </h1> <form method="post" class="form-horizontal"> <?php echo Filter::getCsrf(); ?> <input type="hidden" name="action" value="update"> <h3><?php echo I18N::translate('Titles'); ?> </h3> <!-- MAJ_TITLE_PREFIX --> <div class="form-group"> <label for="MAJ_TITLE_PREFIX" class="col-sm-3 control-label"> <?php echo I18N::translate('Title prefixes'); ?> </label> <div class="col-sm-9"> <input type="text" class="form-control" dir="auto" id="MAJ_TITLE_PREFIX" name="MAJ_TITLE_PREFIX" value="<?php echo Filter::escapeHtml($module->getSetting('MAJ_TITLE_PREFIX')); ?> " maxlength="255" placeholder="de |d'|du |of |von |vom |am |zur |van |del |della |t'|da |ten |ter |das |dos |af "> <p class="small text-muted"> <?php echo I18N::translate('Set possible aristocratic particles to separate titles from the land they refer to (e.g. Earl <strong>of</strong> Essex). Variants must be separated by the character |.'); ?> <br /> <?php echo I18N::translate('An example for this setting is : <strong>de |d\'|du |of |von |vom |am |zur |van |del |della |t\'|da |ten |ter |das |dos |af </strong> (covering some of French, English, German, Dutch, Italian, Spanish, Portuguese, Swedish common particles).'); ?> </p> </div> </div> <h3><?php echo I18N::translate('Header'); ?> </h3> <!-- MAJ_ADD_HTML_HEADER --> <div class="form-group"> <label class="control-label col-sm-3" for="MAJ_ADD_HTML_HEADER"> <?php echo I18N::translate('Include additional HTML in header'); ?> </label> <div class="col-sm-9"> <?php echo FunctionsEdit::editFieldYesNo('MAJ_ADD_HTML_HEADER', $module->getSetting('MAJ_ADD_HTML_HEADER', 0), 'class="radio-inline"'); ?> <p class="small text-muted"> <?php echo I18N::translate('Enable this option to include raw additional HTML in the header of the page.'); ?> </p> </div> </div> <!-- MAJ_SHOW_HTML_HEADER --> <div class="form-group"> <label class="control-label col-sm-3" for="MAJ_SHOW_HTML_HEADER"> <?php echo I18N::translate('Hide additional header'); ?> </label> <div class="col-sm-9"> <?php echo FunctionsEdit::editFieldAccessLevel('MAJ_SHOW_HTML_HEADER', $module->getSetting('MAJ_SHOW_HTML_HEADER', Auth::PRIV_HIDE), 'class="form-control"'); ?> <p class="small text-muted"> <?php echo I18N::translate('Select the access level until which the additional header should be displayed. The <em>Hide from everyone</em> should be used to show the header to everybody.'); ?> </p> </div> </div> <!-- MAJ_HTML_HEADER --> <div class="form-group"> <label for="MAJ_HTML_HEADER" class="col-sm-3 control-label"> <?php echo I18N::translate('Additional HTML in header'); ?> </label> <div class="col-sm-9"> <textarea class="form-control html-edit" rows="10" dir="auto" id="MAJ_HTML_HEADER" name="MAJ_HTML_HEADER" ><?php echo Filter::escapeHtml($module->getSetting('MAJ_HTML_HEADER')); ?> </textarea> <p class="small text-muted"> <?php echo I18N::translate('If the option has been enabled, the saved HTML will be inserted in the header.'); ?> <br> <?php echo I18N::translate('In edit mode, the HTML characters might have been transformed to their HTML equivalents (for instance &gt; for >), it is however possible to insert HTML characters, they will be automatically converted to their equivalent values.'); ?> </p> </div> </div> <h3><?php echo I18N::translate('Footer'); ?> </h3> <!-- MAJ_DISPLAY_CNIL --> <div class="form-group"> <label class="control-label col-sm-3" for="MAJ_DISPLAY_CNIL"> <?php echo I18N::translate('Display French <em>CNIL</em> disclaimer'); ?> </label> <div class="col-sm-9"> <?php echo FunctionsEdit::editFieldYesNo('MAJ_DISPLAY_CNIL', $module->getSetting('MAJ_DISPLAY_CNIL', 0), 'class="radio-inline"'); ?> <p class="small text-muted"> <?php echo I18N::translate('Enable this option to display an information disclaimer in the footer required by the French <em>CNIL</em> for detaining personal information on users.'); ?> </p> </div> </div> <!-- MAJ_CNIL_REFERENCE --> <div class="form-group"> <label for="MAJ_CNIL_REFERENCE" class="col-sm-3 control-label"> <?php echo I18N::translate('<em>CNIL</em> reference'); ?> </label> <div class="col-sm-9"> <input type="text" class="form-control" dir="auto" id="MAJ_CNIL_REFERENCE" name="MAJ_CNIL_REFERENCE" value="<?php echo Filter::escapeHtml($module->getSetting('MAJ_CNIL_REFERENCE')); ?> " maxlength="255"> <p class="small text-muted"> <?php echo I18N::translate('If the website has been notified to the French <em>CNIL</em>, an authorisation number may have been delivered. Providing this reference will display a message in the footer visible to all users.'); ?> </p> </div> </div> <!-- MAJ_ADD_HTML_FOOTER --> <div class="form-group"> <label class="control-label col-sm-3" for="MAJ_ADD_HTML_FOOTER"> <?php echo I18N::translate('Include additional HTML in footer'); ?> </label> <div class="col-sm-9"> <?php echo FunctionsEdit::editFieldYesNo('MAJ_ADD_HTML_FOOTER', $module->getSetting('MAJ_ADD_HTML_FOOTER', 0), 'class="radio-inline"'); ?> <p class="small text-muted"> <?php echo I18N::translate('Enable this option to include raw additional HTML in the footer of the page.'); ?> </p> </div> </div> <!-- MAJ_SHOW_HTML_FOOTER --> <div class="form-group"> <label class="control-label col-sm-3" for="MAJ_SHOW_HTML_FOOTER"> <?php echo I18N::translate('Hide additional footer'); ?> </label> <div class="col-sm-9"> <?php echo FunctionsEdit::editFieldAccessLevel('MAJ_SHOW_HTML_FOOTER', $module->getSetting('MAJ_SHOW_HTML_FOOTER', Auth::PRIV_HIDE), 'class="form-control"'); ?> <p class="small text-muted"> <?php echo I18N::translate('Select the access level until which the additional footer should be displayed. The <em>Hide from everyone</em> should be used to show the footer to everybody.'); ?> </p> </div> </div> <!-- MAJ_HTML_FOOTER --> <div class="form-group"> <label for="MAJ_HTML_FOOTER" class="col-sm-3 control-label"> <?php echo I18N::translate('Additional HTML in footer'); ?> </label> <div class="col-sm-9"> <textarea class="form-control html-edit" rows="10" dir="auto" id="MAJ_HTML_FOOTER" name="MAJ_HTML_FOOTER" ><?php echo Filter::escapeHtml($module->getSetting('MAJ_HTML_FOOTER')); ?> </textarea> <p class="small text-muted"> <?php echo I18N::translate('If the option has been enabled, the saved HTML will be inserted in the footer, before the logo.'); ?> <br> <?php echo I18N::translate('In edit mode, the HTML characters might have been transformed to their HTML equivalents (for instance &gt; for >), it is however possible to insert HTML characters, they will be automatically converted to their equivalent values.'); ?> </p> </div> </div> <div class="form-group"> <div class="col-sm-offset-3 col-sm-9"> <button type="submit" class="btn btn-primary"> <i class="fa fa-check"></i> <?php echo I18N::translate('save'); ?> </button> </div> </div> </form> <?php }
private function pageBody(PageController $controller) { $FTV_SETTINGS = unserialize($this->getSetting('FTV_SETTINGS')); ?> <!-- ADMIN PAGE CONTENT --> <ol class="breadcrumb small"> <li><a href="admin.php"><?php echo I18N::translate('Control panel'); ?> </a></li> <li><a href="admin_modules.php"><?php echo I18N::translate('Module administration'); ?> </a></li> <li class="active"><?php echo $controller->getPageTitle(); ?> </li> </ol> <h2><?php echo $controller->getPageTitle(); ?> </h2> <!-- *** FORM 1 *** --> <form class="form-horizontal" method="post" name="form1"> <?php echo Filter::getCsrf(); ?> <!-- SELECT TREE --> <div class="form-group"> <label class="control-label col-sm-2" for="tree"> <?php echo I18N::translate('Family tree'); ?> </label> <div class="col-sm-4"> <select id="tree" name="NEW_FIB_TREE" class="form-control"> <?php foreach (Tree::getAll() as $tree) { ?> <?php if ($tree->getTreeId() == $this->tree_id) { ?> <option value="<?php echo $tree->getTreeId(); ?> " data-ged="<?php echo $tree->getNameHtml(); ?> " selected="selected"> <?php echo $tree->getTitleHtml(); ?> </option> <?php } else { ?> <option value="<?php echo $tree->getTreeId(); ?> " data-ged="<?php echo $tree->getNameHtml(); ?> "> <?php echo $tree->getTitleHtml(); ?> </option> <?php } ?> <?php } ?> </select> </div> </div> </form> <!-- PANEL GROUP ACCORDION --> <div class="panel-group" id="accordion"> <!-- PANEL 1 --> <div class="panel panel-default" id="panel1"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-target="#collapseOne" href="#"> <?php echo I18N::translate('Pages'); ?> </a> </h4> </div> <div id="collapseOne" class="panel-collapse collapse in"> <div class="panel-body"> <?php if (empty($FTV_SETTINGS) || !empty($FTV_SETTINGS) && !$this->searchArray($FTV_SETTINGS, 'TREE', $this->tree_id)) { ?> <div class="alert alert-info alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="' . I18N::translate('close') . '"> <span aria-hidden="true">×</span> </button> <p class="small text-muted"> <?php echo I18N::translate('Use the search form below to search for a root person. After a successful search the Fancy Treeview page will be automatically created. You can add as many root persons as you want.'); ?> </p> </div> <?php } ?> <!-- *** FORM 2 *** --> <div id="ftv-search-form" class="form-group alert alert-info"> <form class="form-inline" method="post" name="form2"> <!-- SURNAME SEARCH FIELD --> <div class="form-group"> <label class="control-label"> <?php echo I18N::translate('Search root person'); ?> </label> <input class="form-control" data-autocomplete-type="SURN" id="surname-search" name="SURNAME" placeholder="<?php echo I18N::translate('Surname'); ?> " type="text" > <label class="checkbox-inline"> <?php echo FunctionsEdit::checkbox('soundex_std') . I18N::translate('Russell'); ?> </label> <label class="checkbox-inline"> <?php echo FunctionsEdit::checkbox('soudex_dm') . I18N::translate('Daitch-Mokotoff'); ?> </label> <button name="search" class="btn btn-primary" type="submit"> <i class="fa fa-search"></i> <?php echo I18N::translate('search'); ?> </button> </div> <!-- PID SEARCH FIELD --> <?php $class = I18N::direction() === 'rtl' ? 'pull-left' : 'pull-right'; ?> <div class="form-group <?php echo $class; ?> "> <label class="control-label" for="pid-search"> <?php echo I18N::translate('Or enter an ID'); ?> </label> <input class="form-control" data-autocomplete-type="INDI" id="pid-search" name="PID" placeholder="<?php echo I18N::translate('Search ID by name'); ?> " type="text" value="" > <button name="Ok" class="btn btn-primary" type="submit"> <i class="fa fa-check"></i> <?php echo I18N::translate('ok'); ?> </button> </div> </form> <!-- *** FORM 3 *** --> <form class="form-horizontal" method="post" name="form3"> <!-- TABLE --> <table id="search-result-table" class="table" style="display: none"> <thead> <tr> <th><?php echo I18N::translate('Root person'); ?> </th> <?php if (!$this->options('use_fullname')) { ?> <th><?php echo I18N::translate('Surname in page title'); ?> </th> <?php } ?> <th><?php echo I18N::translate('Page title'); ?> </th> <th><?php echo I18N::translate('Access level'); ?> </th> <th><?php echo I18N::translate('Add'); ?> </th> </tr> </thead> <tbody> <tr> <!-- ROOT PERSONS FULL NAME --> <td id="root"> <?php if ($this->options('use_fullname')) { ?> <input name="surname" type="hidden" value="" > <?php } ?> <input name="pid" type="hidden" value="" > <input name="sort" type="hidden" value="" > <span></span> </td> <?php if (!$this->options('use_fullname')) { ?> <!-- SURNAME IN PAGE TITLE --> <td id="surn"> <label class="showname"></label> <input class="form-control editname" name="surname" type="text" value="" > </td> <?php } ?> <!-- PAGE TITLE --> <td id="title"></td> <!-- ACCESS LEVEL --> <td> <?php echo FunctionsEdit::editFieldAccessLevel('access_level', 2, 'class="form-control"'); ?> </td> <!-- ADD BUTTON --> <td> <button type="submit" name="add" class="btn btn-success btn-sm" title="<?php I18N::translate('Add'); ?> "> <i class="fa fa-plus"></i> </button> </td> </tr> </tbody> </table> </form> </div> <?php echo $this->addMessage("error", "danger", true); ?> <?php echo $this->addMessage('update-settings', 'success', true, I18N::translate('The settings for this tree are succesfully updated')); ?> <div id="fancy-treeview-form" class="form-group"> <?php if (!empty($FTV_SETTINGS) && $this->searchArray($FTV_SETTINGS, 'TREE', $this->tree_id)) { ?> <form class="form-horizontal" method="post" name="form4"> <!-- TABLE --> <table id="fancy-treeview-table" class="table table-hover"> <thead> <tr> <th><?php echo I18N::translate('Root person'); ?> </th> <?php if (!$this->options('use_fullname')) { ?> <th><?php echo I18N::translate('Surname in page title'); ?> </th> <?php } ?> <th><?php echo I18N::translate('Page title'); ?> </th> <th><?php echo I18N::translate('Access level'); ?> </th> <th><?php echo I18N::translate('Delete'); ?> </th> </tr> </thead> <tbody> <?php foreach ($FTV_SETTINGS as $key => $this_ITEM) { ?> <?php if ($this_ITEM['TREE'] == $this->tree_id) { ?> <?php if (Individual::getInstance($this_ITEM['PID'], $this->tree)) { ?> <tr class="sortme"> <!-- ROOT PERSONS FULL NAME --> <td> <input name="pid[<?php echo $key; ?> ]" type="hidden" value="<?php echo $this_ITEM['PID']; ?> " > <input name="sort[<?php echo $key; ?> ]" type="hidden" value="<?php echo $this_ITEM['SORT']; ?> " > <?php echo Individual::getInstance($this_ITEM['PID'], $this->tree)->getFullName() . ''; ?> (<?php echo Individual::getInstance($this_ITEM['PID'], $this->tree)->getLifeSpan(); ?> ) </td> <?php if (!$this->options('use_fullname')) { ?> <!-- SURNAME IN PAGE TITLE --> <td> <label class="showname"> <?php echo $this_ITEM['SURNAME']; ?> </label> <input class="form-control editname" name="surname[<?php echo $key; ?> ]" type="text" value="<?php echo $this_ITEM['SURNAME']; ?> " > </td> <?php } ?> <!-- PAGE TITLE --> <td> <a href="module.php?mod=<?php echo $this->getName(); ?> &mod_action=page&ged=<?php echo $this->tree->getNameHtml(); ?> &rootid=<?php echo $this_ITEM['PID']; ?> " target="_blank"> <?php if ($this->options('use_fullname') == true) { echo I18N::translate('Descendants of %s', Individual::getInstance($this_ITEM['PID'], $this->tree)->getFullName()); } else { echo I18N::translate('Descendants of the %s family', $this_ITEM['SURNAME']); } ?> </a> </td> <!-- ACCESS LEVEL --> <td> <?php echo FunctionsEdit::editFieldAccessLevel('access_level[' . $key . ']', $this_ITEM['ACCESS_LEVEL'], 'class="form-control"'); ?> </td> <!-- DELETE BUTTON --> <td> <button type="button" name="delete" class="btn btn-danger btn-sm" data-key="<?php echo $key; ?> " title="<?php I18N::translate('Delete'); ?> "> <i class="fa fa-trash-o"></i> </button> </td> </tr> <?php } else { ?> <tr> <!-- SURNAME --> <td class="error"> <input name="pid[<?php echo $key; ?> ]" type="hidden" value="<?php echo $this_ITEM['PID']; ?> " > <?php echo $this_ITEM['SURNAME']; ?> </td> <!-- ERROR MESSAGE --> <td colspan="4" class="error"> <?php echo I18N::translate('The person with root id %s doesn’t exist anymore in this tree', $this_ITEM['PID']); ?> </td> <!-- DELETE BUTTON --> <td> <button name="delete" type="button" class="btn btn-danger btn-sm" title="<?php I18N::translate('Delete'); ?> "> <i class="fa fa-trash-o"></i> </button> </td> </tr> <?php } ?> <?php } ?> <?php } ?> </tbody> </table> <!-- BUTTONS --> <button name="update" class="btn btn-primary" type="submit"> <i class="fa fa-check"></i> <?php echo I18N::translate('update'); ?> </button> </form> <?php } ?> </div> </div> </div> </div> <!-- PANEL 2 --> <div class="panel panel-default" id="panel2"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-target="#collapseTwo" href="#" class="collapsed"> <?php echo I18N::translate('Options for %s', $this->tree->getTitleHtml()); ?> </a> </h4> </div> <div id="collapseTwo" class="panel-collapse collapse"> <div class="panel-body"> <?php echo $this->addMessage('save-options', 'success', true, I18N::translate('The options for this tree are succesfully saved')); ?> <?php echo $this->addMessage('reset-options', 'success', true, I18N::translate('The options for this tree are succesfully reset to the default settings')); ?> <div id="ftv-options-form" class="form-group"> <form class="form-horizontal" method="post" name="form5"> <!-- USE FULLNAME IN MENU --> <div class="form-group fullname"> <label class="control-label col-sm-4"> <?php echo I18N::translate('Use fullname in menu'); ?> </label> <div class="col-sm-8"> <?php echo FunctionsEdit::editFieldYesNo('NEW_FTV_OPTIONS[USE_FULLNAME]', $this->options('use_fullname'), 'class="radio-inline"'); ?> </div> </div> <!-- GENERATION BLOCKS --> <div class="form-group"> <label class="control-label col-sm-4"> <?php echo I18N::translate('Number of generation blocks to show'); ?> </label> <div class="col-sm-4"> <?php echo FunctionsEdit::selectEditControl('NEW_FTV_OPTIONS[NUMBLOCKS]', array(I18N::translate('All'), '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'), null, $this->options('numblocks'), 'class="form-control"'); ?> </div> <p class="col-sm-8 col-sm-offset-4 small text-muted"> <?php echo I18N::translate('This option is especially usefull for large trees. When you notice a slow page load, here you can set the number of generation blocks to load at once to a lower level. Below the last generation block a button will appear to add the next set of generation blocks. The new blocks will be added to the blocks already loaded. Clicking on a “follow” link in the last visible generation block, will also load the next set of generation blocks.'); ?> </p> </div> <!-- SHOW SINGLES --> <div class="form-group"> <label class="control-label col-sm-4"> <?php echo I18N::translate('Show single persons'); ?> </label> <div class="col-sm-8"> <?php echo FunctionsEdit::editFieldYesNo('NEW_FTV_OPTIONS[SHOW_SINGLES]', $this->options('show_singles'), 'class="radio-inline"'); ?> </div> <p class="col-sm-8 col-sm-offset-4 small text-muted"> <?php echo I18N::translate('Turn this option on if you want to show single persons in the generation blocks. Single persons are persons without partner and children. With this option turned on, every child of a family will be shown in a detailed way in the next generation block.'); ?> </p> </div> <!-- CHECK RELATIONSHIP --> <div class="form-group"> <label class="control-label col-sm-4"> <?php echo I18N::translate('Check relationship between partners'); ?> </label> <div class="col-sm-8"> <?php echo FunctionsEdit::editFieldYesNo('NEW_FTV_OPTIONS[CHECK_RELATIONSHIP]', $this->options('check_relationship'), 'class="radio-inline"'); ?> </div> <p class="col-sm-8 col-sm-offset-4 small text-muted"> <?php echo I18N::translate('With this option turned on, the script checks if a (married) couple has the same ancestors. If a relationship between the partners is found, a text will appear between brackets after the spouses’ name to indicate the blood relationship.'); ?> </p> <p class="col-sm-8 col-sm-offset-4 small text-muted"> <?php echo I18N::translate('<strong>Note</strong>: this option can be time and/or memory consuming, especially on large trees. It can cause very slow page loading or an ’execution time out error’ on your server. If you notice such a behavior, reduce the number of generation blocks to load at once or don’t use it in combination with the option to show singles (see the previous options). If you still experience any problems, don’t use this option at all.'); ?> </p> </div> <!-- SHOW PLACES --> <div id="places" class="form-group"> <label class="control-label col-sm-4"> <?php echo I18N::translate('Show places?'); ?> </label> <div class="col-sm-8"> <?php echo FunctionsEdit::editFieldYesNo('NEW_FTV_OPTIONS[SHOW_PLACES]', $this->options('show_places'), 'class="radio-inline"'); ?> </div> </div> <!-- USE GEDCOM PLACE SETTING --> <div id="gedcom_places" class="form-group<?php if (!$this->options('show_places')) { echo ' collapse'; } ?> "> <label class="control-label col-sm-4"> <?php echo I18N::translate('Use default GEDCOM settings to abbreviate place names?'); ?> </label> <div class="col-sm-8"> <?php echo FunctionsEdit::editFieldYesNo('NEW_FTV_OPTIONS[USE_GEDCOM_PLACES]', $this->options('use_gedcom_places'), 'class="radio-inline"'); ?> </div> <p class="col-sm-8 col-sm-offset-4 small text-muted"> <?php echo I18N::translate('If you have ticked the “Show places” option, you can choose to use the default GEDCOM settings to abbreviate placenames. If you don’t set this option, full place names will be shown.'); ?> </p> </div> <!-- GET COUNTRYLIST --> <?php if ($this->getCountrylist()) { ?> <div id="country_list" class="form-group<?php if (!$this->options('show_places') || $this->options('use_gedcom_places')) { echo ' collapse'; } ?> "> <label class="control-label col-sm-4"> <?php echo I18N::translate('Select your country'); ?> </label> <div class="col-sm-8"> <?php echo FunctionsEdit::selectEditControl('NEW_FTV_OPTIONS[COUNTRY]', $this->getCountryList(), '', $this->options('country'), 'class="form-control"'); ?> </div> <p class="col-sm-8 col-sm-offset-4 small text-muted"> <?php echo I18N::translate('If you have ticked the “Show places” option but NOT the option to abbreviate placenames, you can set your own country here. Full places will be listed on the Fancy Treeview pages, but when a place includes the name of your own country, this name will be left out. If you don’t select a country then all countries will be shown, including your own.'); ?> </p> </div> <?php } ?> <!-- SHOW OCCUPATIONS --> <div class="form-group"> <label class="control-label col-sm-4"> <?php echo I18N::translate('Show occupations'); ?> </label> <div class="col-sm-8"> <?php echo FunctionsEdit::editFieldYesNo('NEW_FTV_OPTIONS[SHOW_OCCU]', $this->options('show_occu'), 'class="radio-inline"'); ?> </div> </div> <!-- RESIZE THUMBS --> <div id="resize_thumbs" class="form-group"> <label class="control-label col-sm-4"> <?php echo I18N::translate('Resize thumbnails'); ?> </label> <div class="col-sm-8"> <?php echo FunctionsEdit::editFieldYesNo('NEW_FTV_OPTIONS[RESIZE_THUMBS]', $this->options('resize_thumbs'), 'class="radio-inline"'); ?> </div> <p class="col-sm-8 col-sm-offset-4 small text-muted"> <?php echo I18N::translate('Here you can choose to resize the default webtrees thumbnails especially for the Fancy Treeview pages. You can set a custom size in percentage or in pixels. If you choose “no” the default webtrees thumbnails will be used with the formats you have set on the tree configuration page.'); ?> </p> </div> <!-- THUMB SIZE --> <div id="thumb_size" class="form-group<?php if (!$this->options('resize_thumbs')) { echo ' collapse'; } ?> "> <label class="control-label col-sm-4"> <?php echo I18N::translate('Thumbnail size'); ?> </label> <div class="row"> <div class="col-sm-1"> <input class="form-control" id="NEW_FTV_OPTIONS[THUMB_SIZE]" name="NEW_FTV_OPTIONS[THUMB_SIZE]" type="text" value="<?php echo $this->options('thumb_size'); ?> " > </div> <div class="col-sm-2"> <?php echo FunctionsEdit::selectEditControl('NEW_FTV_OPTIONS[THUMB_RESIZE_FORMAT]', array('1' => I18N::translate('percent'), '2' => I18N::translate('pixels')), null, $this->options('thumb_resize_format'), 'class="form-control"'); ?> </div> </div> </div> <!-- SQUARE THUMBS --> <div id="square_thumbs" class="form-group<?php if (!$this->options('resize_thumbs')) { echo ' collapse'; } ?> "> <label class="control-label col-sm-4"> <?php echo I18N::translate('Use square thumbnails'); ?> </label> <div class="col-sm-8"> <?php echo FunctionsEdit::editFieldYesNo('NEW_FTV_OPTIONS[USE_SQUARE_THUMBS]', $this->options('use_square_thumbs'), 'class="radio-inline"'); ?> </div> </div> <!-- SHOW USERFORM --> <div class="form-group"> <label class="control-label col-sm-4"> <?php echo I18N::translate('Show form to change start person'); ?> </label> <div class="col-sm-4"> <?php echo FunctionsEdit::editFieldAccessLevel('NEW_FTV_OPTIONS[SHOW_USERFORM]', $this->options('show_userform'), 'class="form-control"'); ?> </div> </div> <!-- SHOW PDF --> <div class="form-group"> <label class="control-label col-sm-4"> <?php echo I18N::translate('Show PDF icon?'); ?> </label> <div class="col-sm-4"> <?php echo FunctionsEdit::editFieldAccessLevel('NEW_FTV_OPTIONS[SHOW_PDF_ICON]', $this->options('show_pdf_icon'), 'class="form-control"'); ?> </div> </div> <!-- SHOW FANCY TREEVIEW ON INDI PAGE --> <div class="form-group fullname"> <label class="control-label col-sm-4"> <?php echo I18N::translate('Show a Fancy Treeview tab on the individual page'); ?> </label> <div class="col-sm-8"> <?php echo FunctionsEdit::editFieldYesNo('NEW_FTV_OPTIONS[FTV_TAB]', $this->options('ftv_tab'), 'class="radio-inline"'); ?> </div> </div> <!-- BUTTONS --> <button name="save-options" class="btn btn-primary" type="submit"> <i class="fa fa-check"></i> <?php echo I18N::translate('save'); ?> </button> <button name="reset-options" class="btn btn-primary" type="reset"> <i class="fa fa-recycle"></i> <?php echo I18N::translate('reset'); ?> </button> </form> </div> </div> </div> </div> </div> <?php }
/** * Show and process a form to edit a story. */ private function edit() { global $WT_TREE; if (Auth::isEditor($WT_TREE)) { if (Filter::postBool('save') && Filter::checkCsrf()) { $block_id = Filter::postInteger('block_id'); if ($block_id) { Database::prepare("UPDATE `##block` SET gedcom_id=?, xref=? WHERE block_id=?")->execute(array(Filter::postInteger('gedcom_id'), Filter::post('xref', WT_REGEX_XREF), $block_id)); } else { Database::prepare("INSERT INTO `##block` (gedcom_id, xref, module_name, block_order) VALUES (?, ?, ?, ?)")->execute(array(Filter::postInteger('gedcom_id'), Filter::post('xref', WT_REGEX_XREF), $this->getName(), 0)); $block_id = Database::getInstance()->lastInsertId(); } $this->setBlockSetting($block_id, 'title', Filter::post('title')); $this->setBlockSetting($block_id, 'story_body', Filter::post('story_body')); $languages = Filter::postArray('lang'); $this->setBlockSetting($block_id, 'languages', implode(',', $languages)); $this->config(); } else { $block_id = Filter::getInteger('block_id'); $controller = new PageController(); if ($block_id) { $controller->setPageTitle(I18N::translate('Edit story')); $title = $this->getBlockSetting($block_id, 'title'); $story_body = $this->getBlockSetting($block_id, 'story_body'); $xref = Database::prepare("SELECT xref FROM `##block` WHERE block_id=?")->execute(array($block_id))->fetchOne(); } else { $controller->setPageTitle(I18N::translate('Add a story')); $title = ''; $story_body = ''; $xref = Filter::get('xref', WT_REGEX_XREF); } $controller->pageHeader()->addExternalJavascript(WT_AUTOCOMPLETE_JS_URL)->addInlineJavascript('autocomplete();'); if (Module::getModuleByName('ckeditor')) { CkeditorModule::enableEditor($controller); } $individual = Individual::getInstance($xref, $WT_TREE); ?> <ol class="breadcrumb small"> <li><a href="admin.php"><?php echo I18N::translate('Control panel'); ?> </a></li> <li><a href="admin_modules.php"><?php echo I18N::translate('Module administration'); ?> </a></li> <li><a href="module.php?mod=<?php echo $this->getName(); ?> &mod_action=admin_config"><?php echo $this->getTitle(); ?> </a></li> <li class="active"><?php echo $controller->getPageTitle(); ?> </li> </ol> <h1><?php echo $controller->getPageTitle(); ?> </h1> <form class="form-horizontal" method="post" action="module.php?mod=<?php echo $this->getName(); ?> &mod_action=admin_edit"> <?php echo Filter::getCsrf(); ?> <input type="hidden" name="save" value="1"> <input type="hidden" name="block_id" value="<?php echo $block_id; ?> "> <input type="hidden" name="gedcom_id" value="<?php echo $WT_TREE->getTreeId(); ?> "> <div class="form-group"> <label for="title" class="col-sm-3 control-label"> <?php echo I18N::translate('Story title'); ?> </label> <div class="col-sm-9"> <input type="text" class="form-control" name="title" id="title" value="<?php echo Filter::escapeHtml($title); ?> "> </div> </div> <div class="form-group"> <label for="story_body" class="col-sm-3 control-label"> <?php echo I18N::translate('Story'); ?> </label> <div class="col-sm-9"> <textarea name="story_body" id="story_body" class="html-edit form-control" rows="10"><?php echo Filter::escapeHtml($story_body); ?> </textarea> </div> </div> <div class="form-group"> <label for="xref" class="col-sm-3 control-label"> <?php echo I18N::translate('Individual'); ?> </label> <div class="col-sm-9"> <input data-autocomplete-type="INDI" type="text" name="xref" id="xref" size="4" value="<?php echo $xref; ?> "> <?php echo FunctionsPrint::printFindIndividualLink('xref'); ?> <?php if ($individual) { ?> <?php echo $individual->formatList('span'); ?> <?php } ?> </div> </div> <div class="form-group"> <label for="xref" class="col-sm-3 control-label"> <?php echo I18N::translate('Show this block for which languages?'); ?> </label> <div class="col-sm-9"> <?php echo FunctionsEdit::editLanguageCheckboxes('lang', explode(',', $this->getBlockSetting($block_id, 'languages'))); ?> </div> </div> <div class="form-group"> <div class="col-sm-offset-3 col-sm-9"> <button type="submit" class="btn btn-primary"> <i class="fa fa-check"></i> <?php echo I18N::translate('save'); ?> </button> </div> </div> </form> <?php } } else { header('Location: ' . WT_BASE_URL); } }
/** * Called by placelist.php */ public function createMap() { global $level, $levelm, $plzoom, $WT_TREE; Database::updateSchema(self::SCHEMA_MIGRATION_PREFIX, self::SCHEMA_SETTING_NAME, self::SCHEMA_TARGET_VERSION); $STREETVIEW = (bool) $this->getSetting('GM_USE_STREETVIEW'); $parent = Filter::getArray('parent'); $levelm = $this->setLevelMap($level, $parent); $latlng = Database::prepare("SELECT pl_place, pl_id, pl_lati, pl_long, pl_zoom, sv_long, sv_lati, sv_bearing, sv_elevation, sv_zoom FROM `##placelocation` WHERE pl_id=?")->execute(array($levelm))->fetch(PDO::FETCH_ASSOC); echo '<table style="margin:auto; border-collapse: collapse;">'; echo '<tr style="vertical-align:top;"><td>'; if ($STREETVIEW && $level != 0) { // Leave space for the Street View buttons, so that the maps align vertically echo '<div id="place_map" style="margin-top:25px; border:1px solid gray; width: ', $this->getSetting('GM_PH_XSIZE'), 'px; height: ', $this->getSetting('GM_PH_YSIZE'), 'px; '; } else { echo '<div id="place_map" style="border:1px solid gray; width:', $this->getSetting('GM_PH_XSIZE'), 'px; height:', $this->getSetting('GM_PH_YSIZE'), 'px; '; } echo '"><i class="icon-loading-large"></i></div>'; echo '<script src="', $this->googleMapsScript(), '"></script>'; $plzoom = $latlng['pl_zoom']; // Map zoom level if (Auth::isAdmin()) { $placecheck_url = 'module.php?mod=googlemap&mod_action=admin_placecheck'; if ($parent && isset($parent[0])) { $placecheck_url .= '&country=' . $parent[0]; if (isset($parent[1])) { $placecheck_url .= '&state=' . $parent[1]; } } $adminplaces_url = 'module.php?mod=googlemap&mod_action=admin_places'; if ($latlng && isset($latlng['pl_id'])) { $adminplaces_url .= '&parent=' . $latlng['pl_id']; } $update_places_url = 'admin_trees_places.php?ged=' . $WT_TREE->getNameHtml() . '&search=' . urlencode(implode(', ', array_reverse($parent))); echo '<div class="gm-options">'; echo '<a href="module.php?mod=googlemap&mod_action=admin_config">', I18N::translate('Google Maps™ preferences'), '</a>'; echo ' | <a href="' . $adminplaces_url . '">' . I18N::translate('Geographic data') . '</a>'; echo ' | <a href="' . $placecheck_url . '">' . I18N::translate('Place check') . '</a>'; echo ' | <a href="' . $update_places_url . '">' . I18N::translate('Update place names') . '</a>'; echo '</div>'; } echo '</td>'; if ($STREETVIEW) { echo '<td>'; global $pl_lati, $pl_long; if ($level >= 1) { $pl_lati = strtr($latlng['pl_lati'], array('N' => '', 'S' => '-', ',' => '.')); // WT_placelocation lati $pl_long = strtr($latlng['pl_long'], array('E' => '', 'W' => '-', ',' => '.')); // WT_placelocation long // Check if Streetview location parameters are stored in database $placeid = $latlng['pl_id']; // Placelocation place id $sv_lat = $latlng['sv_lati']; // StreetView Point of View Latitude $sv_lng = $latlng['sv_long']; // StreetView Point of View Longitude $sv_dir = $latlng['sv_bearing']; // StreetView Point of View Direction (degrees from North) $sv_pitch = $latlng['sv_elevation']; // StreetView Point of View Elevation (+90 to -90 degrees (+=down, -=up) $sv_zoom = $latlng['sv_zoom']; // StreetView Point of View Zoom (0, 1, 2 or 3) // Check if Street View Lati/Long are the default of 0, if so use regular Place Lati/Long to set an initial location for the panda if ($latlng['sv_lati'] == 0 && $latlng['sv_long'] == 0) { $sv_lat = $pl_lati; $sv_lng = $pl_long; } $frameheight = $this->getSetting('GM_PH_YSIZE') + 35; // Add height of buttons ?> <iframe class="gm-streetview-frame" style="height: <?php echo $frameheight; ?> px;" src="module.php?mod=googlemap&mod_action=wt_street_view&x=<?php echo $sv_lng; ?> &y=<?php echo $sv_lat; ?> &z=18&t=2&c=1&s=1&b=<?php echo $sv_dir; ?> &p=<?php echo $sv_pitch; ?> &m=<?php echo $sv_zoom; ?> &j=1&k=1&v=1"></iframe> <?php if (Auth::isAdmin()) { ?> <div class="gm-streetview-parameters"> <form method="post" action="module.php?mod=googlemap&mod_action=places_edit"> <?php echo Filter::getCsrf(); ?> <input type='hidden' name='placeid' value='<?php echo $placeid; ?> '> <input type='hidden' name='action' value='update_sv_params'> <input type='hidden' name='destination' value='<?php echo Filter::server("REQUEST_URI"); ?> '> <label for='sv_latiText'><?php echo GedcomTag::getLabel('LATI'); ?> </label> <input name='sv_latiText' id='sv_latiText' type='text' title="<?php echo $sv_lat; ?> " style='width:42px;' value='<?php echo $sv_lat; ?> '> <label for='sv_longText'><?php echo GedcomTag::getLabel('LONG'); ?> </label> <input name='sv_longText' id='sv_longText' type='text' title="<?php echo $sv_lng; ?> " style='width:42px;' value='<?php echo $sv_lng; ?> '> <label for='sv_bearText'><?php echo I18N::translate('Bearing'); ?> </label> <input name='sv_bearText' id='sv_bearText' type='text' style='width:30px;' value='<?php echo $sv_dir; ?> '> <label for='sv_elevText'><?php echo I18N::translate('Elevation'); ?> </label> <input name='sv_elevText' id='sv_elevText' type='text' style='width:30px;' value='<?php echo $sv_pitch; ?> '> <label for='sv_zoomText'><?php echo I18N::translate('Zoom'); ?> </label> <input name='sv_zoomText' id='sv_zoomText' type='text' style='width:30px;' value='<?php echo $sv_zoom; ?> '> <input type="submit" name="Submit" value="<?php echo I18N::translate('save'); ?> "> </form> </div> <?php } } echo '</td>'; } echo '</tr></table>'; }
/** * {@inhericDoc} * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() */ protected function renderContent() { /** @var AbstractTask $task */ $task = $this->data->get('task'); ?> <ol class="breadcrumb small"> <li><a href="admin.php"><?php echo I18N::translate('Control panel'); ?> </a></li> <li><a href="admin_modules.php"><?php echo I18N::translate('Module administration'); ?> </a></li> <li><a href="<?php echo $this->data->get('admin_config_url'); ?> "><?php echo $this->data->get('module_title'); ?> </a></li> <li class="active"><?php echo $this->data->get('title'); ?> </li> </ol> <h1><?php echo $this->data->get('title'); ?> </h1> <form class="form-horizontal" name="newform" method="post" role="form" action="<?php echo $this->data->get('save_url'); ?> " autocomplete="off"> <?php echo Filter::getCsrf(); ?> <input type="hidden" name="task" value="<?php echo $task->getName(); ?> "> <h3><?php echo I18N::translate('General'); ?> </h3> <!-- FREQUENCY --> <div class="form-group"> <label class="control-label col-sm-3" for="frequency"> <?php echo I18N::translate('Frequency'); ?> </label> <div class="col-sm-9"> <div class="row"> <div class="col-sm-4"> <div class="input-group" > <input class="form-control" type="number" min="0" id="frequency" name="frequency" required maxlength="70" value="<?php echo $task->getFrequency(); ?> " dir="auto"> <span class="input-group-addon"> <?php echo I18N::translate('minutes'); ?> </span> </div> </div> </div> <p class="small text-muted"> <?php echo I18N::translate('Frequency at which the task should be run (in minutes).'); ?> <?php echo I18N::translate('The actual run of the task may not be fired exactly at the frequency defined, but should be run as close as possible to it.'); ?> </p> </div> </div> <!-- LIMITED OCCURRENCES --> <div class="form-group"> <label class="control-label col-sm-3" for="is_limited"> <?php echo I18N::translate('Run a limited number of times'); ?> </label> <div class="col-sm-9"> <?php echo FunctionsEdit::editFieldYesNo('is_limited', $task->getRemainingOccurrences() > 0 ? 1 : 0, 'class="radio-inline"'); ?> <p class="small text-muted"> <?php echo I18N::translate('Defines whether the task should be run only a limited number of times.'); ?> </p> </div> </div> <!-- NB_OCCURRENCES --> <div id="nb_occurences" class="form-group"> <label class="control-label col-sm-3" for="nb_occur"> <?php echo I18N::translate('Number of occurrences'); ?> </label> <div class="col-sm-9"> <div class="row"> <div class="col-sm-3"> <div class="input-group" > <input class="form-control" type="number" min="0" id="nb_occur" name="nb_occur" maxlength="70" value="<?php echo $task->getRemainingOccurrences(); ?> " dir="auto"> <span class="input-group-addon"> <?php echo I18N::translate('time(s)'); ?> </span> </div> </div> </div> <p class="small text-muted"> <?php echo I18N::translate('Defines the number of times the task will run.'); ?> </p> </div> </div> <?php if ($task instanceof ConfigurableTaskInterface) { ?> <h3><?php echo I18N::translate('Options for “%s”', $task->getTitle()); ?> </h3> <?php echo $task->htmlConfigForm(); ?> <?php } ?> <div class="form-group"> <div class="col-sm-offset-3 col-sm-9"> <button type="submit" class="btn btn-primary"> <?php echo I18N::translate('save'); ?> </button> </div> </div> </form> <?php }
/** * {@inhericDoc} * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() */ protected function renderContent() { ?> <div id="maj-sosa-config-page"> <h2><?php echo $this->data->get('title'); ?> </h2> <form name="maj-sosa-config-form" method="post" action="<?php echo $this->data->get('form_url'); ?> "> <input type="hidden" name="action" value="update"> <?php echo Filter::getCsrf(); ?> <div id="maj-sosa-config-page-table"> <div class="label"> <?php echo I18N::translate('Tree'); ?> </div> <div class="value"> <label><?php echo $this->data->get('tree')->getTitleHtml(); ?> </label> </div> <div class="label"> <?php echo I18N::translate('For user'); ?> </div> <div class="value"> <?php $users = $this->data->get('users_settings'); if (count($users) == 1) { $root_indi = $users[0]['rootid']; ?> <label> <input id="maj_sosa_input_userid" type="hidden" name="userid" value="<?php echo $users[0]['user']->getUserId(); ?> " /> <?php echo $users[0]['user']->getRealNameHtml(); ?> </label> <?php } else { if (count($users) > 1) { ?> <select id='maj-sosa-config-select' name="userid"> <?php $root_indi = $users[0]['rootid']; foreach ($this->data->get('users_settings') as $user) { ?> <option value="<?php echo $user['user']->getUserId(); ?> "><?php echo $user['user']->getRealNameHtml(); ?> </option> <?php } ?> </select> <?php } } ?> </div> <div class="label"> <?php echo I18N::translate('Root individual'); ?> </div> <div class="value"> <input data-autocomplete-type="INDI" type="text" name="rootid" id="rootid" size="3" value="<?php echo $root_indi; ?> "> <?php echo FunctionsPrint::printFindIndividualLink('rootid'); ?> </div> <div class="label"></div> <div class="value"> <input type="submit" value="<?php echo I18N::translate('Save'); ?> "> <input type="button" value="<?php echo I18N::translate('Compute'); ?> " id="bt_sosa_compute"> <span id="bt_sosa_computing"></span> </div> </div> </form> <?php }
/** * {@inhericDoc} * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() */ protected function renderContent() { /** @var AbstractModule $module */ $module = $this->data->get('module'); ?> <ol class="breadcrumb small"> <li><a href="admin.php"><?php echo I18N::translate('Control panel'); ?> </a></li> <li><a href="admin_modules.php"><?php echo I18N::translate('Module administration'); ?> </a></li> <li class="active"><?php echo $this->data->get('title'); ?> </li> </ol> <h1><?php echo $this->data->get('title'); ?> </h1> <form method="post" class="form-horizontal"> <?php echo Filter::getCsrf(); ?> <input type="hidden" name="action" value="update"> <h3><?php echo I18N::translate('General'); ?> </h3> <!-- MAJ_CERT_ROOTDIR --> <div class="form-group"> <label class="control-label col-sm-3" for="MAJ_CERT_ROOTDIR"> <?php echo I18N::translate('Certificates directory'); ?> </label> <div class="col-sm-9"> <div class="input-group"> <span class="input-group-addon"> <?php echo WT_DATA_DIR; ?> </span> <input class="form-control" dir="ltr" id="MAJ_CERT_ROOTDIR" maxlength="255" name="MAJ_CERT_ROOTDIR" type="text" value="<?php echo Filter::escapeHtml($module->getSetting('MAJ_CERT_ROOTDIR', 'certificates/')); ?> " required > </div> <p class="small text-muted"> <?php echo I18N::translate('This folder will be used to store the certificate files.'); ?> <?php echo I18N::translate('If you select a different folder, you must also move any certificate files from the existing folder to the new one.'); ?> </p> </div> </div> <!-- MAJ_SHOW_CERT --> <div class="form-group"> <label class="control-label col-sm-3" for="MAJ_SHOW_CERT"> <?php echo I18N::translate('Show certificates'); ?> </label> <div class="col-sm-9"> <?php echo FunctionsEdit::editFieldAccessLevel('MAJ_SHOW_CERT', $module->getSetting('MAJ_SHOW_CERT', Auth::PRIV_HIDE), 'class="form-control"'); ?> <p class="small text-muted"> <?php echo I18N::translate('Define access level required to display certificates in facts sources. By default, nobody can see the certificates.'); ?> </p> </div> </div> <h3><?php echo I18N::translate('Watermarks'); ?> </h3> <!-- MAJ_SHOW_NO_WATERMARK --> <div class="form-group"> <label class="control-label col-sm-3" for="MAJ_SHOW_NO_WATERMARK"> <?php echo I18N::translate('Show certificates without watermark'); ?> </label> <div class="col-sm-9"> <?php echo FunctionsEdit::editFieldAccessLevel('MAJ_SHOW_NO_WATERMARK', $module->getSetting('MAJ_SHOW_NO_WATERMARK', Auth::PRIV_HIDE), 'class="form-control"'); ?> <p class="small text-muted"> <?php echo I18N::translate('Define access level of users who can see certificates without any watermark. By default, everybody will see the watermark.'); ?> </p> <p class="small text-muted"> <?php echo I18N::translate('When displayed, the watermark is generated from the name of the repository and of the sources, if they exist. Otherwise, a default text is displayed.'); ?> </p> </div> </div> <!-- MAJ_WM_DEFAULT --> <div class="form-group"> <label for="MAJ_WM_DEFAULT" class="col-sm-3 control-label"> <?php echo I18N::translate('Default watermark'); ?> </label> <div class="col-sm-9"> <input type="text" class="form-control" dir="ltr" id="MAJ_WM_DEFAULT" name="MAJ_WM_DEFAULT" value="<?php echo Filter::escapeHtml($module->getSetting('MAJ_WM_DEFAULT')); ?> " maxlength="255" placeholder="<?php echo I18N::translate('This image is protected under copyright law.'); ?> "> <p class="small text-muted"> <?php echo I18N::translate('Text to be displayed by default if no source has been associated with the certificate.'); ?> </p> </div> </div> <!-- MAJ_WM_FONT_COLOR --> <div class="form-group"> <label for="MAJ_WM_FONT_COLOR" class="col-sm-3 control-label"> <?php echo I18N::translate('Watermark font color'); ?> </label> <div class="col-sm-9"> <div class="row"> <!-- MAJ_WM_FONT_COLOR --> <div class="col-sm-3"> <div class="input-group"> <label class="input-group-addon" for="MAJ_WM_FONT_COLOR"> <?php echo I18N::translate('Color'); ?> </label> <input type="color" class="form-control" dir="ltr" id="MAJ_WM_FONT_COLOR" name="MAJ_WM_FONT_COLOR" value="<?php echo Filter::escapeHtml($module->getSetting('MAJ_WM_FONT_COLOR', '#4D6DF3')); ?> " maxlength="11"> </div> </div> </div> <p class="small text-muted"> <?php echo I18N::translate('Font color for the watermark. By default, <span style="color:#4d6df3;">the color #4D6DF3</span> is used.'); ?> </p> </div> </div> <div class="form-group"> <legend class="control-label col-sm-3"> <?php echo I18N::translate('Watermark font size'); ?> </legend> <div class="col-sm-9"> <div class="row"> <!-- MAJ_WM_FONT_MAXSIZE --> <div class="col-sm-5"> <div class="input-group"> <label class="input-group-addon" for="MAJ_WM_FONT_MAXSIZE"> <?php echo I18N::translate('Maximum font size'); ?> </label> <input class="form-control" dir="ltr" id="MAJ_WM_FONT_MAXSIZE" maxlength="2" name="MAJ_WM_FONT_MAXSIZE" type="number" placeholder="18" value="<?php echo Filter::escapeHtml($module->getSetting('MAJ_WM_FONT_MAXSIZE')); ?> " > <span class="input-group-addon"> <?php echo I18N::translate('pixels'); ?> </span> </div> </div> </div> <p class="small text-muted"> <?php echo I18N::translate('Watermark font size'); ?> </p> </div> </div> <div class="form-group"> <div class="col-sm-offset-3 col-sm-9"> <button type="submit" class="btn btn-primary"> <i class="fa fa-check"></i> <?php echo I18N::translate('save'); ?> </button> </div> </div> </form> <?php }
/** * {@inhericDoc} * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() */ protected function renderContent() { $table_id = $this->data->get('table_id'); ?> <ol class="breadcrumb small"> <li><a href="admin.php"><?php echo I18N::translate('Control panel'); ?> </a></li> <li><a href="admin_modules.php"><?php echo I18N::translate('Module administration'); ?> </a></li> <li class="active"><?php echo $this->data->get('title'); ?> </li> </ol> <div align="center"> <div id="tabs"> <form method="post" action="#"> <?php echo Filter::getCsrf(); ?> <input type="hidden" name="action" value="update"> <table id="<?php echo $table_id; ?> " class="table table-bordered table-condensed table-hover table-site-changes" > <thead> <tr> <th><?php echo I18N::translate('Enabled'); ?> </th> <th>ENABLED_SORT</th> <th><?php echo I18N::translate('Hook Function'); ?> </th> <th><?php echo I18N::translate('Hook Context'); ?> </th> <th><?php echo I18N::translate('Module Name'); ?> </th> <th><?php echo I18N::translate('Priority (1 is high)'); ?> </th> <th>PRIORITY_SORT</th> </tr> </thead> <tbody> <?php $hooks = $this->data->get('hook_list'); foreach ($hooks as $hook) { ?> <tr> <td> <input type="hidden" name="hook-<?php echo $hook->id; ?> " value="yes" > <?php echo FunctionsEdit::twoStateCheckbox('status-' . $hook->id, $hook->status == 'enabled'); ?> </td> <td><?php echo $hook->status == 'enabled'; ?> </td> <td><?php echo $hook->hook; ?> </td> <td><?php echo $hook->context; ?> </td> <td><?php if ($mod = Module::getModuleByName($hook->module)) { echo $mod->getTitle(); } ?> </td> <td><input type="text" class="center" size="2" value="<?php echo $hook->priority; ?> " name="moduleorder-<?php echo $hook->id; ?> " /></td> <td><?php echo $hook->priority; ?> </td> </tr> <?php } ?> </tbody> </table> <input type="submit" class="btn btn-primary save" value="<?php echo I18N::translate('save'); ?> "> </form> </div> </div> <?php }