@@ -25,215 +25,215 @@ |
||
25 | 25 | */ |
26 | 26 | class SosaStatsController extends MvcController |
27 | 27 | { |
28 | - /** |
|
29 | - * Sosa Provider for the controller |
|
30 | - * @var SosaProvider $sosa_provider |
|
31 | - */ |
|
32 | - protected $sosa_provider; |
|
28 | + /** |
|
29 | + * Sosa Provider for the controller |
|
30 | + * @var SosaProvider $sosa_provider |
|
31 | + */ |
|
32 | + protected $sosa_provider; |
|
33 | 33 | |
34 | - /** |
|
35 | - * Constructor for SosaStatsController |
|
36 | - * @param AbstractModule $module |
|
37 | - */ |
|
38 | - public function __construct(AbstractModule $module) { |
|
39 | - global $WT_TREE; |
|
34 | + /** |
|
35 | + * Constructor for SosaStatsController |
|
36 | + * @param AbstractModule $module |
|
37 | + */ |
|
38 | + public function __construct(AbstractModule $module) { |
|
39 | + global $WT_TREE; |
|
40 | 40 | |
41 | - parent::__construct($module); |
|
41 | + parent::__construct($module); |
|
42 | 42 | |
43 | - $this->sosa_provider = new SosaProvider($WT_TREE, Auth::user()); |
|
44 | - } |
|
43 | + $this->sosa_provider = new SosaProvider($WT_TREE, Auth::user()); |
|
44 | + } |
|
45 | 45 | |
46 | - /** |
|
47 | - * Pages |
|
48 | - */ |
|
46 | + /** |
|
47 | + * Pages |
|
48 | + */ |
|
49 | 49 | |
50 | - /** |
|
51 | - * SosaStats@index |
|
52 | - */ |
|
53 | - public function index() { |
|
54 | - global $WT_TREE; |
|
50 | + /** |
|
51 | + * SosaStats@index |
|
52 | + */ |
|
53 | + public function index() { |
|
54 | + global $WT_TREE; |
|
55 | 55 | |
56 | - $controller = new PageController(); |
|
57 | - $controller |
|
58 | - ->setPageTitle(I18N::translate('Sosa Statistics')) |
|
59 | - ->addInlineJavascript('$(".help_tooltip").tooltip();') |
|
60 | - ; |
|
56 | + $controller = new PageController(); |
|
57 | + $controller |
|
58 | + ->setPageTitle(I18N::translate('Sosa Statistics')) |
|
59 | + ->addInlineJavascript('$(".help_tooltip").tooltip();') |
|
60 | + ; |
|
61 | 61 | |
62 | - $view_bag = new ViewBag(); |
|
63 | - $view_bag->set('title', $controller->getPageTitle()); |
|
64 | - $view_bag->set('is_setup', false); |
|
62 | + $view_bag = new ViewBag(); |
|
63 | + $view_bag->set('title', $controller->getPageTitle()); |
|
64 | + $view_bag->set('is_setup', false); |
|
65 | 65 | |
66 | - if($this->sosa_provider->isSetup()) { |
|
67 | - $view_bag->set('is_setup', true); |
|
66 | + if($this->sosa_provider->isSetup()) { |
|
67 | + $view_bag->set('is_setup', true); |
|
68 | 68 | |
69 | - $sosaCount = $this->sosa_provider->getSosaCount(); |
|
70 | - $diffSosaCount = $this->sosa_provider->getDifferentSosaCount(); |
|
69 | + $sosaCount = $this->sosa_provider->getSosaCount(); |
|
70 | + $diffSosaCount = $this->sosa_provider->getDifferentSosaCount(); |
|
71 | 71 | |
72 | - $general_stats = array( |
|
73 | - 'sosa_count' => $sosaCount, |
|
74 | - 'distinct_count' => $diffSosaCount, |
|
75 | - 'sosa_rate' => Functions::safeDivision($diffSosaCount, $this->sosa_provider->getTotalIndividuals()), |
|
76 | - 'pedi_collapse' => 1 - Functions::safeDivision($diffSosaCount, $sosaCount), |
|
77 | - 'mean_gen_time' => $this->sosa_provider->getMeanGenerationTime() |
|
78 | - ); |
|
79 | - $view_bag->set('general_stats', $general_stats); |
|
72 | + $general_stats = array( |
|
73 | + 'sosa_count' => $sosaCount, |
|
74 | + 'distinct_count' => $diffSosaCount, |
|
75 | + 'sosa_rate' => Functions::safeDivision($diffSosaCount, $this->sosa_provider->getTotalIndividuals()), |
|
76 | + 'pedi_collapse' => 1 - Functions::safeDivision($diffSosaCount, $sosaCount), |
|
77 | + 'mean_gen_time' => $this->sosa_provider->getMeanGenerationTime() |
|
78 | + ); |
|
79 | + $view_bag->set('general_stats', $general_stats); |
|
80 | 80 | |
81 | - $stats_gen = $this->sosa_provider->getStatisticsByGeneration(); |
|
82 | - $view_bag->set('missinganc_url', 'module.php?mod='.$this->module->getName().'&mod_action=SosaList@missing&ged='.$WT_TREE->getNameUrl().'&gen='); |
|
81 | + $stats_gen = $this->sosa_provider->getStatisticsByGeneration(); |
|
82 | + $view_bag->set('missinganc_url', 'module.php?mod='.$this->module->getName().'&mod_action=SosaList@missing&ged='.$WT_TREE->getNameUrl().'&gen='); |
|
83 | 83 | |
84 | - $gen_theoretical=1; |
|
85 | - $total_theoretical=0; |
|
86 | - $prev_diff=0; |
|
87 | - $prev_known=0.5; |
|
88 | - $gen_equiv=0; |
|
89 | - $generation_stats = array(); |
|
84 | + $gen_theoretical=1; |
|
85 | + $total_theoretical=0; |
|
86 | + $prev_diff=0; |
|
87 | + $prev_known=0.5; |
|
88 | + $gen_equiv=0; |
|
89 | + $generation_stats = array(); |
|
90 | 90 | |
91 | - foreach($stats_gen as $gen => $tab){ |
|
92 | - $genY1= I18N::translate('-'); |
|
93 | - $genY2= I18N::translate('-'); |
|
94 | - if($tab['firstBirth']>0) $genY1=$tab['firstBirth']; |
|
95 | - if($tab['lastBirth']>0) $genY2=$tab['lastBirth']; |
|
96 | - $total_theoretical += $gen_theoretical; |
|
97 | - $perc_sosa_count_theor = Functions::safeDivision($tab['sosaCount'], $gen_theoretical); |
|
98 | - $gen_equiv += $perc_sosa_count_theor; |
|
99 | - $missing=2*$prev_known - $tab['sosaCount']; |
|
100 | - $gen_diff=$tab['diffSosaTotalCount']-$prev_diff; |
|
91 | + foreach($stats_gen as $gen => $tab){ |
|
92 | + $genY1= I18N::translate('-'); |
|
93 | + $genY2= I18N::translate('-'); |
|
94 | + if($tab['firstBirth']>0) $genY1=$tab['firstBirth']; |
|
95 | + if($tab['lastBirth']>0) $genY2=$tab['lastBirth']; |
|
96 | + $total_theoretical += $gen_theoretical; |
|
97 | + $perc_sosa_count_theor = Functions::safeDivision($tab['sosaCount'], $gen_theoretical); |
|
98 | + $gen_equiv += $perc_sosa_count_theor; |
|
99 | + $missing=2*$prev_known - $tab['sosaCount']; |
|
100 | + $gen_diff=$tab['diffSosaTotalCount']-$prev_diff; |
|
101 | 101 | |
102 | - $generation_stats[$gen] = array( |
|
103 | - 'gen_min_birth' => $genY1, |
|
104 | - 'gen_max_birth' => $genY2, |
|
105 | - 'theoretical' => $gen_theoretical, |
|
106 | - 'known' => $tab['sosaCount'], |
|
107 | - 'perc_known' => $perc_sosa_count_theor, |
|
108 | - 'missing' => $missing, |
|
109 | - 'perc_missing' => 1-Functions::safeDivision($tab['sosaCount'], 2*$prev_known), |
|
110 | - 'total_known' => $tab['sosaTotalCount'], |
|
111 | - 'perc_total_known' => Functions::safeDivision($tab['sosaTotalCount'], $total_theoretical), |
|
112 | - 'different' => $gen_diff, |
|
113 | - 'perc_different' => Functions::safeDivision($gen_diff, $tab['sosaCount']), |
|
114 | - 'total_different' => $tab['diffSosaTotalCount'], |
|
115 | - 'pedi_collapse' => 1 - Functions::safeDivision($tab['diffSosaTotalCount'], $tab['sosaTotalCount']) |
|
116 | - ); |
|
102 | + $generation_stats[$gen] = array( |
|
103 | + 'gen_min_birth' => $genY1, |
|
104 | + 'gen_max_birth' => $genY2, |
|
105 | + 'theoretical' => $gen_theoretical, |
|
106 | + 'known' => $tab['sosaCount'], |
|
107 | + 'perc_known' => $perc_sosa_count_theor, |
|
108 | + 'missing' => $missing, |
|
109 | + 'perc_missing' => 1-Functions::safeDivision($tab['sosaCount'], 2*$prev_known), |
|
110 | + 'total_known' => $tab['sosaTotalCount'], |
|
111 | + 'perc_total_known' => Functions::safeDivision($tab['sosaTotalCount'], $total_theoretical), |
|
112 | + 'different' => $gen_diff, |
|
113 | + 'perc_different' => Functions::safeDivision($gen_diff, $tab['sosaCount']), |
|
114 | + 'total_different' => $tab['diffSosaTotalCount'], |
|
115 | + 'pedi_collapse' => 1 - Functions::safeDivision($tab['diffSosaTotalCount'], $tab['sosaTotalCount']) |
|
116 | + ); |
|
117 | 117 | |
118 | - $gen_theoretical = $gen_theoretical * 2; |
|
119 | - $prev_known=$tab['sosaCount']; |
|
120 | - $prev_diff=$tab['diffSosaTotalCount']; |
|
121 | - } |
|
118 | + $gen_theoretical = $gen_theoretical * 2; |
|
119 | + $prev_known=$tab['sosaCount']; |
|
120 | + $prev_diff=$tab['diffSosaTotalCount']; |
|
121 | + } |
|
122 | 122 | |
123 | - $view_bag->set('generation_stats', $generation_stats); |
|
124 | - $view_bag->set('equivalent_gen', $gen_equiv); |
|
123 | + $view_bag->set('generation_stats', $generation_stats); |
|
124 | + $view_bag->set('equivalent_gen', $gen_equiv); |
|
125 | 125 | |
126 | - $view_bag->set('chart_img_g2', $this->htmlAncestorDispersionG2()); |
|
127 | - $view_bag->set('chart_img_g3', $this->htmlAncestorDispersionG3()); |
|
126 | + $view_bag->set('chart_img_g2', $this->htmlAncestorDispersionG2()); |
|
127 | + $view_bag->set('chart_img_g3', $this->htmlAncestorDispersionG3()); |
|
128 | 128 | |
129 | - } |
|
129 | + } |
|
130 | 130 | |
131 | - ViewFactory::make('SosaStats', $this, $controller, $view_bag)->render(); |
|
132 | - } |
|
131 | + ViewFactory::make('SosaStats', $this, $controller, $view_bag)->render(); |
|
132 | + } |
|
133 | 133 | |
134 | - /** |
|
135 | - * Returns HTML code for a graph showing the dispersion of ancestors across father & mother |
|
136 | - * @return string HTML code |
|
137 | - */ |
|
138 | - private function htmlAncestorDispersionG2() |
|
139 | - { |
|
140 | - $ancestorsDispGen2 = $this->sosa_provider->getAncestorDispersionForGen(2); |
|
141 | - if(count($ancestorsDispGen2) == 0) return; |
|
134 | + /** |
|
135 | + * Returns HTML code for a graph showing the dispersion of ancestors across father & mother |
|
136 | + * @return string HTML code |
|
137 | + */ |
|
138 | + private function htmlAncestorDispersionG2() |
|
139 | + { |
|
140 | + $ancestorsDispGen2 = $this->sosa_provider->getAncestorDispersionForGen(2); |
|
141 | + if(count($ancestorsDispGen2) == 0) return; |
|
142 | 142 | |
143 | - $size = '600x300'; |
|
143 | + $size = '600x300'; |
|
144 | 144 | |
145 | - $total = array_sum($ancestorsDispGen2); |
|
146 | - $father_count = isset($ancestorsDispGen2[1]) ? $ancestorsDispGen2[1] : 0; |
|
147 | - $father = array ( |
|
148 | - 'color' => '84beff', |
|
149 | - 'count' => $father_count, |
|
150 | - 'perc' => Functions::safeDivision($father_count, $total), |
|
151 | - 'name' => \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('fat') |
|
152 | - ); |
|
153 | - $mother_count = isset($ancestorsDispGen2[2]) ? $ancestorsDispGen2[2] : 0; |
|
154 | - $mother = array ( |
|
155 | - 'color' => 'ffd1dc', |
|
156 | - 'count' => $mother_count, |
|
157 | - 'perc' => Functions::safeDivision($mother_count, $total), |
|
158 | - 'name' => \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('mot') |
|
159 | - ); |
|
160 | - $shared_count = isset($ancestorsDispGen2[-1]) ? $ancestorsDispGen2[-1] : 0; |
|
161 | - $shared = array ( |
|
162 | - 'color' => '777777', |
|
163 | - 'count' => $shared_count, |
|
164 | - 'perc' => Functions::safeDivision($shared_count, $total), |
|
165 | - 'name' => I18N::translate('Shared') |
|
166 | - ); |
|
145 | + $total = array_sum($ancestorsDispGen2); |
|
146 | + $father_count = isset($ancestorsDispGen2[1]) ? $ancestorsDispGen2[1] : 0; |
|
147 | + $father = array ( |
|
148 | + 'color' => '84beff', |
|
149 | + 'count' => $father_count, |
|
150 | + 'perc' => Functions::safeDivision($father_count, $total), |
|
151 | + 'name' => \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('fat') |
|
152 | + ); |
|
153 | + $mother_count = isset($ancestorsDispGen2[2]) ? $ancestorsDispGen2[2] : 0; |
|
154 | + $mother = array ( |
|
155 | + 'color' => 'ffd1dc', |
|
156 | + 'count' => $mother_count, |
|
157 | + 'perc' => Functions::safeDivision($mother_count, $total), |
|
158 | + 'name' => \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('mot') |
|
159 | + ); |
|
160 | + $shared_count = isset($ancestorsDispGen2[-1]) ? $ancestorsDispGen2[-1] : 0; |
|
161 | + $shared = array ( |
|
162 | + 'color' => '777777', |
|
163 | + 'count' => $shared_count, |
|
164 | + 'perc' => Functions::safeDivision($shared_count, $total), |
|
165 | + 'name' => I18N::translate('Shared') |
|
166 | + ); |
|
167 | 167 | |
168 | - $chd = $this->arrayToExtendedEncoding(array(4095 * $father['perc'], 4095 * $shared['perc'], 4095 * $mother['perc'])); |
|
169 | - $chart_title = I18N::translate('Known Sosa ancestors\' dispersion'); |
|
170 | - $chl = |
|
171 | - $father['name'] . ' - ' . I18N::percentage($father['perc'], 1) . '|' . |
|
172 | - $shared['name'] . ' - ' . I18N::percentage($shared['perc'], 1) . '|' . |
|
173 | - $mother['name'] . ' - ' . I18N::percentage($mother['perc'], 1); |
|
174 | - return "<img src=\"https://chart.googleapis.com/chart?cht=p&chp=1.5708&chd=e:{$chd}&chs={$size}&chco={$father['color']},{$shared['color']},{$mother['color']}&chf=bg,s,ffffff00&chl={$chl}\" alt=\"" . $chart_title . "\" title=\"" . $chart_title . "\" />"; |
|
175 | - } |
|
168 | + $chd = $this->arrayToExtendedEncoding(array(4095 * $father['perc'], 4095 * $shared['perc'], 4095 * $mother['perc'])); |
|
169 | + $chart_title = I18N::translate('Known Sosa ancestors\' dispersion'); |
|
170 | + $chl = |
|
171 | + $father['name'] . ' - ' . I18N::percentage($father['perc'], 1) . '|' . |
|
172 | + $shared['name'] . ' - ' . I18N::percentage($shared['perc'], 1) . '|' . |
|
173 | + $mother['name'] . ' - ' . I18N::percentage($mother['perc'], 1); |
|
174 | + return "<img src=\"https://chart.googleapis.com/chart?cht=p&chp=1.5708&chd=e:{$chd}&chs={$size}&chco={$father['color']},{$shared['color']},{$mother['color']}&chf=bg,s,ffffff00&chl={$chl}\" alt=\"" . $chart_title . "\" title=\"" . $chart_title . "\" />"; |
|
175 | + } |
|
176 | 176 | |
177 | - /** |
|
178 | - * Returns HTML code for a graph showing the dispersion of ancestors across grand-parents |
|
179 | - * @return string HTML code |
|
180 | - */ |
|
181 | - private function htmlAncestorDispersionG3() |
|
182 | - { |
|
183 | - $ancestorsDispGen2 = $this->sosa_provider->getAncestorDispersionForGen(3); |
|
177 | + /** |
|
178 | + * Returns HTML code for a graph showing the dispersion of ancestors across grand-parents |
|
179 | + * @return string HTML code |
|
180 | + */ |
|
181 | + private function htmlAncestorDispersionG3() |
|
182 | + { |
|
183 | + $ancestorsDispGen2 = $this->sosa_provider->getAncestorDispersionForGen(3); |
|
184 | 184 | |
185 | - $size = '700x300'; |
|
185 | + $size = '700x300'; |
|
186 | 186 | |
187 | - $color_motmot = 'ffd1dc'; |
|
188 | - $color_motfat = 'b998a0'; |
|
189 | - $color_fatfat = '577292'; |
|
190 | - $color_fatmot = '84beff'; |
|
191 | - $color_shared = '777777'; |
|
187 | + $color_motmot = 'ffd1dc'; |
|
188 | + $color_motfat = 'b998a0'; |
|
189 | + $color_fatfat = '577292'; |
|
190 | + $color_fatmot = '84beff'; |
|
191 | + $color_shared = '777777'; |
|
192 | 192 | |
193 | - $total_fatfat = $ancestorsDispGen2[1] ?: 0; |
|
194 | - $total_fatmot = $ancestorsDispGen2[2] ?: 0; |
|
195 | - $total_motfat = $ancestorsDispGen2[4] ?: 0; |
|
196 | - $total_motmot = $ancestorsDispGen2[8] ?: 0; |
|
197 | - $total_sha = $ancestorsDispGen2[-1] ?: 0; |
|
198 | - $total = $total_fatfat + $total_fatmot + $total_motfat+ $total_motmot + $total_sha; |
|
193 | + $total_fatfat = $ancestorsDispGen2[1] ?: 0; |
|
194 | + $total_fatmot = $ancestorsDispGen2[2] ?: 0; |
|
195 | + $total_motfat = $ancestorsDispGen2[4] ?: 0; |
|
196 | + $total_motmot = $ancestorsDispGen2[8] ?: 0; |
|
197 | + $total_sha = $ancestorsDispGen2[-1] ?: 0; |
|
198 | + $total = $total_fatfat + $total_fatmot + $total_motfat+ $total_motmot + $total_sha; |
|
199 | 199 | |
200 | - $chd = $this->arrayToExtendedEncoding(array( |
|
201 | - 4095 * $total_fatfat / $total, |
|
202 | - 4095 * $total_fatmot / $total, |
|
203 | - 4095 * $total_sha / $total, |
|
204 | - 4095 * $total_motfat / $total, |
|
205 | - 4095 * $total_motmot / $total |
|
206 | - )); |
|
207 | - $chart_title = I18N::translate('Known Sosa ancestors\' dispersion - G3'); |
|
208 | - $chl = |
|
209 | - \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('fatfat') . ' - ' . I18N::percentage(Functions::safeDivision($total_fatfat, $total), 1) . '|' . |
|
210 | - \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('fatmot') . ' - ' . I18N::percentage(Functions::safeDivision($total_fatmot, $total), 1) . '|' . |
|
211 | - I18N::translate('Shared') . ' - ' . I18N::percentage(Functions::safeDivision($total_sha, $total), 1) . '|' . |
|
212 | - \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('motfat') . ' - ' . I18N::percentage(Functions::safeDivision($total_motfat, $total), 1) . '|' . |
|
213 | - \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('motmot') . ' - ' . I18N::percentage(Functions::safeDivision($total_motmot, $total), 1); |
|
214 | - return "<img src=\"https://chart.googleapis.com/chart?cht=p&chp=1.5708&chd=e:{$chd}&chs={$size}&chco={$color_fatfat},{$color_fatmot},{$color_shared},{$color_motfat},{$color_motmot}&chf=bg,s,ffffff00&chl={$chl}\" alt=\"" . $chart_title . "\" title=\"" . $chart_title . "\" />"; |
|
215 | - } |
|
200 | + $chd = $this->arrayToExtendedEncoding(array( |
|
201 | + 4095 * $total_fatfat / $total, |
|
202 | + 4095 * $total_fatmot / $total, |
|
203 | + 4095 * $total_sha / $total, |
|
204 | + 4095 * $total_motfat / $total, |
|
205 | + 4095 * $total_motmot / $total |
|
206 | + )); |
|
207 | + $chart_title = I18N::translate('Known Sosa ancestors\' dispersion - G3'); |
|
208 | + $chl = |
|
209 | + \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('fatfat') . ' - ' . I18N::percentage(Functions::safeDivision($total_fatfat, $total), 1) . '|' . |
|
210 | + \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('fatmot') . ' - ' . I18N::percentage(Functions::safeDivision($total_fatmot, $total), 1) . '|' . |
|
211 | + I18N::translate('Shared') . ' - ' . I18N::percentage(Functions::safeDivision($total_sha, $total), 1) . '|' . |
|
212 | + \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('motfat') . ' - ' . I18N::percentage(Functions::safeDivision($total_motfat, $total), 1) . '|' . |
|
213 | + \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('motmot') . ' - ' . I18N::percentage(Functions::safeDivision($total_motmot, $total), 1); |
|
214 | + return "<img src=\"https://chart.googleapis.com/chart?cht=p&chp=1.5708&chd=e:{$chd}&chs={$size}&chco={$color_fatfat},{$color_fatmot},{$color_shared},{$color_motfat},{$color_motmot}&chf=bg,s,ffffff00&chl={$chl}\" alt=\"" . $chart_title . "\" title=\"" . $chart_title . "\" />"; |
|
215 | + } |
|
216 | 216 | |
217 | - /** |
|
218 | - * Convert an array to Google Chart encoding |
|
219 | - * @param arrat $a Array to encode |
|
220 | - * @return string |
|
221 | - */ |
|
222 | - private function arrayToExtendedEncoding($a) { |
|
223 | - $xencoding = WT_GOOGLE_CHART_ENCODING; |
|
217 | + /** |
|
218 | + * Convert an array to Google Chart encoding |
|
219 | + * @param arrat $a Array to encode |
|
220 | + * @return string |
|
221 | + */ |
|
222 | + private function arrayToExtendedEncoding($a) { |
|
223 | + $xencoding = WT_GOOGLE_CHART_ENCODING; |
|
224 | 224 | |
225 | - $encoding = ''; |
|
226 | - foreach ($a as $value) { |
|
227 | - if ($value < 0) { |
|
228 | - $value = 0; |
|
229 | - } |
|
230 | - $first = (int) ($value / 64); |
|
231 | - $second = $value % 64; |
|
232 | - $encoding .= $xencoding[(int) $first] . $xencoding[(int) $second]; |
|
233 | - } |
|
225 | + $encoding = ''; |
|
226 | + foreach ($a as $value) { |
|
227 | + if ($value < 0) { |
|
228 | + $value = 0; |
|
229 | + } |
|
230 | + $first = (int) ($value / 64); |
|
231 | + $second = $value % 64; |
|
232 | + $encoding .= $xencoding[(int) $first] . $xencoding[(int) $second]; |
|
233 | + } |
|
234 | 234 | |
235 | - return $encoding; |
|
236 | - } |
|
235 | + return $encoding; |
|
236 | + } |
|
237 | 237 | |
238 | 238 | |
239 | 239 | } |
240 | 240 | \ No newline at end of file |
@@ -1,13 +1,13 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * webtrees-lib: MyArtJaub library for webtrees |
|
4 | - * |
|
5 | - * @package MyArtJaub\Webtrees |
|
6 | - * @subpackage Hook |
|
7 | - * @author Jonathan Jaubart <[email protected]> |
|
8 | - * @copyright Copyright (c) 2011-2016, Jonathan Jaubart |
|
9 | - * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 |
|
10 | - */ |
|
3 | + * webtrees-lib: MyArtJaub library for webtrees |
|
4 | + * |
|
5 | + * @package MyArtJaub\Webtrees |
|
6 | + * @subpackage Hook |
|
7 | + * @author Jonathan Jaubart <[email protected]> |
|
8 | + * @copyright Copyright (c) 2011-2016, Jonathan Jaubart |
|
9 | + * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 |
|
10 | + */ |
|
11 | 11 | namespace MyArtJaub\Webtrees\Hook\HookInterfaces; |
12 | 12 | |
13 | 13 | /** |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | interface CustomSimpleTagManager { |
19 | 19 | |
20 | 20 | |
21 | - /** |
|
22 | - * Returns the list of expected tags, classified by type of records. |
|
23 | - * |
|
24 | - * @return array List of expected tags |
|
25 | - */ |
|
26 | - public function hGetExpectedTags(); |
|
21 | + /** |
|
22 | + * Returns the list of expected tags, classified by type of records. |
|
23 | + * |
|
24 | + * @return array List of expected tags |
|
25 | + */ |
|
26 | + public function hGetExpectedTags(); |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * Return the HTML code to be display for this tag. |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * webtrees-lib: MyArtJaub library for webtrees |
|
4 | - * |
|
5 | - * @package MyArtJaub\Webtrees |
|
6 | - * @subpackage Hook |
|
7 | - * @author Jonathan Jaubart <[email protected]> |
|
8 | - * @copyright Copyright (c) 2011-2016, Jonathan Jaubart |
|
9 | - * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 |
|
10 | - */ |
|
3 | + * webtrees-lib: MyArtJaub library for webtrees |
|
4 | + * |
|
5 | + * @package MyArtJaub\Webtrees |
|
6 | + * @subpackage Hook |
|
7 | + * @author Jonathan Jaubart <[email protected]> |
|
8 | + * @copyright Copyright (c) 2011-2016, Jonathan Jaubart |
|
9 | + * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 |
|
10 | + */ |
|
11 | 11 | namespace MyArtJaub\Webtrees\Hook; |
12 | 12 | |
13 | 13 | use \Fisharebest\Webtrees as fw; |
@@ -1,13 +1,13 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * webtrees-lib: MyArtJaub library for webtrees |
|
4 | - * |
|
5 | - * @package MyArtJaub\Webtrees |
|
6 | - * @subpackage Hook |
|
7 | - * @author Jonathan Jaubart <[email protected]> |
|
8 | - * @copyright Copyright (c) 2011-2016, Jonathan Jaubart |
|
9 | - * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 |
|
10 | - */ |
|
3 | + * webtrees-lib: MyArtJaub library for webtrees |
|
4 | + * |
|
5 | + * @package MyArtJaub\Webtrees |
|
6 | + * @subpackage Hook |
|
7 | + * @author Jonathan Jaubart <[email protected]> |
|
8 | + * @copyright Copyright (c) 2011-2016, Jonathan Jaubart |
|
9 | + * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 |
|
10 | + */ |
|
11 | 11 | namespace MyArtJaub\Webtrees\Hook\HookInterfaces; |
12 | 12 | |
13 | 13 | /** |
@@ -15,12 +15,12 @@ discard block |
||
15 | 15 | */ |
16 | 16 | interface PageFooterExtender { |
17 | 17 | |
18 | - /** |
|
19 | - * Get HTML code for extending the footer of a page. |
|
20 | - * |
|
21 | - * @return string HTML code extension |
|
22 | - */ |
|
23 | - public function hPrintFooter(); |
|
18 | + /** |
|
19 | + * Get HTML code for extending the footer of a page. |
|
20 | + * |
|
21 | + * @return string HTML code extension |
|
22 | + */ |
|
23 | + public function hPrintFooter(); |
|
24 | 24 | |
25 | 25 | } |
26 | 26 |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * webtrees-lib: MyArtJaub library for webtrees |
|
4 | - * |
|
5 | - * @package MyArtJaub\Webtrees |
|
6 | - * @subpackage Hook |
|
7 | - * @author Jonathan Jaubart <[email protected]> |
|
8 | - * @copyright Copyright (c) 2011-2016, Jonathan Jaubart |
|
9 | - * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 |
|
10 | - */ |
|
3 | + * webtrees-lib: MyArtJaub library for webtrees |
|
4 | + * |
|
5 | + * @package MyArtJaub\Webtrees |
|
6 | + * @subpackage Hook |
|
7 | + * @author Jonathan Jaubart <[email protected]> |
|
8 | + * @copyright Copyright (c) 2011-2016, Jonathan Jaubart |
|
9 | + * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 |
|
10 | + */ |
|
11 | 11 | namespace MyArtJaub\Webtrees\Hook; |
12 | 12 | |
13 | 13 | use \Fisharebest\Webtrees as fw; |
@@ -1,13 +1,13 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * webtrees-lib: MyArtJaub library for webtrees |
|
4 | - * |
|
5 | - * @package MyArtJaub\Webtrees |
|
6 | - * @subpackage Hook |
|
7 | - * @author Jonathan Jaubart <[email protected]> |
|
8 | - * @copyright Copyright (c) 2011-2016, Jonathan Jaubart |
|
9 | - * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 |
|
10 | - */ |
|
3 | + * webtrees-lib: MyArtJaub library for webtrees |
|
4 | + * |
|
5 | + * @package MyArtJaub\Webtrees |
|
6 | + * @subpackage Hook |
|
7 | + * @author Jonathan Jaubart <[email protected]> |
|
8 | + * @copyright Copyright (c) 2011-2016, Jonathan Jaubart |
|
9 | + * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 |
|
10 | + */ |
|
11 | 11 | namespace MyArtJaub\Webtrees\Hook\HookInterfaces; |
12 | 12 | |
13 | 13 | /** |
@@ -15,12 +15,12 @@ discard block |
||
15 | 15 | */ |
16 | 16 | interface PageHeaderExtender { |
17 | 17 | |
18 | - /** |
|
19 | - * Get HTML code for extending the header of a page. |
|
20 | - * |
|
21 | - * @return string HTML code extension |
|
22 | - */ |
|
23 | - public function hPrintHeader(); |
|
18 | + /** |
|
19 | + * Get HTML code for extending the header of a page. |
|
20 | + * |
|
21 | + * @return string HTML code extension |
|
22 | + */ |
|
23 | + public function hPrintHeader(); |
|
24 | 24 | |
25 | 25 | } |
26 | 26 |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * webtrees-lib: MyArtJaub library for webtrees |
|
4 | - * |
|
5 | - * @package MyArtJaub\Webtrees |
|
6 | - * @subpackage Hook |
|
7 | - * @author Jonathan Jaubart <[email protected]> |
|
8 | - * @copyright Copyright (c) 2011-2016, Jonathan Jaubart |
|
9 | - * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 |
|
10 | - */ |
|
3 | + * webtrees-lib: MyArtJaub library for webtrees |
|
4 | + * |
|
5 | + * @package MyArtJaub\Webtrees |
|
6 | + * @subpackage Hook |
|
7 | + * @author Jonathan Jaubart <[email protected]> |
|
8 | + * @copyright Copyright (c) 2011-2016, Jonathan Jaubart |
|
9 | + * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 |
|
10 | + */ |
|
11 | 11 | namespace MyArtJaub\Webtrees\Hook; |
12 | 12 | |
13 | 13 | use \Fisharebest\Webtrees as fw; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * @return string HTML code of the inserted flag |
80 | 80 | */ |
81 | 81 | public static function htmlPlaceIcon(\Fisharebest\Webtrees\Place $place, $icon_path , $size = 50) { |
82 | - return '<img class="flag_gm_h'. $size . '" src="' . $icon_path . '" title="' . $place->getGedcomName() . '" alt="' . $place->getGedcomName() . '" />'; |
|
82 | + return '<img class="flag_gm_h'. $size . '" src="' . $icon_path . '" title="' . $place->getGedcomName() . '" alt="' . $place->getGedcomName() . '" />'; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | * @return boolean |
356 | 356 | */ |
357 | 357 | public static function isDateWithinChartsRange(Date $date) { |
358 | - return $date->gregorianYear() >= 1550 && $date->gregorianYear() < 2030; |
|
358 | + return $date->gregorianYear() >= 1550 && $date->gregorianYear() < 2030; |
|
359 | 359 | } |
360 | 360 | |
361 | 361 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | if(!$this->gedcomrecord->canShow($access_level)) return false; |
93 | 93 | if($access_level === null ) |
94 | - $access_level = \Fisharebest\Webtrees\Auth::accessLevel($this->gedcomrecord->getTree()); |
|
94 | + $access_level = \Fisharebest\Webtrees\Auth::accessLevel($this->gedcomrecord->getTree()); |
|
95 | 95 | |
96 | 96 | if (isset($global_facts['SOUR'])) { |
97 | 97 | return $global_facts['SOUR'] >= $access_level; |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | * @return int Level of sources |
130 | 130 | */ |
131 | 131 | public function isFactSourced($eventslist){ |
132 | - if(empty($eventslist)) return 0; |
|
132 | + if(empty($eventslist)) return 0; |
|
133 | 133 | $isSourced=0; |
134 | 134 | $facts = $this->gedcomrecord->getFacts($eventslist); |
135 | 135 | foreach($facts as $fact){ |