@@ -217,39 +217,34 @@ discard block |
||
217 | 217 | $placest = implode(I18N::$list_separator, array_slice($levels, 0, $this->analysis_level)); |
218 | 218 | if(isset($placesDispGeneral['places'][$placest])) { |
219 | 219 | $placesDispGeneral['places'][$placest] += 1; |
220 | - } |
|
221 | - else { |
|
220 | + } else { |
|
222 | 221 | $placesDispGeneral['places'][$placest] = 1; |
223 | 222 | } |
224 | - if($placesDispGeneral['places'][$placest]>$placesDispGeneral['max']) |
|
225 | - $placesDispGeneral['max'] = $placesDispGeneral['places'][$placest]; |
|
223 | + if($placesDispGeneral['places'][$placest]>$placesDispGeneral['max']) { |
|
224 | + $placesDispGeneral['max'] = $placesDispGeneral['places'][$placest]; |
|
225 | + } |
|
226 | 226 | foreach($genstab as $gen) { |
227 | 227 | if(isset($placesDispGenerations[$gen]['places'][$placest])) { |
228 | 228 | $placesDispGenerations[$gen]['places'][$placest] += 1; |
229 | - } |
|
230 | - else { |
|
229 | + } else { |
|
231 | 230 | $placesDispGenerations[$gen]['places'][$placest] = 1; |
232 | 231 | } |
233 | 232 | if(isset($placesDispGenerations[$gen]['sum'])) { |
234 | 233 | $placesDispGenerations[$gen]['sum'] += 1; |
235 | - } |
|
236 | - else { |
|
234 | + } else { |
|
237 | 235 | $placesDispGenerations[$gen]['sum'] = 1; |
238 | 236 | } |
239 | 237 | } |
240 | - } |
|
241 | - else{ |
|
238 | + } else{ |
|
242 | 239 | if(isset($placesDispGeneral['other'])) { |
243 | 240 | $placesDispGeneral['other'] += 1; |
244 | - } |
|
245 | - else { |
|
241 | + } else { |
|
246 | 242 | $placesDispGeneral['other'] = 1; |
247 | 243 | } |
248 | 244 | foreach($genstab as $gen) { |
249 | 245 | if(isset($placesDispGenerations[$gen]['other'])) { |
250 | 246 | $placesDispGenerations[$gen]['other'] += 1; |
251 | - } |
|
252 | - else { |
|
247 | + } else { |
|
253 | 248 | $placesDispGenerations[$gen]['other'] = 1; |
254 | 249 | } |
255 | 250 | } |
@@ -263,8 +258,7 @@ discard block |
||
263 | 258 | foreach($genstab as $gen) { |
264 | 259 | if(isset($placesDispGenerations[$gen]['unknown'])) { |
265 | 260 | $placesDispGenerations[$gen]['unknown'] += 1; |
266 | - } |
|
267 | - else { |
|
261 | + } else { |
|
268 | 262 | $placesDispGenerations[$gen]['unknown'] = 1; |
269 | 263 | } |
270 | 264 | } |
@@ -70,7 +70,9 @@ discard block |
||
70 | 70 | $this->is_loaded = false; |
71 | 71 | $this->subdivisions = array(); |
72 | 72 | $this->mappings = array(); |
73 | - if($load) $this->load(); |
|
73 | + if($load) { |
|
74 | + $this->load(); |
|
75 | + } |
|
74 | 76 | } |
75 | 77 | |
76 | 78 | /** |
@@ -117,7 +119,9 @@ discard block |
||
117 | 119 | foreach($xml->subdivisions->children() as $subdivision){ |
118 | 120 | $attributes = $subdivision->attributes(); |
119 | 121 | $key = trim($attributes['name']); |
120 | - if(isset($attributes['parent'])) $key .= '@'.trim($attributes['parent']); |
|
122 | + if(isset($attributes['parent'])) { |
|
123 | + $key .= '@'.trim($attributes['parent']); |
|
124 | + } |
|
121 | 125 | $this->subdivisions[$key] = array( |
122 | 126 | 'id' => trim($attributes['id']), |
123 | 127 | 'displayname' => trim($attributes['name']), |
@@ -142,7 +146,9 @@ discard block |
||
142 | 146 | * @return string |
143 | 147 | */ |
144 | 148 | public function getFileName() { |
145 | - if(!$this->is_loaded) $this->load(); |
|
149 | + if(!$this->is_loaded) { |
|
150 | + $this->load(); |
|
151 | + } |
|
146 | 152 | return $this->filename; |
147 | 153 | } |
148 | 154 | |
@@ -151,7 +157,9 @@ discard block |
||
151 | 157 | * @return string |
152 | 158 | */ |
153 | 159 | public function getDescription() { |
154 | - if(!$this->is_loaded) $this->load(); |
|
160 | + if(!$this->is_loaded) { |
|
161 | + $this->load(); |
|
162 | + } |
|
155 | 163 | return $this->description; |
156 | 164 | } |
157 | 165 | |
@@ -160,7 +168,9 @@ discard block |
||
160 | 168 | * @return string |
161 | 169 | */ |
162 | 170 | public function getTopLevelName() { |
163 | - if(!$this->is_loaded) $this->load(); |
|
171 | + if(!$this->is_loaded) { |
|
172 | + $this->load(); |
|
173 | + } |
|
164 | 174 | return $this->top_level_name; |
165 | 175 | } |
166 | 176 | |
@@ -169,7 +179,9 @@ discard block |
||
169 | 179 | * @return \MyArtJaub\Webtrees\Module\GeoDispersion\Model\OutlineMapCanvas |
170 | 180 | */ |
171 | 181 | public function getCanvas() { |
172 | - if(!$this->is_loaded) $this->load(); |
|
182 | + if(!$this->is_loaded) { |
|
183 | + $this->load(); |
|
184 | + } |
|
173 | 185 | return $this->canvas; |
174 | 186 | } |
175 | 187 | |
@@ -178,7 +190,9 @@ discard block |
||
178 | 190 | * @return array |
179 | 191 | */ |
180 | 192 | public function getSubdivisions() { |
181 | - if(!$this->is_loaded) $this->load(); |
|
193 | + if(!$this->is_loaded) { |
|
194 | + $this->load(); |
|
195 | + } |
|
182 | 196 | return $this->subdivisions; |
183 | 197 | } |
184 | 198 | |
@@ -187,7 +201,9 @@ discard block |
||
187 | 201 | * @return array |
188 | 202 | */ |
189 | 203 | public function getPlacesMappings() { |
190 | - if(!$this->is_loaded) $this->load(); |
|
204 | + if(!$this->is_loaded) { |
|
205 | + $this->load(); |
|
206 | + } |
|
191 | 207 | return $this->mappings; |
192 | 208 | } |
193 | 209 |
@@ -54,7 +54,10 @@ |
||
54 | 54 | <?php echo I18N::translate('Description'); ?> |
55 | 55 | </label> |
56 | 56 | <div class="col-sm-9"> |
57 | - <input class="form-control" type="text" id="description" name="description" required maxlength="70" <?php if(!$is_new) echo 'value="' . Filter::escapeHtml($ga->getTitle()) .'"'; ?> dir="auto"> |
|
57 | + <input class="form-control" type="text" id="description" name="description" required maxlength="70" <?php if(!$is_new) { |
|
58 | + echo 'value="' . Filter::escapeHtml($ga->getTitle()) .'"'; |
|
59 | +} |
|
60 | +?> dir="auto"> |
|
58 | 61 | <p class="small text-muted"> |
59 | 62 | <?php echo I18N::translate('Description to be given to the geographical dispersion analysis. It will be used as the page title for it.'); ?> |
60 | 63 | </p> |
@@ -65,8 +65,7 @@ discard block |
||
65 | 65 | if(!is_null($max_details_gen) && $max_details_gen == 0){ |
66 | 66 | $html .= I18N::translate('<strong><em>Place</em> or <em>Flag</em> aa (bb %%)</strong>: The first number indicates the total number of ancestors born in this place, the percentage relates this count to the total number of found places. No percentage means it is less than 10%%.').'<br />'; |
67 | 67 | $html .= I18N::translate('If any, the darker area indicates the number of unknown places within the generation or places outside the analysed area, and its percentage compared to the number of ancestors. No percentage means it is less than 10%%.'); |
68 | - } |
|
69 | - else{ |
|
68 | + } else{ |
|
70 | 69 | $html .= I18N::translate('<strong><em>Place</em> [aa - bb %%]</strong>: The first number indicates the total number of ancestors born in this place, the percentage compares this count to the total number of found places.').'<br />'; |
71 | 70 | $html .= I18N::translate('Only the %d more frequent places for each generation are displayed.', $max_details_gen); |
72 | 71 | } |
@@ -97,16 +96,16 @@ discard block |
||
97 | 96 | $content = ''; |
98 | 97 | if(isset($dataplace['flag'])){ |
99 | 98 | $content .= '<td class="geodispersion_flag">'. FunctionsPrint::htmlPlaceIcon($dataplace['place'], $dataplace['flag']) .'</td><td>'; |
100 | - } |
|
101 | - else{ |
|
99 | + } else{ |
|
102 | 100 | $content .= '<td><span title="'.implode(I18N::$list_separator, array_reverse($levels)).'">'.$levels[$analysis_level-1].'</span><br/>'; |
103 | 101 | } |
104 | 102 | $count = $dataplace['count']; |
105 | 103 | $content .= I18N::number($count); |
106 | 104 | $perc = Functions::safeDivision($count, $sum_gen + $unknownother); |
107 | 105 | $perc2= Functions::safeDivision($count, $sum_gen); |
108 | - if($perc2>=0.1) |
|
109 | - $content.= '<br/><span class="small">('.I18N::percentage($perc2, 1).')</span>'; |
|
106 | + if($perc2>=0.1) { |
|
107 | + $content.= '<br/><span class="small">('.I18N::percentage($perc2, 1).')</span>'; |
|
108 | + } |
|
110 | 109 | $content .= '</td>'; |
111 | 110 | |
112 | 111 | $html .= ' |
@@ -126,7 +125,9 @@ discard block |
||
126 | 125 | if($unknownother>0){ |
127 | 126 | $perc= Functions::safeDivision($unknownother, $sum_gen + $unknownother); |
128 | 127 | $html .='<td class="geodispersion_unknownitem left" >'.I18N::number($unknownother); |
129 | - if($perc>=0.1) $html.= '<br/><span class="small">('.I18N::percentage($perc, 1).')</span>'; |
|
128 | + if($perc>=0.1) { |
|
129 | + $html.= '<br/><span class="small">('.I18N::percentage($perc, 1).')</span>'; |
|
130 | + } |
|
130 | 131 | $html .='</td>'; |
131 | 132 | } |
132 | 133 | |
@@ -152,8 +153,7 @@ discard block |
||
152 | 153 | if($placename != 'other'){ |
153 | 154 | $levels = array_map('trim',explode(',', $placename)); |
154 | 155 | $placename = '<span title="'.implode(I18N::$list_separator, array_reverse($levels)).'">'.$levels[$analysis_level-1].'</span>'; |
155 | - } |
|
156 | - else{ |
|
156 | + } else{ |
|
157 | 157 | $placename = I18N::translate('Other places'); |
158 | 158 | } |
159 | 159 | $tmp_places[] = I18N::translate('<strong>%s</strong> [%d - %s]', $placename, $count, I18N::percentage(Functions::safeDivision($count, $sum_gen + $other), 1)); |
@@ -86,7 +86,9 @@ |
||
86 | 86 | $html.= 'map.area'.$location['id'].' = paper.path("'.$location['coord'].'").attr(attr);'; |
87 | 87 | if(isset($location['transparency'])) { |
88 | 88 | $textToolTip = '<strong>'.$location['displayname'].'</strong><br/>'; |
89 | - if($this->data->get('use_flags') && $location['flag'] != '') $textToolTip .= '<span class="geodispersion_flag">'.FunctionsPrint::htmlPlaceIcon($location['place'], $location['flag']).'</span><br/>'; |
|
89 | + if($this->data->get('use_flags') && $location['flag'] != '') { |
|
90 | + $textToolTip .= '<span class="geodispersion_flag">'.FunctionsPrint::htmlPlaceIcon($location['place'], $location['flag']).'</span><br/>'; |
|
91 | + } |
|
90 | 92 | $textToolTip .= I18N::translate('%d individuals', $location['count']).'<br/>'.I18N::percentage(Functions::safeDivision($location['count'], $nb_found - $nb_other), 1); |
91 | 93 | $html.= 'addTip(map.area'.$location['id'].'.node, "'.Filter::escapeJs($textToolTip).'");'; |
92 | 94 | $html.= 'map.area'.$location['id'].'.attr({"fill" : "'. $canvas->max_color .'", "fill-opacity" : '.$location['transparency'].' });'; |
@@ -37,14 +37,15 @@ |
||
37 | 37 | $perc = Functions::safeDivision($nb, $nb_found - $nb_other); |
38 | 38 | if($nb!=$previous_nb){ |
39 | 39 | $j= I18N::number($i); |
40 | - } |
|
41 | - else{ |
|
40 | + } else{ |
|
42 | 41 | $j=' '; |
43 | 42 | } |
44 | 43 | |
45 | 44 | $levels = array_map('trim',explode(',', $place)); |
46 | 45 | $placename = $levels[$analysis_level-1]; |
47 | - if($placename == '' && $analysis_level > 1) $placename = I18N::translate('Unknown (%s)', $levels[$analysis_level-2]); |
|
46 | + if($placename == '' && $analysis_level > 1) { |
|
47 | + $placename = I18N::translate('Unknown (%s)', $levels[$analysis_level-2]); |
|
48 | + } |
|
48 | 49 | $html.= |
49 | 50 | '<div class="maj-row"> |
50 | 51 | <div class="label"><strong>'.$j.'</strong></div> |
@@ -118,8 +118,7 @@ discard block |
||
118 | 118 | if(Functions::isValidPath($certfile, true)) { |
119 | 119 | return new Certificate($certfile, $tree, $provider); |
120 | 120 | } |
121 | - } |
|
122 | - catch (\Exception $ex) { |
|
121 | + } catch (\Exception $ex) { |
|
123 | 122 | Log::addErrorLog('Certificate module error : > '.$ex->getMessage().' < with data > '.$xref.' <'); |
124 | 123 | } |
125 | 124 | |
@@ -202,7 +201,9 @@ discard block |
||
202 | 201 | */ |
203 | 202 | public function getCity(){ |
204 | 203 | $chunks = explode('/', $this->getFilename(), 2); |
205 | - if(count($chunks) > 1) return $chunks[0]; |
|
204 | + if(count($chunks) > 1) { |
|
205 | + return $chunks[0]; |
|
206 | + } |
|
206 | 207 | return null; |
207 | 208 | } |
208 | 209 | |
@@ -246,8 +247,7 @@ discard block |
||
246 | 247 | |
247 | 248 | if($sid){ |
248 | 249 | $this->source = Source::getInstance($sid, $this->tree); |
249 | - } |
|
250 | - else{ |
|
250 | + } else{ |
|
251 | 251 | $this->fetchALinkedSource(); // the method already attach the source to the Certificate object; |
252 | 252 | } |
253 | 253 | |
@@ -256,7 +256,9 @@ discard block |
||
256 | 256 | $repofact = $this->source->getFirstFact('REPO'); |
257 | 257 | if($repofact) { |
258 | 258 | $repo = $repofact->getTarget(); |
259 | - if($repo && $repo instanceof Repository) $wmtext .= ' '.$repo->getFullName().' - '; |
|
259 | + if($repo && $repo instanceof Repository) { |
|
260 | + $wmtext .= ' '.$repo->getFullName().' - '; |
|
261 | + } |
|
260 | 262 | } |
261 | 263 | $wmtext .= $this->source->getFullName(); |
262 | 264 | } |
@@ -426,7 +428,9 @@ discard block |
||
426 | 428 | } |
427 | 429 | } |
428 | 430 | |
429 | - if($sid) $this->source = Source::getInstance($sid, $this->tree); |
|
431 | + if($sid) { |
|
432 | + $this->source = Source::getInstance($sid, $this->tree); |
|
433 | + } |
|
430 | 434 | |
431 | 435 | return $this->source; |
432 | 436 | } |
@@ -29,8 +29,7 @@ |
||
29 | 29 | date('Y'), |
30 | 30 | '<span class="odometer">' . I18N::number($this->data->get('visits_today')) . '</span>' |
31 | 31 | ); |
32 | - } |
|
33 | - else { |
|
32 | + } else { |
|
34 | 33 | $html = I18N::translate('No statistics could be retrieved from Piwik.'); |
35 | 34 | } |
36 | 35 |
@@ -77,8 +77,7 @@ |
||
77 | 77 | $index = str_replace('%', '', $match2); |
78 | 78 | if(is_numeric($index) && $index >0 && $index <= $nbLevels){ |
79 | 79 | $displayPlace = str_replace($match2, $levels[$index-1] , $displayPlace); |
80 | - } |
|
81 | - else{ |
|
80 | + } else{ |
|
82 | 81 | $displayPlace = str_replace($match2, '' , $displayPlace); |
83 | 82 | } |
84 | 83 | } |