summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--calendar.php2
-rw-r--r--includes/functions/functions.php10
-rw-r--r--includes/functions/functions_charts.php12
-rw-r--r--includes/session.php6
-rw-r--r--library/WT/Controller/Pedigree.php6
-rw-r--r--login.php2
6 files changed, 21 insertions, 17 deletions
diff --git a/calendar.php b/calendar.php
index a06fa1d201..1fa3a5c69e 100644
--- a/calendar.php
+++ b/calendar.php
@@ -336,7 +336,7 @@ echo '<tr><td class="topbottombar width50">';
if ($view === 'day') {
echo '<span class="error">', WT_I18N::translate('View day'), '</span>';
} else {
- echo '<a href="cal=', $cal. '&amp;day=', $cal_date->d, '&amp;month=', $cal_month, '&amp;year=', $cal_date->y, '&amp;filterev=', $filterev, '&amp;filterof=', $filterof, '&amp;filtersx=', $filtersx, '&amp;view=day">', WT_I18N::translate('View day'), '</a>';
+ echo '<a href="cal=', $cal, '&amp;day=', $cal_date->d, '&amp;month=', $cal_month, '&amp;year=', $cal_date->y, '&amp;filterev=', $filterev, '&amp;filterof=', $filterof, '&amp;filtersx=', $filtersx, '&amp;view=day">', WT_I18N::translate('View day'), '</a>';
}
if ($view === 'calendar') {
echo ' | <span class="error">', WT_I18N::translate('View month'), '</span>';
diff --git a/includes/functions/functions.php b/includes/functions/functions.php
index 8302743dd9..85a242c6f2 100644
--- a/includes/functions/functions.php
+++ b/includes/functions/functions.php
@@ -160,12 +160,12 @@ function load_gedcom_settings($ged_id) {
foreach ($rows as $row) {
if ($row->xref !== null) {
if ($row->tag_type !== null) {
- $person_facts[$row->xref][$row->tag_type] = (int)$row->resn;
+ $person_facts[$row->xref][$row->tag_type] = (int) $row->resn;
} else {
- $person_privacy[$row->xref] = (int)$row->resn;
+ $person_privacy[$row->xref] = (int) $row->resn;
}
} else {
- $global_facts[$row->tag_type] = (int)$row->resn;
+ $global_facts[$row->tag_type] = (int) $row->resn;
}
}
}
@@ -2222,8 +2222,8 @@ function get_relationship_name_from_path($path, WT_Individual $person1 = null, W
$descent = $match[2];
$up = strlen($ascent) / 3;
$down = strlen($descent) / 3;
- $cousin = min($up, $down); // Moved out of switch (en/default case) so that
- $removed = abs($down - $up); // Spanish (and other languages) can use it, too.
+ $cousin = min($up, $down); // Moved out of switch (en/default case) so that
+ $removed = abs($down - $up); // Spanish (and other languages) can use it, too.
// Different languages have different rules for naming cousins. For example,
// an English “second cousin once removed” is a Polish “cousin of 7th degree”.
diff --git a/includes/functions/functions_charts.php b/includes/functions/functions_charts.php
index 982b40205b..3abfa3be9c 100644
--- a/includes/functions/functions_charts.php
+++ b/includes/functions/functions_charts.php
@@ -126,7 +126,7 @@ function print_family_parents(WT_Family $family, $sosa = 0, $label = '', $parid
print_pedigree_person(WT_Individual::getInstance($hfam->getHusband()->getXref()));
echo "</td></tr></table>";
} elseif ($hfam && !$hfam->getHusband()) {
- // here for empty box for grandfather
+ // Empty box for grandfather
echo "<table style=\"width: " . ($pbwidth) . "px; height: " . $pbheight . "px;\" border=\"0\"><tr>";
echo '<td valign="top">';
print_pedigree_person($hfam->getHusband());
@@ -149,7 +149,8 @@ function print_family_parents(WT_Family $family, $sosa = 0, $label = '', $parid
echo '<td valign="top">';
print_pedigree_person(WT_Individual::getInstance($hfam->getWife()->getXref()));
echo '</td></tr></table>';
- } elseif ($hfam && !$hfam->getWife()) { // here for empty box for grandmother
+ } elseif ($hfam && !$hfam->getWife()) {
+ // Empty box for grandmother
echo "<table style=\"width: " . ($pbwidth) . "px; height: " . $pbheight . "px;\" border=\"0\"><tr>";
echo '<td valign="top">';
print_pedigree_person($hfam->getWife());
@@ -207,7 +208,7 @@ function print_family_parents(WT_Family $family, $sosa = 0, $label = '', $parid
print_pedigree_person(WT_Individual::getInstance($hfam->getHusband()->getXref()));
echo "</td></tr></table>";
} elseif ($hfam && !$hfam->getHusband()) {
- // here for empty box for grandfather
+ // Empty box for grandfather
echo "<table style=\"width: " . ($pbwidth) . "px; height: " . $pbheight . "px;\" border=\"0\"><tr>";
echo '<td valign="top">';
print_pedigree_person($hfam->getHusband());
@@ -220,7 +221,7 @@ function print_family_parents(WT_Family $family, $sosa = 0, $label = '', $parid
print_url_arrow(($sosa == 0 ? '?famid=' . $hfam->getXref() . '&amp;ged=' . WT_GEDURL : '#' . $hfam->getXref()), $hfam->getXref(), 1);
echo '</td>';
}
- if ($hfam) { // remove the|| test for $sosa
+ if ($hfam) {
// wife’s mother
echo "</tr><tr><td><img src=\"" . Theme::theme()->parameter('image-hline') . "\" alt=\"\"></td><td>";
if ($hfam && $hfam->getWife()) {
@@ -230,7 +231,8 @@ function print_family_parents(WT_Family $family, $sosa = 0, $label = '', $parid
echo "<td valign=\"top\">";
print_pedigree_person(WT_Individual::getInstance($hfam->getWife()->getXref()));
echo "</td></tr></table>";
- } elseif ($hfam && !$hfam->getWife()) { // here for empty box for grandmother
+ } elseif ($hfam && !$hfam->getWife()) {
+ // Empty box for grandmother
echo "<table style=\"width: " . ($pbwidth) . "px; height: " . $pbheight . "px;\" border=\"0\"><tr>";
echo '<td valign="top">';
print_pedigree_person($hfam->getWife());
diff --git a/includes/session.php b/includes/session.php
index 433a9c4bcd..7ca4df308d 100644
--- a/includes/session.php
+++ b/includes/session.php
@@ -124,10 +124,10 @@ define('WT_EVENTS_DIV', 'DIV|ANUL|_SEPR');
define('WT_EOL', "\r\n");
// Gedcom specification/definitions
-define ('WT_GEDCOM_LINE_LENGTH', 255 - strlen(WT_EOL)); // Characters, not bytes
+define('WT_GEDCOM_LINE_LENGTH', 255 - strlen(WT_EOL)); // Characters, not bytes
// Used in Google charts
-define ('WT_GOOGLE_CHART_ENCODING', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-.');
+define('WT_GOOGLE_CHART_ENCODING', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-.');
// Privacy constants
define('WT_PRIV_PUBLIC', 2); // Allows visitors to view the marked information
@@ -136,7 +136,7 @@ define('WT_PRIV_NONE', 0); // Allows managers to access the marked informatio
define('WT_PRIV_HIDE', -1); // Hide the item to all users
// For performance, it is quicker to refer to files using absolute paths
-define ('WT_ROOT', realpath(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR);
+define('WT_ROOT', realpath(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR);
// Keep track of time statistics, for the summary in the footer
$start_time = microtime(true);
diff --git a/library/WT/Controller/Pedigree.php b/library/WT/Controller/Pedigree.php
index bb472fa15a..e8b2a79a2b 100644
--- a/library/WT/Controller/Pedigree.php
+++ b/library/WT/Controller/Pedigree.php
@@ -63,8 +63,10 @@ class WT_Controller_Pedigree extends WT_Controller_Chart {
$this->box_width = WT_Filter::getInteger('box_width', 50, 300, 100);
$this->PEDIGREE_GENERATIONS = WT_Filter::getInteger('PEDIGREE_GENERATIONS', 2, $MAX_PEDIGREE_GENERATIONS, $DEFAULT_PEDIGREE_GENERATIONS);
- if ($this->talloffset == 1) $this->talloffset = 1; // Make SURE this is an integer
- if ($this->talloffset > 1 && $this->PEDIGREE_GENERATIONS > 8) $this->PEDIGREE_GENERATIONS = 8;
+ // With more than 8 generations, we run out of pixels on the <canvas>
+ if ($this->PEDIGREE_GENERATIONS > 8) {
+ $this->PEDIGREE_GENERATIONS = 8;
+ }
// TODO: some library functions expect this as a global.
// Passing a function parameter would be much better.
diff --git a/login.php b/login.php
index df53e87577..e5d5a9ef09 100644
--- a/login.php
+++ b/login.php
@@ -57,7 +57,7 @@ $timediff = WT_Filter::postInteger('timediff', -43200, 50400, 0); // Same
if (!$action) $action = WT_Filter::get('action');
if (!$user_name) $user_name = WT_Filter::get('user_name', WT_REGEX_USERNAME);
if (!$user_hashcode) $user_hashcode = WT_Filter::get('user_hashcode');
-if (!$url) $url = WT_Filter::get('url'); // Not actually a URL - just a path
+if (!$url) $url = WT_Filter::get('url');
$message = '';