本文整理汇总了PHP中WT_I18N::plural方法的典型用法代码示例。如果您正苦于以下问题:PHP WT_I18N::plural方法的具体用法?PHP WT_I18N::plural怎么用?PHP WT_I18N::plural使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WT_I18N
的用法示例。
在下文中一共展示了WT_I18N::plural方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ageDifference
static function ageDifference(WT_Date $prev, WT_Date $next, $child_number = 0)
{
if ($prev->isOK() && $next->isOK()) {
$days = $next->MaxJD() - $prev->MinJD();
if ($days < 0) {
// Show warning triangle if dates in reverse order
$diff = '<i class="icon-warning"></i> ';
} elseif ($child_number > 1 && $days > 1 && $days < 240) {
// Show warning triangle if children born too close together
$diff = '<i class="icon-warning"></i> ';
} else {
$diff = '';
}
$months = round($days * 12 / 365.25);
// Approximate - we do not know the calendar
if (abs($months) == 12 || abs($months) >= 24) {
$diff .= WT_I18N::plural('%d year', '%d years', round($months / 12), round($months / 12));
} elseif ($months != 0) {
$diff .= WT_I18N::plural('%d month', '%d months', $months, $months);
}
return '<div class="elderdate age">' . $diff . '</div>';
} else {
return '';
}
}
示例2: get_age_at_event
function get_age_at_event($age_string, $show_years)
{
switch (strtoupper($age_string)) {
case 'CHILD':
return WT_I18N::translate('Child');
case 'INFANT':
return WT_I18N::translate('Infant');
case 'STILLBORN':
return WT_I18N::translate('Stillborn');
default:
return preg_replace_callback(array('/(\\d+)([ymwd])/'), function ($match) use($age_string, $show_years) {
switch (WT_LOCALE) {
case 'pl':
$show_years = true;
}
switch ($match[2]) {
case 'y':
if ($show_years || preg_match('/[dm]/', $age_string)) {
return WT_I18N::plural('%s year', '%s years', $match[1], WT_I18N::digits($match[1]));
} else {
return WT_I18N::digits($match[1]);
}
case 'm':
return WT_I18N::plural('%s month', '%s months', $match[1], WT_I18N::digits($match[1]));
case 'w':
return WT_I18N::plural('%s week', '%s weeks', $match[1], WT_I18N::digits($match[1]));
case 'd':
return WT_I18N::plural('%s day', '%s days', $match[1], WT_I18N::digits($match[1]));
}
}, $age_string);
}
}
示例3: pedigreeMap
//.........这里部分代码省略.........
if ($name == WT_I18N::translate('Private')) {
$priv++;
}
$place = $person->getBirthPlace();
if (empty($place)) {
$latlongval[$i] = null;
} else {
$latlongval[$i] = $this->getLatitudeAndLongitudeFromPlaceLocation($person->getBirthPlace());
}
if ($latlongval[$i]) {
$lat[$i] = str_replace(array('N', 'S', ','), array('', '-', '.'), $latlongval[$i]->pl_lati);
$lon[$i] = str_replace(array('E', 'W', ','), array('', '-', '.'), $latlongval[$i]->pl_long);
if ($lat[$i] != null && $lon[$i] != null) {
$count++;
} else {
// The place is in the table but has empty values
if ($name) {
if ($missing) {
$missing .= ', ';
}
$missing .= '<a href="' . $person->getHtmlUrl() . '">' . $name . '</a>';
$miscount++;
}
}
} else {
// There was no place, or not listed in the map table
if ($name) {
if ($missing) {
$missing .= ', ';
}
$missing .= '<a href="' . $person->getHtmlUrl() . '">' . $name . '</a>';
$miscount++;
}
}
}
}
//<!-- end of count records by type -->
//<!-- start of map display -->
echo '<div id="pedigreemap_chart">';
echo '<table class="tabs_table" cellspacing="0" cellpadding="0" border="0" width="100%">';
echo '<tr>';
echo '<td valign="top">';
echo '<div id="pm_map" style="border: 1px solid gray; height: ', $this->getSetting('GM_YSIZE'), 'px; font-size: 0.9em;';
echo '"><i class="icon-loading-large"></i></div>';
if (Auth::isAdmin()) {
echo '<table width="100%">';
echo '<tr><td align="left">';
echo '<a href="module.php?mod=googlemap&mod_action=admin_config">', WT_I18N::translate('Google Maps™ preferences'), '</a>';
echo '</td>';
echo '<td align="center">';
echo '<a href="module.php?mod=googlemap&mod_action=admin_places">', WT_I18N::translate('Geographic data'), '</a>';
echo '</td>';
echo '<td align="right">';
echo '<a href="module.php?mod=googlemap&mod_action=admin_placecheck">', WT_I18N::translate('Place check'), '</a>';
echo '</td></tr>';
echo '</table>';
}
echo '</td><td width="15px"> </td>';
echo '<td width="310px" valign="top">';
echo '<div id="side_bar" style="width:300px; font-size:0.9em; overflow:auto; overflow-x:hidden; overflow-y:auto; height:', $this->getSetting('GM_YSIZE'), 'px;"></div></td>';
echo '</tr>';
echo '</table>';
// display info under map
echo '<hr>';
echo '<table cellspacing="0" cellpadding="0" border="0" width="100%">';
echo '<tr>';
echo '<td valign="top">';
// print summary statistics
if (isset($curgen)) {
$total = pow(2, $curgen) - 1;
echo WT_I18N::plural('%1$d individual displayed, out of the normal total of %2$d, from %3$d generations.', '%1$d individuals displayed, out of the normal total of %2$d, from %3$d generations.', $count, $count, $total, $curgen), '<br>';
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td valign="top">';
if ($priv) {
echo WT_I18N::plural('%s individual is private.', '%s individuals are private.', $priv, $priv), '<br>';
}
if ($count + $priv != $total) {
if ($miscount == 0) {
echo WT_I18N::translate('No ancestors in the database.'), "<br>";
} else {
echo WT_I18N::plural('%1$d individual is missing birthplace map coordinates: %2$s.', '%1$d individuals are missing birthplace map coordinates: %2$s.', $miscount, $miscount, $missing), '<br>';
}
}
}
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</div>';
// close #pedigreemap_chart
echo '</div>';
// close #pedigreemap-page
?>
<!-- end of map display -->
<!-- Start of map scripts -->
<?php
echo '<script src="', $this->googleMapsScript(), '"></script>';
$controller->addInlineJavascript($this->pedigreeMapJavascript($hideflags, $hidelines));
}
示例4: unset
unset($xrefs[$old_xref]);
WT_DB::exec("UNLOCK TABLES");
WT_DB::exec("COMMIT");
try {
WT_DB::prepare("UPDATE `##favorite` SET xref = ? WHERE xref = ? AND gedcom_id = ?")->execute(array($new_xref, $old_xref, WT_GED_ID));
} catch (Exception $ex) {
// Perhaps the favorites module was not installed?
}
// How much time do we have left?
if (microtime(true) - $start_time > ini_get('max_execution_time') - 5) {
echo '<p>', WT_I18N::translate('The server’s time limit was reached.'), '</p>';
break;
}
}
if ($xrefs) {
}
} else {
echo '<p>', WT_I18N::translate('In a family tree, each record has an internal reference number (called an “XREF”) such as “F123” or "R14".'), '</p>';
echo '<p>', WT_I18N::translate('You can renumber a family tree so that these reference numbers are unique across all family trees.'), '</p>';
}
echo '<p>', WT_I18N::plural('This family tree has %s record which uses the same “XREF” as another family tree.', 'This family tree has %s records which use the same “XREF” as another family tree.', count($xrefs), count($xrefs)), '</p>';
if ($xrefs) {
// We use GET (not POST) for this update operation - because we want the user to
// be able to press F5 to continue after a timeout.
echo '<form method="GET" action="', WT_SCRIPT_NAME, '">';
echo '<p>', WT_I18N::translate('You can renumber this family tree.');
echo '<input type="submit" name="go" value="', WT_I18N::translate('go'), '"></p>';
echo '<input type="hidden" name="ged" value="', WT_Filter::escapeUrl(WT_GEDCOM), '">';
echo '</form>';
echo '<p>', WT_I18N::translate('Caution! This may take a long time. Be patient.'), '</p>';
}
示例5: getBlock
public function getBlock($block_id, $template = true, $cfg = null)
{
global $ctype, $SURNAME_LIST_STYLE;
require_once WT_ROOT . 'includes/functions/functions_print_lists.php';
$COMMON_NAMES_REMOVE = get_gedcom_setting(WT_GED_ID, 'COMMON_NAMES_REMOVE');
$COMMON_NAMES_THRESHOLD = get_gedcom_setting(WT_GED_ID, 'COMMON_NAMES_THRESHOLD');
$num = get_block_setting($block_id, 'num', 10);
$infoStyle = get_block_setting($block_id, 'infoStyle', 'table');
$block = get_block_setting($block_id, 'block', false);
if ($cfg) {
foreach (array('num', 'infoStyle', 'block') as $name) {
if (array_key_exists($name, $cfg)) {
${$name} = $cfg[$name];
}
}
}
// This next function is a bit out of date, and doesn't cope well with surname variants
$top_surnames = get_top_surnames(WT_GED_ID, $COMMON_NAMES_THRESHOLD, $num);
// Remove names found in the "Remove Names" list
if ($COMMON_NAMES_REMOVE) {
foreach (preg_split("/[,; ]+/", $COMMON_NAMES_REMOVE) as $delname) {
unset($top_surnames[$delname]);
unset($top_surnames[WT_I18N::strtoupper($delname)]);
}
}
$all_surnames = array();
$i = 0;
foreach (array_keys($top_surnames) as $top_surname) {
$all_surnames = array_merge($all_surnames, WT_Query_Name::surnames($top_surname, '', false, false, WT_GED_ID));
if (++$i == $num) {
break;
}
}
if ($i < $num) {
$num = $i;
}
$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 ($num == 1) {
// I18N: i.e. most popular surname.
$title .= WT_I18N::translate('Top surname');
} else {
// I18N: Title for a list of the most common surnames, %s is a number. Note that a separate translation exists when %s is 1
$title .= WT_I18N::plural('Top %s surname', 'Top %s surnames', $num, WT_I18N::number($num));
}
switch ($infoStyle) {
case 'tagcloud':
uksort($all_surnames, array('WT_I18N', 'strcasecmp'));
$content = format_surname_tagcloud($all_surnames, 'indilist.php', true);
break;
case 'list':
uasort($all_surnames, array('top10_surnames_WT_Module', 'top_surname_sort'));
$content = format_surname_list($all_surnames, '1', true, 'indilist.php');
break;
case 'array':
uasort($all_surnames, array('top10_surnames_WT_Module', 'top_surname_sort'));
$content = format_surname_list($all_surnames, '2', true, 'indilist.php');
break;
case 'table':
default:
uasort($all_surnames, array('top10_surnames_WT_Module', 'top_surname_sort'));
$content = format_surname_table($all_surnames, 'indilist.php');
break;
}
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;
}
}
示例6:
<td>
<input type="submit" name="search" value="<?php
echo WT_I18N::translate('Search');
?>
">
</td>
<td>
<input type="button" value="<?php
echo WT_I18N::translate('Clear chart');
?>
" onclick="window.location='lifespan.php?clear=1';">
</td>
</tr>
</table>
<b><?php
echo WT_I18N::plural('%s individual', '%s individuals', $people, $people);
?>
</b>
</form>
</td>
</tr>
</table>
<div dir="ltr" id="lifespan_chart" class="lifespan_outer">
<div dir="ltr" id="topInner" class="lifespan_timeline" onmousedown="pandiv(); return false;">';
<?php
$controller->PrintTimeline($controller->timelineMinYear, $controller->timelineMaxYear);
?>
</div>
<div id="inner" class="lifespan_people" onmousedown="pandiv(); return false;">
<?php
$maxY = $controller->fillTL($controller->people, $controller->minYear, $controller->YrowLoc);
示例7:
<option value="5" <?php
if (!empty($controller->plusminus[$i]) && $controller->plusminus[$i] == 5) {
echo "selected=\"selected\"";
}
?>
><?php
echo WT_I18N::plural('±%d year', '±%d years', 5, 5);
?>
</option>
<option value="10" <?php
if (!empty($controller->plusminus[$i]) && $controller->plusminus[$i] == 10) {
echo "selected=\"selected\"";
}
?>
><?php
echo WT_I18N::plural('±%d year', '±%d years', 10, 10);
?>
</option>
</select>
<?php
}
?>
</td>
<?php
//-- relative fields
if ($i == 0 && $fct > 4) {
$j = $fct;
// Get the current options for Father’s and Mother’s name searches
$fatherGivnOption = 'SDX';
$fatherSurnOption = 'SDX';
$motherGivnOption = 'SDX';
示例8: print_events_list
/**
* print a list of events
*
* This performs the same function as print_events_table(), but formats the output differently.
*/
function print_events_list($startjd, $endjd, $events = 'BIRT MARR DEAT', $only_living = false, $sort_by = 'anniv')
{
// Did we have any output? Did we skip anything?
$output = 0;
$filter = 0;
$filtered_events = array();
$html = '';
foreach (get_events_list($startjd, $endjd, $events) as $fact) {
$record = $fact->getParent();
//-- only living people ?
if ($only_living) {
if ($record instanceof WT_Individual && $record->isDead()) {
$filter++;
continue;
}
if ($record instanceof WT_Family) {
$husb = $record->getHusband();
if (is_null($husb) || $husb->isDead()) {
$filter++;
continue;
}
$wife = $record->getWife();
if (is_null($wife) || $wife->isDead()) {
$filter++;
continue;
}
}
}
$output++;
$filtered_events[] = $fact;
}
// Now we've filtered the list, we can sort by event, if required
switch ($sort_by) {
case 'anniv':
uasort($filtered_events, function ($x, $y) {
return WT_Date::compare($y->getDate(), $x->getDate());
// most recent first
});
break;
case 'alpha':
uasort($filtered_events, function ($x, $y) {
return WT_GedcomRecord::compare($x->getParent(), $y->getParent());
});
break;
}
foreach ($filtered_events as $fact) {
$record = $fact->getParent();
$html .= '<a href="' . $record->getHtmlUrl() . '" class="list_item name2">' . $record->getFullName() . '</a>';
if ($record instanceof WT_Individual) {
$html .= $record->getSexImage();
}
$html .= '<br><div class="indent">';
$html .= $fact->getLabel() . ' — ' . $fact->getDate()->Display(true);
if ($fact->anniv) {
$html .= ' (' . WT_I18N::translate('%s year anniversary', $fact->anniv) . ')';
}
if (!$fact->getPlace()->isEmpty()) {
$html .= ' — <a href="' . $fact->getPlace()->getURL() . '">' . $fact->getPlace()->getFullName() . '</a>';
}
$html .= '</div>';
}
// Print a final summary message about restricted/filtered facts
$summary = '';
if ($endjd == WT_CLIENT_JD) {
// We're dealing with the Today’s Events block
if ($output == 0) {
if ($filter == 0) {
$summary = WT_I18N::translate('No events exist for today.');
} else {
$summary = WT_I18N::translate('No events for living individuals exist for today.');
}
}
} else {
// We're dealing with the Upcoming Events block
if ($output == 0) {
if ($filter == 0) {
if ($endjd == $startjd) {
$summary = WT_I18N::translate('No events exist for tomorrow.');
} else {
// I18N: translation for %s==1 is unused; it is translated separately as “tomorrow”
$summary = WT_I18N::plural('No events exist for the next %s day.', 'No events exist for the next %s days.', $endjd - $startjd + 1, WT_I18N::number($endjd - $startjd + 1));
}
} else {
if ($endjd == $startjd) {
$summary = WT_I18N::translate('No events for living individuals exist for tomorrow.');
} else {
// I18N: translation for %s==1 is unused; it is translated separately as “tomorrow”
$summary = WT_I18N::plural('No events for living people exist for the next %s day.', 'No events for living people exist for the next %s days.', $endjd - $startjd + 1, WT_I18N::number($endjd - $startjd + 1));
}
}
}
}
if ($summary) {
$html .= "<b>" . $summary . "</b>";
}
//.........这里部分代码省略.........
示例9: configureBlock
public function configureBlock($block_id)
{
if (WT_Filter::postBool('save') && WT_Filter::checkCsrf()) {
set_block_setting($block_id, 'days', WT_Filter::postInteger('days', 1, 30, 7));
set_block_setting($block_id, 'filter', WT_Filter::postBool('filter'));
set_block_setting($block_id, 'onlyBDM', WT_Filter::postBool('onlyBDM'));
set_block_setting($block_id, 'infoStyle', WT_Filter::post('infoStyle', 'list|table', 'table'));
set_block_setting($block_id, 'sortStyle', WT_Filter::post('sortStyle', 'alpha|anniv', 'alpha'));
set_block_setting($block_id, 'block', WT_Filter::postBool('block'));
exit;
}
require_once WT_ROOT . 'includes/functions/functions_edit.php';
$days = get_block_setting($block_id, 'days', 7);
echo '<tr><td class="descriptionbox wrap width33">';
echo WT_I18N::translate('Number of days to show');
echo '</td><td class="optionbox">';
echo '<input type="text" name="days" size="2" value="', $days, '">';
echo ' <em>', WT_I18N::plural('maximum %d day', 'maximum %d days', 30, 30), '</em>';
echo '</td></tr>';
$filter = get_block_setting($block_id, 'filter', true);
echo '<tr><td class="descriptionbox wrap width33">';
echo WT_I18N::translate('Show only events of living individuals?');
echo '</td><td class="optionbox">';
echo edit_field_yes_no('filter', $filter);
echo '</td></tr>';
$onlyBDM = get_block_setting($block_id, 'onlyBDM', false);
echo '<tr><td class="descriptionbox wrap width33">';
echo WT_I18N::translate('Show only births, deaths, and marriages?');
echo '</td><td class="optionbox">';
echo edit_field_yes_no('onlyBDM', $onlyBDM);
echo '</td></tr>';
$infoStyle = get_block_setting($block_id, 'infoStyle', 'table');
echo '<tr><td class="descriptionbox wrap width33">';
echo WT_I18N::translate('Presentation style');
echo '</td><td class="optionbox">';
echo select_edit_control('infoStyle', array('list' => WT_I18N::translate('list'), 'table' => WT_I18N::translate('table')), null, $infoStyle, '');
echo '</td></tr>';
$sortStyle = get_block_setting($block_id, 'sortStyle', 'alpha');
echo '<tr><td class="descriptionbox wrap width33">';
echo WT_I18N::translate('Sort order');
echo '</td><td class="optionbox">';
echo select_edit_control('sortStyle', array('alpha' => WT_I18N::translate('sort by name'), 'anniv' => WT_I18N::translate('sort by date')), null, $sortStyle, '');
echo '</td></tr>';
$block = get_block_setting($block_id, 'block', true);
echo '<tr><td class="descriptionbox wrap width33">';
echo WT_I18N::translate('Add a scrollbar when block contents grow');
echo '</td><td class="optionbox">';
echo edit_field_yes_no('block', $block);
echo '</td></tr>';
}
示例10: _usersLoggedIn
static function _usersLoggedIn($type = 'nolist')
{
$content = '';
// List active users
$NumAnonymous = 0;
$loggedusers = array();
foreach (User::allLoggedIn() as $user) {
if (Auth::isAdmin() || $user->getSetting('visibleonline')) {
$loggedusers[] = $user;
} else {
$NumAnonymous++;
}
}
$LoginUsers = count($loggedusers);
if ($LoginUsers == 0 && $NumAnonymous == 0) {
return WT_I18N::translate('No logged-in and no anonymous users');
}
if ($NumAnonymous > 0) {
$content .= '<b>' . WT_I18N::plural('%d anonymous logged-in user', '%d anonymous logged-in users', $NumAnonymous, $NumAnonymous) . '</b>';
}
if ($LoginUsers > 0) {
if ($NumAnonymous) {
if ($type == 'list') {
$content .= "<br><br>";
} else {
$content .= " " . WT_I18N::translate('and') . " ";
}
}
$content .= '<b>' . WT_I18N::plural('%d logged-in user', '%d logged-in users', $LoginUsers, $LoginUsers) . '</b>';
if ($type == 'list') {
$content .= '<ul>';
} else {
$content .= ': ';
}
}
if (Auth::check()) {
foreach ($loggedusers as $user) {
if ($type == 'list') {
$content .= "<li>" . WT_Filter::escapeHtml($user->getRealName()) . ' - ' . WT_Filter::escapeHtml($user->getUserName());
} else {
$content .= WT_Filter::escapeHtml($user->getRealName()) . ' - ' . WT_Filter::escapeHtml($user->getUserName());
}
if (WT_USER_ID != $user->getUserId() && $user->getSetting('contactmethod') != 'none') {
if ($type == 'list') {
$content .= '<br><a class="icon-email" href="#" onclick="return message(\'' . $user->getUserId() . '\', \'\', \'' . WT_Filter::escapeJs(get_query_url()) . '\');" title="' . WT_I18N::translate('Send message') . '"></a>';
} else {
$content .= ' <a class="icon-email" href="#" onclick="return message(\'' . $user->getUserId() . '\', \'\', \'' . WT_Filter::escapeJs(get_query_url()) . '\');" title="' . WT_I18N::translate('Send message') . '"></a>';
}
}
if ($type == 'list') {
$content .= '</li>';
}
}
}
if ($type == 'list') {
$content .= '</ul>';
}
return $content;
}
示例11: help_link
<input type="hidden" name="action" value="register">
<h4>', WT_I18N::translate('All fields must be completed.'), '</h4><hr>
<div>
<label for="user_realname">', WT_I18N::translate('Real name'), help_link('real_name'), '<input type="text" id="user_realname" name="user_realname" required maxlength="64" value="', WT_Filter::escapeHtml($user_realname), '" autofocus>
</label>
</div>
<div>
<label for="user_email">', WT_I18N::translate('Email address'), help_link('email'), '<input type="email" id="user_email" name="user_email" required maxlength="64" value="', WT_Filter::escapeHtml($user_email), '">
</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>
示例12: ini_restore
$text = WT_I18N::translate('You only need to enter a Login URL if you want to redirect to a different site or location when your users login. This is very useful if you need to switch from http to https when your users login. Include the full URL to <i>login.php</i>. For example, https://www.yourserver.com/webtrees/login.php .');
break;
case 'MAX_ALIVE_AGE':
$title = WT_I18N::translate('Age at which to assume an individual is dead');
$text = WT_I18N::translate('If this individual has any events other than death, burial, or cremation more recent than this number of years, he is considered to be “alive”. Children’s birth dates are considered to be such events for this purpose.');
break;
case 'MAX_DESCENDANCY_GENERATIONS':
$title = WT_I18N::translate('Maximum descendancy generations');
$text = WT_I18N::translate('Set the maximum number of generations to display on descendancy charts.');
break;
case 'MAX_EXECUTION_TIME':
// Find the default value for max_execution_time
ini_restore('max_execution_time');
$dflt_cpu = ini_get('max_execution_time');
$title = WT_I18N::translate('PHP time limit');
$text = WT_I18N::plural('By default, your server allows scripts to run for %s second.', 'By default, your server allows scripts to run for %s seconds.', $dflt_cpu, $dflt_cpu) . ' ' . WT_I18N::translate('You can request a higher or lower limit, although the server may ignore this request.') . ' ' . WT_I18N::translate('If you leave this setting empty, the default value will be used.');
break;
case 'MAX_PEDIGREE_GENERATIONS':
$title = WT_I18N::translate('Maximum pedigree generations');
$text = WT_I18N::translate('Set the maximum number of generations to display on pedigree charts.');
break;
case 'MEDIA_DIRECTORY':
$title = WT_I18N::translate('Media folder');
$text = '<p>' . WT_I18N::translate('This folder will be used to store the media files for this family tree.') . '</p><p>' . WT_I18N::translate('If you select a different folder, you must also move any media files from the existing folder to the new one.') . '</p><p>' . WT_I18N::translate('If two family trees use the same media folder, then they will be able to share media files. If they use different media folders, then their media files will be kept separate.') . '</p>';
break;
case 'MEDIA_ID_PREFIX':
$title = WT_I18N::translate('Media ID prefix');
$text = WT_I18N::translate('When a new media record is added online in <b>webtrees</b>, a new ID for that media will be generated automatically. The media ID will have this prefix.');
break;
case 'MEDIA_UPLOAD':
$title = WT_I18N::translate('Who can upload new media files?');
示例13: whoisonline
function whoisonline()
{
$NumAnonymous = 0;
$loggedusers = array();
$content = '';
foreach (User::allLoggedIn() as $user) {
if (Auth::isAdmin() || $user->getSetting('visibleonline')) {
$loggedusers[] = $user;
} else {
$NumAnonymous++;
}
}
$LoginUsers = count($loggedusers);
$content .= '<div class="logged_in_count">';
if ($NumAnonymous) {
$content .= WT_I18N::plural('%d anonymous logged-in user', '%d anonymous logged-in users', $NumAnonymous, $NumAnonymous);
if ($LoginUsers) {
$content .= ' | ';
}
}
if ($LoginUsers) {
$content .= WT_I18N::plural('%d logged-in user', '%d logged-in users', $LoginUsers, $LoginUsers);
}
$content .= '</div>';
$content .= '<div class="logged_in_list">';
if (WT_USER_ID) {
foreach ($loggedusers as $user) {
$content .= '<div class="logged_in_name">';
$content .= WT_Filter::escapeHtml($user->getRealName()) . ' - ' . WT_Filter::escapeHtml($user->getUserName());
if (WT_USER_ID != $user->getUserId() && $user->getSetting('contactmethod') != 'none') {
$content .= ' <a class="icon-email" href="#" onclick="return message(\'' . WT_Filter::escapeJs($user->getUserName()) . '\', \'\', \'' . WT_Filter::escapeJs(get_query_url()) . '\');" title="' . WT_I18N::translate('Send message') . '"></a>';
}
$content .= '</div>';
}
}
$content .= '</div>';
return $content;
}
示例14: generate_fan_chart
//.........这里部分代码省略.........
$ty = round($cy - $mr * -sin($rad));
$imagemap .= "{$tx},{$ty},";
$deg += ($deg2 - $deg1) / 6;
}
// plot lower points
$mr = ($rx - $rw) / 2;
$deg = $deg2;
while ($deg >= $deg1) {
$rad = deg2rad($deg);
$tx = round($cx + $mr * cos($rad));
$ty = round($cy - $mr * -sin($rad));
$imagemap .= "{$tx},{$ty},";
$deg -= ($deg2 - $deg1) / 6;
}
// join first point
$mr = $rx / 2;
$deg = $deg1;
$rad = deg2rad($deg);
$tx = round($cx + $mr * cos($rad));
$ty = round($cy - $mr * -sin($rad));
$imagemap .= "{$tx},{$ty}";
// add action url
$imagemap .= '" href="#' . $pid . '"';
$tempURL = 'fanchart.php?rootid=' . $pid . '&generations=' . $this->generations . '&fan_width=' . $this->fan_width . '&fan_style=' . $this->fan_style . '&ged=' . WT_GEDURL;
$html .= '<div id="' . $pid . '" class="fan_chart_menu">';
$html .= '<div class="person_box"><div class="details1">';
$html .= '<a href="' . $person->getHtmlUrl() . '" class="name1">' . $name;
if ($addname) {
$html .= $addname;
}
$html .= '</a>';
$html .= '<ul class="charts">';
$html .= "<li><a href=\"pedigree.php?rootid={$pid}&amp;ged=" . WT_GEDURL . "\" >" . WT_I18N::translate('Pedigree') . "</a></li>";
if (array_key_exists('googlemap', WT_Module::getActiveModules())) {
$html .= "<li><a href=\"module.php?mod=googlemap&mod_action=pedigree_map&rootid=" . $pid . "&ged=" . WT_GEDURL . "\">" . WT_I18N::translate('Pedigree map') . "</a></li>";
}
if (WT_USER_GEDCOM_ID && WT_USER_GEDCOM_ID != $pid) {
$html .= "<li><a href=\"relationship.php?pid1=" . WT_USER_GEDCOM_ID . "&pid2={$pid}&ged=" . WT_GEDURL . "\">" . WT_I18N::translate('Relationship to me') . "</a></li>";
}
$html .= "<li><a href=\"descendancy.php?rootid={$pid}&ged=" . WT_GEDURL . "\" >" . WT_I18N::translate('Descendants') . "</a></li>";
$html .= "<li><a href=\"ancestry.php?rootid={$pid}&ged=" . WT_GEDURL . "\">" . WT_I18N::translate('Ancestors') . "</a></li>";
$html .= "<li><a href=\"compact.php?rootid={$pid}&ged=" . WT_GEDURL . "\">" . WT_I18N::translate('Compact tree') . "</a></li>";
$html .= "<li><a href=\"" . $tempURL . "\">" . WT_I18N::translate('Fan chart') . "</a></li>";
$html .= "<li><a href=\"hourglass.php?rootid={$pid}&ged=" . WT_GEDURL . "\">" . WT_I18N::translate('Hourglass chart') . "</a></li>";
if (array_key_exists('tree', WT_Module::getActiveModules())) {
$html .= '<li><a href="module.php?mod=tree&mod_action=treeview&ged=' . WT_GEDURL . '&rootid=' . $pid . '">' . WT_I18N::translate('Interactive tree') . '</a></li>';
}
$html .= '</ul>';
// spouse(s) and children
foreach ($person->getSpouseFamilies() as $family) {
$spouse = $family->getSpouse($person);
if ($spouse) {
$html .= '<a href="' . $spouse->getHtmlUrl() . '" class="name1">' . $spouse->getFullName() . '</a>';
$kids = $family->getChildren();
if ($kids) {
$html .= '<ul class="children">';
foreach ($kids as $child) {
$html .= '<li><a href="' . $child->getHtmlUrl() . '" class="name1">' . $child->getFullName() . '</a></li>';
}
$html .= '</ul>';
}
}
}
// siblings
foreach ($person->getChildFamilies() as $family) {
$children = $family->getChildren();
if ($children) {
$html .= '<div class="name1">' . WT_I18N::plural('Sibling', 'Siblings', count($children) - 1) . '</div>';
$html .= '<ul class="siblings">';
foreach ($children as $sibling) {
if ($sibling !== $person) {
$html .= '<li><a href="' . $sibling->getHtmlUrl() . '" class="name1"> ' . $sibling->getFullName() . '</a></li>';
}
}
$html .= '</ul>';
}
}
$html .= '</div></div>';
$html .= '</div>';
$imagemap .= ' alt="' . strip_tags($person->getFullName()) . '" title="' . strip_tags($person->getFullName()) . '">';
}
$deg1 -= $angle;
$deg2 -= $angle;
$sosa--;
}
$rx -= $rw;
$gen--;
}
$imagemap .= '</map>';
switch ($what) {
case 'html':
$image_title = WT_I18N::translate('Fan chart of %s', strip_tags($person->getFullName()));
return $html . $imagemap . '<div id="fan_chart_img"><img src="' . WT_SCRIPT_NAME . '?rootid=' . $this->rootid . '&fan_style=' . $this->fan_style . '&generations=' . $this->generations . '&fan_width=' . $this->fan_width . '&img=1" width="' . $fanw . '" height="' . $fanh . '" alt="' . $image_title . '" title="' . $image_title . '" usemap="#fanmap"></div>';
case 'png':
header('Content-Type: image/png');
ImageStringUp($image, 1, $fanw - 10, $fanh / 3, WT_SERVER_NAME . WT_SCRIPT_PATH, $color);
ImagePng($image);
ImageDestroy($image);
}
}
示例15: define
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
use WT\Auth;
define('WT_SCRIPT_NAME', 'admin_trees_merge.php');
require './includes/session.php';
require WT_ROOT . 'includes/functions/functions_edit.php';
$controller = new WT_Controller_Page();
$controller->restrictAccess(Auth::isManager())->setPageTitle(WT_I18N::translate('Merge family trees'))->pageHeader();
echo '<h2>', $controller->getPageTitle(), '</h2>';
$ged2_id = WT_Filter::post('ged2_id');
if ($ged2_id && $ged2_id != WT_GED_ID) {
// Every XREF used by both trees
$xrefs = WT_DB::prepare("SELECT xref, type FROM (" . " SELECT i_id AS xref, 'INDI' AS type FROM `##individuals` WHERE i_file = ?" . " UNION " . " SELECT f_id AS xref, 'FAM' AS type FROM `##families` WHERE f_file = ?" . " UNION " . " SELECT s_id AS xref, 'SOUR' AS type FROM `##sources` WHERE s_file = ?" . " UNION " . " SELECT m_id AS xref, 'OBJE' AS type FROM `##media` WHERE m_file = ?" . " UNION " . " SELECT o_id AS xref, o_type AS type FROM `##other` WHERE o_file = ? AND o_type NOT IN ('HEAD', 'TRLR')" . ") AS this_tree JOIN (" . " SELECT xref FROM `##change` WHERE gedcom_id = ?" . " UNION " . " SELECT i_id AS xref FROM `##individuals` WHERE i_file = ?" . " UNION " . " SELECT f_id AS xref FROM `##families` WHERE f_file = ?" . " UNION " . " SELECT s_id AS xref FROM `##sources` WHERE s_file = ?" . " UNION " . " SELECT m_id AS xref FROM `##media` WHERE m_file = ?" . " UNION " . " SELECT o_id AS xref FROM `##other` WHERE o_file = ? AND o_type NOT IN ('HEAD', 'TRLR')" . ") AS other_trees USING (xref)")->execute(array(WT_GED_ID, WT_GED_ID, WT_GED_ID, WT_GED_ID, WT_GED_ID, $ged2_id, $ged2_id, $ged2_id, $ged2_id, $ged2_id, $ged2_id))->fetchAssoc();
if ($xrefs) {
echo '<p class="error">', WT_I18N::plural('The two family trees have %1$s record which uses the same “XREF”.', 'The two family trees have %1$s records which uses the same “XREF”.', count($xrefs), count($xrefs)), '</p>', '<p class="error">', WT_I18N::translate('You must renumber the records in one of the trees before you can merge them.'), '</p>';
} else {
WT_DB::exec("START TRANSACTION");
WT_DB::exec("LOCK TABLE" . " `##individuals` WRITE," . " `##individuals` AS individuals2 READ," . " `##families` WRITE," . " `##families` AS families2 READ," . " `##sources` WRITE," . " `##sources` AS sources2 READ," . " `##media` WRITE," . " `##media` AS media2 READ," . " `##other` WRITE," . " `##other` AS other2 READ," . " `##name` WRITE," . " `##name` AS name2 READ," . " `##placelinks` WRITE," . " `##placelinks` AS placelinks2 READ," . " `##change` WRITE," . " `##change` AS change2 READ," . " `##dates` WRITE," . " `##dates` AS dates2 READ," . " `##default_resn` WRITE," . " `##default_resn` AS default_resn2 READ," . " `##hit_counter` WRITE," . " `##hit_counter` AS hit_counter2 READ," . " `##link` WRITE," . " `##link` AS link2 READ");
try {
WT_DB::prepare("INSERT INTO `##individuals` (i_id, i_file, i_rin, i_sex, i_gedcom)" . " SELECT i_id, ?, i_rin, i_sex, i_gedcom FROM `##individuals` AS individuals2 WHERE i_file = ?")->execute(array($ged2_id, WT_GED_ID));
WT_DB::prepare("INSERT INTO `##families` (f_id, f_file, f_husb, f_wife, f_gedcom, f_numchil)" . " SELECT f_id, ?, f_husb, f_wife, f_gedcom, f_numchil FROM `##families` AS families2 WHERE f_file = ?")->execute(array($ged2_id, WT_GED_ID));
WT_DB::prepare("INSERT INTO `##sources` (s_id, s_file, s_name, s_gedcom)" . " SELECT s_id, ?, s_name, s_gedcom FROM `##sources` AS sources2 WHERE s_file = ?")->execute(array($ged2_id, WT_GED_ID));
WT_DB::prepare("INSERT INTO `##media` (m_id, m_ext, m_type, m_titl, m_filename, m_file, m_gedcom)" . " SELECT m_id, m_ext, m_type, m_titl, m_filename, ?, m_gedcom FROM `##media` AS media2 WHERE m_file = ?")->execute(array($ged2_id, WT_GED_ID));
WT_DB::prepare("INSERT INTO `##other` (o_id, o_file, o_type, o_gedcom)" . " SELECT o_id, ?, o_type, o_gedcom FROM `##other` AS other2 WHERE o_file = ? AND o_type NOT IN ('HEAD', 'TRLR')")->execute(array($ged2_id, WT_GED_ID));
WT_DB::prepare("INSERT INTO `##name` (n_file, n_id, n_num, n_type, n_sort, n_full, n_surname, n_surn, n_givn, n_soundex_givn_std, n_soundex_surn_std, n_soundex_givn_dm, n_soundex_surn_dm)" . " SELECT ?, n_id, n_num, n_type, n_sort, n_full, n_surname, n_surn, n_givn, n_soundex_givn_std, n_soundex_surn_std, n_soundex_givn_dm, n_soundex_surn_dm FROM `##name` AS name2 WHERE n_file = ?")->execute(array($ged2_id, WT_GED_ID));
WT_DB::prepare("INSERT INTO `##placelinks` (pl_p_id, pl_gid, pl_file)" . " SELECT pl_p_id, pl_gid, ? FROM `##placelinks` AS placelinks2 WHERE pl_file = ?")->execute(array($ged2_id, WT_GED_ID));
WT_DB::prepare("INSERT INTO `##dates` (d_day, d_month, d_mon, d_year, d_julianday1, d_julianday2, d_fact, d_gid, d_file, d_type)" . " SELECT d_day, d_month, d_mon, d_year, d_julianday1, d_julianday2, d_fact, d_gid, ?, d_type FROM `##dates` AS dates2 WHERE d_file = ?")->execute(array($ged2_id, WT_GED_ID));
WT_DB::prepare("INSERT INTO `##default_resn` (gedcom_id, xref, tag_type, resn, comment, updated)" . " SELECT ?, xref, tag_type, resn, comment, updated FROM `##default_resn` AS default_resn2 WHERE gedcom_id = ?")->execute(array($ged2_id, WT_GED_ID));
WT_DB::prepare("INSERT INTO `##link` (l_file, l_from, l_type, l_to)" . " SELECT ?, l_from, l_type, l_to FROM `##link` AS link2 WHERE l_file = ?")->execute(array($ged2_id, WT_GED_ID));
// This table may contain old (deleted) references, which could clash. IGNORE these.