function help_set_template_vars(&$template, $prefix = "%") { // NOOOTIENOOOT: You see this is a REFERENCE to the object, not the object itself, since we still use PHP4.0 :( assert(is_object($template)); $result = sql_query("SELECT * FROM perihelion.help WHERE id like '" . $prefix . "_%'"); while ($row = sql_fetchrow($result)) { $template->assign("help_" . strtolower($row['id']), help_link($row['id'])); } }
echo "</td></tr>";*/ echo "<tr><th>{$strValue}</th>"; echo "<td><input type='text' name='value' size='6' maxlength='12'"; if ($_SESSION['formdata']['add_task']['value'] != '') { echo "value='{$_SESSION['formdata']['add_task']['value']}'"; } echo "/></td></tr>"; echo "<tr><th>{$strUser}</th>"; echo "<td>"; if ($_SESSION['formdata']['add_task']['taskuser'] != '') { echo user_drop_down('taskuser', $_SESSION['formdata']['add_task']['taskuser'], FALSE); } else { echo user_drop_down('taskuser', $sit[2], FALSE); } echo help_link('TaskUser') . "</td></tr>"; echo "<tr><th>{$strPrivacy}" . help_link('TaskPrivacy') . "</th>"; echo "<td>"; if ($_SESSION['formdata']['add_task']['distribution'] == 'public') { echo "<label><input type='radio' name='distribution' checked='checked'"; echo " value='public' /> {$strPublic}</label><br />"; echo "<label><input type='radio' name='distribution' value='private' />"; echo " {$strPrivate} "; echo icon('private', 16, $strPrivate, "{$strPublic}/{$strPrivate}"); echo "</label></td></tr>"; } else { echo "<label><input type='radio' name='distribution' value='public' /> {$strPublic}</label><br />"; echo "<label><input type='radio' name='distribution' checked='checked' value='private' /> {$strPrivate} "; echo icon('private', 16, $strPrivate, "{$strPublic}/{$strPrivate}"); echo "</label></td></tr>"; } echo "</table>";
} // Show media and hide the rest if ($type == 'media') { echo '<div id="find-header"> <form name="filtermedia" method="get" onsubmit="return checknames(this);" action="find.php"> <input type="hidden" name="choose" value="', $choose, '"> <input type="hidden" name="action" value="filter"> <input type="hidden" name="type" value="media"> <input type="hidden" name="callback" value="', $callback, '"> <input type="hidden" name="subclick"> <span>', WT_I18N::translate('Media contains:'), '</span> <input type="text" name="filter" value="'; if ($filter) { echo $filter; } echo '" autofocus>', help_link('simple_filter'), '<p><input type="submit" name="search" value="', WT_I18N::translate('Filter'), '" onclick="this.form.subclick.value=this.name"> <input type="submit" name="all" value="', WT_I18N::translate('Display all'), '" onclick="this.form.subclick.value=this.name"> </p></form></div>'; } // Show place and hide the rest if ($type == "place") { echo '<div id="find-header"> <form name="filterplace" method="get" onsubmit="return checknames(this);" action="find.php"> <input type="hidden" name="action" value="filter"> <input type="hidden" name="type" value="place"> <input type="hidden" name="callback" value="', $callback, '"> <input type="hidden" name="subclick"> <span>', WT_I18N::translate('Place contains:'), '</span> <input type="text" name="filter" value="'; if ($filter) { echo $filter;
echo $_SESSION['userid']; ?> +"&val="+escape(toPass), true); xmlhttp.onreadystatechange=function() { //remove this in the future after testing if (xmlhttp.readyState==4) { if (xmlhttp.responseText != ''){ //alert(xmlhttp.responseText); } } } xmlhttp.send(null); $('savelayout').style.display='none'; } /* ]]> */ </script> <?php echo "<div id='footerbar'>"; echo "<form action='{$_SERVER['PHP_SELF']}'>"; echo "{$strSetYourStatus}: "; if (isset($sit[2])) { echo userstatus_bardrop_down("status", user_status($sit[2])) . help_link("SetYourStatus"); } echo "</form>\n"; echo "</div>\n"; if ($CONFIG['debug']) { $dbg .= "\nLang: {$_SESSION['lang']}\n"; } include APPLICATION_INCPATH . 'htmlfooter.inc.php';
public function downloadForm($clip_ctrl) { global $GEDCOM_MEDIA_PATH; $pid = WT_Filter::get('pid', WT_REGEX_XREF); $out = '<script>'; $out .= 'function cancelDownload() { var link = "module.php?mod=' . $this->getName() . '&mod_action=ajax&sb_action=clippings&pid=' . $pid . '"; jQuery("#sb_clippings_content").load(link); }'; $out .= '</script>'; $out .= '<form method="get" action="module.php"> <input type="hidden" name="mod" value="clippings"> <input type="hidden" name="mod_action" value="index"> <input type="hidden" name="pid" value="' . $pid . '"> <input type="hidden" name="action" value="download"> <table> <tr><td colspan="2" class="topbottombar"><h2>' . WT_I18N::translate('Download') . '</h2></td></tr> <tr><td class="descriptionbox width50 wrap">' . WT_I18N::translate('Zip file(s)') . help_link('zip') . '</td> <td class="optionbox"><input type="checkbox" name="Zip" value="yes" checked="checked"></td></tr> <tr><td class="descriptionbox width50 wrap">' . WT_I18N::translate('Include media (automatically zips files)') . help_link('include_media') . '</td> <td class="optionbox"><input type="checkbox" name="IncludeMedia" value="yes" checked="checked"></td></tr> '; if (WT_USER_GEDCOM_ADMIN) { $out .= '<tr><td class="descriptionbox width50 wrap">' . WT_I18N::translate('Apply privacy settings?') . help_link('apply_privacy') . '</td>' . '<td class="optionbox">' . ' <input type="radio" name="privatize_export" value="none" checked="checked"> ' . WT_I18N::translate('None') . '<br>' . ' <input type="radio" name="privatize_export" value="gedadmin"> ' . WT_I18N::translate('Manager') . '<br>' . ' <input type="radio" name="privatize_export" value="user"> ' . WT_I18N::translate('Member') . '<br>' . ' <input type="radio" name="privatize_export" value="visitor"> ' . WT_I18N::translate('Visitor') . '</td></tr>'; } elseif (WT_USER_CAN_ACCESS) { $out .= '<tr><td class="descriptionbox width50 wrap">' . WT_I18N::translate('Apply privacy settings?') . help_link('apply_privacy') . '</td>' . '<td class="list_value">' . ' <input type="radio" name="privatize_export" value="user" checked="checked"> ' . WT_I18N::translate('Member') . '<br>' . ' <input type="radio" name="privatize_export" value="visitor"> ' . WT_I18N::translate('Visitor') . '</td></tr>'; } $out .= ' <tr><td class="descriptionbox width50 wrap">' . WT_I18N::translate('Convert from UTF-8 to ANSI (ISO-8859-1)') . help_link('utf8_ansi') . '</td> <td class="optionbox"><input type="checkbox" name="convert" value="yes"></td></tr> <tr> <td class="descriptionbox width50 wrap">' . WT_I18N::translate('Add the GEDCOM media path to filenames') . help_link('GEDCOM_MEDIA_PATH') . '</td> <td class="optionbox"> <input type="checkbox" name="conv_path" value="' . WT_Filter::escapeHtml($GEDCOM_MEDIA_PATH) . '"> <span dir="auto">' . WT_Filter::escapeHtml($GEDCOM_MEDIA_PATH) . '</span></td> </tr> <input type="hidden" name="conv_path" value="' . $clip_ctrl->conv_path . '"> </td></tr> <tr><td class="topbottombar" colspan="2"> <input type="button" value="' . WT_I18N::translate('Cancel') . '" onclick="cancelDownload();"> <input type="submit" value="' . WT_I18N::translate('Download') . '"> </form>'; return $out; }
} } include APPLICATION_INCPATH . 'htmlfooter.inc.php'; } elseif ($action == 'reassign') { // External variables $incidentid = cleanvar($_REQUEST['incidentid']); $uid = cleanvar($_REQUEST['userid']); $nextaction = cleanvar($_REQUST['nextaction']); include APPLICATION_INCPATH . 'htmlheader.inc.php'; echo "<h2>{$strIncidentAdded} - {$strSummary}</h2>"; echo "<p align='center'>"; $incidentnum = "<a href=\"javascript:incident_details_window('{$incidentid}','incident{$incidentid}');\">{$strIncident} {$incidentid}</a>"; $queuename = "<strong style='color: red'>{$strActionNeeded}</strong>"; $name = user_realname($uid); printf($strHasBeenAutoMovedToX, $incidentnum, $name, $queuename); echo help_link('AutoAssignIncidents') . "</p><br /><br />"; $userphone = user_phone($userid); if ($userphone != '') { echo "<p align='center'>{$strTelephone}: {$userphone}</p>"; } $sql = "UPDATE `{$dbIncidents}` SET owner='{$uid}', lastupdated='{$now}' WHERE id='{$incidentid}'"; mysql_query($sql); if (mysql_error()) { trigger_error("MySQL Query Error " . mysql_error(), E_USER_ERROR); } trigger('TRIGGER_INCIDENT_ASSIGNED', array('userid' => $uid, 'incidentid' => $incidentid)); // add update $sql = "INSERT INTO `{$dbUpdates}` (incidentid, userid, type, timestamp, currentowner, currentstatus, nextaction) "; $sql .= "VALUES ('{$incidentid}', '{$sit[2]}', 'reassigning', '{$now}', '{$uid}', '1', '{$nextaction}')"; $result = mysql_query($sql); if (mysql_error()) {
public function getTabContent() { global $controller; ob_start(); echo '<table class="facts_table">'; foreach ($this->get_facts() as $fact) { if ($fact->getTag() == 'OBJE') { print_main_media($fact, 1); } else { for ($i = 2; $i < 4; ++$i) { print_main_media($fact, $i); } } } if (!$this->get_facts()) { echo '<tr><td id="no_tab4" colspan="2" class="facts_value">', WT_I18N::translate('There are no media objects for this individual.'), '</td></tr>'; } // New media link if ($controller->record->canEdit() && get_gedcom_setting(WT_GED_ID, 'MEDIA_UPLOAD') >= WT_USER_ACCESS_LEVEL) { ?> <tr> <td class="facts_label"> <?php echo WT_Gedcom_Tag::getLabel('OBJE'); ?> </td> <td class="facts_value"> <a href="#" onclick="window.open('addmedia.php?action=showmediaform&linktoid=<?php echo $controller->record->getXref(); ?> &ged=<?php echo WT_GEDURL; ?> ', '_blank', edit_window_specs); return false;"> <?php echo WT_I18N::translate('Add a new media object'); ?> </a> <?php echo help_link('OBJE'); ?> <br> <a href="#" onclick="window.open('inverselink.php?linktoid=<?php echo $controller->record->getXref(); ?> &ged=<?php echo WT_GEDURL; ?> &linkto=person', '_blank', find_window_specs); return false;"> <?php echo WT_I18N::translate('Link to an existing media object'); ?> </a> </td> </tr> <?php } ?> </table> <?php return '<div id="' . $this->getName() . '_content">' . ob_get_clean() . '</div>'; }
public function getBlock($block_id, $template = true, $cfg = null) { global $ctype, $controller; $show_unassigned = get_block_setting($block_id, 'show_unassigned', true); $show_other = get_block_setting($block_id, 'show_other', true); $show_future = get_block_setting($block_id, 'show_future', true); $block = get_block_setting($block_id, 'block', true); if ($cfg) { foreach (array('show_unassigned', 'show_other', 'show_future', 'block') as $name) { if (array_key_exists($name, $cfg)) { ${$name} = $cfg[$name]; } } } $id = $this->getName() . $block_id; $class = $this->getName() . '_block'; if ($ctype == 'gedcom' && WT_USER_GEDCOM_ADMIN || $ctype == 'user' && WT_USER_ID) { $title = '<i class="icon-admin" title="' . WT_I18N::translate('Configure') . '" onclick="modalDialog(\'block_edit.php?block_id=' . $block_id . '\', \'' . $this->getTitle() . '\');"></i>'; } else { $title = ''; } $title .= $this->getTitle() . help_link('todo', $this->getName()); $table_id = Uuid::uuid4(); // create a unique ID $controller->addExternalJavascript(WT_JQUERY_DATATABLES_URL)->addInlineJavascript(' jQuery("#' . $table_id . '").dataTable({ dom: \'t\', ' . WT_I18N::datatablesI18N() . ', autoWidth: false, paginate: false, lengthChange: false, filter: false, info: true, jQueryUI: true, columns: [ /* 0-DATE */ { visible: false }, /* 1-Date */ { dataSort: 0 }, /* 1-Record */ null, /* 2-Username */ null, /* 3-Text */ null ] }); jQuery("#' . $table_id . '").css("visibility", "visible"); jQuery(".loading-image").css("display", "none"); '); $content = ''; $content .= '<div class="loading-image"> </div>'; $content .= '<table id="' . $table_id . '" style="visibility:hidden;">'; $content .= '<thead><tr>'; $content .= '<th>DATE</th>'; //hidden by datables code $content .= '<th>' . WT_Gedcom_Tag::getLabel('DATE') . '</th>'; $content .= '<th>' . WT_I18N::translate('Record') . '</th>'; if ($show_unassigned || $show_other) { $content .= '<th>' . WT_I18N::translate('Username') . '</th>'; } $content .= '<th>' . WT_Gedcom_Tag::getLabel('TEXT') . '</th>'; $content .= '</tr></thead><tbody>'; $found = false; $end_jd = $show_future ? 99999999 : WT_CLIENT_JD; foreach (get_calendar_events(0, $end_jd, '_TODO', WT_GED_ID) as $fact) { $record = $fact->getParent(); $user_name = $fact->getAttribute('_WT_USER'); if ($user_name == WT_USER_NAME || !$user_name && $show_unassigned || $user_name && $show_other) { $content .= '<tr>'; //-- Event date (sortable) $content .= '<td>'; //hidden by datables code $content .= $fact->getDate()->JD(); $content .= '</td>'; $content .= '<td class="wrap">' . $fact->getDate()->Display(empty($SEARCH_SPIDER)) . '</td>'; $content .= '<td class="wrap"><a href="' . $record->getHtmlUrl() . '">' . $record->getFullName() . '</a></td>'; if ($show_unassigned || $show_other) { $content .= '<td class="wrap">' . $user_name . '</td>'; } $text = $fact->getValue(); $content .= '<td class="wrap">' . $text . '</td>'; $content .= '</tr>'; $found = true; } } $content .= '</tbody></table>'; if (!$found) { $content .= '<p>' . WT_I18N::translate('There are no research tasks in this family tree.') . '</p>'; } if ($template) { if ($block) { require WT_THEME_DIR . 'templates/block_small_temp.php'; } else { require WT_THEME_DIR . 'templates/block_main_temp.php'; } } else { return $content; } }
echo contact_site_drop_down('owner', ''); echo "</td></tr>"; echo "<tr><th>{$strID} " . help_link('InventoryID') . "</th>"; echo "<td><input name='identifier' value='{$row->identifier}' /></td></tr>"; echo "<tr><th>{$strAddress}</th>"; echo "<td><input name='address' value='{$row->address}' /></td></tr>"; if (!is_numeric($id) or ($row->privacy == 'adminonly' and user_permission($sit[2], 22) or $row->privacy == 'private' and $row->createdby == $sit[2] or $row->privacy == 'none')) { echo "<tr><th>{$strUsername}</th>"; echo "<td><input name='username' value='{$row->username}' /></td></tr>"; echo "<tr><th>{$strPassword}</th>"; echo "<td><input name='password' value='{$row->password}' /></td></tr>"; } echo "<tr><th>{$strNotes}</th>"; echo "<td><textarea name='notes'>{$row->notes}</textarea></td></tr>"; if ($row->privacy == 'adminonly' and user_permission($sit[2], 22) or $row->privacy == 'private' and $row->createdby == $sit[2] or $row->privacy == 'none') { echo "<tr><th>{$strPrivacy} " . help_link('InventoryPrivacy') . "</th>"; echo "<td><input type='radio' name='privacy' value='private' "; if ($row->privacy == 'private') { echo " checked='checked' "; $selected = TRUE; } echo "/>{$strPrivate}<br />"; echo "<input type='radio' name='privacy' value='adminonly'"; if ($row->privacy == 'adminonly') { echo " checked='checked' "; $selected = TRUE; } echo "/>"; echo "{$strAdminOnly}<br />"; echo "<input type='radio' name='privacy' value='none'"; if (!$selected) {
private function adminPlaces() { require WT_ROOT . 'includes/functions/functions_edit.php'; $action = WT_Filter::get('action'); $parent = WT_Filter::get('parent'); $inactive = WT_Filter::getBool('inactive'); $deleteRecord = WT_Filter::get('deleteRecord'); if (!isset($parent)) { $parent = 0; } $controller = new WT_Controller_Page(); $controller->restrictAccess(Auth::isAdmin()); if ($action == 'ExportFile' && Auth::isAdmin()) { Zend_Session::writeClose(); $tmp = $this->placeIdToHierarchy($parent); $maxLevel = $this->getHighestLevel(); if ($maxLevel > 8) { $maxLevel = 8; } $tmp[0] = 'places'; $outputFileName = preg_replace('/[:;\\/\\\\(\\)\\{\\}\\[\\] $]/', '_', implode('-', $tmp)) . '.csv'; header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="' . $outputFileName . '"'); echo '"', WT_I18N::translate('Level'), '";"', WT_I18N::translate('Country'), '";'; if ($maxLevel > 0) { echo '"', WT_I18N::translate('State'), '";'; } if ($maxLevel > 1) { echo '"', WT_I18N::translate('County'), '";'; } if ($maxLevel > 2) { echo '"', WT_I18N::translate('City'), '";'; } if ($maxLevel > 3) { echo '"', WT_I18N::translate('Place'), '";'; } if ($maxLevel > 4) { echo '"', WT_I18N::translate('Place'), '";'; } if ($maxLevel > 5) { echo '"', WT_I18N::translate('Place'), '";'; } if ($maxLevel > 6) { echo '"', WT_I18N::translate('Place'), '";'; } if ($maxLevel > 7) { echo '"', WT_I18N::translate('Place'), '";'; } echo '"', WT_I18N::translate('Longitude'), '";"', WT_I18N::translate('Latitude'), '";'; echo '"', WT_I18N::translate('Zoom level'), '";"', WT_I18N::translate('Icon'), '";', WT_EOL; $this->outputLevel($parent); exit; } $controller->setPageTitle(WT_I18N::translate('Google Maps™'))->pageHeader(); ?> <table id="gm_config"> <tr> <th> <a href="module.php?mod=googlemap&mod_action=admin_config"> <?php echo WT_I18N::translate('Google Maps™ preferences'); ?> </a> </th> <th> <a class="current" href="module.php?mod=googlemap&mod_action=admin_places"> <?php echo WT_I18N::translate('Geographic data'); ?> </a> </th> <th> <a href="module.php?mod=googlemap&mod_action=admin_placecheck"> <?php echo WT_I18N::translate('Place check'); ?> </a> </th> </tr> </table> <?php if ($action == 'ImportGedcom') { $placelist = array(); $j = 0; $gedcom_records = WT_DB::prepare("SELECT i_gedcom FROM `##individuals` WHERE i_file=? UNION ALL SELECT f_gedcom FROM `##families` WHERE f_file=?")->execute(array(WT_GED_ID, WT_GED_ID))->fetchOneColumn(); foreach ($gedcom_records as $gedrec) { $i = 1; $placerec = get_sub_record(2, '2 PLAC', $gedrec, $i); while (!empty($placerec)) { if (preg_match("/2 PLAC (.+)/", $placerec, $match)) { $placelist[$j] = array(); $placelist[$j]['place'] = trim($match[1]); if (preg_match("/4 LATI (.*)/", $placerec, $match)) { $placelist[$j]['lati'] = trim($match[1]); if ($placelist[$j]['lati'][0] != 'N' && $placelist[$j]['lati'][0] != 'S') { if ($placelist[$j]['lati'] < 0) { $placelist[$j]['lati'][0] = 'S'; } else { $placelist[$j]['lati'] = 'N' . $placelist[$j]['lati']; } } } else { $placelist[$j]['lati'] = NULL; } if (preg_match("/4 LONG (.*)/", $placerec, $match)) { $placelist[$j]['long'] = trim($match[1]); if ($placelist[$j]['long'][0] != 'E' && $placelist[$j]['long'][0] != 'W') { if ($placelist[$j]['long'] < 0) { $placelist[$j]['long'][0] = 'W'; } else { $placelist[$j]['long'] = 'E' . $placelist[$j]['long']; } } } else { $placelist[$j]['long'] = NULL; } $j = $j + 1; } $i = $i + 1; $placerec = get_sub_record(2, '2 PLAC', $gedrec, $i); } } asort($placelist); $prevPlace = ''; $prevLati = ''; $prevLong = ''; $placelistUniq = array(); $j = 0; foreach ($placelist as $k => $place) { if ($place['place'] != $prevPlace) { $placelistUniq[$j] = array(); $placelistUniq[$j]['place'] = $place['place']; $placelistUniq[$j]['lati'] = $place['lati']; $placelistUniq[$j]['long'] = $place['long']; $j = $j + 1; } elseif ($place['place'] == $prevPlace && ($place['lati'] != $prevLati || $place['long'] != $prevLong)) { if ($placelistUniq[$j - 1]['lati'] == 0 || $placelistUniq[$j - 1]['long'] == 0) { $placelistUniq[$j - 1]['lati'] = $place['lati']; $placelistUniq[$j - 1]['long'] = $place['long']; } elseif ($place['lati'] != '0' || $place['long'] != '0') { echo 'Difference: previous value = ', $prevPlace, ', ', $prevLati, ', ', $prevLong, ' current = ', $place['place'], ', ', $place['lati'], ', ', $place['long'], '<br>'; } } $prevPlace = $place['place']; $prevLati = $place['lati']; $prevLong = $place['long']; } $highestIndex = $this->getHighestIndex(); $default_zoom_level = array(4, 7, 10, 12); foreach ($placelistUniq as $k => $place) { $parent = preg_split('/ *, */', $place['place']); $parent = array_reverse($parent); $parent_id = 0; for ($i = 0; $i < count($parent); $i++) { if (!isset($default_zoom_level[$i])) { $default_zoom_level[$i] = $default_zoom_level[$i - 1]; } $escparent = $parent[$i]; if ($escparent == '') { $escparent = 'Unknown'; } $row = WT_DB::prepare("SELECT pl_id, pl_long, pl_lati, pl_zoom FROM `##placelocation` WHERE pl_level=? AND pl_parent_id=? AND pl_place LIKE ?")->execute(array($i, $parent_id, $escparent))->fetchOneRow(); if ($i < count($parent) - 1) { // Create higher-level places, if necessary if (empty($row)) { $highestIndex++; WT_DB::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_zoom) VALUES (?, ?, ?, ?, ?)")->execute(array($highestIndex, $parent_id, $i, $escparent, $default_zoom_level[$i])); echo WT_Filter::escapeHtml($escparent), '<br>'; $parent_id = $highestIndex; } else { $parent_id = $row->pl_id; } } else { // Create lowest-level place, if necessary if (empty($row->pl_id)) { $highestIndex++; WT_DB::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_long, pl_lati, pl_zoom) VALUES (?, ?, ?, ?, ?, ?, ?)")->execute(array($highestIndex, $parent_id, $i, $escparent, $place['long'], $place['lati'], $default_zoom_level[$i])); echo WT_Filter::escapeHtml($escparent), '<br>'; } else { if (empty($row->pl_long) && empty($row->pl_lati) && $place['lati'] != '0' && $place['long'] != '0') { WT_DB::prepare("UPDATE `##placelocation` SET pl_lati=?, pl_long=? WHERE pl_id=?")->execute(array($place['lati'], $place['long'], $row->pl_id)); echo WT_Filter::escapeHtml($escparent), '<br>'; } } } } } $parent = 0; } if ($action == 'ImportFile') { $placefiles = array(); $this->findFiles(WT_MODULES_DIR . 'googlemap/extra'); sort($placefiles); ?> <form method="post" enctype="multipart/form-data" id="importfile" name="importfile" action="module.php?mod=googlemap&mod_action=admin_places&action=ImportFile2"> <table class="gm_plac_edit"> <tr> <th><?php echo WT_I18N::translate('File containing places (CSV)'); ?> </th> <td><input type="file" name="placesfile" size="50"></td> </tr> <?php if (count($placefiles) > 0) { ?> <tr> <th><?php echo WT_I18N::translate('Server file containing places (CSV)'), help_link('PLIF_LOCALFILE', 'googlemap'); ?> </th> <td> <select name="localfile"> <option></option> <?php foreach ($placefiles as $p => $placefile) { ?> <option value="<?php echo WT_Filter::escapeHtml($placefile); ?> "><?php if (substr($placefile, 0, 1) == "/") { echo substr($placefile, 1); } else { echo $placefile; } ?> </option> <?php } ?> </select> </td> </tr> <?php } ?> <tr> <th><?php echo WT_I18N::translate('Delete all existing geographic data before importing the file.'); ?> </th> <td><input type="checkbox" name="cleardatabase"></td> </tr> <tr> <th><?php echo WT_I18N::translate('Do not create new locations, just import coordinates for existing locations.'); ?> </th> <td><input type="checkbox" name="updateonly"></td> </tr> <tr> <th><?php echo WT_I18N::translate('Overwrite existing coordinates.'); ?> </th> <td><input type="checkbox" name="overwritedata"></td> </tr> </table> <input id="savebutton" type="submit" value="<?php echo WT_I18N::translate('Continue adding'); ?> "><br> </form> <?php exit; } if ($action == 'ImportFile2') { $country_names = array(); foreach (WT_Stats::iso3166() as $key => $value) { $country_names[$key] = WT_I18N::translate($key); } if (isset($_POST['cleardatabase'])) { WT_DB::exec("DELETE FROM `##placelocation` WHERE 1=1"); } if (!empty($_FILES['placesfile']['tmp_name'])) { $lines = file($_FILES['placesfile']['tmp_name']); } elseif (!empty($_REQUEST['localfile'])) { $lines = file(WT_MODULES_DIR . 'googlemap/extra' . $_REQUEST['localfile']); } // Strip BYTE-ORDER-MARK, if present if (!empty($lines[0]) && substr($lines[0], 0, 3) == WT_UTF8_BOM) { $lines[0] = substr($lines[0], 3); } asort($lines); $highestIndex = $this->getHighestIndex(); $placelist = array(); $j = 0; $maxLevel = 0; foreach ($lines as $p => $placerec) { $fieldrec = explode(';', $placerec); if ($fieldrec[0] > $maxLevel) { $maxLevel = $fieldrec[0]; } } $fields = count($fieldrec); $set_icon = true; if (!is_dir(WT_MODULES_DIR . 'googlemap/places/flags/')) { $set_icon = false; } foreach ($lines as $p => $placerec) { $fieldrec = explode(';', $placerec); if (is_numeric($fieldrec[0]) && $fieldrec[0] <= $maxLevel) { $placelist[$j] = array(); $placelist[$j]['place'] = ''; for ($ii = $fields - 4; $ii > 1; $ii--) { if ($fieldrec[0] > $ii - 2) { $placelist[$j]['place'] .= $fieldrec[$ii] . ','; } } foreach ($country_names as $countrycode => $countryname) { if ($countrycode == strtoupper($fieldrec[1])) { $fieldrec[1] = $countryname; break; } } $placelist[$j]['place'] .= $fieldrec[1]; $placelist[$j]['long'] = $fieldrec[$fields - 4]; $placelist[$j]['lati'] = $fieldrec[$fields - 3]; $placelist[$j]['zoom'] = $fieldrec[$fields - 2]; if ($set_icon) { $placelist[$j]['icon'] = trim($fieldrec[$fields - 1]); } else { $placelist[$j]['icon'] = ''; } $j = $j + 1; } } $prevPlace = ''; $prevLati = ''; $prevLong = ''; $placelistUniq = array(); $j = 0; foreach ($placelist as $k => $place) { if ($place['place'] != $prevPlace) { $placelistUniq[$j] = array(); $placelistUniq[$j]['place'] = $place['place']; $placelistUniq[$j]['lati'] = $place['lati']; $placelistUniq[$j]['long'] = $place['long']; $placelistUniq[$j]['zoom'] = $place['zoom']; $placelistUniq[$j]['icon'] = $place['icon']; $j = $j + 1; } elseif ($place['place'] == $prevPlace && ($place['lati'] != $prevLati || $place['long'] != $prevLong)) { if ($placelistUniq[$j - 1]['lati'] == 0 || $placelistUniq[$j - 1]['long'] == 0) { $placelistUniq[$j - 1]['lati'] = $place['lati']; $placelistUniq[$j - 1]['long'] = $place['long']; $placelistUniq[$j - 1]['zoom'] = $place['zoom']; $placelistUniq[$j - 1]['icon'] = $place['icon']; } elseif ($place['lati'] != '0' || $place['long'] != '0') { echo 'Difference: previous value = ', $prevPlace, ', ', $prevLati, ', ', $prevLong, ' current = ', $place['place'], ', ', $place['lati'], ', ', $place['long'], '<br>'; } } $prevPlace = $place['place']; $prevLati = $place['lati']; $prevLong = $place['long']; } $default_zoom_level = array(); $default_zoom_level[0] = 4; $default_zoom_level[1] = 7; $default_zoom_level[2] = 10; $default_zoom_level[3] = 12; foreach ($placelistUniq as $k => $place) { $parent = explode(',', $place['place']); $parent = array_reverse($parent); $parent_id = 0; for ($i = 0; $i < count($parent); $i++) { $escparent = $parent[$i]; if ($escparent == '') { $escparent = 'Unknown'; } $row = WT_DB::prepare("SELECT pl_id, pl_long, pl_lati, pl_zoom, pl_icon FROM `##placelocation` WHERE pl_level=? AND pl_parent_id=? AND pl_place LIKE ? ORDER BY pl_place")->execute(array($i, $parent_id, $escparent))->fetchOneRow(); if (empty($row)) { // this name does not yet exist: create entry if (!isset($_POST['updateonly'])) { $highestIndex = $highestIndex + 1; if ($i + 1 == count($parent)) { $zoomlevel = $place['zoom']; } elseif (isset($default_zoom_level[$i])) { $zoomlevel = $default_zoom_level[$i]; } else { $zoomlevel = $this->getSetting('GM_MAX_ZOOM'); } if ($place['lati'] == '0' || $place['long'] == '0' || $i + 1 < count($parent)) { WT_DB::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_zoom, pl_icon) VALUES (?, ?, ?, ?, ?, ?)")->execute(array($highestIndex, $parent_id, $i, $escparent, $zoomlevel, $place['icon'])); } else { //delete leading zero $pl_lati = str_replace(array('N', 'S', ','), array('', '-', '.'), $place['lati']); $pl_long = str_replace(array('E', 'W', ','), array('', '-', '.'), $place['long']); if ($pl_lati >= 0) { $place['lati'] = 'N' . abs($pl_lati); } elseif ($pl_lati < 0) { $place['lati'] = 'S' . abs($pl_lati); } if ($pl_long >= 0) { $place['long'] = 'E' . abs($pl_long); } elseif ($pl_long < 0) { $place['long'] = 'W' . abs($pl_long); } WT_DB::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_long, pl_lati, pl_zoom, pl_icon) VALUES (?, ?, ?, ?, ?, ?, ?, ?)")->execute(array($highestIndex, $parent_id, $i, $escparent, $place['long'], $place['lati'], $zoomlevel, $place['icon'])); } $parent_id = $highestIndex; } } else { $parent_id = $row->pl_id; if (isset($_POST['overwritedata']) && $i + 1 == count($parent)) { WT_DB::prepare("UPDATE `##placelocation` SET pl_lati=?, pl_long=?, pl_zoom=?, pl_icon=? WHERE pl_id=?")->execute(array($place['lati'], $place['long'], $place['zoom'], $place['icon'], $parent_id)); } else { if (($row->pl_long == '0' || $row->pl_long == null) && ($row->pl_lati == '0' || $row->pl_lati == null)) { WT_DB::prepare("UPDATE `##placelocation` SET pl_lati=?, pl_long=? WHERE pl_id=?")->execute(array($place['lati'], $place['long'], $parent_id)); } if (empty($row->pl_icon) && !empty($place['icon'])) { WT_DB::prepare("UPDATE `##placelocation` SET pl_icon=? WHERE pl_id=?")->execute(array($place['icon'], $parent_id)); } } } } } $parent = 0; } if ($action == 'DeleteRecord') { $exists = WT_DB::prepare("SELECT 1 FROM `##placelocation` WHERE pl_parent_id=?")->execute(array($deleteRecord))->fetchOne(); if (!$exists) { WT_DB::prepare("DELETE FROM `##placelocation` WHERE pl_id=?")->execute(array($deleteRecord)); } else { echo '<table class="facts_table"><tr><td>', WT_I18N::translate('Location not removed: this location contains sub-locations'), '</td></tr></table>'; } } ?> <script> function updateList(inactive) { window.location.href='<?php if (strstr($_SERVER['REQUEST_URI'], '&inactive', true)) { $uri = strstr($_SERVER['REQUEST_URI'], '&inactive', true); } else { $uri = $_SERVER['REQUEST_URI']; } echo $uri, '&inactive='; ?> '+inactive; } function edit_place_location(placeid) { window.open('module.php?mod=googlemap&mod_action=places_edit&action=update&placeid='+placeid, '_blank', gmap_window_specs); return false; } function add_place_location(placeid) { window.open('module.php?mod=googlemap&mod_action=places_edit&action=add&placeid='+placeid, '_blank', gmap_window_specs); return false; } function delete_place(placeid) { var answer=confirm('<?php echo WT_I18N::translate('Remove this location?'); ?> '); if (answer == true) { window.location = '<?php echo $_SERVER['REQUEST_URI']; ?> &action=DeleteRecord&deleteRecord=' + placeid; } } </script> <?php echo '<div id="gm_breadcrumb">'; $where_am_i = $this->placeIdToHierarchy($parent); foreach (array_reverse($where_am_i, true) as $id => $place) { if ($id == $parent) { if ($place != 'Unknown') { echo WT_Filter::escapeHtml($place); } else { echo WT_I18N::translate('unknown'); } } else { echo '<a href="module.php?mod=googlemap&mod_action=admin_places&parent=', $id, '&inactive=', $inactive, '">'; if ($place != 'Unknown') { echo WT_Filter::escapeHtml($place), '</a>'; } else { echo WT_I18N::translate('unknown'), '</a>'; } } echo ' - '; } echo '<a href="module.php?mod=googlemap&mod_action=admin_places&parent=0&inactive=', $inactive, '">', WT_I18N::translate('Top level'), '</a></div>'; echo '<form name="active" method="post" action="module.php?mod=googlemap&mod_action=admin_places&parent=', $parent, '&inactive=', $inactive, '"><div id="gm_active">'; echo '<label for="inactive">', WT_I18N::translate('Show inactive places'), '</label>'; echo '<input type="checkbox" name="inactive" id="inactive"'; if ($inactive) { echo ' checked="checked"'; } echo ' onclick="updateList(this.checked)"'; echo '>', help_link('PLE_ACTIVE', 'googlemap'), '</div></form>'; $placelist = $this->getPlaceListLocation($parent, $inactive); echo '<div class="gm_plac_edit">'; echo '<table class="gm_plac_edit"><tr>'; echo '<th>', WT_Gedcom_Tag::getLabel('PLAC'), '</th>'; echo '<th>', WT_Gedcom_Tag::getLabel('LATI'), '</th>'; echo '<th>', WT_Gedcom_Tag::getLabel('LONG'), '</th>'; echo '<th>', WT_I18N::translate('Zoom level'), '</th>'; echo '<th>', WT_I18N::translate('Icon'), '</th>'; echo '<th>'; echo WT_I18N::translate('Edit'), '</th><th>', WT_I18N::translate('Delete'), '</th></tr>'; if (count($placelist) == 0) { echo '<tr><td colspan="7" class="accepted">', WT_I18N::translate('No places found'), '</td></tr>'; } foreach ($placelist as $place) { echo '<tr><td><a href="module.php?mod=googlemap&mod_action=admin_places&parent=', $place['place_id'], '&inactive=', $inactive, '">'; if ($place['place'] != 'Unknown') { echo WT_Filter::escapeHtml($place['place']), '</a></td>'; } else { echo WT_I18N::translate('unknown'), '</a></td>'; } echo '<td>', $place['lati'], '</td>'; echo '<td>', $place['long'], '</td>'; echo '<td>', $place['zoom'], '</td>'; echo '<td>'; if ($place['icon'] == NULL || $place['icon'] == '') { if ($place['lati'] == NULL || $place['long'] == NULL || $place['lati'] == '0' && $place['long'] == '0') { echo '<img src="', WT_STATIC_URL, WT_MODULES_DIR, 'googlemap/images/mm_20_yellow.png">'; } else { echo '<img src="', WT_STATIC_URL, WT_MODULES_DIR, 'googlemap/images/mm_20_red.png">'; } } else { echo '<img src="', WT_STATIC_URL, WT_MODULES_DIR, 'googlemap/', $place['icon'], '" width="25" height="15">'; } echo '</td>'; echo '<td class="narrow"><a href="#" onclick="edit_place_location(', $place['place_id'], ');return false;" class="icon-edit" title="', WT_I18N::translate('Edit'), '"></a></td>'; $noRows = WT_DB::prepare("SELECT COUNT(pl_id) FROM `##placelocation` WHERE pl_parent_id=?")->execute(array($place['place_id']))->fetchOne(); if ($noRows == 0) { ?> <td><a href="#" onclick="delete_place(<?php echo $place['place_id']; ?> );return false;" class="icon-delete" title="<?php echo WT_I18N::translate('Remove'); ?> "></a></td> <?php } else { ?> <td><i class="icon-delete-grey"></i></td> <?php } ?> </tr> <?php } ?> </table> </div> <table id="gm_manage"> <tr> <td> <?php echo WT_I18N::translate('Add a new geographic location'); ?> </td> <td> <form action="?" onsubmit="add_place_location(this.parent_id.options[this.parent_id.selectedIndex].value); return false;"> <?php echo select_edit_control('parent_id', $where_am_i, WT_I18N::translate('Top level'), $parent); ?> <input type="submit" value="<?php echo WT_I18N::translate('Add'); ?> "> </form> </td> </tr> <tr> <td> <?php echo WT_I18N::translate('Import all places from a family tree'); ?> </td> <td> <form action="module.php" method="get"> <input type="hidden" name="mod" value="googlemap"> <input type="hidden" name="mod_action" value="admin_places"> <input type="hidden" name="action" value="ImportGedcom"> <?php echo select_edit_control('ged', WT_Tree::getNameList(), null, WT_GEDCOM); ?> <input type="submit" value="<?php echo WT_I18N::translate('Import'); ?> "> </form> </td> </tr> <tr> <td> <?php echo WT_I18N::translate('Upload geographic data'); ?> </td> <td> <form action="module.php" method="get"> <input type="hidden" name="mod" value="googlemap"> <input type="hidden" name="mod_action" value="admin_places"> <input type="hidden" name="action" value="ImportFile"> <input type="submit" value="<?php echo WT_I18N::translate('Upload'); ?> "> </form> </td> </tr> <tr> <td> <?php echo WT_I18N::translate('Download geographic data'); ?> </td> <td> <form action="module.php" method="get"> <input type="hidden" name="mod" value="googlemap"> <input type="hidden" name="mod_action" value="admin_places"> <input type="hidden" name="action" value="ExportFile"> <?php echo select_edit_control('parent', $where_am_i, WT_I18N::translate('All'), WT_GED_ID); ?> <input type="submit" value="<?php echo WT_I18N::translate('Download'); ?> "> </form> </td> </tr> </table> <?php }
require './includes/session.php'; require_once WT_ROOT . 'includes/functions/functions_print_lists.php'; $controller = new WT_Controller_Note(); if ($controller->record && $controller->record->canShow()) { $controller->pageHeader(); if ($controller->record->isOld()) { if (WT_USER_CAN_ACCEPT) { echo '<p class="ui-state-highlight">', WT_I18N::translate('This note has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" onclick="accept_changes(\'' . $controller->record->getXref() . '\');">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" onclick="reject_changes(\'' . $controller->record->getXref() . '\');">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'reject') . '</a>'), ' ', help_link('pending_changes'), '</p>'; } elseif (WT_USER_CAN_EDIT) { echo '<p class="ui-state-highlight">', WT_I18N::translate('This note has been deleted. The deletion will need to be reviewed by a moderator.'), ' ', help_link('pending_changes'), '</p>'; } } elseif ($controller->record->isNew()) { if (WT_USER_CAN_ACCEPT) { echo '<p class="ui-state-highlight">', WT_I18N::translate('This note has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" onclick="accept_changes(\'' . $controller->record->getXref() . '\');">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" onclick="reject_changes(\'' . $controller->record->getXref() . '\');">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'reject') . '</a>'), ' ', help_link('pending_changes'), '</p>'; } elseif (WT_USER_CAN_EDIT) { echo '<p class="ui-state-highlight">', WT_I18N::translate('This note has been edited. The changes need to be reviewed by a moderator.'), ' ', help_link('pending_changes'), '</p>'; } } } else { header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found'); $controller->pageHeader(); echo '<p class="ui-state-error">', WT_I18N::translate('This note does not exist or you do not have permission to view it.'), '</p>'; exit; } $controller->addInlineJavascript(' jQuery("#note-tabs") .tabs({ create: function(e, ui){ jQuery(e.target).css("visibility", "visible"); // prevent FOUC } });
public function configureBlock($block_id) { if (WT_Filter::postBool('save') && WT_Filter::checkCsrf()) { set_block_setting($block_id, 'gedcom', WT_Filter::post('gedcom')); set_block_setting($block_id, 'title', WT_Filter::post('title')); set_block_setting($block_id, 'html', WT_Filter::post('html')); set_block_setting($block_id, 'show_timestamp', WT_Filter::postBool('show_timestamp')); set_block_setting($block_id, 'timestamp', WT_Filter::post('timestamp')); $languages = array(); foreach (WT_I18N::installed_languages() as $code => $name) { if (WT_Filter::postBool('lang_' . $code)) { $languages[] = $code; } } set_block_setting($block_id, 'languages', implode(',', $languages)); exit; } require_once WT_ROOT . 'includes/functions/functions_edit.php'; $templates = array(WT_I18N::translate('Keyword examples') => '#getAllTagsTable#', WT_I18N::translate('Narrative description') => WT_I18N::translate('This GEDCOM (family tree) was last updated on #gedcomUpdated#. There are #totalSurnames# surnames in this family tree. The earliest recorded event is the #firstEventType# of #firstEventName# in #firstEventYear#. The most recent event is the #lastEventType# of #lastEventName# in #lastEventYear#.<br><br>If you have any comments or feedback please contact #contactWebmaster#.'), WT_I18N::translate('Statistics') => '<div class="gedcom_stats"> <span style="font-weight: bold"><a href="index.php?command=gedcom">#gedcomTitle#</a></span><br> ' . WT_I18N::translate('This family tree was last updated on %s.', '#gedcomUpdated#') . ' <table id="keywords"> <tr> <td valign="top" class="width20"> <table cellspacing="1" cellpadding="0"> <tr> <td class="facts_label">' . WT_I18N::translate('Individuals') . '</td> <td class="facts_value" align="right"><a href="indilist.php?surname_sublist=no">#totalIndividuals#</a></td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Males') . '</td> <td class="facts_value" align="right">#totalSexMales#<br>#totalSexMalesPercentage#</td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Females') . '</td> <td class="facts_value" align="right">#totalSexFemales#<br>#totalSexFemalesPercentage#</td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Total surnames') . '</td> <td class="facts_value" align="right"><a href="indilist.php?show_all=yes&surname_sublist=yes&ged=' . WT_GEDURL . '">#totalSurnames#</a></td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Families') . '</td> <td class="facts_value" align="right"><a href="famlist.php?ged=' . WT_GEDURL . '">#totalFamilies#</a></td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Sources') . '</td> <td class="facts_value" align="right"><a href="sourcelist.php?ged=' . WT_GEDURL . '">#totalSources#</a></td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Media objects') . '</td> <td class="facts_value" align="right"><a href="medialist.php?ged=' . WT_GEDURL . '">#totalMedia#</a></td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Repositories') . '</td> <td class="facts_value" align="right"><a href="repolist.php?ged=' . WT_GEDURL . '">#totalRepositories#</a></td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Total events') . '</td> <td class="facts_value" align="right">#totalEvents#</td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Total users') . '</td> <td class="facts_value" align="right">#totalUsers#</td> </tr> </table> </td> <td><br></td> <td valign="top"> <table cellspacing="1" cellpadding="0" border="0"> <tr> <td class="facts_label">' . WT_I18N::translate('Earliest birth year') . '</td> <td class="facts_value" align="right">#firstBirthYear#</td> <td class="facts_value">#firstBirth#</td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Latest birth year') . '</td> <td class="facts_value" align="right">#lastBirthYear#</td> <td class="facts_value">#lastBirth#</td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Earliest death year') . '</td> <td class="facts_value" align="right">#firstDeathYear#</td> <td class="facts_value">#firstDeath#</td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Latest death year') . '</td> <td class="facts_value" align="right">#lastDeathYear#</td> <td class="facts_value">#lastDeath#</td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Individual who lived the longest') . '</td> <td class="facts_value" align="right">#longestLifeAge#</td> <td class="facts_value">#longestLife#</td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Average age at death') . '</td> <td class="facts_value" align="right">#averageLifespan#</td> <td class="facts_value"></td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Family with the most children') . '</td> <td class="facts_value" align="right">#largestFamilySize#</td> <td class="facts_value">#largestFamily#</td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Average number of children per family') . '</td> <td class="facts_value" align="right">#averageChildren#</td> <td class="facts_value"></td> </tr> </table> </td> </tr> </table><br> <span style="font-weight: bold">' . WT_I18N::translate('Most common surnames') . '</span><br> #commonSurnames# </div>'); $title = get_block_setting($block_id, 'title'); $html = get_block_setting($block_id, 'html'); // title echo '<tr><td class="descriptionbox wrap">', WT_Gedcom_Tag::getLabel('TITL'), '</td><td class="optionbox"><input type="text" name="title" size="30" value="', WT_Filter::escapeHtml($title), '"></td></tr>'; // templates echo '<tr><td class="descriptionbox wrap">', WT_I18N::translate('Templates'), help_link('block_html_template', $this->getName()), '</td><td class="optionbox">'; // The CK editor needs lots of help to load/save data :-( if (array_key_exists('ckeditor', WT_Module::getActiveModules())) { $ckeditor_onchange = 'CKEDITOR.instances.html.setData(document.block.html.value);'; } else { $ckeditor_onchange = ''; } echo '<select name="template" onchange="document.block.html.value=document.block.template.options[document.block.template.selectedIndex].value;', $ckeditor_onchange, '">'; echo '<option value="', WT_Filter::escapeHtml($html), '">', WT_I18N::translate('Custom'), '</option>'; foreach ($templates as $title => $template) { echo '<option value="', WT_Filter::escapeHtml($template), '">', $title, '</option>'; } echo '</select></td></tr>'; // gedcom $gedcom = get_block_setting($block_id, 'gedcom'); if (count(WT_Tree::getAll()) > 1) { if ($gedcom == '__current__') { $sel_current = ' selected="selected"'; } else { $sel_current = ''; } if ($gedcom == '__default__') { $sel_default = ' selected="selected"'; } else { $sel_default = ''; } echo '<tr><td class="descriptionbox wrap">', WT_I18N::translate('Family tree'), '</td><td class="optionbox">', '<select name="gedcom">', '<option value="__current__"', $sel_current, '>', WT_I18N::translate('Current'), '</option>', '<option value="__default__"', $sel_default, '>', WT_I18N::translate('Default'), '</option>'; foreach (WT_Tree::getAll() as $tree) { if ($tree->tree_name == $gedcom) { $sel = ' selected="selected"'; } else { $sel = ''; } echo '<option value="', $tree->tree_name, '"', $sel, ' dir="auto">', $tree->tree_title_html, '</option>'; } echo '</select></td></tr>'; } // html echo '<tr><td colspan="2" class="descriptionbox">', WT_I18N::translate('Content'), help_link('block_html_content', $this->getName()), '</td></tr><tr>', '<td colspan="2" class="optionbox">'; echo '<textarea name="html" class="html-edit" rows="10" style="width:98%;">', WT_Filter::escapeHtml($html), '</textarea>'; echo '</td></tr>'; $show_timestamp = get_block_setting($block_id, 'show_timestamp', false); echo '<tr><td class="descriptionbox wrap">'; echo WT_I18N::translate('Show the date and time of update'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('show_timestamp', $show_timestamp); echo '<input type="hidden" name="timestamp" value="', WT_TIMESTAMP, '">'; echo '</td></tr>'; $languages = get_block_setting($block_id, 'languages'); echo '<tr><td class="descriptionbox wrap">'; echo WT_I18N::translate('Show this block for which languages?'); echo '</td><td class="optionbox">'; echo edit_language_checkboxes('lang_', $languages); echo '</td></tr>'; }
} echo "/></td></tr>\n"; echo "<tr><th>{$strFax}</th><td><input maxlength='50' name='fax' size='30'"; if ($_SESSION['formdata']['add_user']['fax'] != '') { echo "value='{$_SESSION['formdata']['add_user']['fax']}'"; } echo "/></td></tr>\n"; if ($CONFIG['holidays_enabled']) { echo "<tr><th>{$strHolidayEntitlement}</th><td><input maxlength='3' name='holiday_entitlement' size='3' "; if ($_SESSION['formdata']['add_user']['holiday_entitlement'] != '') { echo "value='{$_SESSION['formdata']['add_user']['holiday_entitlement']}'"; } else { echo "value='{$CONFIG['default_entitlement']}'"; } echo " /> {$strDays}</td></tr>\n"; echo "<tr><th>{$strStartDate} " . help_link('UserStartdate') . "</th>"; echo "<td><input type='text' name='startdate' id='startdate' size='10'"; if ($_SESSION['formdata']['add_user']['startdate'] != '') { echo "value='{$_SESSION['formdata']['add_user']['startdate']}'"; } echo "/> "; echo date_picker('adduser.startdate'); echo "</td></tr>\n"; } plugin_do('add_user_form'); echo "</table>\n"; echo "<p><input name='submit' type='submit' value='{$strAddUser}' /></p>"; echo "</form>\n"; include APPLICATION_INCPATH . 'htmlfooter.inc.php'; clear_form_data('add_user'); } else {
public function getTabContent() { global $SHOW_LEVEL2_NOTES, $controller; ob_start(); echo '<table class="facts_table">'; ?> <tr> <td colspan="2" class="descriptionbox rela"> <input id="checkbox_sour2" type="checkbox" <?php if ($SHOW_LEVEL2_NOTES) { echo " checked=\"checked\""; } ?> onclick="jQuery('tr.row_sour2').toggle();"> <label for="checkbox_sour2"><?php echo WT_I18N::translate('Show all sources'), help_link('show_fact_sources'); ?> </label> </td> </tr> <?php foreach ($this->get_facts() as $fact) { if ($fact->getTag() == 'SOUR') { print_main_sources($fact, 1); } else { for ($i = 2; $i < 4; ++$i) { print_main_sources($fact, $i); } } } if (!$this->get_facts()) { echo '<tr><td id="no_tab4" colspan="2" class="facts_value">', WT_I18N::translate('There are no source citations for this individual.'), '</td></tr>'; } // New Source Link if ($controller->record->canEdit()) { ?> <tr> <td class="facts_label"> <?php echo WT_Gedcom_Tag::getLabel('SOUR'); ?> </td> <td class="facts_value"> <a href="#" onclick="add_new_record('<?php echo $controller->record->getXref(); ?> ','SOUR'); return false;"> <?php echo WT_I18N::translate('Add a new source citation'); ?> </a> <?php echo help_link('add_source'); ?> </td> </tr> <?php } ?> </table> <?php if (!$SHOW_LEVEL2_NOTES) { echo '<script>jQuery("tr.row_sour2").toggle();</script>'; } return '<div id="' . $this->getName() . '_content">' . ob_get_clean() . '</div>'; }
echo '<style type="text/css"> #container {width: 70%; margin:15px auto; border: 1px solid gray; padding: 10px;} #container dl {margin:0 0 40px 25px;} #container dt {display:inline; width: 320px; font-weight:normal; margin: 0 0 15px 0;} #container dd {color: #81A9CB; margin-bottom:20px;font-weight:bold;} #container p {color: #81A9CB; font-size: 14px; font-style: italic; font-weight:bold; padding: 0 5px 5px;} h2 {color: #81A9CB;} .good {color: green;} .bad {color: red !important;} .indifferent {color: blue;} #container p.pgv {color: black; font-size: 12px; font-style: normal; font-weight:normal; padding:0; margin:10px 0 0 320px;} </style>'; if ($error || !$PGV_PATH) { // Prompt for location of PhpGedView installation echo '<div id="container">'; echo '<h2>', WT_I18N::translate('PhpGedView to <b>webtrees</b> transfer wizard'), help_link('PGV_WIZARD'), '</h2>'; if ($error) { echo '<p class="bad">', $error, '</p>'; } // Look for PGV in some nearby directories $pgv_dirs = array(); $dir = opendir(realpath('..')); while (($subdir = readdir($dir)) !== false) { if (is_dir('../' . $subdir) && file_exists('../' . $subdir . '/config.php')) { $pgv_dirs[] = '../' . $subdir; } } closedir($dir); echo '<form action="', WT_SCRIPT_NAME, '" method="post">', '<p>', WT_I18N::translate('Where is your PhpGedView installation?'), '</p>', '<dl>', '<dt>', WT_I18N::translate('Installation directory'), '</dt>'; switch (count($pgv_dirs)) { case '0':
public function getBlock($block_id, $template = true, $cfg = null) { global $ctype, $PEDIGREE_FULL_DETAILS, $show_full, $bwidth, $bheight; $PEDIGREE_ROOT_ID = get_gedcom_setting(WT_GED_ID, 'PEDIGREE_ROOT_ID'); $details = get_block_setting($block_id, 'details', false); $type = get_block_setting($block_id, 'type', 'pedigree'); $pid = get_block_setting($block_id, 'pid', WT_USER_ID ? WT_USER_GEDCOM_ID ? WT_USER_GEDCOM_ID : $PEDIGREE_ROOT_ID : $PEDIGREE_ROOT_ID); $block = get_block_setting($block_id, 'block'); if ($cfg) { foreach (array('details', 'type', 'pid', 'block') as $name) { if (array_key_exists($name, $cfg)) { ${$name} = $cfg[$name]; } } } // Override GEDCOM configuration temporarily if (isset($show_full)) { $saveShowFull = $show_full; } $savePedigreeFullDetails = $PEDIGREE_FULL_DETAILS; if (!$details) { $show_full = 0; // Here we could adjust the block width & height to accommodate larger displays } else { $show_full = 1; // Here we could adjust the block width & height to accommodate larger displays } $PEDIGREE_FULL_DETAILS = $show_full; $person = WT_Individual::getInstance($pid); if (!$person) { $pid = $PEDIGREE_ROOT_ID; set_block_setting($block_id, 'pid', $pid); $person = WT_Individual::getInstance($pid); } if ($type != 'treenav' && $person) { $controller = new WT_Controller_Hourglass($person->getXref(), 0); $controller->setupJavascript(); } $id = $this->getName() . $block_id; $class = $this->getName() . '_block'; if ($ctype == 'gedcom' && WT_USER_GEDCOM_ADMIN || $ctype == 'user' && WT_USER_ID) { $title = '<i class="icon-admin" title="' . WT_I18N::translate('Configure') . '" onclick="modalDialog(\'block_edit.php?block_id=' . $block_id . '\', \'' . $this->getTitle() . '\');"></i>'; } else { $title = ''; } if ($person) { switch ($type) { case 'pedigree': $title .= WT_I18N::translate('Pedigree of %s', $person->getFullName()); break; case 'descendants': $title .= WT_I18N::translate('Descendants of %s', $person->getFullName()); break; case 'hourglass': $title .= WT_I18N::translate('Hourglass chart of %s', $person->getFullName()); break; case 'treenav': $title .= WT_I18N::translate('Interactive tree of %s', $person->getFullName()); break; } $title .= help_link('index_charts', $this->getName()); $content = '<table cellspacing="0" cellpadding="0" border="0"><tr>'; if ($type == 'descendants' || $type == 'hourglass') { $content .= "<td valign=\"middle\">"; ob_start(); $controller->print_descendency($person, 1, false); $content .= ob_get_clean(); $content .= "</td>"; } if ($type == 'pedigree' || $type == 'hourglass') { //-- print out the root person if ($type != 'hourglass') { $content .= "<td valign=\"middle\">"; ob_start(); print_pedigree_person($person); $content .= ob_get_clean(); $content .= "</td>"; } $content .= "<td valign=\"middle\">"; ob_start(); $controller->print_person_pedigree($person, 1); $content .= ob_get_clean(); $content .= "</td>"; } if ($type == 'treenav') { require_once WT_MODULES_DIR . 'tree/module.php'; require_once WT_MODULES_DIR . 'tree/class_treeview.php'; $mod = new tree_WT_Module(); $tv = new TreeView(); $content .= '<td>'; $content .= '<script>jQuery("head").append(\'<link rel="stylesheet" href="' . $mod->css() . '" type="text/css" />\');</script>'; $content .= '<script src="' . $mod->js() . '"></script>'; list($html, $js) = $tv->drawViewport($person, 2); $content .= $html . '<script>' . $js . '</script>'; $content .= '</td>'; } $content .= "</tr></table>"; } else { $content = WT_I18N::translate('You must select an individual and chart type in the block configuration settings.'); } if ($template) { if ($block) { require WT_THEME_DIR . 'templates/block_small_temp.php'; } else { require WT_THEME_DIR . 'templates/block_main_temp.php'; } } else { return $content; } // Restore GEDCOM configuration unset($show_full); if (isset($saveShowFull)) { $show_full = $saveShowFull; } $PEDIGREE_FULL_DETAILS = $savePedigreeFullDetails; }
return (array_key_exists($x->getTag(), $order) ? $order[$x->getTag()] : PHP_INT_MAX) - (array_key_exists($y->getTag(), $order) ? $order[$y->getTag()] : PHP_INT_MAX); }); // Print the facts foreach ($facts as $fact) { print_fact($fact, $controller->record); } // new fact link if ($controller->record->canEdit()) { print_add_new_fact($controller->record->getXref(), $facts, 'REPO'); // new media if (get_gedcom_setting(WT_GED_ID, 'MEDIA_UPLOAD') >= WT_USER_ACCESS_LEVEL) { echo '<tr><td class="descriptionbox">'; echo WT_Gedcom_Tag::getLabel('OBJE'); echo '</td><td class="optionbox">'; echo '<a href="#" onclick="window.open(\'addmedia.php?action=showmediaform&linktoid=', $controller->record->getXref(), '\', \'_blank\', edit_window_specs); return false;">', WT_I18N::translate('Add a new media object'), '</a>'; echo help_link('OBJE'); echo '<br>'; echo '<a href="#" onclick="window.open(\'inverselink.php?linktoid=', $controller->record->getXref(), '&linkto=repository\', \'_blank\', find_window_specs); return false;">', WT_I18N::translate('Link to an existing media object'), '</a>'; echo '</td></tr>'; } } echo '</table> </div>'; // Sources linked to this repository if ($linked_sour) { echo '<div id="source-repo">'; echo format_sour_table($linked_sour); echo '</div>'; } echo '</div>'; echo '</div>';
</label> </div> <div> <label for="username">', WT_I18N::translate('Desired user name'), help_link('username'), '<input type="text" id="username" name="user_name" required maxlength="32" value="', WT_Filter::escapeHtml($user_name), '"> </label> </div> <div> <label for="user_password01">', WT_I18N::translate('Desired password'), help_link('password'), '<input type="password" id="user_password01" name="user_password01" value="', WT_Filter::escapeHtml($user_password01), '" required placeholder="', WT_I18N::plural('Use at least %s character.', 'Use at least %s characters.', WT_MINIMUM_PASSWORD_LENGTH, WT_I18N::number(WT_MINIMUM_PASSWORD_LENGTH)), '" pattern="' . WT_REGEX_PASSWORD . '" onchange="form.user_password02.pattern = regex_quote(this.value);"> </label> </div> <div> <label for="user_password02">', WT_I18N::translate('Confirm password'), help_link('password_confirm'), '<input type="password" id="user_password02" name="user_password02" value="', WT_Filter::escapeHtml($user_password02), '" required placeholder="', WT_I18N::translate('Type the password again.'), '" pattern="' . WT_REGEX_PASSWORD . '"> </label> </div> <div> <label for="user_comments">', WT_I18N::translate('Comments'), help_link('register_comments'), '<textarea cols="50" rows="5" id="user_comments" name="user_comments" required placeholder="', WT_I18N::translate('Explain why you are requesting an account.'), '">', WT_Filter::escapeHtml($user_comments), '</textarea> </label> </div> <hr> <div id="registration-submit"> <input type="submit" value="', WT_I18N::translate('continue'), '"> </div> </form> </div> </div>'; break; case 'userverify': if (!WT_Site::preference('USE_REGISTRATION_MODULE')) { header('Location: ' . WT_SERVER_NAME . WT_SCRIPT_PATH); exit; }
function template_robots_seo() { global $adkportal, $txt, $context, $scripturl, $boardurl, $adkFolder; echo ' <form method="post" action="' . $scripturl . '?action=admin;area=adkseoadmin;sa=saverobots"> <div class="cat_bar"><h3 class="catbg"> <img alt="" class="adk_vertical_align" src="' . $adkFolder['images'] . '/login.png" /> ', $txt['adkportal_create_robots'], ' </h3></div> <span class="clear upperframe"> <span> </span> </span> <div class="roundframe"> <div> ', help_link('adkportal_robots', 'adkhelp_robots'), ' <hr /> <table class="size_100"> <tr> <td class="size_40"> </td> <td class="size_60"> <fieldset> <legend style="color: teal">robots.txt</legend> <div class="adk_padding_8 text_align_center"> <textarea cols="70" rows="12" name="robots">' . $context['robots_dir'] . '</textarea><br /> </div> </fieldset> </td> </tr> <tr> <td colspan="2"> <span class="clear upperframe"> <span> </span> </span> <div class="roundframe"> <div> <div class="smalltext">' . $txt['adkportal_robots_info'] . '</div> </div> </div> <span class="lowerframe"> <span> </span> </span> </td> </tr> </table> <div align="center"> <hr /> <input type="submit" value="' . $txt['save'] . '" class="button_submit" /> <input type="hidden" name="sc" value="' . $context['session_id'] . '" /> </div> </div> </div> <span class="lowerframe"> <span> </span> </span> </form>'; }
function view_help_manual() { $this->redirectToUrl(help_link()); }
} if (empty($_SESSION['formdata']['add_servicelevel']['engineerPeriod'])) { $_SESSION['formdata']['add_servicelevel']['engineerPeriod'] = 60; } if (empty($_SESSION['formdata']['add_servicelevel']['customerPeriod'])) { $_SESSION['formdata']['add_servicelevel']['customerPeriod'] = 120; } if (!empty($_SESSION['formdata']['add_servicelevel']['timed'])) { $timedchecked = 'CHECKED'; } echo "<h2>" . icon('sla', 32) . " "; echo "{$title}</h2>"; echo "<form name='add_servicelevel' action='{$_SERVER['PHP_SELF']}' method='post'>"; echo "<p align='center'>{$strTag}: <input type='text' name='tag' value='{$_SESSION['formdata']['add_servicelevel']['tag']}' /></p>"; echo "<table align='center'>"; echo "<tr><th>{$strTimed}</th><td class='shade1'><input type='checkbox' id='timed' name='timed' value='yes' onchange='enableBillingPeriod();' {$timedchecked} />" . help_link('ServiceLevelTimed') . "</td></tr>"; echo "<tr><th>{$strAllowIncidentReopen}</th><td class='shade2'>" . html_checkbox('allow_reopen', $sla->allow_reopen) . "</td></tr>\n"; echo "<tr id='engineerBillingPeriod'><th>{$strBillingEngineerPeriod}</th><td class='shade1'><input type='text' size='5' name='engineerPeriod' maxlength='5' value='{$_SESSION['formdata']['add_servicelevel']['engineerPeriod']}' /> {$strMinutes}</td></tr>"; echo "<tr id='customerBillingPeriod'><th>{$strBillingCustomerPeriod}</th><td class='shade2'><input type='text' size='5' name='customerPeriod' maxlength='5' value='{$_SESSION['formdata']['add_servicelevel']['customerPeriod']}' /> {$strMinutes}</td></tr>"; echo "<tr id='limit'><th>{$strLimit}</th><td class='shade1' >{$CONFIG['currency_symbol']} <input type='text' size='5' name='limit' maxlength='5' value='{$_SESSION['formdata']['add_servicelevel']['limit']}' /></td></tr>"; echo "</table>"; echo "<script type='text/javascript'>enableBillingPeriod();</script>"; echo "<table align='center'>"; echo "<tr><th>{$strPriority}</th><th>{$strInitialResponse}</th>"; echo "<th>{$strProblemDefinition}</th><th>{$strActionPlan}</th><th>{$strResolutionReprioritisation}</th>"; echo "<th>{$strReview}</th></tr>"; echo "<tr class='shade1'>"; echo "<td>{$strLow}</td>"; echo "<td><input type='text' size='5' name='low_initial_response_mins' maxlength='5' value='{$_SESSION['formdata']['add_servicelevel']['low_initial_response_mins']}' /> {$strMinutes}</td>"; echo "<td><input type='text' size='5' name='low_prob_determ_mins' maxlength='5' value='{$_SESSION['formdata']['add_servicelevel']['low_prob_determ_mins']}' /> {$strMinutes}</td>"; echo "<td><input type='text' size='5' name='low_action_plan_mins' maxlength='5' value='{$_SESSION['formdata']['add_servicelevel']['low_action_plan_mins']}' /> {$strMinutes}</td>";
if (mysql_error()) { trigger_error(mysql_error(), E_USER_ERROR); } echo "<select name='exc[]' multiple='multiple' size='6'>"; while ($product = mysql_fetch_object($result)) { echo "<option value='{$product->id}'>{$product->name}</option>\n"; } echo "</select>"; echo "</td></tr>\n"; $sql = "SELECT * FROM `{$dbSiteTypes}`"; $result = mysql_query($sql); if (mysql_error()) { trigger_error(mysql_error(), E_USER_ERROR); } if (mysql_num_rows($result) > 0) { echo "<tr><th>{$strSiteType}" . help_link('CTRLAddRemove') . "</th><td>"; echo "<select name='sitetype[]' multiple='multiple' size='6'>"; while ($obj = mysql_fetch_object($result)) { echo "<option value='{$obj->typeid}'>{$obj->typename}</option>\n"; } echo "</select>"; echo "</td></tr>\n"; } echo "<tr><td colspan='2'><label><input type='checkbox' name='activeonly'"; echo " value='yes' /> {$strShowActiveOnly}</label></td></tr>"; echo "<tr><td colspan='2'>{$strOutput}: <select name='output'>"; echo "<option value='screen'>{$strScreen}</option>"; // echo "<option value='printer'>Printer</option>"; echo "<option value='csv'>{$strCSVfile}</option>"; echo "</select>"; echo "</td></tr>";
<td class="descriptionbox"> <label for="generations"> <?php echo WT_I18N::translate('Generations'); ?> </label> </td> <td class="optionbox"> <?php echo edit_field_integers('generations', $controller->generations, 2, 9); ?> </td> <td class="descriptionbox"> <label for="fan_width"> <?php echo WT_I18N::translate('Width'), help_link('fan_width'); ?> </label> </td> <td class="optionbox"> <input type="text" size="3" id="fan_width" name="fan_width" value="<?php echo $controller->fan_width; ?> "> % </td> </tr> </table> </form> <?php if ($controller->error_message) { echo '<p class="ui-state-error">', $controller->error_message, '</p>';
/** * Print a new fact box on details pages * * @param string $id the id of the person, family, source etc the fact will be added to * @param array $usedfacts an array of facts already used in this record * @param string $type the type of record INDI, FAM, SOUR etc */ function print_add_new_fact($id, $usedfacts, $type) { global $WT_SESSION; // -- Add from clipboard if ($WT_SESSION->clipboard) { $newRow = true; foreach (array_reverse($WT_SESSION->clipboard, true) as $fact_id => $fact) { if ($fact["type"] == $type || $fact["type"] == 'all') { if ($newRow) { $newRow = false; echo '<tr><td class="descriptionbox">'; echo WT_I18N::translate('Add from clipboard'), '</td>'; echo '<td class="optionbox wrap"><form method="get" name="newFromClipboard" action="?" onsubmit="return false;">'; echo '<select id="newClipboardFact">'; } echo '<option value="', WT_Filter::escapeHtml($fact_id), '">', WT_Gedcom_Tag::getLabel($fact['fact']); // TODO use the event class to store/parse the clipboard events if (preg_match('/^2 DATE (.+)/m', $fact['factrec'], $match)) { $tmp = new WT_Date($match[1]); echo '; ', $tmp->minDate()->format('%Y'); } if (preg_match('/^2 PLAC ([^,\\n]+)/m', $fact['factrec'], $match)) { echo '; ', $match[1]; } echo '</option>'; } } if (!$newRow) { echo '</select>'; echo ' <input type="button" value="', WT_I18N::translate('Add'), "\" onclick=\"return paste_fact('{$id}', '#newClipboardFact');\"> "; echo '</form></td></tr>', "\n"; } } // -- Add from pick list switch ($type) { case "INDI": $addfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'INDI_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY); $uniquefacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'INDI_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY); $quickfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'INDI_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY); break; case "FAM": $addfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'FAM_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY); $uniquefacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'FAM_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY); $quickfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'FAM_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY); break; case "SOUR": $addfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'SOUR_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY); $uniquefacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'SOUR_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY); $quickfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'SOUR_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY); break; case "NOTE": $addfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'NOTE_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY); $uniquefacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'NOTE_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY); $quickfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'NOTE_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY); break; case "REPO": $addfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'REPO_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY); $uniquefacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'REPO_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY); $quickfacts = preg_split("/[, ;:]+/", get_gedcom_setting(WT_GED_ID, 'REPO_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY); break; default: return; } $addfacts = array_merge(CheckFactUnique($uniquefacts, $usedfacts, $type), $addfacts); $quickfacts = array_intersect($quickfacts, $addfacts); $translated_addfacts = array(); foreach ($addfacts as $addfact) { $translated_addfacts[$addfact] = WT_Gedcom_Tag::getLabel($addfact); } uasort($translated_addfacts, function ($x, $y) { return WT_I18N::strcasecmp(WT_I18N::translate($x), WT_I18N::translate($y)); }); echo '<tr><td class="descriptionbox">'; echo WT_I18N::translate('Fact or event'); echo help_link('add_facts'), '</td>'; echo '<td class="optionbox wrap">'; echo '<form method="get" name="newfactform" action="?" onsubmit="return false;">'; echo '<select id="newfact" name="newfact">'; echo '<option value="" disabled selected>' . WT_I18N::translate('<select>') . '</option>'; foreach ($translated_addfacts as $fact => $fact_name) { echo '<option value="', $fact, '">', $fact_name, '</option>'; } if ($type == 'INDI' || $type == 'FAM') { echo '<option value="FACT">', WT_I18N::translate('Custom fact'), '</option>'; echo '<option value="EVEN">', WT_I18N::translate('Custom event'), '</option>'; } echo '</select>'; echo '<input type="button" value="', WT_I18N::translate('Add'), '" onclick="add_record(\'' . $id . '\', \'newfact\');">'; echo '<span class="quickfacts">'; foreach ($quickfacts as $fact) { echo '<a href="#" onclick="add_new_record(\'' . $id . '\', \'' . $fact . '\');return false;">', WT_Gedcom_Tag::getLabel($fact), '</a>'; } echo '</span></form>'; echo '</td></tr>'; }
echo '<a onclick="move_left_right_block(\'right_select\', \'available_select\');" title="', WT_I18N::translate('Remove'), '"class="', $IconLarrow, '"></a>'; echo '<br>'; echo '<a onclick="move_left_right_block(\'available_select\', \'right_select\');" title="', WT_I18N::translate('Add'), '"class="', $IconRarrow, '"></a>'; echo '<br><br>'; echo help_link('block_move_right'); echo '</td>'; // NOTE: Row 2 column 6: Right block list echo '<td class="optionbox center">'; echo '<select multiple="multiple" id="right_select" name="right[]" size="10" onchange="show_description(\'right_select\');">'; foreach ($blocks['side'] as $block_id => $block_name) { echo '<option value="', $block_id, '">', $all_blocks[$block_name]->getTitle(), '</option>'; } echo '</select>'; echo '</td>'; // NOTE: Row 2 column 7: Up/Down buttons for right block list echo '<td class="optionbox center vmiddle">'; echo '<a onclick="move_up_block(\'right_select\');" title="', WT_I18N::translate('Move up'), '"class="', $IconUarrow, '"></a>'; echo '<br>'; echo '<a onclick="move_down_block(\'right_select\');" title="', WT_I18N::translate('Move down'), '"class="', $IconDarrow, '"></a>'; echo '<br><br>'; echo help_link('block_move_up'); echo '</td>'; echo '</tr>'; // NOTE: Row 3 columns 1-7: Summary description of currently selected block echo '<tr><td class="descriptionbox wrap" colspan="7"><div id="instructions">'; echo WT_I18N::translate('Highlight a block name and then click on one of the arrow icons to move that highlighted block in the indicated direction.'); echo '</div></td></tr>'; echo '<tr><td class="topbottombar" colspan="7">'; echo '<input type="submit" value="', WT_I18N::translate('save'), '">'; echo '</td></tr></table>'; echo '</form>';
echo "<label><input type='radio' name='wait' value='no' />{$strCloseImmediately}</label></td></tr>\n"; echo "<tr><th>{$strKnowledgeBase}"; echo "</th><td><label><input type='checkbox' name='kbarticle' onchange='enablekb();' value='yes' />"; echo "{$strNewKBArticle}</label></td></tr>\n"; echo "<tr id='titlerow' style='display:none;'><th>{$strTitle}</th>"; echo "<td><input class='required' type='text' name='kbtitle' id='kbtitle' "; echo "size='30' value='{$incident_title}' disabled='disabled' /> "; echo "<span class='required'>{$strRequired}</span></td></tr>\n"; echo "<tr id='distributionrow' style='display:none;'><th>{$strDistribution}</th>"; echo "<td>"; echo "<select name='distribution'> "; echo "<option value='public' selected='selected'>{$strPublic}</option>"; echo "<option value='private' style='color: blue;'>{$strPrivate}</option>"; echo "<option value='restricted' style='color: red;'>{$strRestricted}</option>"; echo "</select> "; echo help_link('KBDistribution'); echo "</td></tr>\n"; echo "<tr><th> </th><td>"; echo "<span id='helptext'>{$strEnterDetailsAboutIncidentToBeStoredInLog}"; echo "{$strSummaryOfProblemAndResolution}<br /><strong>{$strFinalUpdate}</strong>:</span></td></tr>\n"; echo "<tr><th>{$strSummary}<br /><span class='required'>{$strRequired}\n"; echo "</span><br />"; echo "<input type='checkbox' name='incsummary' onclick=\"if (this.checked) {document.closeform.summary.disabled = false; "; echo "document.closeform.summary.style.display='';} else { saveValue=document.closeform.summary.value; "; echo "document.closeform.summary.disabled = true; document.closeform.summary.style.display='none';}\" checked='checked' disabled='disabled' /></th>"; echo "<td>{$strSummaryOfProblem}<br />\n"; echo "<textarea class='required' id='summary' name='summary' cols='40' rows='8' onfocus=\"if (this.enabled) { this.value = saveValue; "; echo "setTimeout('document.articlform.summary.blur()',1); } else saveValue=this.value;\">"; // style="display: none;" $sql = "SELECT * FROM `{$dbUpdates}` WHERE incidentid='{$id}' AND type='probdef' ORDER BY timestamp ASC"; $result = mysql_query($sql);
function template_print_blocks($position = 'left', $type = 'default') { global $txt, $boardurl, $context, $adkFolder; echo ' <span class="clear upperframe"> <span> </span> </span> <div class="roundframe"> <div> <img alt="" class="adk_vertical_align" src="' . $adkFolder['images'] . '/drive_key.png" /> <strong>', $txt['adkblock_' . $position], '</strong> <hr /> <table style="width: 100%;">'; $posicionDelVector = 0; if (!empty($context['blocks_admin'][$position])) { foreach ($context['blocks_admin'][$position] as $id_block => $block) { echo ' <tr > <td style="width: 20px;" align="center"> ', !empty($block['img']) ? '<img src="' . $adkFolder['images'] . '/blocks/' . $block['img'] . '" alt="" align="top" />' : '', ' </td> <td> <span title="(', $block['type'] == 'include' ? $txt['adkblock_include'] : $block['type'], ')">', $block['name'], '</span> </td> <td style="width: 5%;" align="center"> <input type="text" size="2" name="orden_' . $position . '[' . $posicionDelVector . ']" value="' . $block['orden'] . '" style="text-align: center;" /> <input type="hidden" name="id_' . $position . '[' . $posicionDelVector . ']" value="', $id_block, '" /> </td> <td style="width: 5%;" align="center"> <select name="columna_' . $position . '[' . $posicionDelVector . ']"> <option value="1"', $position == 'left' ? ' selected="selected"' : '', '>' . $txt['adkblock_left'] . '</option> ', $context['type'] == 'default' ? '<option value="2"' . ($position == 'center' ? ' selected="selected"' : '') . '>' . $txt['adkblock_center'] . '</option>' : '', ' <option value="3"', $position == 'right' ? ' selected="selected"' : '', '>' . $txt['adkblock_right'] . '</option> <option value="4"', $position == 'top' ? ' selected="selected"' : '', '>' . $txt['adkblock_top'] . '</option> <option value="5"', $position == 'bottom' ? ' selected="selected"' : '', '>' . $txt['adkblock_bottom'] . '</option> <option value="6"', $position == 'admin' ? ' selected="selected"' : '', '>' . $txt['adkblock_none'] . '</option> </select> </td> </tr>'; $posicionDelVector++; } } else { echo '<tr><td class="smalltext" align="center">', $type != 'default' ? help_link('adkblock_only_portal', 'adkhelp_only_portal') : $txt['adkblock_no_blocks'], '</td></tr>'; } echo ' </table> </div> </div> <span class="clear lowerframe"> <span> </span> </span>'; }
$form_data = array('upgrade_from' => $installed_version, 'upgrade_to' => $product_version); } if (array_var($form_data, 'upgrade_from') == 'unknown') { $form_data['upgrade_from'] = '1.1'; } $scripts = $upgrader->getScriptsSince($installed_version); if (count($scripts) > 0) { ?> <form class="internalForm" action="index.php" id="upgraderForm" method="post"> <div id="upgraderControls"> <div class="warning"> <strong><?php echo lang('upgrade warning'); ?> :</strong> <?php echo lang('upgrade warning desc', help_link()); ?> </div> <table class="formBlock"> <tr> <th colspan="2"><?php echo lang('upgrade'); ?> </th> </tr> <?php if ($installed_version == "unknown") { ?> <tr> <td class="optionLabel"><label for="upgradeFormFrom"><?php echo lang('upgrade from');
<td>', WT_I18N::translate('Admin comments on user'), '</td> <td colspan="3"><textarea style="width:95%;" rows="5" name="new_comment" value="', WT_Filter::escapeHtml($new_comment), '"></textarea></td> </tr>'; } echo '<tr> <th colspan="4">', WT_I18N::translate('Family tree access and settings'), '</th> </tr> <tr> <td colspan="4"> <table id="adduser2"> <tr> <th>', WT_I18N::translate('Family tree'), '</th> <th>', WT_I18N::translate('Default individual'), help_link('default_individual'), '</th> <th>', WT_I18N::translate('Individual record'), help_link('useradmin_gedcomid'), '</th> <th>', WT_I18N::translate('Role'), help_link('role'), '</th> <th>', WT_I18N::translate('Restrict to immediate family'), help_link('RELATIONSHIP_PATH_LENGTH'), '</th> </tr>'; foreach (WT_Tree::getAll() as $tree) { echo '<tr>', '<td>', $tree->tree_title_html, '</td>', '<td>'; $varname = 'rootid' . $tree->tree_id; echo '<input data-autocomplete-type="INDI" data-autocomplete-ged="' . $tree->tree_name_html . '" type="text" size="12" name="', $varname, '" id="', $varname, '" value="', WT_Filter::escapeHtml(WT_Filter::post('rootid' . $tree->tree_id, WT_REGEX_XREF)), '"> ', print_findindi_link($varname, '', $tree->tree_name), '</td>', '<td>'; $varname = 'gedcomid' . $tree->tree_id; echo '<input data-autocomplete-type="INDI" data-autocomplete-ged="' . $tree->tree_name_html . '" type="text" size="12" name="', $varname, '" id="', $varname, '" value="', WT_Filter::escapeHtml(WT_Filter::post('gedcomid' . $tree->tree_id, WT_REGEX_XREF)), '"> ', print_findindi_link($varname, '', $tree->tree_name), '</td>', '<td>'; $varname = 'canedit' . $tree->tree_id; echo '<select name="', $varname, '">'; foreach ($ALL_EDIT_OPTIONS as $EDIT_OPTION => $desc) { echo '<option value="', $EDIT_OPTION, '" '; if ($EDIT_OPTION == WT_I18N::translate('None')) { echo 'selected="selected" '; } echo '>', $desc, '</option>';
public function getBlock($block_id, $template = true, $cfg = null) { global $ctype, $WEBTREES_EMAIL; $changes = WT_DB::prepare("SELECT 1" . " FROM `##change`" . " WHERE status='pending'" . " LIMIT 1")->fetchOne(); $days = get_block_setting($block_id, 'days', 1); $sendmail = get_block_setting($block_id, 'sendmail', true); $block = get_block_setting($block_id, 'block', true); if ($cfg) { foreach (array('days', 'sendmail', 'block') as $name) { if (array_key_exists($name, $cfg)) { ${$name} = $cfg[$name]; } } } if ($changes && $sendmail == 'yes') { // There are pending changes - tell moderators/managers/administrators about them. if (WT_TIMESTAMP - WT_Site::getPreference('LAST_CHANGE_EMAIL') > 60 * 60 * 24 * $days) { // Which users have pending changes? foreach (User::all() as $user) { if ($user->getSetting('contactmethod') !== 'none') { foreach (WT_Tree::getAll() as $tree) { if (exists_pending_change($user, $tree)) { WT_I18N::init($user->getSetting('language')); WT_Mail::systemMessage($tree, $user, WT_I18N::translate('Pending changes'), WT_I18N::translate('There are pending changes for you to moderate.') . WT_Mail::EOL . WT_MAIL::EOL . '<a href="' . WT_SERVER_NAME . WT_SCRIPT_PATH . 'index.php?ged=' . WT_GEDURL . '">' . WT_SERVER_NAME . WT_SCRIPT_PATH . 'index.php?ged=' . WT_GEDURL . '</a>'); WT_I18N::init(WT_LOCALE); } } } } WT_Site::setPreference('LAST_CHANGE_EMAIL', WT_TIMESTAMP); } if (WT_USER_CAN_EDIT) { $id = $this->getName() . $block_id; $class = $this->getName() . '_block'; if ($ctype == 'gedcom' && WT_USER_GEDCOM_ADMIN || $ctype == 'user' && WT_USER_ID) { $title = '<i class="icon-admin" title="' . WT_I18N::translate('Configure') . '" onclick="modalDialog(\'block_edit.php?block_id=' . $block_id . '\', \'' . $this->getTitle() . '\');"></i>'; } else { $title = ''; } $title .= $this->getTitle() . help_link('review_changes', $this->getName()); $content = ''; if (WT_USER_CAN_ACCEPT) { $content .= "<a href=\"#\" onclick=\"window.open('edit_changes.php','_blank', chan_window_specs); return false;\">" . WT_I18N::translate('There are pending changes for you to moderate.') . "</a><br>"; } if ($sendmail == "yes") { $content .= WT_I18N::translate('Last email reminder was sent ') . format_timestamp(WT_Site::getPreference('LAST_CHANGE_EMAIL')) . "<br>"; $content .= WT_I18N::translate('Next email reminder will be sent after ') . format_timestamp(WT_Site::getPreference('LAST_CHANGE_EMAIL') + 60 * 60 * 24 * $days) . "<br><br>"; } $changes = WT_DB::prepare("SELECT xref" . " FROM `##change`" . " WHERE status='pending'" . " AND gedcom_id=?" . " GROUP BY xref")->execute(array(WT_GED_ID))->fetchAll(); foreach ($changes as $change) { $record = WT_GedcomRecord::getInstance($change->xref); if ($record->canShow()) { $content .= '<b>' . $record->getFullName() . '</b>'; $content .= $block ? '<br>' : ' '; $content .= '<a href="' . $record->getHtmlUrl() . '">' . WT_I18N::translate('View the changes') . '</a>'; $content .= '<br>'; } } if ($template) { if ($block) { require WT_THEME_DIR . 'templates/block_small_temp.php'; } else { require WT_THEME_DIR . 'templates/block_main_temp.php'; } } else { return $content; } } } }