Test Failed
Branch master (4a3c5b)
by Greg
12:31
created
app/Module/IndividualSidebarModule.php 1 patch
Switch Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -46,13 +46,13 @@  discard block
 block discarded – undo
46 46
 	 */
47 47
 	public function modAction($mod_action) {
48 48
 		switch ($mod_action) {
49
-		case 'ajax':
50
-			header('Content-Type: text/html; charset=UTF-8');
51
-			echo $this->getSidebarAjaxContent();
52
-			break;
53
-		default:
54
-			http_response_code(404);
55
-			break;
49
+			case 'ajax':
50
+				header('Content-Type: text/html; charset=UTF-8');
51
+				echo $this->getSidebarAjaxContent();
52
+				break;
53
+			default:
54
+				http_response_code(404);
55
+				break;
56 56
 		}
57 57
 	}
58 58
 
@@ -150,18 +150,18 @@  discard block
 block discarded – undo
150 150
 		$out = '<form method="post" action="module.php?mod=' . $this->getName() . '&amp;mod_action=ajax" onsubmit="return false;"><input type="search" name="sb_indi_name" id="sb_indi_name" placeholder="' . I18N::translate('Search') . '"><p>';
151 151
 		foreach ($initials as $letter => $count) {
152 152
 			switch ($letter) {
153
-			case '@':
154
-				$html = I18N::translateContext('Unknown surname', '…');
155
-				break;
156
-			case ',':
157
-				$html = I18N::translate('None');
158
-				break;
159
-			case ' ':
160
-				$html = '&nbsp;';
161
-				break;
162
-			default:
163
-				$html = $letter;
164
-				break;
153
+				case '@':
154
+					$html = I18N::translateContext('Unknown surname', '…');
155
+					break;
156
+				case ',':
157
+					$html = I18N::translate('None');
158
+					break;
159
+				case ' ':
160
+					$html = '&nbsp;';
161
+					break;
162
+				default:
163
+					$html = $letter;
164
+					break;
165 165
 			}
166 166
 			$html = '<a href="module.php?mod=' . $this->getName() . '&amp;mod_action=ajax&amp;alpha=' . urlencode($letter) . '" class="sb_indi_letter">' . $html . '</a>';
167 167
 			$out .= $html . ' ';
Please login to merge, or discard this patch.
app/Module/FamiliesSidebarModule.php 1 patch
Switch Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -46,13 +46,13 @@  discard block
 block discarded – undo
46 46
 	 */
47 47
 	public function modAction($mod_action) {
48 48
 		switch ($mod_action) {
49
-		case 'ajax':
50
-			header('Content-Type: text/html; charset=UTF-8');
51
-			echo $this->getSidebarAjaxContent();
52
-			break;
53
-		default:
54
-			http_response_code(404);
55
-			break;
49
+			case 'ajax':
50
+				header('Content-Type: text/html; charset=UTF-8');
51
+				echo $this->getSidebarAjaxContent();
52
+				break;
53
+			default:
54
+				http_response_code(404);
55
+				break;
56 56
 		}
57 57
 	}
58 58
 
@@ -150,18 +150,18 @@  discard block
 block discarded – undo
150 150
 		$out = '<form method="post" action="module.php?mod=' . $this->getName() . '&amp;mod_action=ajax" onsubmit="return false;"><input type="search" name="sb_fam_name" id="sb_fam_name" placeholder="' . I18N::translate('Search') . '"><p>';
151 151
 		foreach ($initials as $letter => $count) {
152 152
 			switch ($letter) {
153
-			case '@':
154
-				$html = I18N::translateContext('Unknown surname', '…');
155
-				break;
156
-			case ',':
157
-				$html = I18N::translate('None');
158
-				break;
159
-			case ' ':
160
-				$html = '&nbsp;';
161
-				break;
162
-			default:
163
-				$html = $letter;
164
-				break;
153
+				case '@':
154
+					$html = I18N::translateContext('Unknown surname', '…');
155
+					break;
156
+				case ',':
157
+					$html = I18N::translate('None');
158
+					break;
159
+				case ' ':
160
+					$html = '&nbsp;';
161
+					break;
162
+				default:
163
+					$html = $letter;
164
+					break;
165 165
 			}
166 166
 			$html = '<a href="module.php?mod=' . $this->getName() . '&amp;mod_action=ajax&amp;alpha=' . urlencode($letter) . '" class="sb_fam_letter">' . $html . '</a>';
167 167
 			$out .= $html . ' ';
Please login to merge, or discard this patch.
app/Module/CensusAssistantModule.php 1 patch
Switch Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -57,28 +57,28 @@
 block discarded – undo
57 57
 		global $WT_TREE;
58 58
 
59 59
 		switch ($mod_action) {
60
-		case 'census-header':
61
-			header('Content-Type: text/html; charset=utf8');
62
-			$census = Filter::get('census');
63
-			echo $this->censusTableHeader(new $census);
64
-			break;
65
-
66
-		case 'census-individual':
67
-			header('Content-Type: text/html; charset=utf8');
68
-			$census     = Filter::get('census');
69
-			$individual = Individual::getInstance(Filter::get('xref'), $WT_TREE);
70
-			$head       = Individual::getInstance(Filter::get('head'), $WT_TREE);
71
-			echo $this->censusTableRow(new $census, $individual, $head);
72
-			break;
73
-
74
-		case 'media_find':
75
-			self::mediaFind();
76
-			break;
77
-		case 'media_query_3a':
78
-			self::mediaQuery();
79
-			break;
80
-		default:
81
-			http_response_code(404);
60
+			case 'census-header':
61
+				header('Content-Type: text/html; charset=utf8');
62
+				$census = Filter::get('census');
63
+				echo $this->censusTableHeader(new $census);
64
+				break;
65
+
66
+			case 'census-individual':
67
+				header('Content-Type: text/html; charset=utf8');
68
+				$census     = Filter::get('census');
69
+				$individual = Individual::getInstance(Filter::get('xref'), $WT_TREE);
70
+				$head       = Individual::getInstance(Filter::get('head'), $WT_TREE);
71
+				echo $this->censusTableRow(new $census, $individual, $head);
72
+				break;
73
+
74
+			case 'media_find':
75
+				self::mediaFind();
76
+				break;
77
+			case 'media_query_3a':
78
+				self::mediaQuery();
79
+				break;
80
+			default:
81
+				http_response_code(404);
82 82
 		}
83 83
 	}
84 84
 
Please login to merge, or discard this patch.
app/Fact.php 1 patch
Switch Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -93,23 +93,23 @@  discard block
 block discarded – undo
93 93
 	public function getTarget() {
94 94
 		$xref = trim($this->getValue(), '@');
95 95
 		switch ($this->tag) {
96
-		case 'FAMC':
97
-		case 'FAMS':
98
-			return Family::getInstance($xref, $this->getParent()->getTree());
99
-		case 'HUSB':
100
-		case 'WIFE':
101
-		case 'CHIL':
102
-			return Individual::getInstance($xref, $this->getParent()->getTree());
103
-		case 'SOUR':
104
-			return Source::getInstance($xref, $this->getParent()->getTree());
105
-		case 'OBJE':
106
-			return Media::getInstance($xref, $this->getParent()->getTree());
107
-		case 'REPO':
108
-			return Repository::getInstance($xref, $this->getParent()->getTree());
109
-		case 'NOTE':
110
-			return Note::getInstance($xref, $this->getParent()->getTree());
111
-		default:
112
-			return GedcomRecord::getInstance($xref, $this->getParent()->getTree());
96
+			case 'FAMC':
97
+			case 'FAMS':
98
+				return Family::getInstance($xref, $this->getParent()->getTree());
99
+			case 'HUSB':
100
+			case 'WIFE':
101
+			case 'CHIL':
102
+				return Individual::getInstance($xref, $this->getParent()->getTree());
103
+			case 'SOUR':
104
+				return Source::getInstance($xref, $this->getParent()->getTree());
105
+			case 'OBJE':
106
+				return Media::getInstance($xref, $this->getParent()->getTree());
107
+			case 'REPO':
108
+				return Repository::getInstance($xref, $this->getParent()->getTree());
109
+			case 'NOTE':
110
+				return Note::getInstance($xref, $this->getParent()->getTree());
111
+			default:
112
+				return GedcomRecord::getInstance($xref, $this->getParent()->getTree());
113 113
 		}
114 114
 	}
115 115
 
@@ -263,15 +263,15 @@  discard block
 block discarded – undo
263 263
 	 */
264 264
 	public function getLabel() {
265 265
 		switch ($this->tag) {
266
-		case 'EVEN':
267
-		case 'FACT':
268
-			if ($this->getAttribute('TYPE') !== '') {
269
-				// Custom FACT/EVEN - with a TYPE
270
-				return I18N::translate(Html::escape($this->getAttribute('TYPE')));
271
-			}
272
-			// no break - drop into next case
273
-		default:
274
-			return GedcomTag::getLabel($this->tag, $this->parent);
266
+			case 'EVEN':
267
+			case 'FACT':
268
+				if ($this->getAttribute('TYPE') !== '') {
269
+					// Custom FACT/EVEN - with a TYPE
270
+					return I18N::translate(Html::escape($this->getAttribute('TYPE')));
271
+				}
272
+				// no break - drop into next case
273
+			default:
274
+				return GedcomTag::getLabel($this->tag, $this->parent);
275 275
 		}
276 276
 	}
277 277
 
Please login to merge, or discard this patch.
app/Stats.php 1 patch
Switch Indentation   +385 added lines, -385 removed lines patch added patch discarded remove patch
@@ -301,22 +301,22 @@  discard block
 block discarded – undo
301 301
 	 */
302 302
 	private function getPercentage($total, $type) {
303 303
 		switch ($type) {
304
-		case 'individual':
305
-			$type = $this->totalIndividualsQuery();
306
-			break;
307
-		case 'family':
308
-			$type = $this->totalFamiliesQuery();
309
-			break;
310
-		case 'source':
311
-			$type = $this->totalSourcesQuery();
312
-			break;
313
-		case 'note':
314
-			$type = $this->totalNotesQuery();
315
-			break;
316
-		case 'all':
317
-		default:
318
-			$type = $this->totalIndividualsQuery() + $this->totalFamiliesQuery() + $this->totalSourcesQuery();
319
-			break;
304
+			case 'individual':
305
+				$type = $this->totalIndividualsQuery();
306
+				break;
307
+			case 'family':
308
+				$type = $this->totalFamiliesQuery();
309
+				break;
310
+			case 'source':
311
+				$type = $this->totalSourcesQuery();
312
+				break;
313
+			case 'note':
314
+				$type = $this->totalNotesQuery();
315
+				break;
316
+			case 'all':
317
+			default:
318
+				$type = $this->totalIndividualsQuery() + $this->totalFamiliesQuery() + $this->totalSourcesQuery();
319
+				break;
320 320
 		}
321 321
 		if ($type == 0) {
322 322
 			return I18N::percentage(0, 1);
@@ -1442,32 +1442,32 @@  discard block
 block discarded – undo
1442 1442
 		$row    = $rows[0];
1443 1443
 		$record = GedcomRecord::getInstance($row['d_gid'], $this->tree);
1444 1444
 		switch ($type) {
1445
-		default:
1446
-		case 'full':
1447
-			if ($record->canShow()) {
1448
-				$result = $record->formatList('span', false, $record->getFullName());
1449
-			} else {
1450
-				$result = I18N::translate('This information is private and cannot be shown.');
1451
-			}
1452
-			break;
1453
-		case 'year':
1454
-			if ($row['d_year'] < 0) {
1455
-				$row['d_year'] = abs($row['d_year']) . ' B.C.';
1456
-			}
1457
-			$date   = new Date($row['d_type'] . ' ' . $row['d_year']);
1458
-			$result = $date->display();
1459
-			break;
1460
-		case 'name':
1461
-			$result = '<a href="' . $record->getHtmlUrl() . '">' . $record->getFullName() . '</a>';
1462
-			break;
1463
-		case 'place':
1464
-			$fact = GedcomRecord::getInstance($row['d_gid'], $this->tree)->getFirstFact($row['d_fact']);
1465
-			if ($fact) {
1466
-				$result = FunctionsPrint::formatFactPlace($fact, true, true, true);
1467
-			} else {
1468
-				$result = I18N::translate('Private');
1469
-			}
1470
-			break;
1445
+			default:
1446
+			case 'full':
1447
+				if ($record->canShow()) {
1448
+					$result = $record->formatList('span', false, $record->getFullName());
1449
+				} else {
1450
+					$result = I18N::translate('This information is private and cannot be shown.');
1451
+				}
1452
+				break;
1453
+			case 'year':
1454
+				if ($row['d_year'] < 0) {
1455
+					$row['d_year'] = abs($row['d_year']) . ' B.C.';
1456
+				}
1457
+				$date   = new Date($row['d_type'] . ' ' . $row['d_year']);
1458
+				$result = $date->display();
1459
+				break;
1460
+			case 'name':
1461
+				$result = '<a href="' . $record->getHtmlUrl() . '">' . $record->getFullName() . '</a>';
1462
+				break;
1463
+			case 'place':
1464
+				$fact = GedcomRecord::getInstance($row['d_gid'], $this->tree)->getFirstFact($row['d_fact']);
1465
+				if ($fact) {
1466
+					$result = FunctionsPrint::formatFactPlace($fact, true, true, true);
1467
+				} else {
1468
+					$result = I18N::translate('Private');
1469
+				}
1470
+				break;
1471 1471
 		}
1472 1472
 
1473 1473
 		return $result;
@@ -1632,96 +1632,96 @@  discard block
 block discarded – undo
1632 1632
 		}
1633 1633
 		I18N::init(WT_LOCALE);
1634 1634
 		switch ($chart_type) {
1635
-		case 'surname_distribution_chart':
1636
-			if ($surname == '') {
1637
-				$surname = $this->getCommonSurname();
1638
-			}
1639
-			$chart_title = I18N::translate('Surname distribution chart') . ': ' . $surname;
1640
-			// Count how many people are events in each country
1641
-			$surn_countries = [];
1642
-			$indis          = QueryName::individuals($this->tree, I18N::strtoupper($surname), '', '', false, false);
1643
-			foreach ($indis as $person) {
1644
-				if (preg_match_all('/^2 PLAC (?:.*, *)*(.*)/m', $person->getGedcom(), $matches)) {
1645
-					// webtrees uses 3 letter country codes and localised country names, but google uses 2 letter codes.
1646
-					foreach ($matches[1] as $country) {
1647
-						if (array_key_exists($country, $country_to_iso3166)) {
1648
-							if (array_key_exists($country_to_iso3166[$country], $surn_countries)) {
1649
-								$surn_countries[$country_to_iso3166[$country]]++;
1650
-							} else {
1651
-								$surn_countries[$country_to_iso3166[$country]] = 1;
1635
+			case 'surname_distribution_chart':
1636
+				if ($surname == '') {
1637
+					$surname = $this->getCommonSurname();
1638
+				}
1639
+				$chart_title = I18N::translate('Surname distribution chart') . ': ' . $surname;
1640
+				// Count how many people are events in each country
1641
+				$surn_countries = [];
1642
+				$indis          = QueryName::individuals($this->tree, I18N::strtoupper($surname), '', '', false, false);
1643
+				foreach ($indis as $person) {
1644
+					if (preg_match_all('/^2 PLAC (?:.*, *)*(.*)/m', $person->getGedcom(), $matches)) {
1645
+						// webtrees uses 3 letter country codes and localised country names, but google uses 2 letter codes.
1646
+						foreach ($matches[1] as $country) {
1647
+							if (array_key_exists($country, $country_to_iso3166)) {
1648
+								if (array_key_exists($country_to_iso3166[$country], $surn_countries)) {
1649
+									$surn_countries[$country_to_iso3166[$country]]++;
1650
+								} else {
1651
+									$surn_countries[$country_to_iso3166[$country]] = 1;
1652
+								}
1652 1653
 							}
1653 1654
 						}
1654 1655
 					}
1655 1656
 				}
1656
-			}
1657
-			break;
1658
-		case 'birth_distribution_chart':
1659
-			$chart_title = I18N::translate('Birth by country');
1660
-			// Count how many people were born in each country
1661
-			$surn_countries = [];
1662
-			$b_countries    = $this->statsPlaces('INDI', 'BIRT', 0, true);
1663
-			foreach ($b_countries as $place => $count) {
1664
-				$country = $place;
1665
-				if (array_key_exists($country, $country_to_iso3166)) {
1666
-					if (!isset($surn_countries[$country_to_iso3166[$country]])) {
1667
-						$surn_countries[$country_to_iso3166[$country]] = $count;
1668
-					} else {
1669
-						$surn_countries[$country_to_iso3166[$country]] += $count;
1657
+				break;
1658
+			case 'birth_distribution_chart':
1659
+				$chart_title = I18N::translate('Birth by country');
1660
+				// Count how many people were born in each country
1661
+				$surn_countries = [];
1662
+				$b_countries    = $this->statsPlaces('INDI', 'BIRT', 0, true);
1663
+				foreach ($b_countries as $place => $count) {
1664
+					$country = $place;
1665
+					if (array_key_exists($country, $country_to_iso3166)) {
1666
+						if (!isset($surn_countries[$country_to_iso3166[$country]])) {
1667
+							$surn_countries[$country_to_iso3166[$country]] = $count;
1668
+						} else {
1669
+							$surn_countries[$country_to_iso3166[$country]] += $count;
1670
+						}
1670 1671
 					}
1671 1672
 				}
1672
-			}
1673
-			break;
1674
-		case 'death_distribution_chart':
1675
-			$chart_title = I18N::translate('Death by country');
1676
-			// Count how many people were death in each country
1677
-			$surn_countries = [];
1678
-			$d_countries    = $this->statsPlaces('INDI', 'DEAT', 0, true);
1679
-			foreach ($d_countries as $place => $count) {
1680
-				$country = $place;
1681
-				if (array_key_exists($country, $country_to_iso3166)) {
1682
-					if (!isset($surn_countries[$country_to_iso3166[$country]])) {
1683
-						$surn_countries[$country_to_iso3166[$country]] = $count;
1684
-					} else {
1685
-						$surn_countries[$country_to_iso3166[$country]] += $count;
1673
+				break;
1674
+			case 'death_distribution_chart':
1675
+				$chart_title = I18N::translate('Death by country');
1676
+				// Count how many people were death in each country
1677
+				$surn_countries = [];
1678
+				$d_countries    = $this->statsPlaces('INDI', 'DEAT', 0, true);
1679
+				foreach ($d_countries as $place => $count) {
1680
+					$country = $place;
1681
+					if (array_key_exists($country, $country_to_iso3166)) {
1682
+						if (!isset($surn_countries[$country_to_iso3166[$country]])) {
1683
+							$surn_countries[$country_to_iso3166[$country]] = $count;
1684
+						} else {
1685
+							$surn_countries[$country_to_iso3166[$country]] += $count;
1686
+						}
1686 1687
 					}
1687 1688
 				}
1688
-			}
1689
-			break;
1690
-		case 'marriage_distribution_chart':
1691
-			$chart_title = I18N::translate('Marriage by country');
1692
-			// Count how many families got marriage in each country
1693
-			$surn_countries = [];
1694
-			$m_countries    = $this->statsPlaces('FAM');
1695
-			// webtrees uses 3 letter country codes and localised country names, but google uses 2 letter codes.
1696
-			foreach ($m_countries as $place) {
1697
-				$country = $place['country'];
1698
-				if (array_key_exists($country, $country_to_iso3166)) {
1699
-					if (!isset($surn_countries[$country_to_iso3166[$country]])) {
1700
-						$surn_countries[$country_to_iso3166[$country]] = $place['tot'];
1701
-					} else {
1702
-						$surn_countries[$country_to_iso3166[$country]] += $place['tot'];
1689
+				break;
1690
+			case 'marriage_distribution_chart':
1691
+				$chart_title = I18N::translate('Marriage by country');
1692
+				// Count how many families got marriage in each country
1693
+				$surn_countries = [];
1694
+				$m_countries    = $this->statsPlaces('FAM');
1695
+				// webtrees uses 3 letter country codes and localised country names, but google uses 2 letter codes.
1696
+				foreach ($m_countries as $place) {
1697
+					$country = $place['country'];
1698
+					if (array_key_exists($country, $country_to_iso3166)) {
1699
+						if (!isset($surn_countries[$country_to_iso3166[$country]])) {
1700
+							$surn_countries[$country_to_iso3166[$country]] = $place['tot'];
1701
+						} else {
1702
+							$surn_countries[$country_to_iso3166[$country]] += $place['tot'];
1703
+						}
1703 1704
 					}
1704 1705
 				}
1705
-			}
1706
-			break;
1707
-		case 'indi_distribution_chart':
1708
-		default:
1709
-			$chart_title = I18N::translate('Individual distribution chart');
1710
-			// Count how many people have events in each country
1711
-			$surn_countries = [];
1712
-			$a_countries    = $this->statsPlaces('INDI');
1713
-			// webtrees uses 3 letter country codes and localised country names, but google uses 2 letter codes.
1714
-			foreach ($a_countries as $place) {
1715
-				$country = $place['country'];
1716
-				if (array_key_exists($country, $country_to_iso3166)) {
1717
-					if (!isset($surn_countries[$country_to_iso3166[$country]])) {
1718
-						$surn_countries[$country_to_iso3166[$country]] = $place['tot'];
1719
-					} else {
1720
-						$surn_countries[$country_to_iso3166[$country]] += $place['tot'];
1706
+				break;
1707
+			case 'indi_distribution_chart':
1708
+			default:
1709
+				$chart_title = I18N::translate('Individual distribution chart');
1710
+				// Count how many people have events in each country
1711
+				$surn_countries = [];
1712
+				$a_countries    = $this->statsPlaces('INDI');
1713
+				// webtrees uses 3 letter country codes and localised country names, but google uses 2 letter codes.
1714
+				foreach ($a_countries as $place) {
1715
+					$country = $place['country'];
1716
+					if (array_key_exists($country, $country_to_iso3166)) {
1717
+						if (!isset($surn_countries[$country_to_iso3166[$country]])) {
1718
+							$surn_countries[$country_to_iso3166[$country]] = $place['tot'];
1719
+						} else {
1720
+							$surn_countries[$country_to_iso3166[$country]] += $place['tot'];
1721
+						}
1721 1722
 					}
1722 1723
 				}
1723
-			}
1724
-			break;
1724
+				break;
1725 1725
 		}
1726 1726
 		$chart_url = 'https://chart.googleapis.com/chart?cht=t&amp;chtm=' . $chart_shows;
1727 1727
 		$chart_url .= '&amp;chco=' . $WT_STATS_CHART_COLOR1 . ',' . $WT_STATS_CHART_COLOR3 . ',' . $WT_STATS_CHART_COLOR2; // country colours
@@ -2260,20 +2260,20 @@  discard block
 block discarded – undo
2260 2260
 		$row    = $rows[0];
2261 2261
 		$person = Individual::getInstance($row['id'], $this->tree);
2262 2262
 		switch ($type) {
2263
-		default:
2264
-		case 'full':
2265
-			if ($person->canShowName()) {
2266
-				$result = $person->formatList('span', false, $person->getFullName());
2267
-			} else {
2268
-				$result = I18N::translate('This information is private and cannot be shown.');
2269
-			}
2270
-			break;
2271
-		case 'age':
2272
-			$result = I18N::number((int) ($row['age'] / 365.25));
2273
-			break;
2274
-		case 'name':
2275
-			$result = '<a href="' . $person->getHtmlUrl() . '">' . $person->getFullName() . '</a>';
2276
-			break;
2263
+			default:
2264
+			case 'full':
2265
+				if ($person->canShowName()) {
2266
+					$result = $person->formatList('span', false, $person->getFullName());
2267
+				} else {
2268
+					$result = I18N::translate('This information is private and cannot be shown.');
2269
+				}
2270
+				break;
2271
+			case 'age':
2272
+				$result = I18N::number((int) ($row['age'] / 365.25));
2273
+				break;
2274
+			case 'name':
2275
+				$result = '<a href="' . $person->getHtmlUrl() . '">' . $person->getFullName() . '</a>';
2276
+				break;
2277 2277
 		}
2278 2278
 
2279 2279
 		return $result;
@@ -2943,36 +2943,36 @@  discard block
 block discarded – undo
2943 2943
 		$row    = $rows[0];
2944 2944
 		$record = GedcomRecord::getInstance($row['id'], $this->tree);
2945 2945
 		switch ($type) {
2946
-		default:
2947
-		case 'full':
2948
-			if ($record->canShow()) {
2949
-				$result = $record->formatList('span', false, $record->getFullName());
2950
-			} else {
2951
-				$result = I18N::translate('This information is private and cannot be shown.');
2952
-			}
2953
-			break;
2954
-		case 'year':
2955
-			$date   = new Date($row['type'] . ' ' . $row['year']);
2956
-			$result = $date->display();
2957
-			break;
2958
-		case 'type':
2959
-			if (isset($eventTypes[$row['fact']])) {
2960
-				$result = $eventTypes[$row['fact']];
2961
-			} else {
2962
-				$result = GedcomTag::getLabel($row['fact']);
2963
-			}
2964
-			break;
2965
-		case 'name':
2966
-			$result = '<a href="' . $record->getHtmlUrl() . '">' . $record->getFullName() . '</a>';
2967
-			break;
2968
-		case 'place':
2969
-			$fact = $record->getFirstFact($row['fact']);
2970
-			if ($fact) {
2971
-				$result = FunctionsPrint::formatFactPlace($fact, true, true, true);
2972
-			} else {
2973
-				$result = I18N::translate('Private');
2974
-			}
2975
-			break;
2946
+			default:
2947
+			case 'full':
2948
+				if ($record->canShow()) {
2949
+					$result = $record->formatList('span', false, $record->getFullName());
2950
+				} else {
2951
+					$result = I18N::translate('This information is private and cannot be shown.');
2952
+				}
2953
+				break;
2954
+			case 'year':
2955
+				$date   = new Date($row['type'] . ' ' . $row['year']);
2956
+				$result = $date->display();
2957
+				break;
2958
+			case 'type':
2959
+				if (isset($eventTypes[$row['fact']])) {
2960
+					$result = $eventTypes[$row['fact']];
2961
+				} else {
2962
+					$result = GedcomTag::getLabel($row['fact']);
2963
+				}
2964
+				break;
2965
+			case 'name':
2966
+				$result = '<a href="' . $record->getHtmlUrl() . '">' . $record->getFullName() . '</a>';
2967
+				break;
2968
+			case 'place':
2969
+				$fact = $record->getFirstFact($row['fact']);
2970
+				if ($fact) {
2971
+					$result = FunctionsPrint::formatFactPlace($fact, true, true, true);
2972
+				} else {
2973
+					$result = I18N::translate('Private');
2974
+				}
2975
+				break;
2976 2976
 		}
2977 2977
 
2978 2978
 		return $result;
@@ -3117,32 +3117,32 @@  discard block
 block discarded – undo
3117 3117
 			$person = Individual::getInstance($row['i_id'], $this->tree);
3118 3118
 		}
3119 3119
 		switch ($type) {
3120
-		default:
3121
-		case 'full':
3122
-			if ($family->canShow()) {
3123
-				$result = $family->formatList('span', false, $person->getFullName());
3124
-			} else {
3125
-				$result = I18N::translate('This information is private and cannot be shown.');
3126
-			}
3127
-			break;
3128
-		case 'name':
3129
-			$result = '<a href="' . $family->getHtmlUrl() . '">' . $person->getFullName() . '</a>';
3130
-			break;
3131
-		case 'age':
3132
-			$age = $row['age'];
3133
-			if ($show_years) {
3134
-				if ((int) ($age / 365.25) > 0) {
3135
-					$age = (int) ($age / 365.25) . 'y';
3136
-				} elseif ((int) ($age / 30.4375) > 0) {
3137
-					$age = (int) ($age / 30.4375) . 'm';
3120
+			default:
3121
+			case 'full':
3122
+				if ($family->canShow()) {
3123
+					$result = $family->formatList('span', false, $person->getFullName());
3138 3124
 				} else {
3139
-					$age = $age . 'd';
3125
+					$result = I18N::translate('This information is private and cannot be shown.');
3140 3126
 				}
3141
-				$result = FunctionsDate::getAgeAtEvent($age);
3142
-			} else {
3143
-				$result = I18N::number((int) ($age / 365.25));
3144
-			}
3145
-			break;
3127
+				break;
3128
+			case 'name':
3129
+				$result = '<a href="' . $family->getHtmlUrl() . '">' . $person->getFullName() . '</a>';
3130
+				break;
3131
+			case 'age':
3132
+				$age = $row['age'];
3133
+				if ($show_years) {
3134
+					if ((int) ($age / 365.25) > 0) {
3135
+						$age = (int) ($age / 365.25) . 'y';
3136
+					} elseif ((int) ($age / 30.4375) > 0) {
3137
+						$age = (int) ($age / 30.4375) . 'm';
3138
+					} else {
3139
+						$age = $age . 'd';
3140
+					}
3141
+					$result = FunctionsDate::getAgeAtEvent($age);
3142
+				} else {
3143
+					$result = I18N::number((int) ($age / 365.25));
3144
+				}
3145
+				break;
3146 3146
 		}
3147 3147
 
3148 3148
 		return $result;
@@ -3415,32 +3415,32 @@  discard block
 block discarded – undo
3415 3415
 			$person = Individual::getInstance($row['id'], $this->tree);
3416 3416
 		}
3417 3417
 		switch ($type) {
3418
-		default:
3419
-		case 'full':
3420
-			if ($person->canShow()) {
3421
-				$result = $person->formatList('span', false, $person->getFullName());
3422
-			} else {
3423
-				$result = I18N::translate('This information is private and cannot be shown.');
3424
-			}
3425
-			break;
3426
-		case 'name':
3427
-			$result = '<a href="' . $person->getHtmlUrl() . '">' . $person->getFullName() . '</a>';
3428
-			break;
3429
-		case 'age':
3430
-			$age = $row['age'];
3431
-			if ($show_years) {
3432
-				if ((int) ($age / 365.25) > 0) {
3433
-					$age = (int) ($age / 365.25) . 'y';
3434
-				} elseif ((int) ($age / 30.4375) > 0) {
3435
-					$age = (int) ($age / 30.4375) . 'm';
3418
+			default:
3419
+			case 'full':
3420
+				if ($person->canShow()) {
3421
+					$result = $person->formatList('span', false, $person->getFullName());
3436 3422
 				} else {
3437
-					$age = $age . 'd';
3423
+					$result = I18N::translate('This information is private and cannot be shown.');
3438 3424
 				}
3439
-				$result = FunctionsDate::getAgeAtEvent($age);
3440
-			} else {
3441
-				$result = (int) ($age / 365.25);
3442
-			}
3443
-			break;
3425
+				break;
3426
+			case 'name':
3427
+				$result = '<a href="' . $person->getHtmlUrl() . '">' . $person->getFullName() . '</a>';
3428
+				break;
3429
+			case 'age':
3430
+				$age = $row['age'];
3431
+				if ($show_years) {
3432
+					if ((int) ($age / 365.25) > 0) {
3433
+						$age = (int) ($age / 365.25) . 'y';
3434
+					} elseif ((int) ($age / 30.4375) > 0) {
3435
+						$age = (int) ($age / 30.4375) . 'm';
3436
+					} else {
3437
+						$age = $age . 'd';
3438
+					}
3439
+					$result = FunctionsDate::getAgeAtEvent($age);
3440
+				} else {
3441
+					$result = (int) ($age / 365.25);
3442
+				}
3443
+				break;
3444 3444
 		}
3445 3445
 
3446 3446
 		return $result;
@@ -4398,20 +4398,20 @@  discard block
 block discarded – undo
4398 4398
 		$row    = $rows[0];
4399 4399
 		$family = Family::getInstance($row['id'], $this->tree);
4400 4400
 		switch ($type) {
4401
-		default:
4402
-		case 'full':
4403
-			if ($family->canShow()) {
4404
-				$result = $family->formatList('span', false, $family->getFullName());
4405
-			} else {
4406
-				$result = I18N::translate('This information is private and cannot be shown.');
4407
-			}
4408
-			break;
4409
-		case 'size':
4410
-			$result = I18N::number($row['tot']);
4411
-			break;
4412
-		case 'name':
4413
-			$result = '<a href="' . $family->getHtmlUrl() . '">' . $family->getFullName() . '</a>';
4414
-			break;
4401
+			default:
4402
+			case 'full':
4403
+				if ($family->canShow()) {
4404
+					$result = $family->formatList('span', false, $family->getFullName());
4405
+				} else {
4406
+					$result = I18N::translate('This information is private and cannot be shown.');
4407
+				}
4408
+				break;
4409
+			case 'size':
4410
+				$result = I18N::number($row['tot']);
4411
+				break;
4412
+			case 'name':
4413
+				$result = '<a href="' . $family->getHtmlUrl() . '">' . $family->getFullName() . '</a>';
4414
+				break;
4415 4415
 		}
4416 4416
 
4417 4417
 		return $result;
@@ -4686,43 +4686,43 @@  discard block
 block discarded – undo
4686 4686
 			foreach ($rows as $values) {
4687 4687
 				$counts[] = round(100 * $values['total'] / $tot, 0);
4688 4688
 				switch ($values['d_month']) {
4689
-				default:
4690
-				case 'JAN':
4691
-					$values['d_month'] = 1;
4692
-					break;
4693
-				case 'FEB':
4694
-					$values['d_month'] = 2;
4695
-					break;
4696
-				case 'MAR':
4697
-					$values['d_month'] = 3;
4698
-					break;
4699
-				case 'APR':
4700
-					$values['d_month'] = 4;
4701
-					break;
4702
-				case 'MAY':
4703
-					$values['d_month'] = 5;
4704
-					break;
4705
-				case 'JUN':
4706
-					$values['d_month'] = 6;
4707
-					break;
4708
-				case 'JUL':
4709
-					$values['d_month'] = 7;
4710
-					break;
4711
-				case 'AUG':
4712
-					$values['d_month'] = 8;
4713
-					break;
4714
-				case 'SEP':
4715
-					$values['d_month'] = 9;
4716
-					break;
4717
-				case 'OCT':
4718
-					$values['d_month'] = 10;
4719
-					break;
4720
-				case 'NOV':
4721
-					$values['d_month'] = 11;
4722
-					break;
4723
-				case 'DEC':
4724
-					$values['d_month'] = 12;
4725
-					break;
4689
+					default:
4690
+					case 'JAN':
4691
+						$values['d_month'] = 1;
4692
+						break;
4693
+					case 'FEB':
4694
+						$values['d_month'] = 2;
4695
+						break;
4696
+					case 'MAR':
4697
+						$values['d_month'] = 3;
4698
+						break;
4699
+					case 'APR':
4700
+						$values['d_month'] = 4;
4701
+						break;
4702
+					case 'MAY':
4703
+						$values['d_month'] = 5;
4704
+						break;
4705
+					case 'JUN':
4706
+						$values['d_month'] = 6;
4707
+						break;
4708
+					case 'JUL':
4709
+						$values['d_month'] = 7;
4710
+						break;
4711
+					case 'AUG':
4712
+						$values['d_month'] = 8;
4713
+						break;
4714
+					case 'SEP':
4715
+						$values['d_month'] = 9;
4716
+						break;
4717
+					case 'OCT':
4718
+						$values['d_month'] = 10;
4719
+						break;
4720
+					case 'NOV':
4721
+						$values['d_month'] = 11;
4722
+						break;
4723
+					case 'DEC':
4724
+						$values['d_month'] = 12;
4725
+						break;
4726 4726
 				}
4727 4727
 				$text .= I18N::translate(ucfirst(strtolower(($values['d_month'])))) . ' - ' . $values['total'] . '|';
4728 4728
 			}
@@ -5309,16 +5309,16 @@  discard block
 block discarded – undo
5309 5309
 		}
5310 5310
 
5311 5311
 		switch ($sorting) {
5312
-		default:
5313
-		case 'alpha':
5314
-			uksort($surname_list, '\Fisharebest\Webtrees\I18N::strcasecmp');
5315
-			break;
5316
-		case 'count':
5317
-			asort($surname_list);
5318
-			break;
5319
-		case 'rcount':
5320
-			arsort($surname_list);
5321
-			break;
5312
+			default:
5313
+			case 'alpha':
5314
+				uksort($surname_list, '\Fisharebest\Webtrees\I18N::strcasecmp');
5315
+				break;
5316
+			case 'count':
5317
+				asort($surname_list);
5318
+				break;
5319
+			case 'rcount':
5320
+				arsort($surname_list);
5321
+				break;
5322 5322
 		}
5323 5323
 
5324 5324
 		// Note that we count/display SPFX SURN, but sort/group under just SURN
@@ -5432,9 +5432,9 @@  discard block
 block discarded – undo
5432 5432
 				}
5433 5433
 			}
5434 5434
 			switch ($SURNAME_TRADITION) {
5435
-			case 'polish':
5436
-				// most common surname should be in male variant (Kowalski, not Kowalska)
5437
-				$top_name = preg_replace(['/ska$/', '/cka$/', '/dzka$/', '/żka$/'], ['ski', 'cki', 'dzki', 'żki'], $top_name);
5435
+				case 'polish':
5436
+					// most common surname should be in male variant (Kowalski, not Kowalska)
5437
+					$top_name = preg_replace(['/ska$/', '/cka$/', '/dzka$/', '/żka$/'], ['ski', 'cki', 'dzki', 'żki'], $top_name);
5438 5438
 			}
5439 5439
 			$per = round(100 * $count_per / $tot_indi, 0);
5440 5440
 			$chd .= $this->arrayToExtendedEncoding([$per]);
@@ -5473,19 +5473,19 @@  discard block
 block discarded – undo
5473 5473
 		}
5474 5474
 
5475 5475
 		switch ($sex) {
5476
-		case 'M':
5477
-			$sex_sql = "i_sex='M'";
5478
-			break;
5479
-		case 'F':
5480
-			$sex_sql = "i_sex='F'";
5481
-			break;
5482
-		case 'U':
5483
-			$sex_sql = "i_sex='U'";
5484
-			break;
5485
-		case 'B':
5486
-		default:
5487
-			$sex_sql = "i_sex<>'U'";
5488
-			break;
5476
+			case 'M':
5477
+				$sex_sql = "i_sex='M'";
5478
+				break;
5479
+			case 'F':
5480
+				$sex_sql = "i_sex='F'";
5481
+				break;
5482
+			case 'U':
5483
+				$sex_sql = "i_sex='U'";
5484
+				break;
5485
+			case 'B':
5486
+			default:
5487
+				$sex_sql = "i_sex<>'U'";
5488
+				break;
5489 5489
 		}
5490 5490
 		$ged_id = $this->tree->getTreeId();
5491 5491
 
@@ -5530,29 +5530,29 @@  discard block
 block discarded – undo
5530 5530
 				$tot = '';
5531 5531
 			}
5532 5532
 			switch ($type) {
5533
-			case 'table':
5534
-				$common[] = '<tr><td>' . $given . '</td><td data-sort="' . $total . '">' . I18N::number($total) . '</td></tr>';
5535
-				break;
5536
-			case 'list':
5537
-				$common[] = '<li><span dir="auto">' . $given . '</span>' . $tot . '</li>';
5538
-				break;
5539
-			case 'nolist':
5540
-				$common[] = '<span dir="auto">' . $given . '</span>' . $tot;
5541
-				break;
5533
+				case 'table':
5534
+					$common[] = '<tr><td>' . $given . '</td><td data-sort="' . $total . '">' . I18N::number($total) . '</td></tr>';
5535
+					break;
5536
+				case 'list':
5537
+					$common[] = '<li><span dir="auto">' . $given . '</span>' . $tot . '</li>';
5538
+					break;
5539
+				case 'nolist':
5540
+					$common[] = '<span dir="auto">' . $given . '</span>' . $tot;
5541
+					break;
5542 5542
 			}
5543 5543
 		}
5544 5544
 		if ($common) {
5545 5545
 			switch ($type) {
5546
-			case 'table':
5547
-				$lookup = ['M' => I18N::translate('Male'), 'F' => I18N::translate('Female'), 'U' => I18N::translateContext('unknown gender', 'Unknown'), 'B' => I18N::translate('All')];
5548
-
5549
-				return '<table ' . Datatables::givenNameTableAttributes() . '><thead><tr><th colspan="3">' . $lookup[$sex] . '</th></tr><tr><th>' . I18N::translate('Name') . '</th><th>' . I18N::translate('Individuals') . '</th></tr></thead><tbody>' . implode('', $common) . '</tbody></table>';
5550
-			case 'list':
5551
-				return '<ul>' . implode('', $common) . '</ul>';
5552
-			case 'nolist':
5553
-				return implode(I18N::$list_separator, $common);
5554
-			default:
5555
-				return '';
5546
+				case 'table':
5547
+					$lookup = ['M' => I18N::translate('Male'), 'F' => I18N::translate('Female'), 'U' => I18N::translateContext('unknown gender', 'Unknown'), 'B' => I18N::translate('All')];
5548
+
5549
+					return '<table ' . Datatables::givenNameTableAttributes() . '><thead><tr><th colspan="3">' . $lookup[$sex] . '</th></tr><tr><th>' . I18N::translate('Name') . '</th><th>' . I18N::translate('Individuals') . '</th></tr></thead><tbody>' . implode('', $common) . '</tbody></table>';
5550
+				case 'list':
5551
+					return '<ul>' . implode('', $common) . '</ul>';
5552
+				case 'nolist':
5553
+					return implode(I18N::$list_separator, $common);
5554
+				default:
5555
+					return '';
5556 5556
 			}
5557 5557
 		} else {
5558 5558
 			return '';
@@ -6038,42 +6038,42 @@  discard block
 block discarded – undo
6038 6038
 		}
6039 6039
 
6040 6040
 		switch ($type) {
6041
-		default:
6042
-		case 'userid':
6043
-			return $user->getUserId();
6044
-		case 'username':
6045
-			return Html::escape($user->getUserName());
6046
-		case 'fullname':
6047
-			return $user->getRealNameHtml();
6048
-		case 'regdate':
6049
-			if (is_array($params) && isset($params[0]) && $params[0] != '') {
6050
-				$datestamp = $params[0];
6051
-			} else {
6052
-				$datestamp = I18N::dateFormat();
6053
-			}
6041
+			default:
6042
+			case 'userid':
6043
+				return $user->getUserId();
6044
+			case 'username':
6045
+				return Html::escape($user->getUserName());
6046
+			case 'fullname':
6047
+				return $user->getRealNameHtml();
6048
+			case 'regdate':
6049
+				if (is_array($params) && isset($params[0]) && $params[0] != '') {
6050
+					$datestamp = $params[0];
6051
+				} else {
6052
+					$datestamp = I18N::dateFormat();
6053
+				}
6054 6054
 
6055
-			return FunctionsDate::timestampToGedcomDate((int) $user->getPreference('reg_timestamp'))->display(false, $datestamp);
6056
-		case 'regtime':
6057
-			if (is_array($params) && isset($params[0]) && $params[0] != '') {
6058
-				$datestamp = $params[0];
6059
-			} else {
6060
-				$datestamp = str_replace('%', '', I18N::timeFormat());
6061
-			}
6055
+				return FunctionsDate::timestampToGedcomDate((int) $user->getPreference('reg_timestamp'))->display(false, $datestamp);
6056
+			case 'regtime':
6057
+				if (is_array($params) && isset($params[0]) && $params[0] != '') {
6058
+					$datestamp = $params[0];
6059
+				} else {
6060
+					$datestamp = str_replace('%', '', I18N::timeFormat());
6061
+				}
6062 6062
 
6063
-			return date($datestamp, (int) $user->getPreference('reg_timestamp'));
6064
-		case 'loggedin':
6065
-			if (is_array($params) && isset($params[0]) && $params[0] != '') {
6066
-				$yes = $params[0];
6067
-			} else {
6068
-				$yes = I18N::translate('yes');
6069
-			}
6070
-			if (is_array($params) && isset($params[1]) && $params[1] != '') {
6071
-				$no = $params[1];
6072
-			} else {
6073
-				$no = I18N::translate('no');
6074
-			}
6063
+				return date($datestamp, (int) $user->getPreference('reg_timestamp'));
6064
+			case 'loggedin':
6065
+				if (is_array($params) && isset($params[0]) && $params[0] != '') {
6066
+					$yes = $params[0];
6067
+				} else {
6068
+					$yes = I18N::translate('yes');
6069
+				}
6070
+				if (is_array($params) && isset($params[1]) && $params[1] != '') {
6071
+					$no = $params[1];
6072
+				} else {
6073
+					$no = I18N::translate('no');
6074
+				}
6075 6075
 
6076
-			return Database::prepare("SELECT SQL_NO_CACHE 1 FROM `##session` WHERE user_id=? LIMIT 1")->execute([$user->getUserId()])->fetchOne() ? $yes : $no;
6076
+				return Database::prepare("SELECT SQL_NO_CACHE 1 FROM `##session` WHERE user_id=? LIMIT 1")->execute([$user->getUserId()])->fetchOne() ? $yes : $no;
6077 6077
 		}
6078 6078
 	}
6079 6079
 
@@ -6890,50 +6890,50 @@  discard block
 block discarded – undo
6890 6890
 		}
6891 6891
 		// The current chart engine (Google charts) can't handle <sup></sup> markup
6892 6892
 		switch ($century) {
6893
-		case 21:
6894
-			return strip_tags(I18N::translateContext('CENTURY', '21st'));
6895
-		case 20:
6896
-			return strip_tags(I18N::translateContext('CENTURY', '20th'));
6897
-		case 19:
6898
-			return strip_tags(I18N::translateContext('CENTURY', '19th'));
6899
-		case 18:
6900
-			return strip_tags(I18N::translateContext('CENTURY', '18th'));
6901
-		case 17:
6902
-			return strip_tags(I18N::translateContext('CENTURY', '17th'));
6903
-		case 16:
6904
-			return strip_tags(I18N::translateContext('CENTURY', '16th'));
6905
-		case 15:
6906
-			return strip_tags(I18N::translateContext('CENTURY', '15th'));
6907
-		case 14:
6908
-			return strip_tags(I18N::translateContext('CENTURY', '14th'));
6909
-		case 13:
6910
-			return strip_tags(I18N::translateContext('CENTURY', '13th'));
6911
-		case 12:
6912
-			return strip_tags(I18N::translateContext('CENTURY', '12th'));
6913
-		case 11:
6914
-			return strip_tags(I18N::translateContext('CENTURY', '11th'));
6915
-		case 10:
6916
-			return strip_tags(I18N::translateContext('CENTURY', '10th'));
6917
-		case  9:
6918
-			return strip_tags(I18N::translateContext('CENTURY', '9th'));
6919
-		case  8:
6920
-			return strip_tags(I18N::translateContext('CENTURY', '8th'));
6921
-		case  7:
6922
-			return strip_tags(I18N::translateContext('CENTURY', '7th'));
6923
-		case  6:
6924
-			return strip_tags(I18N::translateContext('CENTURY', '6th'));
6925
-		case  5:
6926
-			return strip_tags(I18N::translateContext('CENTURY', '5th'));
6927
-		case  4:
6928
-			return strip_tags(I18N::translateContext('CENTURY', '4th'));
6929
-		case  3:
6930
-			return strip_tags(I18N::translateContext('CENTURY', '3rd'));
6931
-		case  2:
6932
-			return strip_tags(I18N::translateContext('CENTURY', '2nd'));
6933
-		case  1:
6934
-			return strip_tags(I18N::translateContext('CENTURY', '1st'));
6935
-		default:
6936
-			return ($century - 1) . '01-' . $century . '00';
6893
+			case 21:
6894
+				return strip_tags(I18N::translateContext('CENTURY', '21st'));
6895
+			case 20:
6896
+				return strip_tags(I18N::translateContext('CENTURY', '20th'));
6897
+			case 19:
6898
+				return strip_tags(I18N::translateContext('CENTURY', '19th'));
6899
+			case 18:
6900
+				return strip_tags(I18N::translateContext('CENTURY', '18th'));
6901
+			case 17:
6902
+				return strip_tags(I18N::translateContext('CENTURY', '17th'));
6903
+			case 16:
6904
+				return strip_tags(I18N::translateContext('CENTURY', '16th'));
6905
+			case 15:
6906
+				return strip_tags(I18N::translateContext('CENTURY', '15th'));
6907
+			case 14:
6908
+				return strip_tags(I18N::translateContext('CENTURY', '14th'));
6909
+			case 13:
6910
+				return strip_tags(I18N::translateContext('CENTURY', '13th'));
6911
+			case 12:
6912
+				return strip_tags(I18N::translateContext('CENTURY', '12th'));
6913
+			case 11:
6914
+				return strip_tags(I18N::translateContext('CENTURY', '11th'));
6915
+			case 10:
6916
+				return strip_tags(I18N::translateContext('CENTURY', '10th'));
6917
+			case  9:
6918
+				return strip_tags(I18N::translateContext('CENTURY', '9th'));
6919
+			case  8:
6920
+				return strip_tags(I18N::translateContext('CENTURY', '8th'));
6921
+			case  7:
6922
+				return strip_tags(I18N::translateContext('CENTURY', '7th'));
6923
+			case  6:
6924
+				return strip_tags(I18N::translateContext('CENTURY', '6th'));
6925
+			case  5:
6926
+				return strip_tags(I18N::translateContext('CENTURY', '5th'));
6927
+			case  4:
6928
+				return strip_tags(I18N::translateContext('CENTURY', '4th'));
6929
+			case  3:
6930
+				return strip_tags(I18N::translateContext('CENTURY', '3rd'));
6931
+			case  2:
6932
+				return strip_tags(I18N::translateContext('CENTURY', '2nd'));
6933
+			case  1:
6934
+				return strip_tags(I18N::translateContext('CENTURY', '1st'));
6935
+			default:
6936
+				return ($century - 1) . '01-' . $century . '00';
6937 6937
 		}
6938 6938
 	}
6939 6939
 }
Please login to merge, or discard this patch.
admin_trees_manage.php 1 patch
Switch Indentation   +142 added lines, -142 removed lines patch added patch discarded remove patch
@@ -45,115 +45,115 @@  discard block
 block discarded – undo
45 45
 }
46 46
 // Process POST actions
47 47
 switch (Filter::post('action')) {
48
-case 'delete':
49
-	$gedcom_id = Filter::postInteger('gedcom_id');
50
-	if (Filter::checkCsrf() && $gedcom_id) {
51
-		$tree = Tree::findById($gedcom_id);
52
-		FlashMessages::addMessage(/* I18N: %s is the name of a family tree */ I18N::translate('The family tree “%s” has been deleted.', $tree->getTitleHtml()), 'success');
53
-		$tree->delete();
54
-	}
55
-	header('Location: admin_trees_manage.php');
56
-
57
-	return;
58
-case 'setdefault':
59
-	if (Filter::checkCsrf()) {
60
-		Site::setPreference('DEFAULT_GEDCOM', Filter::post('ged'));
61
-		FlashMessages::addMessage(/* I18N: %s is the name of a family tree */ I18N::translate('The family tree “%s” will be shown to visitors when they first arrive at this website.', $WT_TREE->getTitleHtml()), 'success');
62
-	}
63
-	header('Location: admin_trees_manage.php');
64
-
65
-	return;
66
-case 'new_tree':
67
-	$basename   = basename(Filter::post('tree_name'));
68
-	$tree_title = Filter::post('tree_title');
69
-
70
-	if (Filter::checkCsrf() && $basename && $tree_title) {
71
-		if (Tree::findByName($basename)) {
72
-			FlashMessages::addMessage(/* I18N: %s is the name of a family tree */ I18N::translate('The family tree “%s” already exists.', Html::escape($basename)), 'danger');
73
-		} else {
74
-			Tree::create($basename, $tree_title);
75
-			FlashMessages::addMessage(/* I18N: %s is the name of a family tree */ I18N::translate('The family tree “%s” has been created.', Html::escape($basename)), 'success');
48
+	case 'delete':
49
+		$gedcom_id = Filter::postInteger('gedcom_id');
50
+		if (Filter::checkCsrf() && $gedcom_id) {
51
+			$tree = Tree::findById($gedcom_id);
52
+			FlashMessages::addMessage(/* I18N: %s is the name of a family tree */ I18N::translate('The family tree “%s” has been deleted.', $tree->getTitleHtml()), 'success');
53
+			$tree->delete();
76 54
 		}
77
-	}
78
-	header('Location: admin_trees_manage.php?ged=' . rawurlencode($basename));
79
-
80
-	return;
81
-case 'replace_upload':
82
-	$gedcom_id          = Filter::postInteger('gedcom_id');
83
-	$keep_media         = Filter::post('keep_media', '1', '0');
84
-	$GEDCOM_MEDIA_PATH  = Filter::post('GEDCOM_MEDIA_PATH');
85
-	$WORD_WRAPPED_NOTES = Filter::post('WORD_WRAPPED_NOTES', '1', '0');
86
-	$tree               = Tree::findById($gedcom_id);
87
-
88
-	if (Filter::checkCsrf() && $tree) {
89
-		$tree->setPreference('keep_media', $keep_media);
90
-		$tree->setPreference('GEDCOM_MEDIA_PATH', $GEDCOM_MEDIA_PATH);
91
-		$tree->setPreference('WORD_WRAPPED_NOTES', $WORD_WRAPPED_NOTES);
92
-		if (isset($_FILES['tree_name'])) {
93
-			if ($_FILES['tree_name']['error'] == 0 && is_readable($_FILES['tree_name']['tmp_name'])) {
94
-				$tree->importGedcomFile($_FILES['tree_name']['tmp_name'], $_FILES['tree_name']['name']);
95
-			} else {
96
-				FlashMessages::addMessage(Functions::fileUploadErrorText($_FILES['tree_name']['error']), 'danger');
97
-			}
98
-		} else {
99
-			FlashMessages::addMessage(I18N::translate('No GEDCOM file was received.'), 'danger');
100
-		}
101
-	}
102
-	header('Location: admin_trees_manage.php');
103
-
104
-	return;
105
-case 'replace_import':
106
-	$basename           = basename(Filter::post('tree_name'));
107
-	$gedcom_id          = Filter::postInteger('gedcom_id');
108
-	$keep_media         = Filter::post('keep_media', '1', '0');
109
-	$GEDCOM_MEDIA_PATH  = Filter::post('GEDCOM_MEDIA_PATH');
110
-	$WORD_WRAPPED_NOTES = Filter::post('WORD_WRAPPED_NOTES', '1', '0');
111
-	$tree               = Tree::findById($gedcom_id);
112
-
113
-	if (Filter::checkCsrf() && $tree) {
114
-		$tree->setPreference('keep_media', $keep_media);
115
-		$tree->setPreference('GEDCOM_MEDIA_PATH', $GEDCOM_MEDIA_PATH);
116
-		$tree->setPreference('WORD_WRAPPED_NOTES', $WORD_WRAPPED_NOTES);
117
-		if ($basename) {
118
-			$tree->importGedcomFile(WT_DATA_DIR . $basename, $basename);
119
-		} else {
120
-			FlashMessages::addMessage(I18N::translate('No GEDCOM file was received.'), 'danger');
121
-		}
122
-	}
123
-	header('Location: admin_trees_manage.php');
124
-
125
-	return;
55
+		header('Location: admin_trees_manage.php');
126 56
 
127
-case 'synchronize':
128
-	if (Filter::checkCsrf()) {
129
-		$basenames = [];
57
+		return;
58
+	case 'setdefault':
59
+		if (Filter::checkCsrf()) {
60
+			Site::setPreference('DEFAULT_GEDCOM', Filter::post('ged'));
61
+			FlashMessages::addMessage(/* I18N: %s is the name of a family tree */ I18N::translate('The family tree “%s” will be shown to visitors when they first arrive at this website.', $WT_TREE->getTitleHtml()), 'success');
62
+		}
63
+		header('Location: admin_trees_manage.php');
130 64
 
131
-		foreach ($gedcom_files as $gedcom_file) {
132
-			$filemtime   = filemtime($gedcom_file); // Only import files that have changed
133
-			$basename    = basename($gedcom_file);
134
-			$basenames[] = $basename;
65
+		return;
66
+	case 'new_tree':
67
+		$basename   = basename(Filter::post('tree_name'));
68
+		$tree_title = Filter::post('tree_title');
135 69
 
136
-			$tree = Tree::findByName($basename);
137
-			if (!$tree) {
138
-				$tree = Tree::create($basename, $basename);
70
+		if (Filter::checkCsrf() && $basename && $tree_title) {
71
+			if (Tree::findByName($basename)) {
72
+				FlashMessages::addMessage(/* I18N: %s is the name of a family tree */ I18N::translate('The family tree “%s” already exists.', Html::escape($basename)), 'danger');
73
+			} else {
74
+				Tree::create($basename, $tree_title);
75
+				FlashMessages::addMessage(/* I18N: %s is the name of a family tree */ I18N::translate('The family tree “%s” has been created.', Html::escape($basename)), 'success');
76
+			}
77
+		}
78
+		header('Location: admin_trees_manage.php?ged=' . rawurlencode($basename));
79
+
80
+		return;
81
+	case 'replace_upload':
82
+		$gedcom_id          = Filter::postInteger('gedcom_id');
83
+		$keep_media         = Filter::post('keep_media', '1', '0');
84
+		$GEDCOM_MEDIA_PATH  = Filter::post('GEDCOM_MEDIA_PATH');
85
+		$WORD_WRAPPED_NOTES = Filter::post('WORD_WRAPPED_NOTES', '1', '0');
86
+		$tree               = Tree::findById($gedcom_id);
87
+
88
+		if (Filter::checkCsrf() && $tree) {
89
+			$tree->setPreference('keep_media', $keep_media);
90
+			$tree->setPreference('GEDCOM_MEDIA_PATH', $GEDCOM_MEDIA_PATH);
91
+			$tree->setPreference('WORD_WRAPPED_NOTES', $WORD_WRAPPED_NOTES);
92
+			if (isset($_FILES['tree_name'])) {
93
+				if ($_FILES['tree_name']['error'] == 0 && is_readable($_FILES['tree_name']['tmp_name'])) {
94
+					$tree->importGedcomFile($_FILES['tree_name']['tmp_name'], $_FILES['tree_name']['name']);
95
+				} else {
96
+					FlashMessages::addMessage(Functions::fileUploadErrorText($_FILES['tree_name']['error']), 'danger');
97
+				}
98
+			} else {
99
+				FlashMessages::addMessage(I18N::translate('No GEDCOM file was received.'), 'danger');
139 100
 			}
140
-			if ($tree->getPreference('filemtime') != $filemtime) {
141
-				$tree->importGedcomFile($gedcom_file, $basename);
142
-				$tree->setPreference('filemtime', $filemtime);
143
-				FlashMessages::addMessage(I18N::translate('The GEDCOM file “%s” has been imported.', Html::escape($basename)), 'success');
101
+		}
102
+		header('Location: admin_trees_manage.php');
103
+
104
+		return;
105
+	case 'replace_import':
106
+		$basename           = basename(Filter::post('tree_name'));
107
+		$gedcom_id          = Filter::postInteger('gedcom_id');
108
+		$keep_media         = Filter::post('keep_media', '1', '0');
109
+		$GEDCOM_MEDIA_PATH  = Filter::post('GEDCOM_MEDIA_PATH');
110
+		$WORD_WRAPPED_NOTES = Filter::post('WORD_WRAPPED_NOTES', '1', '0');
111
+		$tree               = Tree::findById($gedcom_id);
112
+
113
+		if (Filter::checkCsrf() && $tree) {
114
+			$tree->setPreference('keep_media', $keep_media);
115
+			$tree->setPreference('GEDCOM_MEDIA_PATH', $GEDCOM_MEDIA_PATH);
116
+			$tree->setPreference('WORD_WRAPPED_NOTES', $WORD_WRAPPED_NOTES);
117
+			if ($basename) {
118
+				$tree->importGedcomFile(WT_DATA_DIR . $basename, $basename);
119
+			} else {
120
+				FlashMessages::addMessage(I18N::translate('No GEDCOM file was received.'), 'danger');
144 121
 			}
145 122
 		}
123
+		header('Location: admin_trees_manage.php');
124
+
125
+		return;
126
+
127
+	case 'synchronize':
128
+		if (Filter::checkCsrf()) {
129
+			$basenames = [];
130
+
131
+			foreach ($gedcom_files as $gedcom_file) {
132
+				$filemtime   = filemtime($gedcom_file); // Only import files that have changed
133
+				$basename    = basename($gedcom_file);
134
+				$basenames[] = $basename;
135
+
136
+				$tree = Tree::findByName($basename);
137
+				if (!$tree) {
138
+					$tree = Tree::create($basename, $basename);
139
+				}
140
+				if ($tree->getPreference('filemtime') != $filemtime) {
141
+					$tree->importGedcomFile($gedcom_file, $basename);
142
+					$tree->setPreference('filemtime', $filemtime);
143
+					FlashMessages::addMessage(I18N::translate('The GEDCOM file “%s” has been imported.', Html::escape($basename)), 'success');
144
+				}
145
+			}
146 146
 
147
-		foreach (Tree::getAll() as $tree) {
148
-			if (!in_array($tree->getName(), $basenames)) {
149
-				FlashMessages::addMessage(I18N::translate('The family tree “%s” has been deleted.', $tree->getTitleHtml()), 'success');
150
-				$tree->delete();
147
+			foreach (Tree::getAll() as $tree) {
148
+				if (!in_array($tree->getName(), $basenames)) {
149
+					FlashMessages::addMessage(I18N::translate('The family tree “%s” has been deleted.', $tree->getTitleHtml()), 'success');
150
+					$tree->delete();
151
+				}
151 152
 			}
152 153
 		}
153
-	}
154
-	header('Location: admin_trees_manage.php');
154
+		header('Location: admin_trees_manage.php');
155 155
 
156
-	return;
156
+		return;
157 157
 }
158 158
 
159 159
 $default_tree_title  = /* I18N: Default name for a new tree */ I18N::translate('My family tree');
@@ -167,28 +167,28 @@  discard block
 block discarded – undo
167 167
 
168 168
 // Process GET actions
169 169
 switch (Filter::get('action')) {
170
-case 'importform':
171
-	$controller
172
-		->setPageTitle($WT_TREE->getTitleHtml() . ' — ' . I18N::translate('Import a GEDCOM file'))
173
-		->pageHeader();
170
+	case 'importform':
171
+		$controller
172
+			->setPageTitle($WT_TREE->getTitleHtml() . ' — ' . I18N::translate('Import a GEDCOM file'))
173
+			->pageHeader();
174 174
 
175
-	echo Bootstrap4::breadcrumbs([
176
-		route('admin-control-panel')              => I18N::translate('Control panel'),
177
-		'admin_trees_manage.php' => I18N::translate('Manage family trees'),
178
-	], $controller->getPageTitle());
179
-	?>
175
+		echo Bootstrap4::breadcrumbs([
176
+			route('admin-control-panel')              => I18N::translate('Control panel'),
177
+			'admin_trees_manage.php' => I18N::translate('Manage family trees'),
178
+		], $controller->getPageTitle());
179
+		?>
180 180
 
181 181
 	<h1><?= $controller->getPageTitle() ?></h1>
182 182
 	<?php
183 183
 
184
-	$tree = Tree::findById(Filter::getInteger('gedcom_id'));
185
-	// Check it exists
186
-	if (!$tree) {
187
-		break;
188
-	}
189
-	$gedcom_filename = $tree->getPreference('gedcom_filename')
190
-	?>
191
-	<p>
184
+		$tree = Tree::findById(Filter::getInteger('gedcom_id'));
185
+		// Check it exists
186
+		if (!$tree) {
187
+			break;
188
+		}
189
+		$gedcom_filename = $tree->getPreference('gedcom_filename')
190
+		?>
191
+		<p>
192 192
 		<?= /* I18N: %s is the name of a family tree */ I18N::translate('This will delete all the genealogy data from “%s” and replace it with data from a GEDCOM file.', $tree->getTitleHtml()) ?>
193 193
 	</p>
194 194
 	<form class="form form-horizontal" name="gedcomimportform" method="post" enctype="multipart/form-data" onsubmit="return checkGedcomImportForm('<?= Html::escape(I18N::translate('You have selected a GEDCOM file with a different name. Is this correct?')) ?>');">
@@ -222,35 +222,35 @@  discard block
 block discarded – undo
222 222
 							<div class="input-group">
223 223
 								<span class="input-group-addon">
224 224
 									<?= WT_DATA_DIR ?>
225
-								</span>
225
+									</span>
226 226
 								<?php
227
-								$d     = opendir(WT_DATA_DIR);
228
-								$files = [];
229
-								while (($f = readdir($d)) !== false) {
230
-									if (!is_dir(WT_DATA_DIR . $f) && is_readable(WT_DATA_DIR . $f)) {
231
-										$fp     = fopen(WT_DATA_DIR . $f, 'rb');
232
-										$header = fread($fp, 64);
233
-										fclose($fp);
234
-										if (preg_match('/^(' . WT_UTF8_BOM . ')?0 *HEAD/', $header)) {
235
-											$files[] = $f;
227
+									$d     = opendir(WT_DATA_DIR);
228
+									$files = [];
229
+									while (($f = readdir($d)) !== false) {
230
+										if (!is_dir(WT_DATA_DIR . $f) && is_readable(WT_DATA_DIR . $f)) {
231
+											$fp     = fopen(WT_DATA_DIR . $f, 'rb');
232
+											$header = fread($fp, 64);
233
+											fclose($fp);
234
+											if (preg_match('/^(' . WT_UTF8_BOM . ')?0 *HEAD/', $header)) {
235
+												$files[] = $f;
236
+											}
237
+										}
238
+									}
239
+									echo '<select name="tree_name" class="form-control" id="import-server-file">';
240
+									echo '<option value=""></option>';
241
+									sort($files);
242
+									foreach ($files as $gedcom_file) {
243
+										echo '<option value="', Html::escape($gedcom_file), '" ';
244
+										if ($gedcom_file === $gedcom_filename) {
245
+											echo ' selected';
236 246
 										}
247
+										echo'>', Html::escape($gedcom_file), '</option>';
237 248
 									}
238
-								}
239
-								echo '<select name="tree_name" class="form-control" id="import-server-file">';
240
-								echo '<option value=""></option>';
241
-								sort($files);
242
-								foreach ($files as $gedcom_file) {
243
-									echo '<option value="', Html::escape($gedcom_file), '" ';
244
-									if ($gedcom_file === $gedcom_filename) {
245
-										echo ' selected';
249
+									if (empty($files)) {
250
+										echo '<option disabled selected>', I18N::translate('No GEDCOM files found.'), '</option>';
246 251
 									}
247
-									echo'>', Html::escape($gedcom_file), '</option>';
248
-								}
249
-								if (empty($files)) {
250
-									echo '<option disabled selected>', I18N::translate('No GEDCOM files found.'), '</option>';
251
-								}
252
-								echo '</select>';
253
-								?>
252
+									echo '</select>';
253
+									?>
254 254
 							</div>
255 255
 						</div>
256 256
 					</div>
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 						>
295 295
 					<p class="small text-muted">
296 296
 						<?= /* I18N: Help text for the “GEDCOM media path” configuration setting. A “path” is something like “C:\Documents\Genealogy\Photos\John_Smith.jpeg” */ I18N::translate('Some genealogy software creates GEDCOM files that contain media filenames with full paths. These paths will not exist on the web-server. To allow webtrees to find the file, the first part of the path must be removed.') ?>
297
-						<?= /* I18N: Help text for the “GEDCOM media path” configuration setting. %s are all folder names */ I18N::translate('For example, if the GEDCOM file contains %1$s and webtrees expects to find %2$s in the media folder, then you would need to remove %3$s.', '<code>C:\\Documents\\family\\photo.jpeg</code>', '<code>family\\photo.jpeg</code>', '<code>C:\\Documents\\</code>') ?>
297
+							<?= /* I18N: Help text for the “GEDCOM media path” configuration setting. %s are all folder names */ I18N::translate('For example, if the GEDCOM file contains %1$s and webtrees expects to find %2$s in the media folder, then you would need to remove %3$s.', '<code>C:\\Documents\\family\\photo.jpeg</code>', '<code>family\\photo.jpeg</code>', '<code>C:\\Documents\\</code>') ?>
298 298
 					</p>
299 299
 				</div>
300 300
 			</div>
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 	</form>
311 311
 	<?php
312 312
 
313
-	return;
313
+		return;
314 314
 }
315 315
 
316 316
 if (!Tree::getAll()) {
Please login to merge, or discard this patch.
admin_trees_config.php 1 patch
Switch Indentation   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -106,119 +106,119 @@
 block discarded – undo
106 106
 $relatives_events = explode(',', $WT_TREE->getPreference('SHOW_RELATIVES_EVENTS'));
107 107
 
108 108
 switch (Filter::post('action')) {
109
-case 'general':
110
-	if (!Filter::checkCsrf()) {
111
-		break;
112
-	}
109
+	case 'general':
110
+		if (!Filter::checkCsrf()) {
111
+			break;
112
+		}
113 113
 
114
-	// Coming soon
115
-	if (Filter::postBool('all_trees')) {
116
-		FlashMessages::addMessage(I18N::translate('The preferences for all family trees have been updated.', $WT_TREE->getTitleHtml()), 'success');
117
-	}
118
-	if (Filter::postBool('new_trees')) {
119
-		FlashMessages::addMessage(I18N::translate('The preferences for new family trees have been updated.', $WT_TREE->getTitleHtml()), 'success');
120
-	}
114
+		// Coming soon
115
+		if (Filter::postBool('all_trees')) {
116
+			FlashMessages::addMessage(I18N::translate('The preferences for all family trees have been updated.', $WT_TREE->getTitleHtml()), 'success');
117
+		}
118
+		if (Filter::postBool('new_trees')) {
119
+			FlashMessages::addMessage(I18N::translate('The preferences for new family trees have been updated.', $WT_TREE->getTitleHtml()), 'success');
120
+		}
121 121
 
122
-	$WT_TREE->setPreference('ADVANCED_NAME_FACTS', implode(',', Filter::postArray('ADVANCED_NAME_FACTS')));
123
-	$WT_TREE->setPreference('ADVANCED_PLAC_FACTS', implode(',', Filter::postArray('ADVANCED_PLAC_FACTS')));
124
-	$WT_TREE->setPreference('ALLOW_THEME_DROPDOWN', Filter::postBool('ALLOW_THEME_DROPDOWN'));
125
-	// For backwards compatibility with webtrees 1.x we store the two calendar formats in one variable
126
-	// e.g. "gregorian_and_jewish"
127
-	$WT_TREE->setPreference('CALENDAR_FORMAT', implode('_and_', array_unique([
128
-		Filter::post('CALENDAR_FORMAT0', 'gregorian|julian|french|jewish|hijri|jalali', 'none'),
129
-		Filter::post('CALENDAR_FORMAT1', 'gregorian|julian|french|jewish|hijri|jalali', 'none'),
130
-	])));
131
-	$WT_TREE->setPreference('CHART_BOX_TAGS', Filter::post('CHART_BOX_TAGS'));
132
-	$WT_TREE->setPreference('CONTACT_USER_ID', Filter::post('CONTACT_USER_ID'));
133
-	$WT_TREE->setPreference('DEFAULT_PEDIGREE_GENERATIONS', Filter::post('DEFAULT_PEDIGREE_GENERATIONS'));
134
-	$WT_TREE->setPreference('EXPAND_NOTES', Filter::postBool('EXPAND_NOTES'));
135
-	$WT_TREE->setPreference('EXPAND_SOURCES', Filter::postBool('EXPAND_SOURCES'));
136
-	$WT_TREE->setPreference('FAM_FACTS_ADD', implode(',', Filter::postArray('FAM_FACTS_ADD')));
137
-	$WT_TREE->setPreference('FAM_FACTS_QUICK', implode(',', Filter::postArray('FAM_FACTS_QUICK')));
138
-	$WT_TREE->setPreference('FAM_FACTS_UNIQUE', implode(',', Filter::postArray('FAM_FACTS_UNIQUE')));
139
-	$WT_TREE->setPreference('FULL_SOURCES', Filter::postBool('FULL_SOURCES'));
140
-	$WT_TREE->setPreference('FORMAT_TEXT', Filter::post('FORMAT_TEXT'));
141
-	$WT_TREE->setPreference('GEDCOM_MEDIA_PATH', Filter::post('GEDCOM_MEDIA_PATH'));
142
-	$WT_TREE->setPreference('GENERATE_UIDS', Filter::postBool('GENERATE_UIDS'));
143
-	$WT_TREE->setPreference('GEONAMES_ACCOUNT', Filter::post('GEONAMES_ACCOUNT'));
144
-	$WT_TREE->setPreference('HIDE_GEDCOM_ERRORS', Filter::postBool('HIDE_GEDCOM_ERRORS'));
145
-	$WT_TREE->setPreference('INDI_FACTS_ADD', implode(',', Filter::postArray('INDI_FACTS_ADD')));
146
-	$WT_TREE->setPreference('INDI_FACTS_QUICK', implode(',', Filter::postArray('INDI_FACTS_QUICK')));
147
-	$WT_TREE->setPreference('INDI_FACTS_UNIQUE', implode(',', Filter::postArray('INDI_FACTS_UNIQUE')));
148
-	$WT_TREE->setPreference('LANGUAGE', Filter::post('LANGUAGE'));
149
-	$WT_TREE->setPreference('MAX_DESCENDANCY_GENERATIONS', Filter::post('MAX_DESCENDANCY_GENERATIONS'));
150
-	$WT_TREE->setPreference('MAX_PEDIGREE_GENERATIONS', Filter::post('MAX_PEDIGREE_GENERATIONS'));
151
-	$WT_TREE->setPreference('MEDIA_UPLOAD', Filter::post('MEDIA_UPLOAD'));
152
-	$WT_TREE->setPreference('META_DESCRIPTION', Filter::post('META_DESCRIPTION'));
153
-	$WT_TREE->setPreference('META_TITLE', Filter::post('META_TITLE'));
154
-	$WT_TREE->setPreference('NO_UPDATE_CHAN', Filter::postBool('NO_UPDATE_CHAN'));
155
-	$WT_TREE->setPreference('PEDIGREE_LAYOUT', Filter::postBool('PEDIGREE_LAYOUT'));
156
-	$WT_TREE->setPreference('PEDIGREE_ROOT_ID', Filter::post('PEDIGREE_ROOT_ID', WT_REGEX_XREF));
157
-	$WT_TREE->setPreference('PEDIGREE_SHOW_GENDER', Filter::postBool('PEDIGREE_SHOW_GENDER'));
158
-	$WT_TREE->setPreference('PREFER_LEVEL2_SOURCES', Filter::post('PREFER_LEVEL2_SOURCES'));
159
-	$WT_TREE->setPreference('QUICK_REQUIRED_FACTS', implode(',', Filter::postArray('QUICK_REQUIRED_FACTS')));
160
-	$WT_TREE->setPreference('QUICK_REQUIRED_FAMFACTS', implode(',', Filter::postArray('QUICK_REQUIRED_FAMFACTS')));
161
-	$WT_TREE->setPreference('REPO_FACTS_ADD', implode(',', Filter::postArray('REPO_FACTS_ADD')));
162
-	$WT_TREE->setPreference('REPO_FACTS_QUICK', implode(',', Filter::postArray('REPO_FACTS_QUICK')));
163
-	$WT_TREE->setPreference('REPO_FACTS_UNIQUE', implode(',', Filter::postArray('REPO_FACTS_UNIQUE')));
164
-	$WT_TREE->setPreference('SHOW_COUNTER', Filter::postBool('SHOW_COUNTER'));
165
-	$WT_TREE->setPreference('SHOW_EST_LIST_DATES', Filter::postBool('SHOW_EST_LIST_DATES'));
166
-	$WT_TREE->setPreference('SHOW_FACT_ICONS', Filter::postBool('SHOW_FACT_ICONS'));
167
-	$WT_TREE->setPreference('SHOW_GEDCOM_RECORD', Filter::postBool('SHOW_GEDCOM_RECORD'));
168
-	$WT_TREE->setPreference('SHOW_HIGHLIGHT_IMAGES', Filter::postBool('SHOW_HIGHLIGHT_IMAGES'));
169
-	$WT_TREE->setPreference('SHOW_LAST_CHANGE', Filter::postBool('SHOW_LAST_CHANGE'));
170
-	$WT_TREE->setPreference('SHOW_LDS_AT_GLANCE', Filter::postBool('SHOW_LDS_AT_GLANCE'));
171
-	$WT_TREE->setPreference('SHOW_MEDIA_DOWNLOAD', Filter::post('SHOW_MEDIA_DOWNLOAD'));
172
-	$WT_TREE->setPreference('SHOW_NO_WATERMARK', Filter::post('SHOW_NO_WATERMARK'));
173
-	$WT_TREE->setPreference('SHOW_PARENTS_AGE', Filter::postBool('SHOW_PARENTS_AGE'));
174
-	$WT_TREE->setPreference('SHOW_PEDIGREE_PLACES', Filter::post('SHOW_PEDIGREE_PLACES'));
175
-	$WT_TREE->setPreference('SHOW_PEDIGREE_PLACES_SUFFIX', Filter::postBool('SHOW_PEDIGREE_PLACES_SUFFIX'));
176
-	$WT_TREE->setPreference('SHOW_RELATIVES_EVENTS', implode(',', Filter::postArray('SHOW_RELATIVES_EVENTS')));
177
-	$WT_TREE->setPreference('SOUR_FACTS_ADD', implode(',', Filter::postArray('SOUR_FACTS_ADD')));
178
-	$WT_TREE->setPreference('SOUR_FACTS_QUICK', implode(',', Filter::postArray('SOUR_FACTS_QUICK')));
179
-	$WT_TREE->setPreference('SOUR_FACTS_UNIQUE', implode(',', Filter::postArray('SOUR_FACTS_UNIQUE')));
180
-	$WT_TREE->setPreference('SUBLIST_TRIGGER_I', Filter::post('SUBLIST_TRIGGER_I', WT_REGEX_INTEGER, 200));
181
-	$WT_TREE->setPreference('SURNAME_LIST_STYLE', Filter::post('SURNAME_LIST_STYLE'));
182
-	$WT_TREE->setPreference('SURNAME_TRADITION', Filter::post('SURNAME_TRADITION'));
183
-	$WT_TREE->setPreference('THEME_DIR', Filter::post('THEME_DIR'));
184
-	$WT_TREE->setPreference('USE_SILHOUETTE', Filter::postBool('USE_SILHOUETTE'));
185
-	$WT_TREE->setPreference('WEBMASTER_USER_ID', Filter::post('WEBMASTER_USER_ID'));
186
-	$WT_TREE->setPreference('WEBTREES_EMAIL', Filter::post('WEBTREES_EMAIL'));
187
-	$WT_TREE->setPreference('title', Filter::post('title'));
188
-
189
-	// Only accept valid folders for MEDIA_DIRECTORY
190
-	$MEDIA_DIRECTORY = preg_replace('/[\/\\\\]+/', '/', Filter::post('MEDIA_DIRECTORY') . '/');
191
-	if (substr($MEDIA_DIRECTORY, 0, 1) === '/') {
192
-		$MEDIA_DIRECTORY = substr($MEDIA_DIRECTORY, 1);
193
-	}
122
+		$WT_TREE->setPreference('ADVANCED_NAME_FACTS', implode(',', Filter::postArray('ADVANCED_NAME_FACTS')));
123
+		$WT_TREE->setPreference('ADVANCED_PLAC_FACTS', implode(',', Filter::postArray('ADVANCED_PLAC_FACTS')));
124
+		$WT_TREE->setPreference('ALLOW_THEME_DROPDOWN', Filter::postBool('ALLOW_THEME_DROPDOWN'));
125
+		// For backwards compatibility with webtrees 1.x we store the two calendar formats in one variable
126
+		// e.g. "gregorian_and_jewish"
127
+		$WT_TREE->setPreference('CALENDAR_FORMAT', implode('_and_', array_unique([
128
+			Filter::post('CALENDAR_FORMAT0', 'gregorian|julian|french|jewish|hijri|jalali', 'none'),
129
+			Filter::post('CALENDAR_FORMAT1', 'gregorian|julian|french|jewish|hijri|jalali', 'none'),
130
+		])));
131
+		$WT_TREE->setPreference('CHART_BOX_TAGS', Filter::post('CHART_BOX_TAGS'));
132
+		$WT_TREE->setPreference('CONTACT_USER_ID', Filter::post('CONTACT_USER_ID'));
133
+		$WT_TREE->setPreference('DEFAULT_PEDIGREE_GENERATIONS', Filter::post('DEFAULT_PEDIGREE_GENERATIONS'));
134
+		$WT_TREE->setPreference('EXPAND_NOTES', Filter::postBool('EXPAND_NOTES'));
135
+		$WT_TREE->setPreference('EXPAND_SOURCES', Filter::postBool('EXPAND_SOURCES'));
136
+		$WT_TREE->setPreference('FAM_FACTS_ADD', implode(',', Filter::postArray('FAM_FACTS_ADD')));
137
+		$WT_TREE->setPreference('FAM_FACTS_QUICK', implode(',', Filter::postArray('FAM_FACTS_QUICK')));
138
+		$WT_TREE->setPreference('FAM_FACTS_UNIQUE', implode(',', Filter::postArray('FAM_FACTS_UNIQUE')));
139
+		$WT_TREE->setPreference('FULL_SOURCES', Filter::postBool('FULL_SOURCES'));
140
+		$WT_TREE->setPreference('FORMAT_TEXT', Filter::post('FORMAT_TEXT'));
141
+		$WT_TREE->setPreference('GEDCOM_MEDIA_PATH', Filter::post('GEDCOM_MEDIA_PATH'));
142
+		$WT_TREE->setPreference('GENERATE_UIDS', Filter::postBool('GENERATE_UIDS'));
143
+		$WT_TREE->setPreference('GEONAMES_ACCOUNT', Filter::post('GEONAMES_ACCOUNT'));
144
+		$WT_TREE->setPreference('HIDE_GEDCOM_ERRORS', Filter::postBool('HIDE_GEDCOM_ERRORS'));
145
+		$WT_TREE->setPreference('INDI_FACTS_ADD', implode(',', Filter::postArray('INDI_FACTS_ADD')));
146
+		$WT_TREE->setPreference('INDI_FACTS_QUICK', implode(',', Filter::postArray('INDI_FACTS_QUICK')));
147
+		$WT_TREE->setPreference('INDI_FACTS_UNIQUE', implode(',', Filter::postArray('INDI_FACTS_UNIQUE')));
148
+		$WT_TREE->setPreference('LANGUAGE', Filter::post('LANGUAGE'));
149
+		$WT_TREE->setPreference('MAX_DESCENDANCY_GENERATIONS', Filter::post('MAX_DESCENDANCY_GENERATIONS'));
150
+		$WT_TREE->setPreference('MAX_PEDIGREE_GENERATIONS', Filter::post('MAX_PEDIGREE_GENERATIONS'));
151
+		$WT_TREE->setPreference('MEDIA_UPLOAD', Filter::post('MEDIA_UPLOAD'));
152
+		$WT_TREE->setPreference('META_DESCRIPTION', Filter::post('META_DESCRIPTION'));
153
+		$WT_TREE->setPreference('META_TITLE', Filter::post('META_TITLE'));
154
+		$WT_TREE->setPreference('NO_UPDATE_CHAN', Filter::postBool('NO_UPDATE_CHAN'));
155
+		$WT_TREE->setPreference('PEDIGREE_LAYOUT', Filter::postBool('PEDIGREE_LAYOUT'));
156
+		$WT_TREE->setPreference('PEDIGREE_ROOT_ID', Filter::post('PEDIGREE_ROOT_ID', WT_REGEX_XREF));
157
+		$WT_TREE->setPreference('PEDIGREE_SHOW_GENDER', Filter::postBool('PEDIGREE_SHOW_GENDER'));
158
+		$WT_TREE->setPreference('PREFER_LEVEL2_SOURCES', Filter::post('PREFER_LEVEL2_SOURCES'));
159
+		$WT_TREE->setPreference('QUICK_REQUIRED_FACTS', implode(',', Filter::postArray('QUICK_REQUIRED_FACTS')));
160
+		$WT_TREE->setPreference('QUICK_REQUIRED_FAMFACTS', implode(',', Filter::postArray('QUICK_REQUIRED_FAMFACTS')));
161
+		$WT_TREE->setPreference('REPO_FACTS_ADD', implode(',', Filter::postArray('REPO_FACTS_ADD')));
162
+		$WT_TREE->setPreference('REPO_FACTS_QUICK', implode(',', Filter::postArray('REPO_FACTS_QUICK')));
163
+		$WT_TREE->setPreference('REPO_FACTS_UNIQUE', implode(',', Filter::postArray('REPO_FACTS_UNIQUE')));
164
+		$WT_TREE->setPreference('SHOW_COUNTER', Filter::postBool('SHOW_COUNTER'));
165
+		$WT_TREE->setPreference('SHOW_EST_LIST_DATES', Filter::postBool('SHOW_EST_LIST_DATES'));
166
+		$WT_TREE->setPreference('SHOW_FACT_ICONS', Filter::postBool('SHOW_FACT_ICONS'));
167
+		$WT_TREE->setPreference('SHOW_GEDCOM_RECORD', Filter::postBool('SHOW_GEDCOM_RECORD'));
168
+		$WT_TREE->setPreference('SHOW_HIGHLIGHT_IMAGES', Filter::postBool('SHOW_HIGHLIGHT_IMAGES'));
169
+		$WT_TREE->setPreference('SHOW_LAST_CHANGE', Filter::postBool('SHOW_LAST_CHANGE'));
170
+		$WT_TREE->setPreference('SHOW_LDS_AT_GLANCE', Filter::postBool('SHOW_LDS_AT_GLANCE'));
171
+		$WT_TREE->setPreference('SHOW_MEDIA_DOWNLOAD', Filter::post('SHOW_MEDIA_DOWNLOAD'));
172
+		$WT_TREE->setPreference('SHOW_NO_WATERMARK', Filter::post('SHOW_NO_WATERMARK'));
173
+		$WT_TREE->setPreference('SHOW_PARENTS_AGE', Filter::postBool('SHOW_PARENTS_AGE'));
174
+		$WT_TREE->setPreference('SHOW_PEDIGREE_PLACES', Filter::post('SHOW_PEDIGREE_PLACES'));
175
+		$WT_TREE->setPreference('SHOW_PEDIGREE_PLACES_SUFFIX', Filter::postBool('SHOW_PEDIGREE_PLACES_SUFFIX'));
176
+		$WT_TREE->setPreference('SHOW_RELATIVES_EVENTS', implode(',', Filter::postArray('SHOW_RELATIVES_EVENTS')));
177
+		$WT_TREE->setPreference('SOUR_FACTS_ADD', implode(',', Filter::postArray('SOUR_FACTS_ADD')));
178
+		$WT_TREE->setPreference('SOUR_FACTS_QUICK', implode(',', Filter::postArray('SOUR_FACTS_QUICK')));
179
+		$WT_TREE->setPreference('SOUR_FACTS_UNIQUE', implode(',', Filter::postArray('SOUR_FACTS_UNIQUE')));
180
+		$WT_TREE->setPreference('SUBLIST_TRIGGER_I', Filter::post('SUBLIST_TRIGGER_I', WT_REGEX_INTEGER, 200));
181
+		$WT_TREE->setPreference('SURNAME_LIST_STYLE', Filter::post('SURNAME_LIST_STYLE'));
182
+		$WT_TREE->setPreference('SURNAME_TRADITION', Filter::post('SURNAME_TRADITION'));
183
+		$WT_TREE->setPreference('THEME_DIR', Filter::post('THEME_DIR'));
184
+		$WT_TREE->setPreference('USE_SILHOUETTE', Filter::postBool('USE_SILHOUETTE'));
185
+		$WT_TREE->setPreference('WEBMASTER_USER_ID', Filter::post('WEBMASTER_USER_ID'));
186
+		$WT_TREE->setPreference('WEBTREES_EMAIL', Filter::post('WEBTREES_EMAIL'));
187
+		$WT_TREE->setPreference('title', Filter::post('title'));
188
+
189
+		// Only accept valid folders for MEDIA_DIRECTORY
190
+		$MEDIA_DIRECTORY = preg_replace('/[\/\\\\]+/', '/', Filter::post('MEDIA_DIRECTORY') . '/');
191
+		if (substr($MEDIA_DIRECTORY, 0, 1) === '/') {
192
+			$MEDIA_DIRECTORY = substr($MEDIA_DIRECTORY, 1);
193
+		}
194 194
 
195
-	if ($MEDIA_DIRECTORY) {
196
-		if (is_dir(WT_DATA_DIR . $MEDIA_DIRECTORY)) {
197
-			$WT_TREE->setPreference('MEDIA_DIRECTORY', $MEDIA_DIRECTORY);
198
-		} elseif (File::mkdir(WT_DATA_DIR . $MEDIA_DIRECTORY)) {
199
-			$WT_TREE->setPreference('MEDIA_DIRECTORY', $MEDIA_DIRECTORY);
200
-			FlashMessages::addMessage(I18N::translate('The folder %s has been created.', Html::filename(WT_DATA_DIR . $MEDIA_DIRECTORY)), 'info');
201
-		} else {
202
-			FlashMessages::addMessage(I18N::translate('The folder %s does not exist, and it could not be created.', Html::filename(WT_DATA_DIR . $MEDIA_DIRECTORY)), 'danger');
195
+		if ($MEDIA_DIRECTORY) {
196
+			if (is_dir(WT_DATA_DIR . $MEDIA_DIRECTORY)) {
197
+				$WT_TREE->setPreference('MEDIA_DIRECTORY', $MEDIA_DIRECTORY);
198
+			} elseif (File::mkdir(WT_DATA_DIR . $MEDIA_DIRECTORY)) {
199
+				$WT_TREE->setPreference('MEDIA_DIRECTORY', $MEDIA_DIRECTORY);
200
+				FlashMessages::addMessage(I18N::translate('The folder %s has been created.', Html::filename(WT_DATA_DIR . $MEDIA_DIRECTORY)), 'info');
201
+			} else {
202
+				FlashMessages::addMessage(I18N::translate('The folder %s does not exist, and it could not be created.', Html::filename(WT_DATA_DIR . $MEDIA_DIRECTORY)), 'danger');
203
+			}
203 204
 		}
204
-	}
205 205
 
206
-	$gedcom = Filter::post('gedcom');
207
-	if ($gedcom && $gedcom !== $WT_TREE->getName()) {
208
-		try {
209
-			Database::prepare("UPDATE `##gedcom` SET gedcom_name = ? WHERE gedcom_id = ?")->execute([$gedcom, $WT_TREE->getTreeId()]);
210
-			Database::prepare("UPDATE `##site_setting` SET setting_value = ? WHERE setting_name='DEFAULT_GEDCOM' AND setting_value = ?")->execute([$gedcom, $WT_TREE->getName()]);
211
-		} catch (\Exception $ex) {
212
-			DebugBar::addThrowable($ex);
206
+		$gedcom = Filter::post('gedcom');
207
+		if ($gedcom && $gedcom !== $WT_TREE->getName()) {
208
+			try {
209
+				Database::prepare("UPDATE `##gedcom` SET gedcom_name = ? WHERE gedcom_id = ?")->execute([$gedcom, $WT_TREE->getTreeId()]);
210
+				Database::prepare("UPDATE `##site_setting` SET setting_value = ? WHERE setting_name='DEFAULT_GEDCOM' AND setting_value = ?")->execute([$gedcom, $WT_TREE->getName()]);
211
+			} catch (\Exception $ex) {
212
+				DebugBar::addThrowable($ex);
213 213
 
214
-			// Probably a duplicate name.
214
+				// Probably a duplicate name.
215
+			}
215 216
 		}
216
-	}
217 217
 
218
-	FlashMessages::addMessage(I18N::translate('The preferences for the family tree “%s” have been updated.', $WT_TREE->getTitleHtml()), 'success');
219
-	header('Location: admin_trees_manage.php');
218
+		FlashMessages::addMessage(I18N::translate('The preferences for the family tree “%s” have been updated.', $WT_TREE->getTitleHtml()), 'success');
219
+		header('Location: admin_trees_manage.php');
220 220
 
221
-	return;
221
+		return;
222 222
 }
223 223
 
224 224
 switch (Filter::get('action')) {
Please login to merge, or discard this patch.
help_text.php 1 patch
Switch Indentation   +176 added lines, -176 removed lines patch added patch discarded remove patch
@@ -28,102 +28,102 @@  discard block
 block discarded – undo
28 28
 	// Generally, these tags need to be lists explicitly in FunctionsEdit::add_simple_tag()
29 29
 	//////////////////////////////////////////////////////////////////////////////
30 30
 
31
-case 'DATE':
32
-	$title = I18N::translate('Date');
33
-	$dates = [
34
-		'1900'                                                     => new Date('1900'),
35
-		'JAN 1900'                                                 => new Date('JAN 1900'),
36
-		'FEB 1900'                                                 => new Date('FEB 1900'),
37
-		'MAR 1900'                                                 => new Date('MAR 1900'),
38
-		'APR 1900'                                                 => new Date('APR 1900'),
39
-		'MAY 1900'                                                 => new Date('MAY 1900'),
40
-		'JUN 1900'                                                 => new Date('JUN 1900'),
41
-		'JUL 1900'                                                 => new Date('JUL 1900'),
42
-		'AUG 1900'                                                 => new Date('AUG 1900'),
43
-		'SEP 1900'                                                 => new Date('SEP 1900'),
44
-		'OCT 1900'                                                 => new Date('OCT 1900'),
45
-		'NOV 1900'                                                 => new Date('NOV 1900'),
46
-		'DEC 1900'                                                 => new Date('DEC 1900'),
47
-		'11 DEC 1913'                                              => new Date('11 DEC 1913'),
48
-		'01 FEB 2003'                                              => new Date('01 FEB 2003'),
49
-		'ABT 1900'                                                 => new Date('ABT 1900'),
50
-		'EST 1900'                                                 => new Date('EST 1900'),
51
-		'CAL 1900'                                                 => new Date('CAL 1900'),
52
-		'INT 1900 (...)'                                           => new Date('INT 1900 (...)'),
53
-		'@#DJULIAN@ 44 B.C.'                                       => new Date('@#DJULIAN@ 44 B.C.'),
54
-		'@#DJULIAN@ 14 JAN 1700'                                   => new Date('@#DJULIAN@ 14 JAN 1700'),
55
-		'BET @#DJULIAN@ 01 SEP 1752 AND @#DGREGORIAN@ 30 SEP 1752' => new Date('BET @#DJULIAN@ 01 SEP 1752 AND @#DGREGORIAN@ 30 SEP 1752'),
56
-		'@#DJULIAN@ 20 FEB 1742/43'                                => new Date('@#DJULIAN@ 20 FEB 1742/43'),
57
-		'FROM 1900 TO 1910'                                        => new Date('FROM 1900 TO 1910'),
58
-		'FROM 1900'                                                => new Date('FROM 1900'),
59
-		'TO 1910'                                                  => new Date('TO 1910'),
60
-		'BET 1900 AND 1910'                                        => new Date('BET 1900 AND 1910'),
61
-		'BET JAN 1900 AND MAR 1900'                                => new Date('BET JAN 1900 AND MAR 1900'),
62
-		'BET APR 1900 AND JUN 1900'                                => new Date('BET APR 1900 AND JUN 1900'),
63
-		'BET JUL 1900 AND SEP 1900'                                => new Date('BET JUL 1900 AND SEP 1900'),
64
-		'BET OCT 1900 AND DEC 1900'                                => new Date('BET OCT 1900 AND DEC 1900'),
65
-		'AFT 1900'                                                 => new Date('AFT 1900'),
66
-		'BEF 1910'                                                 => new Date('BEF 1910'),
67
-		// Hijri dates
68
-		'@#DHIJRI@ 1497'                                    => new Date('@#DHIJRI@ 1497'),
69
-		'@#DHIJRI@ MUHAR 1497'                              => new Date('@#DHIJRI@ MUHAR 1497'),
70
-		'ABT @#DHIJRI@ SAFAR 1497'                          => new Date('ABT @#DHIJRI@ SAFAR 1497'),
71
-		'BET @#DHIJRI@ RABIA 1497 AND @#DHIJRI@ RABIT 1497' => new Date('BET @#DHIJRI@ RABIA 1497 AND @#DHIJRI@ RABIT 1497'),
72
-		'FROM @#DHIJRI@ JUMAA 1497 TO @#DHIJRI@ JUMAT 1497' => new Date('FROM @#DHIJRI@ JUMAA 1497 TO @#DHIJRI@ JUMAT 1497'),
73
-		'AFT @#DHIJRI@ RAJAB 1497'                          => new Date('AFT @#DHIJRI@ RAJAB 1497'),
74
-		'BEF @#DHIJRI@ SHAAB 1497'                          => new Date('BEF @#DHIJRI@ SHAAB 1497'),
75
-		'ABT @#DHIJRI@ RAMAD 1497'                          => new Date('ABT @#DHIJRI@ RAMAD 1497'),
76
-		'FROM @#DHIJRI@ SHAWW 1497'                         => new Date('FROM @#DHIJRI@ SHAWW 1497'),
77
-		'TO @#DHIJRI@ DHUAQ 1497'                           => new Date('TO @#DHIJRI@ DHUAQ 1497'),
78
-		'@#DHIJRI@ 03 DHUAH 1497'                           => new Date('@#DHIJRI@ 03 DHUAH 1497'),
79
-		// French dates
80
-		'@#DFRENCH R@ 12'                                   => new Date('@#DFRENCH R@ 12'),
81
-		'@#DFRENCH R@ VEND 12'                              => new Date('@#DFRENCH R@ VEND 12'),
82
-		'ABT @#DFRENCH R@ BRUM 12'                          => new Date('ABT @#DFRENCH R@ BRUM 12'),
83
-		'BET @#DFRENCH R@ FRIM 12 AND @#DFRENCH R@ NIVO 12' => new Date('BET @#DFRENCH R@ FRIM 12 AND @#DFRENCH R@ NIVO 12'),
84
-		'FROM @#DFRENCH R@ PLUV 12 TO @#DFRENCH R@ VENT 12' => new Date('FROM @#DFRENCH R@ PLUV 12 TO @#DFRENCH R@ VENT 12'),
85
-		'AFT @#DFRENCH R@ GERM 12'                          => new Date('AFT @#DFRENCH R@ GERM 12'),
86
-		'BEF @#DFRENCH R@ FLOR 12'                          => new Date('BEF @#DFRENCH R@ FLOR 12'),
87
-		'ABT @#DFRENCH R@ PRAI 12'                          => new Date('ABT @#DFRENCH R@ PRAI 12'),
88
-		'FROM @#DFRENCH R@ MESS 12'                         => new Date('FROM @#DFRENCH R@ MESS 12'),
89
-		'TO @#DFRENCH R@ THER 12'                           => new Date('TO @#DFRENCH R@ THER 12'),
90
-		'EST @#DFRENCH R@ FRUC 12'                          => new Date('EST @#DFRENCH R@ FRUC 12'),
91
-		'@#DFRENCH R@ 03 COMP 12'                           => new Date('@#DFRENCH R@ 03 COMP 12'),
92
-		// Jewish dates
93
-		'@#DHEBREW@ 5481'                                 => new Date('@#DHEBREW@ 5481'),
94
-		'@#DHEBREW@ TSH 5481'                             => new Date('@#DHEBREW@ TSH 5481'),
95
-		'ABT @#DHEBREW@ CSH 5481'                         => new Date('ABT @#DHEBREW@ CSH 5481'),
96
-		'BET @#DHEBREW@ KSL 5481 AND @#DHEBREW@ TVT 5481' => new Date('BET @#DHEBREW@ KSL 5481 AND @#DHEBREW@ TVT 5481'),
97
-		'FROM @#DHEBREW@ SHV 5481 TO @#DHEBREW@ ADR 5481' => new Date('FROM @#DHEBREW@ SHV 5481 TO @#DHEBREW@ ADR 5481'),
98
-		'AFT @#DHEBREW@ ADR 5481'                         => new Date('AFT @#DHEBREW@ ADR 5481'),
99
-		'AFT @#DHEBREW@ ADS 5480'                         => new Date('AFT @#DHEBREW@ ADS 5480'),
100
-		'BEF @#DHEBREW@ NSN 5481'                         => new Date('BEF @#DHEBREW@ NSN 5481'),
101
-		'ABT @#DHEBREW@ IYR 5481'                         => new Date('ABT @#DHEBREW@ IYR 5481'),
102
-		'FROM @#DHEBREW@ SVN 5481'                        => new Date('FROM @#DHEBREW@ SVN 5481'),
103
-		'TO @#DHEBREW@ TMZ 5481'                          => new Date('TO @#DHEBREW@ TMZ 5481'),
104
-		'EST @#DHEBREW@ AAV 5481'                         => new Date('EST @#DHEBREW@ AAV 5481'),
105
-		'@#DHEBREW@ 03 ELL 5481'                          => new Date('@#DHEBREW@ 03 ELL 5481'),
106
-	];
31
+	case 'DATE':
32
+		$title = I18N::translate('Date');
33
+		$dates = [
34
+			'1900'                                                     => new Date('1900'),
35
+			'JAN 1900'                                                 => new Date('JAN 1900'),
36
+			'FEB 1900'                                                 => new Date('FEB 1900'),
37
+			'MAR 1900'                                                 => new Date('MAR 1900'),
38
+			'APR 1900'                                                 => new Date('APR 1900'),
39
+			'MAY 1900'                                                 => new Date('MAY 1900'),
40
+			'JUN 1900'                                                 => new Date('JUN 1900'),
41
+			'JUL 1900'                                                 => new Date('JUL 1900'),
42
+			'AUG 1900'                                                 => new Date('AUG 1900'),
43
+			'SEP 1900'                                                 => new Date('SEP 1900'),
44
+			'OCT 1900'                                                 => new Date('OCT 1900'),
45
+			'NOV 1900'                                                 => new Date('NOV 1900'),
46
+			'DEC 1900'                                                 => new Date('DEC 1900'),
47
+			'11 DEC 1913'                                              => new Date('11 DEC 1913'),
48
+			'01 FEB 2003'                                              => new Date('01 FEB 2003'),
49
+			'ABT 1900'                                                 => new Date('ABT 1900'),
50
+			'EST 1900'                                                 => new Date('EST 1900'),
51
+			'CAL 1900'                                                 => new Date('CAL 1900'),
52
+			'INT 1900 (...)'                                           => new Date('INT 1900 (...)'),
53
+			'@#DJULIAN@ 44 B.C.'                                       => new Date('@#DJULIAN@ 44 B.C.'),
54
+			'@#DJULIAN@ 14 JAN 1700'                                   => new Date('@#DJULIAN@ 14 JAN 1700'),
55
+			'BET @#DJULIAN@ 01 SEP 1752 AND @#DGREGORIAN@ 30 SEP 1752' => new Date('BET @#DJULIAN@ 01 SEP 1752 AND @#DGREGORIAN@ 30 SEP 1752'),
56
+			'@#DJULIAN@ 20 FEB 1742/43'                                => new Date('@#DJULIAN@ 20 FEB 1742/43'),
57
+			'FROM 1900 TO 1910'                                        => new Date('FROM 1900 TO 1910'),
58
+			'FROM 1900'                                                => new Date('FROM 1900'),
59
+			'TO 1910'                                                  => new Date('TO 1910'),
60
+			'BET 1900 AND 1910'                                        => new Date('BET 1900 AND 1910'),
61
+			'BET JAN 1900 AND MAR 1900'                                => new Date('BET JAN 1900 AND MAR 1900'),
62
+			'BET APR 1900 AND JUN 1900'                                => new Date('BET APR 1900 AND JUN 1900'),
63
+			'BET JUL 1900 AND SEP 1900'                                => new Date('BET JUL 1900 AND SEP 1900'),
64
+			'BET OCT 1900 AND DEC 1900'                                => new Date('BET OCT 1900 AND DEC 1900'),
65
+			'AFT 1900'                                                 => new Date('AFT 1900'),
66
+			'BEF 1910'                                                 => new Date('BEF 1910'),
67
+			// Hijri dates
68
+			'@#DHIJRI@ 1497'                                    => new Date('@#DHIJRI@ 1497'),
69
+			'@#DHIJRI@ MUHAR 1497'                              => new Date('@#DHIJRI@ MUHAR 1497'),
70
+			'ABT @#DHIJRI@ SAFAR 1497'                          => new Date('ABT @#DHIJRI@ SAFAR 1497'),
71
+			'BET @#DHIJRI@ RABIA 1497 AND @#DHIJRI@ RABIT 1497' => new Date('BET @#DHIJRI@ RABIA 1497 AND @#DHIJRI@ RABIT 1497'),
72
+			'FROM @#DHIJRI@ JUMAA 1497 TO @#DHIJRI@ JUMAT 1497' => new Date('FROM @#DHIJRI@ JUMAA 1497 TO @#DHIJRI@ JUMAT 1497'),
73
+			'AFT @#DHIJRI@ RAJAB 1497'                          => new Date('AFT @#DHIJRI@ RAJAB 1497'),
74
+			'BEF @#DHIJRI@ SHAAB 1497'                          => new Date('BEF @#DHIJRI@ SHAAB 1497'),
75
+			'ABT @#DHIJRI@ RAMAD 1497'                          => new Date('ABT @#DHIJRI@ RAMAD 1497'),
76
+			'FROM @#DHIJRI@ SHAWW 1497'                         => new Date('FROM @#DHIJRI@ SHAWW 1497'),
77
+			'TO @#DHIJRI@ DHUAQ 1497'                           => new Date('TO @#DHIJRI@ DHUAQ 1497'),
78
+			'@#DHIJRI@ 03 DHUAH 1497'                           => new Date('@#DHIJRI@ 03 DHUAH 1497'),
79
+			// French dates
80
+			'@#DFRENCH R@ 12'                                   => new Date('@#DFRENCH R@ 12'),
81
+			'@#DFRENCH R@ VEND 12'                              => new Date('@#DFRENCH R@ VEND 12'),
82
+			'ABT @#DFRENCH R@ BRUM 12'                          => new Date('ABT @#DFRENCH R@ BRUM 12'),
83
+			'BET @#DFRENCH R@ FRIM 12 AND @#DFRENCH R@ NIVO 12' => new Date('BET @#DFRENCH R@ FRIM 12 AND @#DFRENCH R@ NIVO 12'),
84
+			'FROM @#DFRENCH R@ PLUV 12 TO @#DFRENCH R@ VENT 12' => new Date('FROM @#DFRENCH R@ PLUV 12 TO @#DFRENCH R@ VENT 12'),
85
+			'AFT @#DFRENCH R@ GERM 12'                          => new Date('AFT @#DFRENCH R@ GERM 12'),
86
+			'BEF @#DFRENCH R@ FLOR 12'                          => new Date('BEF @#DFRENCH R@ FLOR 12'),
87
+			'ABT @#DFRENCH R@ PRAI 12'                          => new Date('ABT @#DFRENCH R@ PRAI 12'),
88
+			'FROM @#DFRENCH R@ MESS 12'                         => new Date('FROM @#DFRENCH R@ MESS 12'),
89
+			'TO @#DFRENCH R@ THER 12'                           => new Date('TO @#DFRENCH R@ THER 12'),
90
+			'EST @#DFRENCH R@ FRUC 12'                          => new Date('EST @#DFRENCH R@ FRUC 12'),
91
+			'@#DFRENCH R@ 03 COMP 12'                           => new Date('@#DFRENCH R@ 03 COMP 12'),
92
+			// Jewish dates
93
+			'@#DHEBREW@ 5481'                                 => new Date('@#DHEBREW@ 5481'),
94
+			'@#DHEBREW@ TSH 5481'                             => new Date('@#DHEBREW@ TSH 5481'),
95
+			'ABT @#DHEBREW@ CSH 5481'                         => new Date('ABT @#DHEBREW@ CSH 5481'),
96
+			'BET @#DHEBREW@ KSL 5481 AND @#DHEBREW@ TVT 5481' => new Date('BET @#DHEBREW@ KSL 5481 AND @#DHEBREW@ TVT 5481'),
97
+			'FROM @#DHEBREW@ SHV 5481 TO @#DHEBREW@ ADR 5481' => new Date('FROM @#DHEBREW@ SHV 5481 TO @#DHEBREW@ ADR 5481'),
98
+			'AFT @#DHEBREW@ ADR 5481'                         => new Date('AFT @#DHEBREW@ ADR 5481'),
99
+			'AFT @#DHEBREW@ ADS 5480'                         => new Date('AFT @#DHEBREW@ ADS 5480'),
100
+			'BEF @#DHEBREW@ NSN 5481'                         => new Date('BEF @#DHEBREW@ NSN 5481'),
101
+			'ABT @#DHEBREW@ IYR 5481'                         => new Date('ABT @#DHEBREW@ IYR 5481'),
102
+			'FROM @#DHEBREW@ SVN 5481'                        => new Date('FROM @#DHEBREW@ SVN 5481'),
103
+			'TO @#DHEBREW@ TMZ 5481'                          => new Date('TO @#DHEBREW@ TMZ 5481'),
104
+			'EST @#DHEBREW@ AAV 5481'                         => new Date('EST @#DHEBREW@ AAV 5481'),
105
+			'@#DHEBREW@ 03 ELL 5481'                          => new Date('@#DHEBREW@ 03 ELL 5481'),
106
+		];
107 107
 
108
-	foreach ($dates as &$date) {
109
-		$date = strip_tags($date->display(false, null, false));
110
-	}
111
-	// These shortcuts work differently for different languages
112
-	switch (preg_replace('/[^DMY]/', '', str_replace(['J', 'F'], ['D', 'M'], I18N::dateFormat()))) {
113
-	case 'YMD':
114
-		$example1 = '11/12/1913'; // Note: we ignore the DMY order if it doesn't make sense.
115
-		$example2 = '03/02/01';
116
-		break;
117
-	case 'MDY':
118
-		$example1 = '12/11/1913';
119
-		$example2 = '02/01/03';
120
-		break;
121
-	case 'DMY':
122
-	default:
123
-		$example1 = '11/12/1913';
124
-		$example2 = '01/02/03';
125
-		break;
126
-	}
108
+		foreach ($dates as &$date) {
109
+			$date = strip_tags($date->display(false, null, false));
110
+		}
111
+		// These shortcuts work differently for different languages
112
+		switch (preg_replace('/[^DMY]/', '', str_replace(['J', 'F'], ['D', 'M'], I18N::dateFormat()))) {
113
+			case 'YMD':
114
+				$example1 = '11/12/1913'; // Note: we ignore the DMY order if it doesn't make sense.
115
+				$example2 = '03/02/01';
116
+				break;
117
+			case 'MDY':
118
+				$example1 = '12/11/1913';
119
+				$example2 = '02/01/03';
120
+				break;
121
+			case 'DMY':
122
+			default:
123
+				$example1 = '11/12/1913';
124
+				$example2 = '01/02/03';
125
+				break;
126
+		}
127 127
 	$example1 .= '<br>' . str_replace('/', '-', $example1) . '<br>' . str_replace('/', '.', $example1);
128 128
 	$example2 .= '<br>' . str_replace('/', '-', $example2) . '<br>' . str_replace('/', '.', $example2);
129 129
 	$text =
@@ -208,99 +208,99 @@  discard block
 block discarded – undo
208 208
 	break;
209 209
 
210 210
 // This help text is used for all NAME components
211
-case 'NAME':
212
-	$title = GedcomTag::getLabel('NAME');
213
-	$text  =
214
-		'<p>' .
215
-		I18N::translate('The <b>name</b> field contains the individual’s full name, as they would have spelled it or as it was recorded. This is how it will be displayed on screen. It uses standard genealogy annotations to identify different parts of the name.') .
216
-		'</p>' .
217
-		'<ul><li>' .
218
-		I18N::translate('The surname is enclosed by slashes: <%s>John Paul /Smith/<%s>', 'span style="color:#0000ff;"', '/span') .
219
-		'</li><li>' .
220
-		I18N::translate('If the surname is unknown, use empty slashes: <%s>Mary //<%s>', 'span style="color:#0000ff;"', '/span') .
221
-		'</li><li>' .
222
-		I18N::translate('If an individual has two separate surnames, both should be enclosed by slashes: <%s>José Antonio /Gómez/ /Iglesias/<%s>', 'span style="color:#0000ff;"', '/span') .
223
-		'</li><li>' .
224
-		I18N::translate('If an individual does not have a surname, no slashes are needed: <%s>Jón Einarsson<%s>', 'span style="color:#0000ff;"', '/span') .
225
-		'</li><li>' .
226
-		I18N::translate('If an individual was not known by their first given name, the preferred name should be indicated with an asterisk: <%s>John Paul* /Smith/<%s>', 'span style="color:#0000ff;"', '/span') .
227
-		'</li><li>' .
228
-		I18N::translate('If an individual was known by a nickname which is not part of their formal name, it should be enclosed by quotation marks. For example, <%s>John &quot;Nobby&quot; /Clark/<%s>.', 'span style="color:#0000ff;"', '/span') .
229
-		'</li></ul>';
230
-	break;
211
+	case 'NAME':
212
+		$title = GedcomTag::getLabel('NAME');
213
+		$text  =
214
+			'<p>' .
215
+			I18N::translate('The <b>name</b> field contains the individual’s full name, as they would have spelled it or as it was recorded. This is how it will be displayed on screen. It uses standard genealogy annotations to identify different parts of the name.') .
216
+			'</p>' .
217
+			'<ul><li>' .
218
+			I18N::translate('The surname is enclosed by slashes: <%s>John Paul /Smith/<%s>', 'span style="color:#0000ff;"', '/span') .
219
+			'</li><li>' .
220
+			I18N::translate('If the surname is unknown, use empty slashes: <%s>Mary //<%s>', 'span style="color:#0000ff;"', '/span') .
221
+			'</li><li>' .
222
+			I18N::translate('If an individual has two separate surnames, both should be enclosed by slashes: <%s>José Antonio /Gómez/ /Iglesias/<%s>', 'span style="color:#0000ff;"', '/span') .
223
+			'</li><li>' .
224
+			I18N::translate('If an individual does not have a surname, no slashes are needed: <%s>Jón Einarsson<%s>', 'span style="color:#0000ff;"', '/span') .
225
+			'</li><li>' .
226
+			I18N::translate('If an individual was not known by their first given name, the preferred name should be indicated with an asterisk: <%s>John Paul* /Smith/<%s>', 'span style="color:#0000ff;"', '/span') .
227
+			'</li><li>' .
228
+			I18N::translate('If an individual was known by a nickname which is not part of their formal name, it should be enclosed by quotation marks. For example, <%s>John &quot;Nobby&quot; /Clark/<%s>.', 'span style="color:#0000ff;"', '/span') .
229
+			'</li></ul>';
230
+		break;
231 231
 
232
-case 'SURN':
233
-	$title = I18N::translate('Surname');
234
-	$text  = '<p>' .
235
-		I18N::translate('The <b>surname</b> field contains a name that is used for sorting and grouping. It can be different to the individual’s actual surname which is always taken from the <b>name</b> field. This field can be used to sort surnames with or without a prefix (Gogh / van Gogh) and to group spelling variations or inflections (Kowalski / Kowalska). If an individual needs to be listed under more than one surname, each name should be separated by a comma.') .
236
-		'</p>';
237
-	break;
232
+	case 'SURN':
233
+		$title = I18N::translate('Surname');
234
+		$text  = '<p>' .
235
+			I18N::translate('The <b>surname</b> field contains a name that is used for sorting and grouping. It can be different to the individual’s actual surname which is always taken from the <b>name</b> field. This field can be used to sort surnames with or without a prefix (Gogh / van Gogh) and to group spelling variations or inflections (Kowalski / Kowalska). If an individual needs to be listed under more than one surname, each name should be separated by a comma.') .
236
+			'</p>';
237
+		break;
238 238
 
239
-case 'OBJE':
240
-	$title = I18N::translate('Media object');
241
-	$text  =
242
-		'<p>' .
243
-		I18N::translate('A media object is a record in the family tree which contains information about a media file. This information may include a title, a copyright notice, a transcript, privacy restrictions, etc. The media file, such as the photo or video, can be stored locally (on this webserver) or remotely (on a different webserver).') .
244
-		'</p>';
245
-	break;
239
+	case 'OBJE':
240
+		$title = I18N::translate('Media object');
241
+		$text  =
242
+			'<p>' .
243
+			I18N::translate('A media object is a record in the family tree which contains information about a media file. This information may include a title, a copyright notice, a transcript, privacy restrictions, etc. The media file, such as the photo or video, can be stored locally (on this webserver) or remotely (on a different webserver).') .
244
+			'</p>';
245
+		break;
246 246
 
247
-case 'PLAC':
248
-	$title = I18N::translate('Place');
249
-	$text  = I18N::translate('Places should be entered according to the standards for genealogy. In genealogy, places are recorded with the most specific information about the place first and then working up to the least specific place last, using commas to separate the different place levels. The level at which you record the place information should represent the levels of government or church where vital records for that place are kept.<br><br>For example, a place like Salt Lake City would be entered as “Salt Lake City, Salt Lake, Utah, USA”.<br><br>Let’s examine each part of this place. The first part, “Salt Lake City,” is the city or township where the event occurred. In some countries, there may be municipalities or districts inside a city which are important to note. In that case, they should come before the city. The next part, “Salt Lake,” is the county. “Utah” is the state, and “USA” is the country. It is important to note each place because genealogy records are kept by the governments of each level.<br><br>If a level of the place is unknown, you should leave a space between the commas. Suppose, in the example above, you didn’t know the county for Salt Lake City. You should then record it like this: “Salt Lake City, , Utah, USA”. Suppose you only know that an individual was born in Utah. You would enter the information like this: “, , Utah, USA”. <br><br>You can use the <b>Find Place</b> link to help you find places that already exist in the database.');
250
-	break;
247
+	case 'PLAC':
248
+		$title = I18N::translate('Place');
249
+		$text  = I18N::translate('Places should be entered according to the standards for genealogy. In genealogy, places are recorded with the most specific information about the place first and then working up to the least specific place last, using commas to separate the different place levels. The level at which you record the place information should represent the levels of government or church where vital records for that place are kept.<br><br>For example, a place like Salt Lake City would be entered as “Salt Lake City, Salt Lake, Utah, USA”.<br><br>Let’s examine each part of this place. The first part, “Salt Lake City,” is the city or township where the event occurred. In some countries, there may be municipalities or districts inside a city which are important to note. In that case, they should come before the city. The next part, “Salt Lake,” is the county. “Utah” is the state, and “USA” is the country. It is important to note each place because genealogy records are kept by the governments of each level.<br><br>If a level of the place is unknown, you should leave a space between the commas. Suppose, in the example above, you didn’t know the county for Salt Lake City. You should then record it like this: “Salt Lake City, , Utah, USA”. Suppose you only know that an individual was born in Utah. You would enter the information like this: “, , Utah, USA”. <br><br>You can use the <b>Find Place</b> link to help you find places that already exist in the database.');
250
+		break;
251 251
 
252
-case 'RESN':
253
-	$title = GedcomTag::getLabel('RESN');
254
-	$text  = I18N::translate('Restrictions can be added to records and/or facts. They restrict who can view the data and who can edit it.') . '<br><br>' . I18N::translate('Note that if a user account is linked to a record, then that user will always be able to view that record.');
255
-	break;
252
+	case 'RESN':
253
+		$title = GedcomTag::getLabel('RESN');
254
+		$text  = I18N::translate('Restrictions can be added to records and/or facts. They restrict who can view the data and who can edit it.') . '<br><br>' . I18N::translate('Note that if a user account is linked to a record, then that user will always be able to view that record.');
255
+		break;
256 256
 
257
-case 'ROMN':
258
-	$title = GedcomTag::getLabel('ROMN');
259
-	$text  = I18N::translate('In many cultures it is customary to have a traditional name spelled in the traditional characters and also a romanized version of the name as it would be spelled or pronounced in languages based on the Latin alphabet, such as English.<br><br>If you prefer to use a non-Latin alphabet such as Hebrew, Greek, Russian, Chinese, or Arabic to enter the name in the standard name fields, then you can use this field to enter the same name using the Latin alphabet. Both versions of the name will appear in lists and charts.<br><br>Although this field is labeled “Romanized”, it is not restricted to containing only characters based on the Latin alphabet. This might be of use with Japanese names, where three different alphabets may occur.');
260
-	break;
257
+	case 'ROMN':
258
+		$title = GedcomTag::getLabel('ROMN');
259
+		$text  = I18N::translate('In many cultures it is customary to have a traditional name spelled in the traditional characters and also a romanized version of the name as it would be spelled or pronounced in languages based on the Latin alphabet, such as English.<br><br>If you prefer to use a non-Latin alphabet such as Hebrew, Greek, Russian, Chinese, or Arabic to enter the name in the standard name fields, then you can use this field to enter the same name using the Latin alphabet. Both versions of the name will appear in lists and charts.<br><br>Although this field is labeled “Romanized”, it is not restricted to containing only characters based on the Latin alphabet. This might be of use with Japanese names, where three different alphabets may occur.');
260
+		break;
261 261
 
262
-case '_HEB':
263
-	$title = GedcomTag::getLabel('_HEB');
264
-	$text  = I18N::translate('In many cultures it is customary to have a traditional name spelled in the traditional characters and also a romanized version of the name as it would be spelled or pronounced in languages based on the Latin alphabet, such as English.<br><br>If you prefer to use the Latin alphabet to enter the name in the standard name fields, then you can use this field to enter the same name in the non-Latin alphabet such as Greek, Hebrew, Russian, Arabic, or Chinese. Both versions of the name will appear in lists and charts.<br><br>Although this field is labeled “Hebrew”, it is not restricted to containing only Hebrew characters.');
265
-	break;
262
+	case '_HEB':
263
+		$title = GedcomTag::getLabel('_HEB');
264
+		$text  = I18N::translate('In many cultures it is customary to have a traditional name spelled in the traditional characters and also a romanized version of the name as it would be spelled or pronounced in languages based on the Latin alphabet, such as English.<br><br>If you prefer to use the Latin alphabet to enter the name in the standard name fields, then you can use this field to enter the same name in the non-Latin alphabet such as Greek, Hebrew, Russian, Arabic, or Chinese. Both versions of the name will appear in lists and charts.<br><br>Although this field is labeled “Hebrew”, it is not restricted to containing only Hebrew characters.');
265
+		break;
266 266
 
267
-	//////////////////////////////////////////////////////////////////////////////
268
-	// This section contains all the other help items.
269
-	//////////////////////////////////////////////////////////////////////////////
267
+		//////////////////////////////////////////////////////////////////////////////
268
+		// This section contains all the other help items.
269
+		//////////////////////////////////////////////////////////////////////////////
270 270
 
271
-case 'annivers_year_select':
272
-	$title = I18N::translate('Year input box');
273
-	$text  = I18N::translate('This input box lets you change that year of the calendar. Type a year into the box and press <b>Enter</b> to change the calendar to that year.<br><br><b>Advanced features</b> for <b>View the year</b><dl><dt><b>More than one year</b></dt><dd>You can search for dates in a range of years.<br><br>Year ranges are <u>inclusive</u>. This means that the date range extends from 1 January of the first year of the range to 31 December of the last year mentioned. Here are a few examples of year ranges:<br><br><b>1992-5</b> for all events from 1992 to 1995.<br><b>1972-89</b> for all events from 1972 to 1989.<br><b>1610-759</b> for all events from 1610 to 1759.<br><b>1880-1905</b> for all events from 1880 to 1905.<br><b>880-1105</b> for all events from 880 to 1105.<br><br>To see all the events in a given decade or century, you can use <b>?</b> in place of the final digits. For example, <b>197?</b> for all events from 1970 to 1979 or <b>16??</b> for all events from 1600 to 1699.<br><br>Selecting a range of years will change the calendar to the year view.</dd></dl>');
274
-	break;
271
+	case 'annivers_year_select':
272
+		$title = I18N::translate('Year input box');
273
+		$text  = I18N::translate('This input box lets you change that year of the calendar. Type a year into the box and press <b>Enter</b> to change the calendar to that year.<br><br><b>Advanced features</b> for <b>View the year</b><dl><dt><b>More than one year</b></dt><dd>You can search for dates in a range of years.<br><br>Year ranges are <u>inclusive</u>. This means that the date range extends from 1 January of the first year of the range to 31 December of the last year mentioned. Here are a few examples of year ranges:<br><br><b>1992-5</b> for all events from 1992 to 1995.<br><b>1972-89</b> for all events from 1972 to 1989.<br><b>1610-759</b> for all events from 1610 to 1759.<br><b>1880-1905</b> for all events from 1880 to 1905.<br><b>880-1105</b> for all events from 880 to 1105.<br><br>To see all the events in a given decade or century, you can use <b>?</b> in place of the final digits. For example, <b>197?</b> for all events from 1970 to 1979 or <b>16??</b> for all events from 1600 to 1699.<br><br>Selecting a range of years will change the calendar to the year view.</dd></dl>');
274
+		break;
275 275
 
276
-case 'edit_SOUR_EVEN':
277
-	$title = I18N::translate('Associate events with this source');
278
-	$text  = I18N::translate('Each source records specific events, generally for a given date range and for a place jurisdiction. For example a Census records census events and church records record birth, marriage, and death events.<br><br>Select the events that are recorded by this source from the list of events provided. The date should be specified in a range format such as <i>FROM 1900 TO 1910</i>. The place jurisdiction is the name of the lowest jurisdiction that encompasses all lower-level places named in this source. For example, “Oneida, Idaho, USA” would be used as a source jurisdiction place for events occurring in the various towns within Oneida County. “Idaho, USA” would be the source jurisdiction place if the events recorded took place not only in Oneida County but also in other counties in Idaho.');
279
-	break;
276
+	case 'edit_SOUR_EVEN':
277
+		$title = I18N::translate('Associate events with this source');
278
+		$text  = I18N::translate('Each source records specific events, generally for a given date range and for a place jurisdiction. For example a Census records census events and church records record birth, marriage, and death events.<br><br>Select the events that are recorded by this source from the list of events provided. The date should be specified in a range format such as <i>FROM 1900 TO 1910</i>. The place jurisdiction is the name of the lowest jurisdiction that encompasses all lower-level places named in this source. For example, “Oneida, Idaho, USA” would be used as a source jurisdiction place for events occurring in the various towns within Oneida County. “Idaho, USA” would be the source jurisdiction place if the events recorded took place not only in Oneida County but also in other counties in Idaho.');
279
+		break;
280 280
 
281
-case 'google_chart_surname':
282
-	$title = I18N::translate('Surname');
283
-	$text  = I18N::translate('The number of occurrences of the specified name will be shown on the map. If you leave this field empty, the most common surname will be used.');
284
-	break;
281
+	case 'google_chart_surname':
282
+		$title = I18N::translate('Surname');
283
+		$text  = I18N::translate('The number of occurrences of the specified name will be shown on the map. If you leave this field empty, the most common surname will be used.');
284
+		break;
285 285
 
286
-case 'pending_changes':
287
-	$title = I18N::translate('Pending changes');
288
-	$text  = '<p>' . I18N::translate('When you add, edit, or delete information, the changes are not saved immediately. Instead, they are kept in a “pending” area. These pending changes need to be reviewed by a moderator before they are accepted.') . '</p><p>' .
289
-		I18N::translate('This process allows the site’s owner to ensure that the new information follows the site’s standards and conventions, has proper source attributions, etc.') .
290
-		'</p><p>' .
291
-		I18N::translate('Pending changes are only shown when your account has permission to edit. When you sign out, you will no longer be able to see them. Also, pending changes are only shown on certain pages. For example, they are not shown in lists, reports, or search results.') .
292
-		'</p>';
293
-	if (Auth::isAdmin()) {
294
-		$text .=
295
-			'<p>' .
296
-			I18N::translate('Each user account has an option to “automatically accept changes”. When this is enabled, any changes made by that user are saved immediately. Many administrators enable this for their own user account.') .
286
+	case 'pending_changes':
287
+		$title = I18N::translate('Pending changes');
288
+		$text  = '<p>' . I18N::translate('When you add, edit, or delete information, the changes are not saved immediately. Instead, they are kept in a “pending” area. These pending changes need to be reviewed by a moderator before they are accepted.') . '</p><p>' .
289
+			I18N::translate('This process allows the site’s owner to ensure that the new information follows the site’s standards and conventions, has proper source attributions, etc.') .
290
+			'</p><p>' .
291
+			I18N::translate('Pending changes are only shown when your account has permission to edit. When you sign out, you will no longer be able to see them. Also, pending changes are only shown on certain pages. For example, they are not shown in lists, reports, or search results.') .
297 292
 			'</p>';
298
-	}
299
-	break;
293
+		if (Auth::isAdmin()) {
294
+			$text .=
295
+				'<p>' .
296
+				I18N::translate('Each user account has an option to “automatically accept changes”. When this is enabled, any changes made by that user are saved immediately. Many administrators enable this for their own user account.') .
297
+				'</p>';
298
+		}
299
+		break;
300 300
 
301
-default:
302
-	$title = I18N::translate('Help');
303
-	$text  = I18N::translate('The help text has not been written for this item.');
304
-	break;
301
+	default:
302
+		$title = I18N::translate('Help');
303
+		$text  = I18N::translate('The help text has not been written for this item.');
304
+		break;
305 305
 }
306 306
 
Please login to merge, or discard this patch.
statisticsplot.php 1 patch
Switch Indentation   +400 added lines, -400 removed lines patch added patch discarded remove patch
@@ -792,425 +792,425 @@
 block discarded – undo
792 792
 echo '<div class="statistics_chart" title="', I18N::translate('Statistics chart'), '">';
793 793
 
794 794
 switch ($x_axis) {
795
-case '1':
796
-	echo $stats->chartDistribution([Filter::get('chart_shows'), Filter::get('chart_type'), Filter::get('SURN')]);
797
-	break;
798
-case '2':
799
-	echo $stats->chartDistribution([Filter::get('chart_shows'), 'birth_distribution_chart']);
800
-	break;
801
-case '3':
802
-	echo $stats->chartDistribution([Filter::get('chart_shows'), 'death_distribution_chart']);
803
-	break;
804
-case '4':
805
-	echo $stats->chartDistribution([Filter::get('chart_shows'), 'marriage_distribution_chart']);
806
-	break;
807
-case '11':
808
-	$monthdata = [];
809
-	for ($i = 0; $i < 12; ++$i) {
810
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
811
-	}
812
-	$xgiven            = true;
813
-	$zgiven            = false;
814
-	$title             = I18N::translate('Month of birth');
815
-	$xtitle            = I18N::translate('Month');
816
-	$ytitle            = I18N::translate('numbers');
817
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
818
-	$xdata             = $monthdata;
819
-	$xmax              = 12;
820
-	if ($z_axis !== 300 && $z_axis !== 301) {
821
-		calculate_legend($boundaries_z_axis);
822
-	}
823
-	$percentage = false;
824
-	if ($y_axis === 201) {
795
+	case '1':
796
+		echo $stats->chartDistribution([Filter::get('chart_shows'), Filter::get('chart_type'), Filter::get('SURN')]);
797
+		break;
798
+	case '2':
799
+		echo $stats->chartDistribution([Filter::get('chart_shows'), 'birth_distribution_chart']);
800
+		break;
801
+	case '3':
802
+		echo $stats->chartDistribution([Filter::get('chart_shows'), 'death_distribution_chart']);
803
+		break;
804
+	case '4':
805
+		echo $stats->chartDistribution([Filter::get('chart_shows'), 'marriage_distribution_chart']);
806
+		break;
807
+	case '11':
808
+		$monthdata = [];
809
+		for ($i = 0; $i < 12; ++$i) {
810
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
811
+		}
812
+		$xgiven            = true;
813
+		$zgiven            = false;
814
+		$title             = I18N::translate('Month of birth');
815
+		$xtitle            = I18N::translate('Month');
816
+		$ytitle            = I18N::translate('numbers');
817
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
818
+		$xdata             = $monthdata;
819
+		$xmax              = 12;
820
+		if ($z_axis !== 300 && $z_axis !== 301) {
821
+			calculate_legend($boundaries_z_axis);
822
+		}
825 823
 		$percentage = false;
826
-		$ytitle     = I18N::translate('Individuals');
827
-	} elseif ($y_axis === 202) {
828
-		$percentage = true;
829
-		$ytitle     = I18N::translate('percentage');
830
-	}
831
-	$male_female = false;
832
-	if ($z_axis === 300) {
833
-		$zgiven          = false;
834
-		$legend[0]       = 'all';
835
-		$zmax            = 1;
836
-		$z_boundaries[0] = 100000;
837
-	} elseif ($z_axis === 301) {
838
-		$male_female = true;
839
-		$zgiven      = true;
840
-		$legend[0]   = I18N::translate('Male');
841
-		$legend[1]   = I18N::translate('Female');
842
-		$zmax        = 2;
843
-	}
844
-	//-- reset the data array
845
-	for ($i = 0; $i < $zmax; $i++) {
846
-		for ($j = 0; $j < $xmax; $j++) {
847
-			$ydata[$i][$j] = 0;
824
+		if ($y_axis === 201) {
825
+			$percentage = false;
826
+			$ytitle     = I18N::translate('Individuals');
827
+		} elseif ($y_axis === 202) {
828
+			$percentage = true;
829
+			$ytitle     = I18N::translate('percentage');
830
+		}
831
+		$male_female = false;
832
+		if ($z_axis === 300) {
833
+			$zgiven          = false;
834
+			$legend[0]       = 'all';
835
+			$zmax            = 1;
836
+			$z_boundaries[0] = 100000;
837
+		} elseif ($z_axis === 301) {
838
+			$male_female = true;
839
+			$zgiven      = true;
840
+			$legend[0]   = I18N::translate('Male');
841
+			$legend[1]   = I18N::translate('Female');
842
+			$zmax        = 2;
843
+		}
844
+		//-- reset the data array
845
+		for ($i = 0; $i < $zmax; $i++) {
846
+			for ($j = 0; $j < $xmax; $j++) {
847
+				$ydata[$i][$j] = 0;
848
+			}
849
+		}
850
+		$total = month_of_birth($z_axis, $z_boundaries, $stats);
851
+		my_plot($title, $xdata, $xtitle, $ydata, $ytitle, $legend);
852
+		break;
853
+	case '12':
854
+		$monthdata = [];
855
+		for ($i = 0; $i < 12; ++$i) {
856
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
857
+		}
858
+		$xgiven            = true;
859
+		$zgiven            = false;
860
+		$title             = I18N::translate('Month of death');
861
+		$xtitle            = I18N::translate('Month');
862
+		$ytitle            = I18N::translate('numbers');
863
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
864
+		$xdata             = $monthdata;
865
+		$xmax              = 12;
866
+		if ($z_axis !== 300 && $z_axis !== 301) {
867
+			calculate_legend($boundaries_z_axis);
848 868
 		}
849
-	}
850
-	$total = month_of_birth($z_axis, $z_boundaries, $stats);
851
-	my_plot($title, $xdata, $xtitle, $ydata, $ytitle, $legend);
852
-	break;
853
-case '12':
854
-	$monthdata = [];
855
-	for ($i = 0; $i < 12; ++$i) {
856
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
857
-	}
858
-	$xgiven            = true;
859
-	$zgiven            = false;
860
-	$title             = I18N::translate('Month of death');
861
-	$xtitle            = I18N::translate('Month');
862
-	$ytitle            = I18N::translate('numbers');
863
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
864
-	$xdata             = $monthdata;
865
-	$xmax              = 12;
866
-	if ($z_axis !== 300 && $z_axis !== 301) {
867
-		calculate_legend($boundaries_z_axis);
868
-	}
869
-	$percentage = false;
870
-	if ($y_axis === 201) {
871 869
 		$percentage = false;
872
-		$ytitle     = I18N::translate('Individuals');
873
-	} elseif ($y_axis === 202) {
874
-		$percentage = true;
875
-		$ytitle     = I18N::translate('percentage');
876
-	}
877
-	$male_female = false;
878
-	if ($z_axis === 300) {
879
-		$zgiven          = false;
880
-		$legend[0]       = 'all';
881
-		$zmax            = 1;
882
-		$z_boundaries[0] = 100000;
883
-	} elseif ($z_axis === 301) {
884
-		$male_female = true;
885
-		$zgiven      = true;
886
-		$legend[0]   = I18N::translate('Male');
887
-		$legend[1]   = I18N::translate('Female');
888
-		$zmax        = 2;
889
-	}
890
-	//-- reset the data array
891
-	for ($i = 0; $i < $zmax; $i++) {
892
-		for ($j = 0; $j < $xmax; $j++) {
893
-			$ydata[$i][$j] = 0;
870
+		if ($y_axis === 201) {
871
+			$percentage = false;
872
+			$ytitle     = I18N::translate('Individuals');
873
+		} elseif ($y_axis === 202) {
874
+			$percentage = true;
875
+			$ytitle     = I18N::translate('percentage');
876
+		}
877
+		$male_female = false;
878
+		if ($z_axis === 300) {
879
+			$zgiven          = false;
880
+			$legend[0]       = 'all';
881
+			$zmax            = 1;
882
+			$z_boundaries[0] = 100000;
883
+		} elseif ($z_axis === 301) {
884
+			$male_female = true;
885
+			$zgiven      = true;
886
+			$legend[0]   = I18N::translate('Male');
887
+			$legend[1]   = I18N::translate('Female');
888
+			$zmax        = 2;
889
+		}
890
+		//-- reset the data array
891
+		for ($i = 0; $i < $zmax; $i++) {
892
+			for ($j = 0; $j < $xmax; $j++) {
893
+				$ydata[$i][$j] = 0;
894
+			}
895
+		}
896
+		$total = month_of_death($z_axis, $z_boundaries, $stats);
897
+		my_plot($title, $xdata, $xtitle, $ydata, $ytitle, $legend);
898
+		break;
899
+	case '13':
900
+		$monthdata = [];
901
+		for ($i = 0; $i < 12; ++$i) {
902
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
894 903
 		}
895
-	}
896
-	$total = month_of_death($z_axis, $z_boundaries, $stats);
897
-	my_plot($title, $xdata, $xtitle, $ydata, $ytitle, $legend);
898
-	break;
899
-case '13':
900
-	$monthdata = [];
901
-	for ($i = 0; $i < 12; ++$i) {
902
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
903
-	}
904 904
 
905
-	if ($z_axis === 301) {
906
-		$z_axis = 300;
907
-	}
908
-	$xgiven            = true;
909
-	$zgiven            = false;
910
-	$title             = I18N::translate('Month of marriage');
911
-	$xtitle            = I18N::translate('Month');
912
-	$ytitle            = I18N::translate('numbers');
913
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
914
-	$xdata             = $monthdata;
915
-	$xmax              = 12;
916
-	if ($z_axis !== 300 && $z_axis !== 301) {
917
-		calculate_legend($boundaries_z_axis);
918
-	}
919
-	$percentage = false;
920
-	if ($y_axis === 201) {
905
+		if ($z_axis === 301) {
906
+			$z_axis = 300;
907
+		}
908
+		$xgiven            = true;
909
+		$zgiven            = false;
910
+		$title             = I18N::translate('Month of marriage');
911
+		$xtitle            = I18N::translate('Month');
912
+		$ytitle            = I18N::translate('numbers');
913
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
914
+		$xdata             = $monthdata;
915
+		$xmax              = 12;
916
+		if ($z_axis !== 300 && $z_axis !== 301) {
917
+			calculate_legend($boundaries_z_axis);
918
+		}
921 919
 		$percentage = false;
922
-		$ytitle     = I18N::translate('Families');
923
-	} elseif ($y_axis === 202) {
924
-		$percentage = true;
925
-		$ytitle     = I18N::translate('percentage');
926
-	}
927
-	$male_female = false;
928
-	if ($z_axis === 300) {
929
-		$zgiven          = false;
930
-		$legend[0]       = 'all';
931
-		$zmax            = 1;
932
-		$z_boundaries[0] = 100000;
933
-	} elseif ($z_axis === 301) {
934
-		$male_female = true;
935
-		$zgiven      = true;
936
-		$legend[0]   = I18N::translate('Male');
937
-		$legend[1]   = I18N::translate('Female');
938
-		$zmax        = 2;
939
-	}
940
-	//-- reset the data array
941
-	for ($i = 0; $i < $zmax; $i++) {
942
-		for ($j = 0; $j < $xmax; $j++) {
943
-			$ydata[$i][$j] = 0;
920
+		if ($y_axis === 201) {
921
+			$percentage = false;
922
+			$ytitle     = I18N::translate('Families');
923
+		} elseif ($y_axis === 202) {
924
+			$percentage = true;
925
+			$ytitle     = I18N::translate('percentage');
926
+		}
927
+		$male_female = false;
928
+		if ($z_axis === 300) {
929
+			$zgiven          = false;
930
+			$legend[0]       = 'all';
931
+			$zmax            = 1;
932
+			$z_boundaries[0] = 100000;
933
+		} elseif ($z_axis === 301) {
934
+			$male_female = true;
935
+			$zgiven      = true;
936
+			$legend[0]   = I18N::translate('Male');
937
+			$legend[1]   = I18N::translate('Female');
938
+			$zmax        = 2;
939
+		}
940
+		//-- reset the data array
941
+		for ($i = 0; $i < $zmax; $i++) {
942
+			for ($j = 0; $j < $xmax; $j++) {
943
+				$ydata[$i][$j] = 0;
944
+			}
945
+		}
946
+		$total = month_of_marriage($z_axis, $z_boundaries, $stats);
947
+		my_plot($title, $xdata, $xtitle, $ydata, $ytitle, $legend);
948
+		break;
949
+	case '14':
950
+		$monthdata = [];
951
+		for ($i = 0; $i < 12; ++$i) {
952
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
953
+		}
954
+		$xgiven            = true;
955
+		$zgiven            = false;
956
+		$title             = I18N::translate('Month of birth of first child in a relation');
957
+		$xtitle            = I18N::translate('Month');
958
+		$ytitle            = I18N::translate('numbers');
959
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
960
+		$xdata             = $monthdata;
961
+		$xmax              = 12;
962
+		if ($z_axis !== 300 && $z_axis !== 301) {
963
+			calculate_legend($boundaries_z_axis);
944 964
 		}
945
-	}
946
-	$total = month_of_marriage($z_axis, $z_boundaries, $stats);
947
-	my_plot($title, $xdata, $xtitle, $ydata, $ytitle, $legend);
948
-	break;
949
-case '14':
950
-	$monthdata = [];
951
-	for ($i = 0; $i < 12; ++$i) {
952
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
953
-	}
954
-	$xgiven            = true;
955
-	$zgiven            = false;
956
-	$title             = I18N::translate('Month of birth of first child in a relation');
957
-	$xtitle            = I18N::translate('Month');
958
-	$ytitle            = I18N::translate('numbers');
959
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
960
-	$xdata             = $monthdata;
961
-	$xmax              = 12;
962
-	if ($z_axis !== 300 && $z_axis !== 301) {
963
-		calculate_legend($boundaries_z_axis);
964
-	}
965
-	$percentage = false;
966
-	if ($y_axis === 201) {
967 965
 		$percentage = false;
968
-		$ytitle     = I18N::translate('Children');
969
-	} elseif ($y_axis === 202) {
970
-		$percentage = true;
971
-		$ytitle     = I18N::translate('percentage');
972
-	}
973
-	$male_female = false;
974
-	if ($z_axis === 300) {
975
-		$zgiven          = false;
976
-		$legend[0]       = 'all';
977
-		$zmax            = 1;
978
-		$z_boundaries[0] = 100000;
979
-	} elseif ($z_axis === 301) {
980
-		$male_female = true;
981
-		$zgiven      = true;
982
-		$legend[0]   = I18N::translate('Male');
983
-		$legend[1]   = I18N::translate('Female');
984
-		$zmax        = 2;
985
-	}
986
-	//-- reset the data array
987
-	for ($i = 0; $i < $zmax; $i++) {
988
-		for ($j = 0; $j < $xmax; $j++) {
989
-			$ydata[$i][$j] = 0;
966
+		if ($y_axis === 201) {
967
+			$percentage = false;
968
+			$ytitle     = I18N::translate('Children');
969
+		} elseif ($y_axis === 202) {
970
+			$percentage = true;
971
+			$ytitle     = I18N::translate('percentage');
972
+		}
973
+		$male_female = false;
974
+		if ($z_axis === 300) {
975
+			$zgiven          = false;
976
+			$legend[0]       = 'all';
977
+			$zmax            = 1;
978
+			$z_boundaries[0] = 100000;
979
+		} elseif ($z_axis === 301) {
980
+			$male_female = true;
981
+			$zgiven      = true;
982
+			$legend[0]   = I18N::translate('Male');
983
+			$legend[1]   = I18N::translate('Female');
984
+			$zmax        = 2;
985
+		}
986
+		//-- reset the data array
987
+		for ($i = 0; $i < $zmax; $i++) {
988
+			for ($j = 0; $j < $xmax; $j++) {
989
+				$ydata[$i][$j] = 0;
990
+			}
991
+		}
992
+		$total = month_of_birth_of_first_child($z_axis, $z_boundaries, $stats);
993
+		my_plot($title, $xdata, $xtitle, $ydata, $ytitle, $legend);
994
+		break;
995
+	case '15':
996
+		$monthdata = [];
997
+		for ($i = 0; $i < 12; ++$i) {
998
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
990 999
 		}
991
-	}
992
-	$total = month_of_birth_of_first_child($z_axis, $z_boundaries, $stats);
993
-	my_plot($title, $xdata, $xtitle, $ydata, $ytitle, $legend);
994
-	break;
995
-case '15':
996
-	$monthdata = [];
997
-	for ($i = 0; $i < 12; ++$i) {
998
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
999
-	}
1000 1000
 
1001
-	if ($z_axis === 301) {
1002
-		$z_axis = 300;
1003
-	}
1004
-	$xgiven            = true;
1005
-	$zgiven            = false;
1006
-	$title             = I18N::translate('Month of first marriage');
1007
-	$xtitle            = I18N::translate('Month');
1008
-	$ytitle            = I18N::translate('numbers');
1009
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1010
-	$xdata             = $monthdata;
1011
-	$xmax              = 12;
1012
-	if ($z_axis !== 300 && $z_axis !== 301) {
1013
-		calculate_legend($boundaries_z_axis);
1014
-	}
1015
-	$percentage = false;
1016
-	if ($y_axis === 201) {
1017
-		$percentage = false;
1018
-		$ytitle     = I18N::translate('Families');
1019
-	} elseif ($y_axis === 202) {
1020
-		$percentage = true;
1021
-		$ytitle     = I18N::translate('percentage');
1022
-	}
1023
-	$male_female = false;
1024
-	if ($z_axis === 300) {
1025
-		$zgiven          = false;
1026
-		$legend[0]       = 'all';
1027
-		$zmax            = 1;
1028
-		$z_boundaries[0] = 100000;
1029
-	} elseif ($z_axis === 301) {
1030
-		$male_female = true;
1031
-		$zgiven      = true;
1032
-		$legend[0]   = I18N::translate('Male');
1033
-		$legend[1]   = I18N::translate('Female');
1034
-		$zmax        = 2;
1035
-	}
1036
-	//-- reset the data array
1037
-	for ($i = 0; $i < $zmax; $i++) {
1038
-		for ($j = 0; $j < $xmax; $j++) {
1039
-			$ydata[$i][$j] = 0;
1001
+		if ($z_axis === 301) {
1002
+			$z_axis = 300;
1003
+		}
1004
+		$xgiven            = true;
1005
+		$zgiven            = false;
1006
+		$title             = I18N::translate('Month of first marriage');
1007
+		$xtitle            = I18N::translate('Month');
1008
+		$ytitle            = I18N::translate('numbers');
1009
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1010
+		$xdata             = $monthdata;
1011
+		$xmax              = 12;
1012
+		if ($z_axis !== 300 && $z_axis !== 301) {
1013
+			calculate_legend($boundaries_z_axis);
1040 1014
 		}
1041
-	}
1042
-	$total = month_of_first_marriage($z_axis, $z_boundaries, $stats);
1043
-	my_plot($title, $xdata, $xtitle, $ydata, $ytitle, $legend);
1044
-	break;
1045
-case '18':
1046
-	$xgiven            = false;
1047
-	$zgiven            = false;
1048
-	$title             = /* I18N: Two axes of a graph */ I18N::translate('Longevity versus time');
1049
-	$xtitle            = I18N::translate('age');
1050
-	$ytitle            = I18N::translate('numbers');
1051
-	$boundaries_x_axis = Filter::get('x-axis-boundaries-ages');
1052
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1053
-	calculate_axis($boundaries_x_axis);
1054
-	if ($z_axis !== 300 && $z_axis !== 301) {
1055
-		calculate_legend($boundaries_z_axis);
1056
-	}
1057
-	$percentage = false;
1058
-	if ($y_axis === 201) {
1059 1015
 		$percentage = false;
1060
-		$ytitle     = I18N::translate('Individuals');
1061
-	} elseif ($y_axis === 202) {
1062
-		$percentage = true;
1063
-		$ytitle     = I18N::translate('percentage');
1064
-	}
1065
-	$male_female = false;
1066
-	if ($z_axis === 300) {
1067
-		$zgiven          = false;
1068
-		$legend[0]       = 'all';
1069
-		$zmax            = 1;
1070
-		$z_boundaries[0] = 100000;
1071
-	} elseif ($z_axis === 301) {
1072
-		$male_female = true;
1073
-		$zgiven      = true;
1074
-		$legend[0]   = I18N::translate('Male');
1075
-		$legend[1]   = I18N::translate('Female');
1076
-		$zmax        = 2;
1077
-	}
1078
-	//-- reset the data array
1079
-	for ($i = 0; $i < $zmax; $i++) {
1080
-		for ($j = 0; $j < $xmax; $j++) {
1081
-			$ydata[$i][$j] = 0;
1016
+		if ($y_axis === 201) {
1017
+			$percentage = false;
1018
+			$ytitle     = I18N::translate('Families');
1019
+		} elseif ($y_axis === 202) {
1020
+			$percentage = true;
1021
+			$ytitle     = I18N::translate('percentage');
1022
+		}
1023
+		$male_female = false;
1024
+		if ($z_axis === 300) {
1025
+			$zgiven          = false;
1026
+			$legend[0]       = 'all';
1027
+			$zmax            = 1;
1028
+			$z_boundaries[0] = 100000;
1029
+		} elseif ($z_axis === 301) {
1030
+			$male_female = true;
1031
+			$zgiven      = true;
1032
+			$legend[0]   = I18N::translate('Male');
1033
+			$legend[1]   = I18N::translate('Female');
1034
+			$zmax        = 2;
1035
+		}
1036
+		//-- reset the data array
1037
+		for ($i = 0; $i < $zmax; $i++) {
1038
+			for ($j = 0; $j < $xmax; $j++) {
1039
+				$ydata[$i][$j] = 0;
1040
+			}
1041
+		}
1042
+		$total = month_of_first_marriage($z_axis, $z_boundaries, $stats);
1043
+		my_plot($title, $xdata, $xtitle, $ydata, $ytitle, $legend);
1044
+		break;
1045
+	case '18':
1046
+		$xgiven            = false;
1047
+		$zgiven            = false;
1048
+		$title             = /* I18N: Two axes of a graph */ I18N::translate('Longevity versus time');
1049
+		$xtitle            = I18N::translate('age');
1050
+		$ytitle            = I18N::translate('numbers');
1051
+		$boundaries_x_axis = Filter::get('x-axis-boundaries-ages');
1052
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1053
+		calculate_axis($boundaries_x_axis);
1054
+		if ($z_axis !== 300 && $z_axis !== 301) {
1055
+			calculate_legend($boundaries_z_axis);
1082 1056
 		}
1083
-	}
1084
-	$total = longevity_versus_time($z_axis, $z_boundaries, $stats);
1085
-	my_plot($title, $xdata, $xtitle, $ydata, $ytitle, $legend);
1086
-	break;
1087
-case '19':
1088
-	$xgiven            = false;
1089
-	$zgiven            = false;
1090
-	$title             = I18N::translate('Age in year of marriage');
1091
-	$xtitle            = I18N::translate('age');
1092
-	$ytitle            = I18N::translate('numbers');
1093
-	$boundaries_x_axis = Filter::get('x-axis-boundaries-ages_m');
1094
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1095
-	calculate_axis($boundaries_x_axis);
1096
-	if ($z_axis !== 300 && $z_axis !== 301) {
1097
-		calculate_legend($boundaries_z_axis);
1098
-	}
1099
-	$percentage = false;
1100
-	if ($y_axis === 201) {
1101 1057
 		$percentage = false;
1102
-		$ytitle     = I18N::translate('Individuals');
1103
-	} elseif ($y_axis === 202) {
1104
-		$percentage = true;
1105
-		$ytitle     = I18N::translate('percentage');
1106
-	}
1107
-	$male_female     = false;
1108
-	$z_boundaries[0] = 100000;
1109
-	if ($z_axis === 300) {
1110
-		$zgiven    = false;
1111
-		$legend[0] = 'all';
1112
-		$zmax      = 1;
1113
-	} elseif ($z_axis === 301) {
1114
-		$male_female = true;
1115
-		$zgiven      = true;
1116
-		$legend[0]   = I18N::translate('Male');
1117
-		$legend[1]   = I18N::translate('Female');
1118
-		$zmax        = 2;
1119
-	}
1120
-	//-- reset the data array
1121
-	for ($i = 0; $i < $zmax; $i++) {
1122
-		for ($j = 0; $j < $xmax; $j++) {
1123
-			$ydata[$i][$j] = 0;
1058
+		if ($y_axis === 201) {
1059
+			$percentage = false;
1060
+			$ytitle     = I18N::translate('Individuals');
1061
+		} elseif ($y_axis === 202) {
1062
+			$percentage = true;
1063
+			$ytitle     = I18N::translate('percentage');
1064
+		}
1065
+		$male_female = false;
1066
+		if ($z_axis === 300) {
1067
+			$zgiven          = false;
1068
+			$legend[0]       = 'all';
1069
+			$zmax            = 1;
1070
+			$z_boundaries[0] = 100000;
1071
+		} elseif ($z_axis === 301) {
1072
+			$male_female = true;
1073
+			$zgiven      = true;
1074
+			$legend[0]   = I18N::translate('Male');
1075
+			$legend[1]   = I18N::translate('Female');
1076
+			$zmax        = 2;
1077
+		}
1078
+		//-- reset the data array
1079
+		for ($i = 0; $i < $zmax; $i++) {
1080
+			for ($j = 0; $j < $xmax; $j++) {
1081
+				$ydata[$i][$j] = 0;
1082
+			}
1083
+		}
1084
+		$total = longevity_versus_time($z_axis, $z_boundaries, $stats);
1085
+		my_plot($title, $xdata, $xtitle, $ydata, $ytitle, $legend);
1086
+		break;
1087
+	case '19':
1088
+		$xgiven            = false;
1089
+		$zgiven            = false;
1090
+		$title             = I18N::translate('Age in year of marriage');
1091
+		$xtitle            = I18N::translate('age');
1092
+		$ytitle            = I18N::translate('numbers');
1093
+		$boundaries_x_axis = Filter::get('x-axis-boundaries-ages_m');
1094
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1095
+		calculate_axis($boundaries_x_axis);
1096
+		if ($z_axis !== 300 && $z_axis !== 301) {
1097
+			calculate_legend($boundaries_z_axis);
1124 1098
 		}
1125
-	}
1126
-	$total = age_at_marriage($z_axis, $z_boundaries, $stats);
1127
-	my_plot($title, $xdata, $xtitle, $ydata, $ytitle, $legend);
1128
-	break;
1129
-case '20':
1130
-	$xgiven            = false;
1131
-	$zgiven            = false;
1132
-	$title             = I18N::translate('Age in year of first marriage');
1133
-	$xtitle            = I18N::translate('age');
1134
-	$ytitle            = I18N::translate('numbers');
1135
-	$boundaries_x_axis = Filter::get('x-axis-boundaries-ages_m');
1136
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1137
-	calculate_axis($boundaries_x_axis);
1138
-	if ($z_axis !== 300 && $z_axis !== 301) {
1139
-		calculate_legend($boundaries_z_axis);
1140
-	}
1141
-	$percentage = false;
1142
-	if ($y_axis === 201) {
1143 1099
 		$percentage = false;
1144
-		$ytitle     = I18N::translate('Individuals');
1145
-	} elseif ($y_axis === 202) {
1146
-		$percentage = true;
1147
-		$ytitle     = I18N::translate('percentage');
1148
-	}
1149
-	$male_female = false;
1150
-	if ($z_axis === 300) {
1151
-		$zgiven          = false;
1152
-		$legend[0]       = 'all';
1153
-		$zmax            = 1;
1100
+		if ($y_axis === 201) {
1101
+			$percentage = false;
1102
+			$ytitle     = I18N::translate('Individuals');
1103
+		} elseif ($y_axis === 202) {
1104
+			$percentage = true;
1105
+			$ytitle     = I18N::translate('percentage');
1106
+		}
1107
+		$male_female     = false;
1154 1108
 		$z_boundaries[0] = 100000;
1155
-	} elseif ($z_axis === 301) {
1156
-		$male_female = true;
1157
-		$zgiven      = true;
1158
-		$legend[0]   = I18N::translate('Male');
1159
-		$legend[1]   = I18N::translate('Female');
1160
-		$zmax        = 2;
1161
-	}
1162
-	//-- reset the data array
1163
-	for ($i = 0; $i < $zmax; $i++) {
1164
-		for ($j = 0; $j < $xmax; $j++) {
1165
-			$ydata[$i][$j] = 0;
1109
+		if ($z_axis === 300) {
1110
+			$zgiven    = false;
1111
+			$legend[0] = 'all';
1112
+			$zmax      = 1;
1113
+		} elseif ($z_axis === 301) {
1114
+			$male_female = true;
1115
+			$zgiven      = true;
1116
+			$legend[0]   = I18N::translate('Male');
1117
+			$legend[1]   = I18N::translate('Female');
1118
+			$zmax        = 2;
1119
+		}
1120
+		//-- reset the data array
1121
+		for ($i = 0; $i < $zmax; $i++) {
1122
+			for ($j = 0; $j < $xmax; $j++) {
1123
+				$ydata[$i][$j] = 0;
1124
+			}
1125
+		}
1126
+		$total = age_at_marriage($z_axis, $z_boundaries, $stats);
1127
+		my_plot($title, $xdata, $xtitle, $ydata, $ytitle, $legend);
1128
+		break;
1129
+	case '20':
1130
+		$xgiven            = false;
1131
+		$zgiven            = false;
1132
+		$title             = I18N::translate('Age in year of first marriage');
1133
+		$xtitle            = I18N::translate('age');
1134
+		$ytitle            = I18N::translate('numbers');
1135
+		$boundaries_x_axis = Filter::get('x-axis-boundaries-ages_m');
1136
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1137
+		calculate_axis($boundaries_x_axis);
1138
+		if ($z_axis !== 300 && $z_axis !== 301) {
1139
+			calculate_legend($boundaries_z_axis);
1166 1140
 		}
1167
-	}
1168
-	$total = age_at_first_marriage($z_axis, $z_boundaries, $stats);
1169
-	my_plot($title, $xdata, $xtitle, $ydata, $ytitle, $legend);
1170
-	break;
1171
-case '21':
1172
-	$xgiven            = false;
1173
-	$zgiven            = false;
1174
-	$title             = I18N::translate('Number of children');
1175
-	$xtitle            = I18N::translate('children');
1176
-	$ytitle            = I18N::translate('numbers');
1177
-	$boundaries_x_axis = Filter::get('x-axis-boundaries-numbers');
1178
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1179
-	calculate_axis($boundaries_x_axis);
1180
-	if ($z_axis !== 300 && $z_axis !== 301) {
1181
-		calculate_legend($boundaries_z_axis);
1182
-	}
1183
-	$percentage = false;
1184
-	if ($y_axis === 201) {
1185 1141
 		$percentage = false;
1186
-		$ytitle     = I18N::translate('Families');
1187
-	} elseif ($y_axis === 202) {
1188
-		$percentage = true;
1189
-		$ytitle     = I18N::translate('percentage');
1190
-	}
1191
-	$male_female = false;
1192
-	if ($z_axis === 300) {
1193
-		$zgiven          = false;
1194
-		$legend[0]       = 'all';
1195
-		$zmax            = 1;
1196
-		$z_boundaries[0] = 100000;
1197
-	} elseif ($z_axis === 301) {
1198
-		$male_female = true;
1199
-		$zgiven      = true;
1200
-		$legend[0]   = I18N::translate('Male');
1201
-		$legend[1]   = I18N::translate('Female');
1202
-		$zmax        = 2;
1203
-	}
1204
-	//-- reset the data array
1205
-	for ($i = 0; $i < $zmax; $i++) {
1206
-		for ($j = 0; $j < $xmax; $j++) {
1207
-			$ydata[$i][$j] = 0;
1142
+		if ($y_axis === 201) {
1143
+			$percentage = false;
1144
+			$ytitle     = I18N::translate('Individuals');
1145
+		} elseif ($y_axis === 202) {
1146
+			$percentage = true;
1147
+			$ytitle     = I18N::translate('percentage');
1208 1148
 		}
1209
-	}
1210
-	$total = number_of_children($z_axis, $z_boundaries, $stats);
1211
-	my_plot($title, $xdata, $xtitle, $ydata, $ytitle, $legend);
1212
-	break;
1213
-default:
1214
-	break;
1149
+		$male_female = false;
1150
+		if ($z_axis === 300) {
1151
+			$zgiven          = false;
1152
+			$legend[0]       = 'all';
1153
+			$zmax            = 1;
1154
+			$z_boundaries[0] = 100000;
1155
+		} elseif ($z_axis === 301) {
1156
+			$male_female = true;
1157
+			$zgiven      = true;
1158
+			$legend[0]   = I18N::translate('Male');
1159
+			$legend[1]   = I18N::translate('Female');
1160
+			$zmax        = 2;
1161
+		}
1162
+		//-- reset the data array
1163
+		for ($i = 0; $i < $zmax; $i++) {
1164
+			for ($j = 0; $j < $xmax; $j++) {
1165
+				$ydata[$i][$j] = 0;
1166
+			}
1167
+		}
1168
+		$total = age_at_first_marriage($z_axis, $z_boundaries, $stats);
1169
+		my_plot($title, $xdata, $xtitle, $ydata, $ytitle, $legend);
1170
+		break;
1171
+	case '21':
1172
+		$xgiven            = false;
1173
+		$zgiven            = false;
1174
+		$title             = I18N::translate('Number of children');
1175
+		$xtitle            = I18N::translate('children');
1176
+		$ytitle            = I18N::translate('numbers');
1177
+		$boundaries_x_axis = Filter::get('x-axis-boundaries-numbers');
1178
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1179
+		calculate_axis($boundaries_x_axis);
1180
+		if ($z_axis !== 300 && $z_axis !== 301) {
1181
+			calculate_legend($boundaries_z_axis);
1182
+		}
1183
+		$percentage = false;
1184
+		if ($y_axis === 201) {
1185
+			$percentage = false;
1186
+			$ytitle     = I18N::translate('Families');
1187
+		} elseif ($y_axis === 202) {
1188
+			$percentage = true;
1189
+			$ytitle     = I18N::translate('percentage');
1190
+		}
1191
+		$male_female = false;
1192
+		if ($z_axis === 300) {
1193
+			$zgiven          = false;
1194
+			$legend[0]       = 'all';
1195
+			$zmax            = 1;
1196
+			$z_boundaries[0] = 100000;
1197
+		} elseif ($z_axis === 301) {
1198
+			$male_female = true;
1199
+			$zgiven      = true;
1200
+			$legend[0]   = I18N::translate('Male');
1201
+			$legend[1]   = I18N::translate('Female');
1202
+			$zmax        = 2;
1203
+		}
1204
+		//-- reset the data array
1205
+		for ($i = 0; $i < $zmax; $i++) {
1206
+			for ($j = 0; $j < $xmax; $j++) {
1207
+				$ydata[$i][$j] = 0;
1208
+			}
1209
+		}
1210
+		$total = number_of_children($z_axis, $z_boundaries, $stats);
1211
+		my_plot($title, $xdata, $xtitle, $ydata, $ytitle, $legend);
1212
+		break;
1213
+	default:
1214
+		break;
1215 1215
 }
1216 1216
 echo '</div>';
Please login to merge, or discard this patch.