Completed
Push — 1.7 ( 35206a...5c14a5 )
by Greg
17:33 queued 07:18
created
statisticsplot.php 1 patch
Switch Indentation   +501 added lines, -501 removed lines patch added patch discarded remove patch
@@ -852,528 +852,528 @@
 block discarded – undo
852 852
 echo '<div class="statistics_chart" title="', I18N::translate('Statistics chart'), '">';
853 853
 
854 854
 switch ($x_axis) {
855
-case '1':
856
-	echo $stats->chartDistribution(array(Filter::get('chart_shows'), Filter::get('chart_type'), Filter::get('SURN')));
857
-	break;
858
-case '2':
859
-	echo $stats->chartDistribution(array(Filter::get('chart_shows'), 'birth_distribution_chart'));
860
-	break;
861
-case '3':
862
-	echo $stats->chartDistribution(array(Filter::get('chart_shows'), 'death_distribution_chart'));
863
-	break;
864
-case '4':
865
-	echo $stats->chartDistribution(array(Filter::get('chart_shows'), 'marriage_distribution_chart'));
866
-	break;
867
-case '11':
868
-	$monthdata = array();
869
-	for ($i = 0; $i < 12; ++$i) {
870
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
871
-	}
872
-	$xgiven            = true;
873
-	$zgiven            = false;
874
-	$title             = I18N::translate('Month of birth');
875
-	$xtitle            = I18N::translate('month');
876
-	$ytitle            = I18N::translate('numbers');
877
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
878
-	$xdata             = $monthdata;
879
-	$xmax              = 12;
880
-	if ($z_axis !== 300 && $z_axis !== 301) {
881
-		calculate_legend($boundaries_z_axis);
882
-	}
883
-	$percentage = false;
884
-	if ($y_axis === 201) {
855
+	case '1':
856
+		echo $stats->chartDistribution(array(Filter::get('chart_shows'), Filter::get('chart_type'), Filter::get('SURN')));
857
+		break;
858
+	case '2':
859
+		echo $stats->chartDistribution(array(Filter::get('chart_shows'), 'birth_distribution_chart'));
860
+		break;
861
+	case '3':
862
+		echo $stats->chartDistribution(array(Filter::get('chart_shows'), 'death_distribution_chart'));
863
+		break;
864
+	case '4':
865
+		echo $stats->chartDistribution(array(Filter::get('chart_shows'), 'marriage_distribution_chart'));
866
+		break;
867
+	case '11':
868
+		$monthdata = array();
869
+		for ($i = 0; $i < 12; ++$i) {
870
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
871
+		}
872
+		$xgiven            = true;
873
+		$zgiven            = false;
874
+		$title             = I18N::translate('Month of birth');
875
+		$xtitle            = I18N::translate('month');
876
+		$ytitle            = I18N::translate('numbers');
877
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
878
+		$xdata             = $monthdata;
879
+		$xmax              = 12;
880
+		if ($z_axis !== 300 && $z_axis !== 301) {
881
+			calculate_legend($boundaries_z_axis);
882
+		}
885 883
 		$percentage = false;
886
-		$ytitle     = I18N::translate('Individuals');
887
-	} elseif ($y_axis === 202) {
888
-		$percentage = true;
889
-		$ytitle     = I18N::translate('percentage');
890
-	}
891
-	$male_female = false;
892
-	if ($z_axis === 300) {
893
-		$zgiven          = false;
894
-		$legend[0]       = 'all';
895
-		$zmax            = 1;
896
-		$z_boundaries[0] = 100000;
897
-	} elseif ($z_axis === 301) {
898
-		$male_female = true;
899
-		$zgiven      = true;
900
-		$legend[0]   = I18N::translate('Male');
901
-		$legend[1]   = I18N::translate('Female');
902
-		$zmax        = 2;
903
-		$xtitle      = $xtitle . I18N::translate(' per gender');
904
-	} elseif ($z_axis === 302) {
905
-		$xtitle = $xtitle . I18N::translate(' per time period');
906
-	}
907
-	//-- reset the data array
908
-	for ($i = 0; $i < $zmax; $i++) {
909
-		for ($j = 0; $j < $xmax; $j++) {
910
-			$ydata[$i][$j] = 0;
884
+		if ($y_axis === 201) {
885
+			$percentage = false;
886
+			$ytitle     = I18N::translate('Individuals');
887
+		} elseif ($y_axis === 202) {
888
+			$percentage = true;
889
+			$ytitle     = I18N::translate('percentage');
890
+		}
891
+		$male_female = false;
892
+		if ($z_axis === 300) {
893
+			$zgiven          = false;
894
+			$legend[0]       = 'all';
895
+			$zmax            = 1;
896
+			$z_boundaries[0] = 100000;
897
+		} elseif ($z_axis === 301) {
898
+			$male_female = true;
899
+			$zgiven      = true;
900
+			$legend[0]   = I18N::translate('Male');
901
+			$legend[1]   = I18N::translate('Female');
902
+			$zmax        = 2;
903
+			$xtitle      = $xtitle . I18N::translate(' per gender');
904
+		} elseif ($z_axis === 302) {
905
+			$xtitle = $xtitle . I18N::translate(' per time period');
906
+		}
907
+		//-- reset the data array
908
+		for ($i = 0; $i < $zmax; $i++) {
909
+			for ($j = 0; $j < $xmax; $j++) {
910
+				$ydata[$i][$j] = 0;
911
+			}
912
+		}
913
+		$total = month_of_birth($z_axis, $z_boundaries, $stats);
914
+		$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
915
+		my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
916
+		break;
917
+	case '12':
918
+		$monthdata = array();
919
+		for ($i = 0; $i < 12; ++$i) {
920
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
921
+		}
922
+		$xgiven            = true;
923
+		$zgiven            = false;
924
+		$title             = I18N::translate('Month of death');
925
+		$xtitle            = I18N::translate('month');
926
+		$ytitle            = I18N::translate('numbers');
927
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
928
+		$xdata             = $monthdata;
929
+		$xmax              = 12;
930
+		if ($z_axis !== 300 && $z_axis !== 301) {
931
+			calculate_legend($boundaries_z_axis);
911 932
 		}
912
-	}
913
-	$total = month_of_birth($z_axis, $z_boundaries, $stats);
914
-	$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
915
-	my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
916
-	break;
917
-case '12':
918
-	$monthdata = array();
919
-	for ($i = 0; $i < 12; ++$i) {
920
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
921
-	}
922
-	$xgiven            = true;
923
-	$zgiven            = false;
924
-	$title             = I18N::translate('Month of death');
925
-	$xtitle            = I18N::translate('month');
926
-	$ytitle            = I18N::translate('numbers');
927
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
928
-	$xdata             = $monthdata;
929
-	$xmax              = 12;
930
-	if ($z_axis !== 300 && $z_axis !== 301) {
931
-		calculate_legend($boundaries_z_axis);
932
-	}
933
-	$percentage = false;
934
-	if ($y_axis === 201) {
935 933
 		$percentage = false;
936
-		$ytitle     = I18N::translate('Individuals');
937
-	} elseif ($y_axis === 202) {
938
-		$percentage = true;
939
-		$ytitle     = I18N::translate('percentage');
940
-	}
941
-	$male_female = false;
942
-	if ($z_axis === 300) {
943
-		$zgiven          = false;
944
-		$legend[0]       = 'all';
945
-		$zmax            = 1;
946
-		$z_boundaries[0] = 100000;
947
-	} elseif ($z_axis === 301) {
948
-		$male_female = true;
949
-		$zgiven      = true;
950
-		$legend[0]   = I18N::translate('Male');
951
-		$legend[1]   = I18N::translate('Female');
952
-		$zmax        = 2;
953
-		$xtitle      = $xtitle . I18N::translate(' per gender');
954
-	} elseif ($z_axis === 302) {
955
-		$xtitle = $xtitle . I18N::translate(' per time period');
956
-	}
957
-	//-- reset the data array
958
-	for ($i = 0; $i < $zmax; $i++) {
959
-		for ($j = 0; $j < $xmax; $j++) {
960
-			$ydata[$i][$j] = 0;
934
+		if ($y_axis === 201) {
935
+			$percentage = false;
936
+			$ytitle     = I18N::translate('Individuals');
937
+		} elseif ($y_axis === 202) {
938
+			$percentage = true;
939
+			$ytitle     = I18N::translate('percentage');
940
+		}
941
+		$male_female = false;
942
+		if ($z_axis === 300) {
943
+			$zgiven          = false;
944
+			$legend[0]       = 'all';
945
+			$zmax            = 1;
946
+			$z_boundaries[0] = 100000;
947
+		} elseif ($z_axis === 301) {
948
+			$male_female = true;
949
+			$zgiven      = true;
950
+			$legend[0]   = I18N::translate('Male');
951
+			$legend[1]   = I18N::translate('Female');
952
+			$zmax        = 2;
953
+			$xtitle      = $xtitle . I18N::translate(' per gender');
954
+		} elseif ($z_axis === 302) {
955
+			$xtitle = $xtitle . I18N::translate(' per time period');
956
+		}
957
+		//-- reset the data array
958
+		for ($i = 0; $i < $zmax; $i++) {
959
+			for ($j = 0; $j < $xmax; $j++) {
960
+				$ydata[$i][$j] = 0;
961
+			}
962
+		}
963
+		$total = month_of_death($z_axis, $z_boundaries, $stats);
964
+		$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
965
+		my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
966
+		break;
967
+	case '13':
968
+		$monthdata = array();
969
+		for ($i = 0; $i < 12; ++$i) {
970
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
961 971
 		}
962
-	}
963
-	$total = month_of_death($z_axis, $z_boundaries, $stats);
964
-	$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
965
-	my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
966
-	break;
967
-case '13':
968
-	$monthdata = array();
969
-	for ($i = 0; $i < 12; ++$i) {
970
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
971
-	}
972 972
 
973
-	if ($z_axis === 301) {
974
-		$z_axis = 300;
975
-	}
976
-	$xgiven            = true;
977
-	$zgiven            = false;
978
-	$title             = I18N::translate('Month of marriage');
979
-	$xtitle            = I18N::translate('month');
980
-	$ytitle            = I18N::translate('numbers');
981
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
982
-	$xdata             = $monthdata;
983
-	$xmax              = 12;
984
-	if ($z_axis !== 300 && $z_axis !== 301) {
985
-		calculate_legend($boundaries_z_axis);
986
-	}
987
-	$percentage = false;
988
-	if ($y_axis === 201) {
973
+		if ($z_axis === 301) {
974
+			$z_axis = 300;
975
+		}
976
+		$xgiven            = true;
977
+		$zgiven            = false;
978
+		$title             = I18N::translate('Month of marriage');
979
+		$xtitle            = I18N::translate('month');
980
+		$ytitle            = I18N::translate('numbers');
981
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
982
+		$xdata             = $monthdata;
983
+		$xmax              = 12;
984
+		if ($z_axis !== 300 && $z_axis !== 301) {
985
+			calculate_legend($boundaries_z_axis);
986
+		}
989 987
 		$percentage = false;
990
-		$ytitle     = I18N::translate('Families');
991
-	} elseif ($y_axis === 202) {
992
-		$percentage = true;
993
-		$ytitle     = I18N::translate('percentage');
994
-	}
995
-	$male_female = false;
996
-	if ($z_axis === 300) {
997
-		$zgiven          = false;
998
-		$legend[0]       = 'all';
999
-		$zmax            = 1;
1000
-		$z_boundaries[0] = 100000;
1001
-	} elseif ($z_axis === 301) {
1002
-		$male_female = true;
1003
-		$zgiven      = true;
1004
-		$legend[0]   = I18N::translate('Male');
1005
-		$legend[1]   = I18N::translate('Female');
1006
-		$zmax        = 2;
1007
-		$xtitle      = $xtitle . I18N::translate(' per gender');
1008
-	} elseif ($z_axis === 302) {
1009
-		$xtitle = $xtitle . I18N::translate(' per time period');
1010
-	}
1011
-	//-- reset the data array
1012
-	for ($i = 0; $i < $zmax; $i++) {
1013
-		for ($j = 0; $j < $xmax; $j++) {
1014
-			$ydata[$i][$j] = 0;
988
+		if ($y_axis === 201) {
989
+			$percentage = false;
990
+			$ytitle     = I18N::translate('Families');
991
+		} elseif ($y_axis === 202) {
992
+			$percentage = true;
993
+			$ytitle     = I18N::translate('percentage');
994
+		}
995
+		$male_female = false;
996
+		if ($z_axis === 300) {
997
+			$zgiven          = false;
998
+			$legend[0]       = 'all';
999
+			$zmax            = 1;
1000
+			$z_boundaries[0] = 100000;
1001
+		} elseif ($z_axis === 301) {
1002
+			$male_female = true;
1003
+			$zgiven      = true;
1004
+			$legend[0]   = I18N::translate('Male');
1005
+			$legend[1]   = I18N::translate('Female');
1006
+			$zmax        = 2;
1007
+			$xtitle      = $xtitle . I18N::translate(' per gender');
1008
+		} elseif ($z_axis === 302) {
1009
+			$xtitle = $xtitle . I18N::translate(' per time period');
1010
+		}
1011
+		//-- reset the data array
1012
+		for ($i = 0; $i < $zmax; $i++) {
1013
+			for ($j = 0; $j < $xmax; $j++) {
1014
+				$ydata[$i][$j] = 0;
1015
+			}
1016
+		}
1017
+		$total = month_of_marriage($z_axis, $z_boundaries, $stats);
1018
+		$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalFamilies();
1019
+		my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1020
+		break;
1021
+	case '14':
1022
+		$monthdata = array();
1023
+		for ($i = 0; $i < 12; ++$i) {
1024
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1025
+		}
1026
+		$xgiven            = true;
1027
+		$zgiven            = false;
1028
+		$title             = I18N::translate('Month of birth of first child in a relation');
1029
+		$xtitle            = I18N::translate('month');
1030
+		$ytitle            = I18N::translate('numbers');
1031
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1032
+		$xdata             = $monthdata;
1033
+		$xmax              = 12;
1034
+		if ($z_axis !== 300 && $z_axis !== 301) {
1035
+			calculate_legend($boundaries_z_axis);
1015 1036
 		}
1016
-	}
1017
-	$total = month_of_marriage($z_axis, $z_boundaries, $stats);
1018
-	$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalFamilies();
1019
-	my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1020
-	break;
1021
-case '14':
1022
-	$monthdata = array();
1023
-	for ($i = 0; $i < 12; ++$i) {
1024
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1025
-	}
1026
-	$xgiven            = true;
1027
-	$zgiven            = false;
1028
-	$title             = I18N::translate('Month of birth of first child in a relation');
1029
-	$xtitle            = I18N::translate('month');
1030
-	$ytitle            = I18N::translate('numbers');
1031
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1032
-	$xdata             = $monthdata;
1033
-	$xmax              = 12;
1034
-	if ($z_axis !== 300 && $z_axis !== 301) {
1035
-		calculate_legend($boundaries_z_axis);
1036
-	}
1037
-	$percentage = false;
1038
-	if ($y_axis === 201) {
1039 1037
 		$percentage = false;
1040
-		$ytitle     = I18N::translate('Children');
1041
-	} elseif ($y_axis === 202) {
1042
-		$percentage = true;
1043
-		$ytitle     = I18N::translate('percentage');
1044
-	}
1045
-	$male_female = false;
1046
-	if ($z_axis === 300) {
1047
-		$zgiven          = false;
1048
-		$legend[0]       = 'all';
1049
-		$zmax            = 1;
1050
-		$z_boundaries[0] = 100000;
1051
-	} elseif ($z_axis === 301) {
1052
-		$male_female = true;
1053
-		$zgiven      = true;
1054
-		$legend[0]   = I18N::translate('Male');
1055
-		$legend[1]   = I18N::translate('Female');
1056
-		$zmax        = 2;
1057
-		$xtitle      = $xtitle . I18N::translate(' per gender');
1058
-	} elseif ($z_axis === 302) {
1059
-		$xtitle = $xtitle . I18N::translate(' per time period');
1060
-	}
1061
-	//-- reset the data array
1062
-	for ($i = 0; $i < $zmax; $i++) {
1063
-		for ($j = 0; $j < $xmax; $j++) {
1064
-			$ydata[$i][$j] = 0;
1038
+		if ($y_axis === 201) {
1039
+			$percentage = false;
1040
+			$ytitle     = I18N::translate('Children');
1041
+		} elseif ($y_axis === 202) {
1042
+			$percentage = true;
1043
+			$ytitle     = I18N::translate('percentage');
1044
+		}
1045
+		$male_female = false;
1046
+		if ($z_axis === 300) {
1047
+			$zgiven          = false;
1048
+			$legend[0]       = 'all';
1049
+			$zmax            = 1;
1050
+			$z_boundaries[0] = 100000;
1051
+		} elseif ($z_axis === 301) {
1052
+			$male_female = true;
1053
+			$zgiven      = true;
1054
+			$legend[0]   = I18N::translate('Male');
1055
+			$legend[1]   = I18N::translate('Female');
1056
+			$zmax        = 2;
1057
+			$xtitle      = $xtitle . I18N::translate(' per gender');
1058
+		} elseif ($z_axis === 302) {
1059
+			$xtitle = $xtitle . I18N::translate(' per time period');
1060
+		}
1061
+		//-- reset the data array
1062
+		for ($i = 0; $i < $zmax; $i++) {
1063
+			for ($j = 0; $j < $xmax; $j++) {
1064
+				$ydata[$i][$j] = 0;
1065
+			}
1066
+		}
1067
+		$total = month_of_birth_of_first_child($z_axis, $z_boundaries, $stats);
1068
+		$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalFamilies();
1069
+		my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1070
+		break;
1071
+	case '15':
1072
+		$monthdata = array();
1073
+		for ($i = 0; $i < 12; ++$i) {
1074
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1065 1075
 		}
1066
-	}
1067
-	$total = month_of_birth_of_first_child($z_axis, $z_boundaries, $stats);
1068
-	$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalFamilies();
1069
-	my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1070
-	break;
1071
-case '15':
1072
-	$monthdata = array();
1073
-	for ($i = 0; $i < 12; ++$i) {
1074
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1075
-	}
1076 1076
 
1077
-	if ($z_axis === 301) {
1078
-		$z_axis = 300;
1079
-	}
1080
-	$xgiven            = true;
1081
-	$zgiven            = false;
1082
-	$title             = I18N::translate('Month of first marriage');
1083
-	$xtitle            = I18N::translate('month');
1084
-	$ytitle            = I18N::translate('numbers');
1085
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1086
-	$xdata             = $monthdata;
1087
-	$xmax              = 12;
1088
-	if ($z_axis !== 300 && $z_axis !== 301) {
1089
-		calculate_legend($boundaries_z_axis);
1090
-	}
1091
-	$percentage = false;
1092
-	if ($y_axis === 201) {
1093
-		$percentage = false;
1094
-		$ytitle     = I18N::translate('Families');
1095
-	} elseif ($y_axis === 202) {
1096
-		$percentage = true;
1097
-		$ytitle     = I18N::translate('percentage');
1098
-	}
1099
-	$male_female = false;
1100
-	if ($z_axis === 300) {
1101
-		$zgiven          = false;
1102
-		$legend[0]       = 'all';
1103
-		$zmax            = 1;
1104
-		$z_boundaries[0] = 100000;
1105
-	} elseif ($z_axis === 301) {
1106
-		$male_female = true;
1107
-		$zgiven      = true;
1108
-		$legend[0]   = I18N::translate('Male');
1109
-		$legend[1]   = I18N::translate('Female');
1110
-		$zmax        = 2;
1111
-		$xtitle      = $xtitle . I18N::translate(' per gender');
1112
-	} elseif ($z_axis === 302) {
1113
-		$xtitle = $xtitle . I18N::translate(' per time period');
1114
-	}
1115
-	//-- reset the data array
1116
-	for ($i = 0; $i < $zmax; $i++) {
1117
-		for ($j = 0; $j < $xmax; $j++) {
1118
-			$ydata[$i][$j] = 0;
1077
+		if ($z_axis === 301) {
1078
+			$z_axis = 300;
1079
+		}
1080
+		$xgiven            = true;
1081
+		$zgiven            = false;
1082
+		$title             = I18N::translate('Month of first marriage');
1083
+		$xtitle            = I18N::translate('month');
1084
+		$ytitle            = I18N::translate('numbers');
1085
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1086
+		$xdata             = $monthdata;
1087
+		$xmax              = 12;
1088
+		if ($z_axis !== 300 && $z_axis !== 301) {
1089
+			calculate_legend($boundaries_z_axis);
1119 1090
 		}
1120
-	}
1121
-	$total = month_of_first_marriage($z_axis, $z_boundaries, $stats);
1122
-	$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalFamilies();
1123
-	my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1124
-	break;
1125
-case '17':
1126
-	$monthdata = array();
1127
-	for ($i = 0; $i < 12; ++$i) {
1128
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1129
-	}
1130
-	$xgiven            = false;
1131
-	$zgiven            = false;
1132
-	$title             = I18N::translate('Age related to birth year');
1133
-	$xtitle            = I18N::translate('age');
1134
-	$ytitle            = I18N::translate('numbers');
1135
-	$boundaries_x_axis = Filter::get('x-axis-boundaries-ages');
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 1091
 		$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;
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
-		$xtitle      = $xtitle . I18N::translate(' per gender');
1162
-	} elseif ($z_axis === 302) {
1163
-		$xtitle = $xtitle . I18N::translate(' per time period');
1164
-	}
1165
-	//-- reset the data array
1166
-	for ($i = 0; $i < $zmax; $i++) {
1167
-		for ($j = 0; $j < $xmax; $j++) {
1168
-			$ydata[$i][$j] = 0;
1092
+		if ($y_axis === 201) {
1093
+			$percentage = false;
1094
+			$ytitle     = I18N::translate('Families');
1095
+		} elseif ($y_axis === 202) {
1096
+			$percentage = true;
1097
+			$ytitle     = I18N::translate('percentage');
1098
+		}
1099
+		$male_female = false;
1100
+		if ($z_axis === 300) {
1101
+			$zgiven          = false;
1102
+			$legend[0]       = 'all';
1103
+			$zmax            = 1;
1104
+			$z_boundaries[0] = 100000;
1105
+		} elseif ($z_axis === 301) {
1106
+			$male_female = true;
1107
+			$zgiven      = true;
1108
+			$legend[0]   = I18N::translate('Male');
1109
+			$legend[1]   = I18N::translate('Female');
1110
+			$zmax        = 2;
1111
+			$xtitle      = $xtitle . I18N::translate(' per gender');
1112
+		} elseif ($z_axis === 302) {
1113
+			$xtitle = $xtitle . I18N::translate(' per time period');
1114
+		}
1115
+		//-- reset the data array
1116
+		for ($i = 0; $i < $zmax; $i++) {
1117
+			for ($j = 0; $j < $xmax; $j++) {
1118
+				$ydata[$i][$j] = 0;
1119
+			}
1120
+		}
1121
+		$total = month_of_first_marriage($z_axis, $z_boundaries, $stats);
1122
+		$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalFamilies();
1123
+		my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1124
+		break;
1125
+	case '17':
1126
+		$monthdata = array();
1127
+		for ($i = 0; $i < 12; ++$i) {
1128
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1129
+		}
1130
+		$xgiven            = false;
1131
+		$zgiven            = false;
1132
+		$title             = I18N::translate('Age related to birth year');
1133
+		$xtitle            = I18N::translate('age');
1134
+		$ytitle            = I18N::translate('numbers');
1135
+		$boundaries_x_axis = Filter::get('x-axis-boundaries-ages');
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);
1169 1140
 		}
1170
-	}
1171
-	$total = lifespan_by_birth_year($z_axis, $z_boundaries, $stats);
1172
-	$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
1173
-	my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1174
-	break;
1175
-case '18':
1176
-	$monthdata = array();
1177
-	for ($i = 0; $i < 12; ++$i) {
1178
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1179
-	}
1180
-	$xgiven            = false;
1181
-	$zgiven            = false;
1182
-	$title             = I18N::translate('Age related to death year');
1183
-	$xtitle            = I18N::translate('age');
1184
-	$ytitle            = I18N::translate('numbers');
1185
-	$boundaries_x_axis = Filter::get('x-axis-boundaries-ages');
1186
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1187
-	calculate_axis($boundaries_x_axis);
1188
-	if ($z_axis !== 300 && $z_axis !== 301) {
1189
-		calculate_legend($boundaries_z_axis);
1190
-	}
1191
-	$percentage = false;
1192
-	if ($y_axis === 201) {
1193 1141
 		$percentage = false;
1194
-		$ytitle     = I18N::translate('Individuals');
1195
-	} elseif ($y_axis === 202) {
1196
-		$percentage = true;
1197
-		$ytitle     = I18N::translate('percentage');
1198
-	}
1199
-	$male_female = false;
1200
-	if ($z_axis === 300) {
1201
-		$zgiven          = false;
1202
-		$legend[0]       = 'all';
1203
-		$zmax            = 1;
1204
-		$z_boundaries[0] = 100000;
1205
-	} elseif ($z_axis === 301) {
1206
-		$male_female = true;
1207
-		$zgiven      = true;
1208
-		$legend[0]   = I18N::translate('Male');
1209
-		$legend[1]   = I18N::translate('Female');
1210
-		$zmax        = 2;
1211
-		$xtitle      = $xtitle . I18N::translate(' per gender');
1212
-	} elseif ($z_axis === 302) {
1213
-		$xtitle = $xtitle . I18N::translate(' per time period');
1214
-	}
1215
-	//-- reset the data array
1216
-	for ($i = 0; $i < $zmax; $i++) {
1217
-		for ($j = 0; $j < $xmax; $j++) {
1218
-			$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');
1148
+		}
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
+			$xtitle      = $xtitle . I18N::translate(' per gender');
1162
+		} elseif ($z_axis === 302) {
1163
+			$xtitle = $xtitle . I18N::translate(' per time period');
1164
+		}
1165
+		//-- reset the data array
1166
+		for ($i = 0; $i < $zmax; $i++) {
1167
+			for ($j = 0; $j < $xmax; $j++) {
1168
+				$ydata[$i][$j] = 0;
1169
+			}
1170
+		}
1171
+		$total = lifespan_by_birth_year($z_axis, $z_boundaries, $stats);
1172
+		$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
1173
+		my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1174
+		break;
1175
+	case '18':
1176
+		$monthdata = array();
1177
+		for ($i = 0; $i < 12; ++$i) {
1178
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1179
+		}
1180
+		$xgiven            = false;
1181
+		$zgiven            = false;
1182
+		$title             = I18N::translate('Age related to death year');
1183
+		$xtitle            = I18N::translate('age');
1184
+		$ytitle            = I18N::translate('numbers');
1185
+		$boundaries_x_axis = Filter::get('x-axis-boundaries-ages');
1186
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1187
+		calculate_axis($boundaries_x_axis);
1188
+		if ($z_axis !== 300 && $z_axis !== 301) {
1189
+			calculate_legend($boundaries_z_axis);
1219 1190
 		}
1220
-	}
1221
-	$total = lifespan_by_death_year($z_axis, $z_boundaries, $stats);
1222
-	$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
1223
-	my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1224
-	break;
1225
-case '19':
1226
-	$monthdata = array();
1227
-	for ($i = 0; $i < 12; ++$i) {
1228
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1229
-	}
1230
-	$xgiven            = false;
1231
-	$zgiven            = false;
1232
-	$title             = I18N::translate('Age in year of marriage');
1233
-	$xtitle            = I18N::translate('age');
1234
-	$ytitle            = I18N::translate('numbers');
1235
-	$boundaries_x_axis = Filter::get('x-axis-boundaries-ages_m');
1236
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1237
-	calculate_axis($boundaries_x_axis);
1238
-	if ($z_axis !== 300 && $z_axis !== 301) {
1239
-		calculate_legend($boundaries_z_axis);
1240
-	}
1241
-	$percentage = false;
1242
-	if ($y_axis === 201) {
1243 1191
 		$percentage = false;
1244
-		$ytitle     = I18N::translate('Individuals');
1245
-	} elseif ($y_axis === 202) {
1246
-		$percentage = true;
1247
-		$ytitle     = I18N::translate('percentage');
1248
-	}
1249
-	$male_female     = false;
1250
-	$z_boundaries[0] = 100000;
1251
-	if ($z_axis === 300) {
1252
-		$zgiven          = false;
1253
-		$legend[0]       = 'all';
1254
-		$zmax            = 1;
1255
-	} elseif ($z_axis === 301) {
1256
-		$male_female = true;
1257
-		$zgiven      = true;
1258
-		$legend[0]   = I18N::translate('Male');
1259
-		$legend[1]   = I18N::translate('Female');
1260
-		$zmax        = 2;
1261
-		$xtitle      = $xtitle . I18N::translate(' per gender');
1262
-	} elseif ($z_axis === 302) {
1263
-		$xtitle = $xtitle . I18N::translate(' per time period');
1264
-	}
1265
-	//-- reset the data array
1266
-	for ($i = 0; $i < $zmax; $i++) {
1267
-		for ($j = 0; $j < $xmax; $j++) {
1268
-			$ydata[$i][$j] = 0;
1192
+		if ($y_axis === 201) {
1193
+			$percentage = false;
1194
+			$ytitle     = I18N::translate('Individuals');
1195
+		} elseif ($y_axis === 202) {
1196
+			$percentage = true;
1197
+			$ytitle     = I18N::translate('percentage');
1198
+		}
1199
+		$male_female = false;
1200
+		if ($z_axis === 300) {
1201
+			$zgiven          = false;
1202
+			$legend[0]       = 'all';
1203
+			$zmax            = 1;
1204
+			$z_boundaries[0] = 100000;
1205
+		} elseif ($z_axis === 301) {
1206
+			$male_female = true;
1207
+			$zgiven      = true;
1208
+			$legend[0]   = I18N::translate('Male');
1209
+			$legend[1]   = I18N::translate('Female');
1210
+			$zmax        = 2;
1211
+			$xtitle      = $xtitle . I18N::translate(' per gender');
1212
+		} elseif ($z_axis === 302) {
1213
+			$xtitle = $xtitle . I18N::translate(' per time period');
1214
+		}
1215
+		//-- reset the data array
1216
+		for ($i = 0; $i < $zmax; $i++) {
1217
+			for ($j = 0; $j < $xmax; $j++) {
1218
+				$ydata[$i][$j] = 0;
1219
+			}
1220
+		}
1221
+		$total = lifespan_by_death_year($z_axis, $z_boundaries, $stats);
1222
+		$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
1223
+		my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1224
+		break;
1225
+	case '19':
1226
+		$monthdata = array();
1227
+		for ($i = 0; $i < 12; ++$i) {
1228
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1229
+		}
1230
+		$xgiven            = false;
1231
+		$zgiven            = false;
1232
+		$title             = I18N::translate('Age in year of marriage');
1233
+		$xtitle            = I18N::translate('age');
1234
+		$ytitle            = I18N::translate('numbers');
1235
+		$boundaries_x_axis = Filter::get('x-axis-boundaries-ages_m');
1236
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1237
+		calculate_axis($boundaries_x_axis);
1238
+		if ($z_axis !== 300 && $z_axis !== 301) {
1239
+			calculate_legend($boundaries_z_axis);
1269 1240
 		}
1270
-	}
1271
-	$total = age_at_marriage($z_axis, $z_boundaries, $stats);
1272
-	$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
1273
-	my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1274
-	break;
1275
-case '20':
1276
-	$monthdata = array();
1277
-	for ($i = 0; $i < 12; ++$i) {
1278
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1279
-	}
1280
-	$xgiven            = false;
1281
-	$zgiven            = false;
1282
-	$title             = I18N::translate('Age in year of first marriage');
1283
-	$xtitle            = I18N::translate('age');
1284
-	$ytitle            = I18N::translate('numbers');
1285
-	$boundaries_x_axis = Filter::get('x-axis-boundaries-ages_m');
1286
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1287
-	calculate_axis($boundaries_x_axis);
1288
-	if ($z_axis !== 300 && $z_axis !== 301) {
1289
-		calculate_legend($boundaries_z_axis);
1290
-	}
1291
-	$percentage = false;
1292
-	if ($y_axis === 201) {
1293 1241
 		$percentage = false;
1294
-		$ytitle     = I18N::translate('Individuals');
1295
-	} elseif ($y_axis === 202) {
1296
-		$percentage = true;
1297
-		$ytitle     = I18N::translate('percentage');
1298
-	}
1299
-	$male_female = false;
1300
-	if ($z_axis === 300) {
1301
-		$zgiven          = false;
1302
-		$legend[0]       = 'all';
1303
-		$zmax            = 1;
1242
+		if ($y_axis === 201) {
1243
+			$percentage = false;
1244
+			$ytitle     = I18N::translate('Individuals');
1245
+		} elseif ($y_axis === 202) {
1246
+			$percentage = true;
1247
+			$ytitle     = I18N::translate('percentage');
1248
+		}
1249
+		$male_female     = false;
1304 1250
 		$z_boundaries[0] = 100000;
1305
-	} elseif ($z_axis === 301) {
1306
-		$male_female = true;
1307
-		$zgiven      = true;
1308
-		$legend[0]   = I18N::translate('Male');
1309
-		$legend[1]   = I18N::translate('Female');
1310
-		$zmax        = 2;
1311
-		$xtitle      = $xtitle . I18N::translate(' per gender');
1312
-	} elseif ($z_axis === 302) {
1313
-		$xtitle = $xtitle . I18N::translate(' per time period');
1314
-	}
1315
-	//-- reset the data array
1316
-	for ($i = 0; $i < $zmax; $i++) {
1317
-		for ($j = 0; $j < $xmax; $j++) {
1318
-			$ydata[$i][$j] = 0;
1251
+		if ($z_axis === 300) {
1252
+			$zgiven          = false;
1253
+			$legend[0]       = 'all';
1254
+			$zmax            = 1;
1255
+		} elseif ($z_axis === 301) {
1256
+			$male_female = true;
1257
+			$zgiven      = true;
1258
+			$legend[0]   = I18N::translate('Male');
1259
+			$legend[1]   = I18N::translate('Female');
1260
+			$zmax        = 2;
1261
+			$xtitle      = $xtitle . I18N::translate(' per gender');
1262
+		} elseif ($z_axis === 302) {
1263
+			$xtitle = $xtitle . I18N::translate(' per time period');
1264
+		}
1265
+		//-- reset the data array
1266
+		for ($i = 0; $i < $zmax; $i++) {
1267
+			for ($j = 0; $j < $xmax; $j++) {
1268
+				$ydata[$i][$j] = 0;
1269
+			}
1270
+		}
1271
+		$total = age_at_marriage($z_axis, $z_boundaries, $stats);
1272
+		$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
1273
+		my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1274
+		break;
1275
+	case '20':
1276
+		$monthdata = array();
1277
+		for ($i = 0; $i < 12; ++$i) {
1278
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1279
+		}
1280
+		$xgiven            = false;
1281
+		$zgiven            = false;
1282
+		$title             = I18N::translate('Age in year of first marriage');
1283
+		$xtitle            = I18N::translate('age');
1284
+		$ytitle            = I18N::translate('numbers');
1285
+		$boundaries_x_axis = Filter::get('x-axis-boundaries-ages_m');
1286
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1287
+		calculate_axis($boundaries_x_axis);
1288
+		if ($z_axis !== 300 && $z_axis !== 301) {
1289
+			calculate_legend($boundaries_z_axis);
1319 1290
 		}
1320
-	}
1321
-	$total = age_at_first_marriage($z_axis, $z_boundaries, $stats);
1322
-	$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
1323
-	my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1324
-	break;
1325
-case '21':
1326
-	$monthdata = array();
1327
-	for ($i = 0; $i < 12; ++$i) {
1328
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1329
-	}
1330
-	$xgiven            = false;
1331
-	$zgiven            = false;
1332
-	$title             = I18N::translate('Number of children');
1333
-	$xtitle            = I18N::translate('children');
1334
-	$ytitle            = I18N::translate('numbers');
1335
-	$boundaries_x_axis = Filter::get('x-axis-boundaries-numbers');
1336
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1337
-	calculate_axis($boundaries_x_axis);
1338
-	if ($z_axis !== 300 && $z_axis !== 301) {
1339
-		calculate_legend($boundaries_z_axis);
1340
-	}
1341
-	$percentage = false;
1342
-	if ($y_axis === 201) {
1343 1291
 		$percentage = false;
1344
-		$ytitle     = I18N::translate('Families');
1345
-	} elseif ($y_axis === 202) {
1346
-		$percentage = true;
1347
-		$ytitle     = I18N::translate('percentage');
1348
-	}
1349
-	$male_female = false;
1350
-	if ($z_axis === 300) {
1351
-		$zgiven          = false;
1352
-		$legend[0]       = 'all';
1353
-		$zmax            = 1;
1354
-		$z_boundaries[0] = 100000;
1355
-	} elseif ($z_axis === 301) {
1356
-		$male_female = true;
1357
-		$zgiven      = true;
1358
-		$legend[0]   = I18N::translate('Male');
1359
-		$legend[1]   = I18N::translate('Female');
1360
-		$zmax        = 2;
1361
-		$xtitle      = $xtitle . I18N::translate(' per gender');
1362
-	} elseif ($z_axis === 302) {
1363
-		$xtitle = $xtitle . I18N::translate(' per time period');
1364
-	}
1365
-	//-- reset the data array
1366
-	for ($i = 0; $i < $zmax; $i++) {
1367
-		for ($j = 0; $j < $xmax; $j++) {
1368
-			$ydata[$i][$j] = 0;
1292
+		if ($y_axis === 201) {
1293
+			$percentage = false;
1294
+			$ytitle     = I18N::translate('Individuals');
1295
+		} elseif ($y_axis === 202) {
1296
+			$percentage = true;
1297
+			$ytitle     = I18N::translate('percentage');
1369 1298
 		}
1370
-	}
1371
-	$total = number_of_children($z_axis, $z_boundaries, $stats);
1372
-	$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalChildren();
1373
-	my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1374
-	break;
1375
-default:
1376
-	echo '<i class="icon-loading-large"></i>';
1377
-	break;
1299
+		$male_female = false;
1300
+		if ($z_axis === 300) {
1301
+			$zgiven          = false;
1302
+			$legend[0]       = 'all';
1303
+			$zmax            = 1;
1304
+			$z_boundaries[0] = 100000;
1305
+		} elseif ($z_axis === 301) {
1306
+			$male_female = true;
1307
+			$zgiven      = true;
1308
+			$legend[0]   = I18N::translate('Male');
1309
+			$legend[1]   = I18N::translate('Female');
1310
+			$zmax        = 2;
1311
+			$xtitle      = $xtitle . I18N::translate(' per gender');
1312
+		} elseif ($z_axis === 302) {
1313
+			$xtitle = $xtitle . I18N::translate(' per time period');
1314
+		}
1315
+		//-- reset the data array
1316
+		for ($i = 0; $i < $zmax; $i++) {
1317
+			for ($j = 0; $j < $xmax; $j++) {
1318
+				$ydata[$i][$j] = 0;
1319
+			}
1320
+		}
1321
+		$total = age_at_first_marriage($z_axis, $z_boundaries, $stats);
1322
+		$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
1323
+		my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1324
+		break;
1325
+	case '21':
1326
+		$monthdata = array();
1327
+		for ($i = 0; $i < 12; ++$i) {
1328
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1329
+		}
1330
+		$xgiven            = false;
1331
+		$zgiven            = false;
1332
+		$title             = I18N::translate('Number of children');
1333
+		$xtitle            = I18N::translate('children');
1334
+		$ytitle            = I18N::translate('numbers');
1335
+		$boundaries_x_axis = Filter::get('x-axis-boundaries-numbers');
1336
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1337
+		calculate_axis($boundaries_x_axis);
1338
+		if ($z_axis !== 300 && $z_axis !== 301) {
1339
+			calculate_legend($boundaries_z_axis);
1340
+		}
1341
+		$percentage = false;
1342
+		if ($y_axis === 201) {
1343
+			$percentage = false;
1344
+			$ytitle     = I18N::translate('Families');
1345
+		} elseif ($y_axis === 202) {
1346
+			$percentage = true;
1347
+			$ytitle     = I18N::translate('percentage');
1348
+		}
1349
+		$male_female = false;
1350
+		if ($z_axis === 300) {
1351
+			$zgiven          = false;
1352
+			$legend[0]       = 'all';
1353
+			$zmax            = 1;
1354
+			$z_boundaries[0] = 100000;
1355
+		} elseif ($z_axis === 301) {
1356
+			$male_female = true;
1357
+			$zgiven      = true;
1358
+			$legend[0]   = I18N::translate('Male');
1359
+			$legend[1]   = I18N::translate('Female');
1360
+			$zmax        = 2;
1361
+			$xtitle      = $xtitle . I18N::translate(' per gender');
1362
+		} elseif ($z_axis === 302) {
1363
+			$xtitle = $xtitle . I18N::translate(' per time period');
1364
+		}
1365
+		//-- reset the data array
1366
+		for ($i = 0; $i < $zmax; $i++) {
1367
+			for ($j = 0; $j < $xmax; $j++) {
1368
+				$ydata[$i][$j] = 0;
1369
+			}
1370
+		}
1371
+		$total = number_of_children($z_axis, $z_boundaries, $stats);
1372
+		$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalChildren();
1373
+		my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1374
+		break;
1375
+	default:
1376
+		echo '<i class="icon-loading-large"></i>';
1377
+		break;
1378 1378
 }
1379 1379
 echo '</div>';
Please login to merge, or discard this patch.
admin_pgv_to_wt.php 1 patch
Switch Indentation   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -780,69 +780,69 @@  discard block
 block discarded – undo
780 780
 	$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'INDI_FACTS_QUICK', $INDI_FACTS_QUICK));
781 781
 	$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'INDI_FACTS_UNIQUE', $INDI_FACTS_UNIQUE));
782 782
 	switch ($LANGUAGE) {
783
-	case 'catalan':
784
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'ca'));
785
-		break;
786
-	case 'english-uk':
787
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'en-GB'));
788
-		break;
789
-	case 'polish':
790
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'pl'));
791
-		break;
792
-	case 'italian':
793
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'it'));
794
-		break;
795
-	case 'spanish':
796
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'es'));
797
-		break;
798
-	case 'finnish':
799
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'fi'));
800
-		break;
801
-	case 'french':
802
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'fr'));
803
-		break;
804
-	case 'german':
805
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'de'));
806
-		break;
807
-	case 'danish':
808
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'da'));
809
-		break;
810
-	case 'portuguese':
811
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'pt'));
812
-		break;
813
-	case 'hebrew':
814
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'he'));
815
-		break;
816
-	case 'estonian':
817
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'et'));
818
-		break;
819
-	case 'turkish':
820
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'tr'));
821
-		break;
822
-	case 'dutch':
823
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'nl'));
824
-		break;
825
-	case 'slovak':
826
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'sk'));
827
-		break;
828
-	case 'norwegian':
829
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'nn'));
830
-		break;
831
-	case 'slovenian':
832
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'sl'));
833
-		break;
834
-	case 'hungarian':
835
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'hu'));
836
-		break;
837
-	case 'swedish':
838
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'sv'));
839
-		break;
840
-	case 'russian':
841
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'ru'));
842
-		break;
843
-	default:
844
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'en-US'));
845
-		break;
783
+		case 'catalan':
784
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'ca'));
785
+			break;
786
+		case 'english-uk':
787
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'en-GB'));
788
+			break;
789
+		case 'polish':
790
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'pl'));
791
+			break;
792
+		case 'italian':
793
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'it'));
794
+			break;
795
+		case 'spanish':
796
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'es'));
797
+			break;
798
+		case 'finnish':
799
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'fi'));
800
+			break;
801
+		case 'french':
802
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'fr'));
803
+			break;
804
+		case 'german':
805
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'de'));
806
+			break;
807
+		case 'danish':
808
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'da'));
809
+			break;
810
+		case 'portuguese':
811
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'pt'));
812
+			break;
813
+		case 'hebrew':
814
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'he'));
815
+			break;
816
+		case 'estonian':
817
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'et'));
818
+			break;
819
+		case 'turkish':
820
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'tr'));
821
+			break;
822
+		case 'dutch':
823
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'nl'));
824
+			break;
825
+		case 'slovak':
826
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'sk'));
827
+			break;
828
+		case 'norwegian':
829
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'nn'));
830
+			break;
831
+		case 'slovenian':
832
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'sl'));
833
+			break;
834
+		case 'hungarian':
835
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'hu'));
836
+			break;
837
+		case 'swedish':
838
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'sv'));
839
+			break;
840
+		case 'russian':
841
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'ru'));
842
+			break;
843
+		default:
844
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'LANGUAGE', 'en-US'));
845
+			break;
846 846
 	}
847 847
 	$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'MAX_ALIVE_AGE', $MAX_ALIVE_AGE));
848 848
 	$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'MAX_DESCENDANCY_GENERATIONS', $MAX_DESCENDANCY_GENERATIONS));
@@ -902,26 +902,26 @@  discard block
 block discarded – undo
902 902
 	$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'SURNAME_LIST_STYLE', $SURNAME_LIST_STYLE));
903 903
 	$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'SURNAME_TRADITION', $SURNAME_TRADITION));
904 904
 	switch ($THEME_DIR) {
905
-	case '':
906
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'THEME_DIR', ''));
907
-		break;
908
-	case 'themes/cloudy/':
909
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'THEME_DIR', 'clouds'));
910
-		break;
911
-	case 'themes/minimal/':
912
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'THEME_DIR', 'minimal'));
913
-		break;
914
-	case 'themes/simplyblue/':
915
-	case 'themes/simplygreen/':
916
-	case 'themes/simplyred/':
917
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'THEME_DIR', 'colors'));
918
-		break;
919
-	case 'themes/xenea/':
920
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'THEME_DIR', 'xenea'));
921
-		break;
922
-	default:
923
-		$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'THEME_DIR', 'webtrees'));
924
-		break;
905
+		case '':
906
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'THEME_DIR', ''));
907
+			break;
908
+		case 'themes/cloudy/':
909
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'THEME_DIR', 'clouds'));
910
+			break;
911
+		case 'themes/minimal/':
912
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'THEME_DIR', 'minimal'));
913
+			break;
914
+		case 'themes/simplyblue/':
915
+		case 'themes/simplygreen/':
916
+		case 'themes/simplyred/':
917
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'THEME_DIR', 'colors'));
918
+			break;
919
+		case 'themes/xenea/':
920
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'THEME_DIR', 'xenea'));
921
+			break;
922
+		default:
923
+			$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'THEME_DIR', 'webtrees'));
924
+			break;
925 925
 	}
926 926
 	$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'THUMBNAIL_WIDTH', $THUMBNAIL_WIDTH));
927 927
 	$stmt_gedcom_setting->execute(array($GED_DATA['id'], 'USE_RELATIONSHIP_PRIVACY', $USE_RELATIONSHIP_PRIVACY));
Please login to merge, or discard this patch.
famlist.php 1 patch
Switch Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -46,12 +46,12 @@  discard block
 block discarded – undo
46 46
 
47 47
 $show_marnm = Filter::get('show_marnm', 'no|yes');
48 48
 switch ($show_marnm) {
49
-case 'no':
50
-case 'yes':
51
-	Auth::user()->setPreference(WT_SCRIPT_NAME . '_show_marnm', $show_marnm);
52
-	break;
53
-default:
54
-	$show_marnm = Auth::user()->getPreference(WT_SCRIPT_NAME . '_show_marnm');
49
+	case 'no':
50
+	case 'yes':
51
+		Auth::user()->setPreference(WT_SCRIPT_NAME . '_show_marnm', $show_marnm);
52
+		break;
53
+	default:
54
+		$show_marnm = Auth::user()->getPreference(WT_SCRIPT_NAME . '_show_marnm');
55 55
 }
56 56
 
57 57
 // Make sure selections are consistent.
@@ -91,16 +91,16 @@  discard block
 block discarded – undo
91 91
 	}
92 92
 	$url = WT_SCRIPT_NAME . '?surname=' . rawurlencode($surname) . '&amp;ged=' . $WT_TREE->getNameUrl();
93 93
 	switch ($falpha) {
94
-	case '':
95
-		break;
96
-	case '@':
97
-		$legend .= ', ' . I18N::translateContext('Unknown given name', '…');
98
-		$url .= '&amp;falpha=' . rawurlencode($falpha) . '&amp;ged=' . $WT_TREE->getNameUrl();
99
-		break;
100
-	default:
101
-		$legend .= ', ' . Filter::escapeHtml($falpha) . '…';
102
-		$url .= '&amp;falpha=' . rawurlencode($falpha) . '&amp;ged=' . $WT_TREE->getNameUrl();
103
-		break;
94
+		case '':
95
+			break;
96
+		case '@':
97
+			$legend .= ', ' . I18N::translateContext('Unknown given name', '…');
98
+			$url .= '&amp;falpha=' . rawurlencode($falpha) . '&amp;ged=' . $WT_TREE->getNameUrl();
99
+			break;
100
+		default:
101
+			$legend .= ', ' . Filter::escapeHtml($falpha) . '…';
102
+			$url .= '&amp;falpha=' . rawurlencode($falpha) . '&amp;ged=' . $WT_TREE->getNameUrl();
103
+			break;
104 104
 	}
105 105
 	$show = 'indi'; // SURN list makes no sense here
106 106
 } elseif ($alpha === '@') {
@@ -136,15 +136,15 @@  discard block
 block discarded – undo
136 136
 $list = array();
137 137
 foreach (QueryName::surnameAlpha($WT_TREE, $show_marnm === 'yes', true) as $letter => $count) {
138 138
 	switch ($letter) {
139
-	case '@':
140
-		$html = I18N::translateContext('Unknown surname', '…');
141
-		break;
142
-	case ',':
143
-		$html = I18N::translate('None');
144
-		break;
145
-	default:
146
-		$html = Filter::escapeHtml($letter);
147
-		break;
139
+		case '@':
140
+			$html = I18N::translateContext('Unknown surname', '…');
141
+			break;
142
+		case ',':
143
+			$html = I18N::translate('None');
144
+			break;
145
+		default:
146
+			$html = Filter::escapeHtml($letter);
147
+			break;
148 148
 	}
149 149
 	if ($count) {
150 150
 		if ($letter == $alpha) {
@@ -194,16 +194,16 @@  discard block
 block discarded – undo
194 194
 	if ($show === 'surn') {
195 195
 		// Show the surname list
196 196
 		switch ($WT_TREE->getPreference('SURNAME_LIST_STYLE')) {
197
-		case 'style1':
198
-			echo FunctionsPrintLists::surnameList($surns, 3, true, WT_SCRIPT_NAME, $WT_TREE);
199
-			break;
200
-		case 'style3':
201
-			echo FunctionsPrintLists::surnameTagCloud($surns, WT_SCRIPT_NAME, true, $WT_TREE);
202
-			break;
203
-		case 'style2':
204
-		default:
205
-			echo FunctionsPrintLists::surnameTable($surns, WT_SCRIPT_NAME, $WT_TREE);
206
-			break;
197
+			case 'style1':
198
+				echo FunctionsPrintLists::surnameList($surns, 3, true, WT_SCRIPT_NAME, $WT_TREE);
199
+				break;
200
+			case 'style3':
201
+				echo FunctionsPrintLists::surnameTagCloud($surns, WT_SCRIPT_NAME, true, $WT_TREE);
202
+				break;
203
+			case 'style2':
204
+			default:
205
+				echo FunctionsPrintLists::surnameTable($surns, WT_SCRIPT_NAME, $WT_TREE);
206
+				break;
207 207
 		}
208 208
 	} else {
209 209
 		// Show the list
@@ -226,12 +226,12 @@  discard block
 block discarded – undo
226 226
 				$list = array();
227 227
 				foreach ($givn_initials as $givn_initial => $count) {
228 228
 					switch ($givn_initial) {
229
-					case '@':
230
-						$html = I18N::translateContext('Unknown given name', '…');
231
-						break;
232
-					default:
233
-						$html = Filter::escapeHtml($givn_initial);
234
-						break;
229
+						case '@':
230
+							$html = I18N::translateContext('Unknown given name', '…');
231
+							break;
232
+						default:
233
+							$html = Filter::escapeHtml($givn_initial);
234
+							break;
235 235
 					}
236 236
 					if ($count) {
237 237
 						if ($show === 'indi' && $givn_initial === $falpha && $show_all_firstnames === 'no') {
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
@@ -92,23 +92,23 @@  discard block
 block discarded – undo
92 92
 	public function getTarget() {
93 93
 		$xref = trim($this->getValue(), '@');
94 94
 		switch ($this->tag) {
95
-		case 'FAMC':
96
-		case 'FAMS':
97
-			return Family::getInstance($xref, $this->getParent()->getTree());
98
-		case 'HUSB':
99
-		case 'WIFE':
100
-		case 'CHIL':
101
-			return Individual::getInstance($xref, $this->getParent()->getTree());
102
-		case 'SOUR':
103
-			return Source::getInstance($xref, $this->getParent()->getTree());
104
-		case 'OBJE':
105
-			return Media::getInstance($xref, $this->getParent()->getTree());
106
-		case 'REPO':
107
-			return Repository::getInstance($xref, $this->getParent()->getTree());
108
-		case 'NOTE':
109
-			return Note::getInstance($xref, $this->getParent()->getTree());
110
-		default:
111
-			return GedcomRecord::getInstance($xref, $this->getParent()->getTree());
95
+			case 'FAMC':
96
+			case 'FAMS':
97
+				return Family::getInstance($xref, $this->getParent()->getTree());
98
+			case 'HUSB':
99
+			case 'WIFE':
100
+			case 'CHIL':
101
+				return Individual::getInstance($xref, $this->getParent()->getTree());
102
+			case 'SOUR':
103
+				return Source::getInstance($xref, $this->getParent()->getTree());
104
+			case 'OBJE':
105
+				return Media::getInstance($xref, $this->getParent()->getTree());
106
+			case 'REPO':
107
+				return Repository::getInstance($xref, $this->getParent()->getTree());
108
+			case 'NOTE':
109
+				return Note::getInstance($xref, $this->getParent()->getTree());
110
+			default:
111
+				return GedcomRecord::getInstance($xref, $this->getParent()->getTree());
112 112
 		}
113 113
 	}
114 114
 
@@ -262,15 +262,15 @@  discard block
 block discarded – undo
262 262
 	 */
263 263
 	public function getLabel() {
264 264
 		switch ($this->tag) {
265
-		case 'EVEN':
266
-		case 'FACT':
267
-			if ($this->getAttribute('TYPE')) {
268
-				// Custom FACT/EVEN - with a TYPE
269
-				return I18N::translate(Filter::escapeHtml($this->getAttribute('TYPE')));
270
-			}
271
-			// no break - drop into next case
272
-		default:
273
-			return GedcomTag::getLabel($this->tag, $this->parent);
265
+			case 'EVEN':
266
+			case 'FACT':
267
+				if ($this->getAttribute('TYPE')) {
268
+					// Custom FACT/EVEN - with a TYPE
269
+					return I18N::translate(Filter::escapeHtml($this->getAttribute('TYPE')));
270
+				}
271
+				// no break - drop into next case
272
+			default:
273
+				return GedcomTag::getLabel($this->tag, $this->parent);
274 274
 		}
275 275
 	}
276 276
 
Please login to merge, or discard this patch.
app/Query/QueryName.php 1 patch
Switch Indentation   +145 added lines, -145 removed lines patch added patch discarded remove patch
@@ -34,85 +34,85 @@  discard block
 block discarded – undo
34 34
 	 */
35 35
 	private static function getAlphabetForLocale($locale) {
36 36
 		switch ($locale) {
37
-		case 'ar':
38
-			return array(
39
-				'ا', 'ب', 'ت', 'ث', 'ج', 'ح', 'خ', 'د', 'ذ', 'ر', 'ز', 'س', 'ش', 'ص', 'ض', 'ط', 'ظ', 'ع', 'غ', 'ف', 'ق', 'ك', 'ل', 'م', 'ن', 'ه', 'و', 'ي', 'آ', 'ة', 'ى', 'ی',
40
-			);
41
-		case 'cs':
42
-			return array(
43
-				'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'CH', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
44
-			);
45
-		case 'da':
46
-		case 'nb':
47
-		case 'nn':
48
-			return array(
49
-				'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Æ', 'Ø', 'Å',
50
-			);
51
-		case 'el':
52
-			return array(
53
-				'Α', 'Β', 'Γ', 'Δ', 'Ε', 'Ζ', 'Η', 'Θ', 'Ι', 'Κ', 'Λ', 'Μ', 'Ν', 'Ξ', 'Ο', 'Π', 'Ρ', 'Σ', 'Τ', 'Υ', 'Φ', 'Χ', 'Ψ', 'Ω',
54
-			);
55
-		case 'es':
56
-			return array(
57
-				'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'Ñ', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
58
-			);
59
-		case 'et':
60
-			return array(
61
-				'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'Š', 'Z', 'Ž', 'T', 'U', 'V', 'W', 'Õ', 'Ä', 'Ö', 'Ü', 'X', 'Y',
62
-			);
63
-		case 'fi':
64
-		case 'sv':
65
-			return array(
66
-				'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Å', 'Ä', 'Ö',
67
-			);
68
-		case 'he':
69
-			return array(
70
-				'א', 'ב', 'ג', 'ד', 'ה', 'ו', 'ז', 'ח', 'ט', 'י', 'כ', 'ל', 'מ', 'נ', 'ס', 'ע', 'פ', 'צ', 'ק', 'ר', 'ש', 'ת',
71
-			);
72
-		case 'hu':
73
-			return array(
74
-				'A', 'B', 'C', 'CS', 'D', 'DZ', 'DZS', 'E', 'F', 'G', 'GY', 'H', 'I', 'J', 'K', 'L', 'LY', 'M', 'N', 'NY', 'O', 'Ö', 'P', 'Q', 'R', 'S', 'SZ', 'T', 'TY', 'U', 'Ü', 'V', 'W', 'X', 'Y', 'Z', 'ZS',
75
-			);
76
-		case 'lt':
77
-			return array(
78
-				'A', 'Ą', 'B', 'C', 'Č', 'D', 'E', 'Ę', 'Ė', 'F', 'G', 'H', 'I', 'Y', 'Į', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'Š', 'T', 'U', 'Ų', 'Ū', 'V', 'Z', 'Ž',
79
-			);
80
-		case 'nl':
81
-			return array(
82
-				'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'IJ',
83
-			);
84
-		case 'pl':
85
-			return array(
86
-				'A', 'B', 'C', 'Ć', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'Ł', 'M', 'N', 'O', 'Ó', 'P', 'Q', 'R', 'S', 'Ś', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Ź', 'Ż',
87
-			);
88
-		case 'ro':
89
-			return array(
90
-				'A', 'Ă', 'Â', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'Î', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'Ş', 'T', 'Ţ', 'U', 'V', 'W', 'X', 'Y', 'Z',
91
-			);
92
-		case 'ru':
93
-			return array(
94
-				'А', 'Б', 'В', 'Г', 'Д', 'Е', 'Ё', 'Ж', 'З', 'И', 'Й', 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р', 'С', 'Т', 'У', 'Ф', 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ъ', 'Ы', 'Ь', 'Э', 'Ю', 'Я',
95
-			);
96
-		case 'sk':
97
-			return array(
98
-				'A', 'Á', 'Ä', 'B', 'C', 'Č', 'D', 'Ď', 'E', 'É', 'F', 'G', 'H', 'I', 'Í', 'J', 'K', 'L', 'Ľ', 'Ĺ', 'M', 'N', 'Ň', 'O', 'Ó', 'Ô', 'P', 'Q', 'R', 'Ŕ', 'S', 'Š', 'T', 'Ť', 'U', 'Ú', 'V', 'W', 'X', 'Y', 'Ý', 'Z', 'Ž',
99
-			);
100
-		case 'sl':
101
-			return array(
102
-				'A', 'B', 'C', 'Č', 'Ć', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'Š', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Ž',
103
-			);
104
-		case 'sr':
105
-			return array(
106
-				'A', 'B', 'C', 'Č', 'Ć', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'Š', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Ž',
107
-			);
108
-		case 'tr':
109
-			return array(
110
-				'A', 'B', 'C', 'Ç', 'D', 'E', 'F', 'G', 'Ğ', 'H', 'I', 'İ', 'J', 'K', 'L', 'M', 'N', 'O', 'Ö', 'P', 'R', 'S', 'Ş', 'T', 'U', 'Ü', 'V', 'Y', 'Z',
111
-			);
112
-		default:
113
-			return array(
114
-				'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
115
-			);
37
+			case 'ar':
38
+				return array(
39
+					'ا', 'ب', 'ت', 'ث', 'ج', 'ح', 'خ', 'د', 'ذ', 'ر', 'ز', 'س', 'ش', 'ص', 'ض', 'ط', 'ظ', 'ع', 'غ', 'ف', 'ق', 'ك', 'ل', 'م', 'ن', 'ه', 'و', 'ي', 'آ', 'ة', 'ى', 'ی',
40
+				);
41
+			case 'cs':
42
+				return array(
43
+					'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'CH', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
44
+				);
45
+			case 'da':
46
+			case 'nb':
47
+			case 'nn':
48
+				return array(
49
+					'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Æ', 'Ø', 'Å',
50
+				);
51
+			case 'el':
52
+				return array(
53
+					'Α', 'Β', 'Γ', 'Δ', 'Ε', 'Ζ', 'Η', 'Θ', 'Ι', 'Κ', 'Λ', 'Μ', 'Ν', 'Ξ', 'Ο', 'Π', 'Ρ', 'Σ', 'Τ', 'Υ', 'Φ', 'Χ', 'Ψ', 'Ω',
54
+				);
55
+			case 'es':
56
+				return array(
57
+					'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'Ñ', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
58
+				);
59
+			case 'et':
60
+				return array(
61
+					'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'Š', 'Z', 'Ž', 'T', 'U', 'V', 'W', 'Õ', 'Ä', 'Ö', 'Ü', 'X', 'Y',
62
+				);
63
+			case 'fi':
64
+			case 'sv':
65
+				return array(
66
+					'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Å', 'Ä', 'Ö',
67
+				);
68
+			case 'he':
69
+				return array(
70
+					'א', 'ב', 'ג', 'ד', 'ה', 'ו', 'ז', 'ח', 'ט', 'י', 'כ', 'ל', 'מ', 'נ', 'ס', 'ע', 'פ', 'צ', 'ק', 'ר', 'ש', 'ת',
71
+				);
72
+			case 'hu':
73
+				return array(
74
+					'A', 'B', 'C', 'CS', 'D', 'DZ', 'DZS', 'E', 'F', 'G', 'GY', 'H', 'I', 'J', 'K', 'L', 'LY', 'M', 'N', 'NY', 'O', 'Ö', 'P', 'Q', 'R', 'S', 'SZ', 'T', 'TY', 'U', 'Ü', 'V', 'W', 'X', 'Y', 'Z', 'ZS',
75
+				);
76
+			case 'lt':
77
+				return array(
78
+					'A', 'Ą', 'B', 'C', 'Č', 'D', 'E', 'Ę', 'Ė', 'F', 'G', 'H', 'I', 'Y', 'Į', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'Š', 'T', 'U', 'Ų', 'Ū', 'V', 'Z', 'Ž',
79
+				);
80
+			case 'nl':
81
+				return array(
82
+					'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'IJ',
83
+				);
84
+			case 'pl':
85
+				return array(
86
+					'A', 'B', 'C', 'Ć', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'Ł', 'M', 'N', 'O', 'Ó', 'P', 'Q', 'R', 'S', 'Ś', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Ź', 'Ż',
87
+				);
88
+			case 'ro':
89
+				return array(
90
+					'A', 'Ă', 'Â', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'Î', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'Ş', 'T', 'Ţ', 'U', 'V', 'W', 'X', 'Y', 'Z',
91
+				);
92
+			case 'ru':
93
+				return array(
94
+					'А', 'Б', 'В', 'Г', 'Д', 'Е', 'Ё', 'Ж', 'З', 'И', 'Й', 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р', 'С', 'Т', 'У', 'Ф', 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ъ', 'Ы', 'Ь', 'Э', 'Ю', 'Я',
95
+				);
96
+			case 'sk':
97
+				return array(
98
+					'A', 'Á', 'Ä', 'B', 'C', 'Č', 'D', 'Ď', 'E', 'É', 'F', 'G', 'H', 'I', 'Í', 'J', 'K', 'L', 'Ľ', 'Ĺ', 'M', 'N', 'Ň', 'O', 'Ó', 'Ô', 'P', 'Q', 'R', 'Ŕ', 'S', 'Š', 'T', 'Ť', 'U', 'Ú', 'V', 'W', 'X', 'Y', 'Ý', 'Z', 'Ž',
99
+				);
100
+			case 'sl':
101
+				return array(
102
+					'A', 'B', 'C', 'Č', 'Ć', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'Š', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Ž',
103
+				);
104
+			case 'sr':
105
+				return array(
106
+					'A', 'B', 'C', 'Č', 'Ć', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'Š', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Ž',
107
+				);
108
+			case 'tr':
109
+				return array(
110
+					'A', 'B', 'C', 'Ç', 'D', 'E', 'F', 'G', 'Ğ', 'H', 'I', 'İ', 'J', 'K', 'L', 'M', 'N', 'O', 'Ö', 'P', 'R', 'S', 'Ş', 'T', 'U', 'Ü', 'V', 'Y', 'Z',
111
+				);
112
+			default:
113
+				return array(
114
+					'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
115
+				);
116 116
 		}
117 117
 	}
118 118
 
@@ -126,44 +126,44 @@  discard block
 block discarded – undo
126 126
 	public static function initialLetter($name) {
127 127
 		$name = I18N::strtoupper($name);
128 128
 		switch (WT_LOCALE) {
129
-		case 'cs':
130
-			if (substr($name, 0, 2) == 'CH') {
131
-				return 'CH';
132
-			}
133
-			break;
134
-		case 'da':
135
-		case 'nb':
136
-		case 'nn':
137
-			if (substr($name, 0, 2) == 'AA') {
138
-				return 'Å';
139
-			}
140
-			break;
141
-		case 'hu':
142
-			if (substr($name, 0, 2) == 'CS') {
143
-				return 'CS';
144
-			} elseif (substr($name, 0, 3) == 'DZS') {
145
-				return 'DZS';
146
-			} elseif (substr($name, 0, 2) == 'DZ') {
147
-				return 'DZ';
148
-			} elseif (substr($name, 0, 2) == 'GY') {
149
-				return 'GY';
150
-			} elseif (substr($name, 0, 2) == 'LY') {
151
-				return 'LY';
152
-			} elseif (substr($name, 0, 2) == 'NY') {
153
-				return 'NY';
154
-			} elseif (substr($name, 0, 2) == 'SZ') {
155
-				return 'SZ';
156
-			} elseif (substr($name, 0, 2) == 'TY') {
157
-				return 'TY';
158
-			} elseif (substr($name, 0, 2) == 'ZS') {
159
-				return 'ZS';
160
-			}
161
-			break;
162
-		case 'nl':
163
-			if (substr($name, 0, 2) == 'IJ') {
164
-				return 'IJ';
165
-			}
166
-			break;
129
+			case 'cs':
130
+				if (substr($name, 0, 2) == 'CH') {
131
+					return 'CH';
132
+				}
133
+				break;
134
+			case 'da':
135
+			case 'nb':
136
+			case 'nn':
137
+				if (substr($name, 0, 2) == 'AA') {
138
+					return 'Å';
139
+				}
140
+				break;
141
+			case 'hu':
142
+				if (substr($name, 0, 2) == 'CS') {
143
+					return 'CS';
144
+				} elseif (substr($name, 0, 3) == 'DZS') {
145
+					return 'DZS';
146
+				} elseif (substr($name, 0, 2) == 'DZ') {
147
+					return 'DZ';
148
+				} elseif (substr($name, 0, 2) == 'GY') {
149
+					return 'GY';
150
+				} elseif (substr($name, 0, 2) == 'LY') {
151
+					return 'LY';
152
+				} elseif (substr($name, 0, 2) == 'NY') {
153
+					return 'NY';
154
+				} elseif (substr($name, 0, 2) == 'SZ') {
155
+					return 'SZ';
156
+				} elseif (substr($name, 0, 2) == 'TY') {
157
+					return 'TY';
158
+				} elseif (substr($name, 0, 2) == 'ZS') {
159
+					return 'ZS';
160
+				}
161
+				break;
162
+			case 'nl':
163
+				if (substr($name, 0, 2) == 'IJ') {
164
+					return 'IJ';
165
+				}
166
+				break;
167 167
 		}
168 168
 		// No special rules - just take the first character
169 169
 		return mb_substr($name, 0, 1);
@@ -191,37 +191,37 @@  discard block
 block discarded – undo
191 191
 	 */
192 192
 	private static function getInitialSql($field, $letter) {
193 193
 		switch (WT_LOCALE) {
194
-		case 'cs':
195
-			switch ($letter) {
196
-			case 'C': return $field . " LIKE 'C%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'CH%' COLLATE " . I18N::collation();
197
-			}
194
+			case 'cs':
195
+				switch ($letter) {
196
+					case 'C': return $field . " LIKE 'C%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'CH%' COLLATE " . I18N::collation();
197
+				}
198 198
 			break;
199
-		case 'da':
200
-		case 'nb':
201
-		case 'nn':
202
-			switch ($letter) {
203
-			// AA gets listed under Å
204
-			case 'A': return $field . " LIKE 'A%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'AA%' COLLATE " . I18N::collation();
205
-			case 'Å': return "(" . $field . " LIKE 'Å%' COLLATE " . I18N::collation() . " OR " . $field . " LIKE 'AA%' COLLATE " . I18N::collation() . ")";
206
-			}
199
+			case 'da':
200
+			case 'nb':
201
+			case 'nn':
202
+				switch ($letter) {
203
+				// AA gets listed under Å
204
+					case 'A': return $field . " LIKE 'A%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'AA%' COLLATE " . I18N::collation();
205
+					case 'Å': return "(" . $field . " LIKE 'Å%' COLLATE " . I18N::collation() . " OR " . $field . " LIKE 'AA%' COLLATE " . I18N::collation() . ")";
206
+				}
207 207
 			break;
208
-		case 'hu':
209
-			switch ($letter) {
210
-			case 'C':  return $field . " LIKE 'C%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'CS%' COLLATE " . I18N::collation();
211
-			case 'D':  return $field . " LIKE 'D%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'DZ%' COLLATE " . I18N::collation();
212
-			case 'DZ': return $field . " LIKE 'DZ%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'DZS%' COLLATE " . I18N::collation();
213
-			case 'G':  return $field . " LIKE 'G%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'GY%' COLLATE " . I18N::collation();
214
-			case 'L':  return $field . " LIKE 'L%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'LY%' COLLATE " . I18N::collation();
215
-			case 'N':  return $field . " LIKE 'N%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'NY%' COLLATE " . I18N::collation();
216
-			case 'S':  return $field . " LIKE 'S%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'SZ%' COLLATE " . I18N::collation();
217
-			case 'T':  return $field . " LIKE 'T%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'TY%' COLLATE " . I18N::collation();
218
-			case 'Z':  return $field . " LIKE 'Z%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'ZS%' COLLATE " . I18N::collation();
219
-			}
208
+			case 'hu':
209
+				switch ($letter) {
210
+					case 'C':  return $field . " LIKE 'C%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'CS%' COLLATE " . I18N::collation();
211
+					case 'D':  return $field . " LIKE 'D%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'DZ%' COLLATE " . I18N::collation();
212
+					case 'DZ': return $field . " LIKE 'DZ%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'DZS%' COLLATE " . I18N::collation();
213
+					case 'G':  return $field . " LIKE 'G%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'GY%' COLLATE " . I18N::collation();
214
+					case 'L':  return $field . " LIKE 'L%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'LY%' COLLATE " . I18N::collation();
215
+					case 'N':  return $field . " LIKE 'N%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'NY%' COLLATE " . I18N::collation();
216
+					case 'S':  return $field . " LIKE 'S%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'SZ%' COLLATE " . I18N::collation();
217
+					case 'T':  return $field . " LIKE 'T%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'TY%' COLLATE " . I18N::collation();
218
+					case 'Z':  return $field . " LIKE 'Z%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'ZS%' COLLATE " . I18N::collation();
219
+				}
220 220
 			break;
221
-		case 'nl':
222
-			switch ($letter) {
223
-			case 'I': return $field . " LIKE 'I%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'IJ%' COLLATE " . I18N::collation();
224
-			}
221
+			case 'nl':
222
+				switch ($letter) {
223
+					case 'I': return $field . " LIKE 'I%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'IJ%' COLLATE " . I18N::collation();
224
+				}
225 225
 			break;
226 226
 		}
227 227
 
Please login to merge, or discard this patch.
app/Query/QueryMedia.php 1 patch
Switch Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -104,17 +104,17 @@  discard block
 block discarded – undo
104 104
 
105 105
 		// Include / exclude subfolders (but always include external)
106 106
 		switch ($subfolders) {
107
-		case 'include':
108
-			$sql .= " AND (m_filename LIKE CONCAT(?, '%') $sql_external)";
109
-			$args[] = Filter::escapeLike($folder);
110
-			break;
111
-		case 'exclude':
112
-			$sql .= " AND (m_filename LIKE CONCAT(?, '%')  AND m_filename NOT LIKE CONCAT(?, '%/%') $sql_external)";
113
-			$args[] = Filter::escapeLike($folder);
114
-			$args[] = Filter::escapeLike($folder);
115
-			break;
116
-		default:
117
-			throw new \Exception('Bad argument (subfolders=' . $subfolders . ') in QueryMedia::mediaList()');
107
+			case 'include':
108
+				$sql .= " AND (m_filename LIKE CONCAT(?, '%') $sql_external)";
109
+				$args[] = Filter::escapeLike($folder);
110
+				break;
111
+			case 'exclude':
112
+				$sql .= " AND (m_filename LIKE CONCAT(?, '%')  AND m_filename NOT LIKE CONCAT(?, '%/%') $sql_external)";
113
+				$args[] = Filter::escapeLike($folder);
114
+				$args[] = Filter::escapeLike($folder);
115
+				break;
116
+			default:
117
+				throw new \Exception('Bad argument (subfolders=' . $subfolders . ') in QueryMedia::mediaList()');
118 118
 		}
119 119
 
120 120
 		// Apply search terms
@@ -130,14 +130,14 @@  discard block
 block discarded – undo
130 130
 		}
131 131
 
132 132
 		switch ($sort) {
133
-		case 'file':
134
-			$sql .= " ORDER BY m_filename";
135
-			break;
136
-		case 'title':
137
-			$sql .= " ORDER BY m_titl";
138
-			break;
139
-		default:
140
-			throw new \Exception('Bad argument (sort=' . $sort . ') in QueryMedia::mediaList()');
133
+			case 'file':
134
+				$sql .= " ORDER BY m_filename";
135
+				break;
136
+			case 'title':
137
+				$sql .= " ORDER BY m_titl";
138
+				break;
139
+			default:
140
+				throw new \Exception('Bad argument (sort=' . $sort . ') in QueryMedia::mediaList()');
141 141
 		}
142 142
 
143 143
 		$rows = Database::prepare($sql)->execute($args)->fetchAll();
Please login to merge, or discard this patch.
app/SurnameTradition/PaternalSurnameTradition.php 1 patch
Switch Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -39,17 +39,17 @@
 block discarded – undo
39 39
 	public function newParentNames($child_name, $parent_sex) {
40 40
 		if (preg_match(self::REGEX_SPFX_SURN, $child_name, $match)) {
41 41
 			switch ($parent_sex) {
42
-			case 'M':
43
-				return array_filter(array(
44
-					'NAME' => $match['NAME'],
45
-					'SPFX' => $match['SPFX'],
46
-					'SURN' => $match['SURN'],
47
-				));
48
-			case 'F':
49
-				return array(
50
-					'NAME'   => '//',
51
-					'_MARNM' => '/' . trim($match['SPFX'] . ' ' . $match['SURN']) . '/',
52
-				);
42
+				case 'M':
43
+					return array_filter(array(
44
+						'NAME' => $match['NAME'],
45
+						'SPFX' => $match['SPFX'],
46
+						'SURN' => $match['SURN'],
47
+					));
48
+				case 'F':
49
+					return array(
50
+						'NAME'   => '//',
51
+						'_MARNM' => '/' . trim($match['SPFX'] . ' ' . $match['SURN']) . '/',
52
+					);
53 53
 			}
54 54
 		}
55 55
 
Please login to merge, or discard this patch.
app/SurnameTradition/PortugueseSurnameTradition.php 1 patch
Switch Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -62,16 +62,16 @@
 block discarded – undo
62 62
 	public function newParentNames($child_name, $parent_sex) {
63 63
 		if (preg_match(self::REGEX_SURNS, $child_name, $match)) {
64 64
 			switch ($parent_sex) {
65
-			case 'M':
66
-				return array(
67
-					'NAME' => '// /' . $match['SURN1'] . '/',
68
-					'SURN' => $match['SURN1'],
69
-				);
70
-			case 'F':
71
-				return array(
72
-					'NAME' => '// /' . $match['SURN2'] . '/',
73
-					'SURN' => $match['SURN2'],
74
-				);
65
+				case 'M':
66
+					return array(
67
+						'NAME' => '// /' . $match['SURN1'] . '/',
68
+						'SURN' => $match['SURN1'],
69
+					);
70
+				case 'F':
71
+					return array(
72
+						'NAME' => '// /' . $match['SURN2'] . '/',
73
+						'SURN' => $match['SURN2'],
74
+					);
75 75
 			}
76 76
 		}
77 77
 
Please login to merge, or discard this patch.
app/SurnameTradition/IcelandicSurnameTradition.php 1 patch
Switch Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -43,14 +43,14 @@
 block discarded – undo
43 43
 	public function newChildNames($father_name, $mother_name, $child_sex) {
44 44
 		if (preg_match(self::REGEX_GIVN, $father_name, $father_match)) {
45 45
 			switch ($child_sex) {
46
-			case 'M':
47
-				return array(
48
-					'NAME' => $father_match['GIVN'] . 'sson',
49
-				);
50
-			case 'F':
51
-				return array(
52
-					'NAME' => $father_match['GIVN'] . 'sdottir',
53
-				);
46
+				case 'M':
47
+					return array(
48
+						'NAME' => $father_match['GIVN'] . 'sson',
49
+					);
50
+				case 'F':
51
+					return array(
52
+						'NAME' => $father_match['GIVN'] . 'sdottir',
53
+					);
54 54
 			}
55 55
 		}
56 56
 
Please login to merge, or discard this patch.