Completed
Push — master ( b40ea8...2ebfe4 )
by Jonathan
05:27
created
src/Webtrees/Module/Hooks/Views/AdminConfigView.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,10 @@
 block discarded – undo
66 66
 								<td><?php echo (($hook->status)=='enabled'); ?></td>
67 67
 								<td><?php echo $hook->hook; ?></td>
68 68
 								<td><?php echo $hook->context; ?></td>
69
-								<td><?php if($mod = Module::getModuleByName($hook->module)) echo $mod->getTitle(); ?></td>
69
+								<td><?php if($mod = Module::getModuleByName($hook->module)) {
70
+	echo $mod->getTitle();
71
+}
72
+?></td>
70 73
 								<td><input type="text" class="center" size="2" value="<?php echo $hook->priority; ?>" name="moduleorder-<?php echo $hook->id; ?>" /></td>
71 74
 								<td><?php echo $hook->priority; ?></td>
72 75
 							</tr>
Please login to merge, or discard this patch.
src/Webtrees/Module/ModuleManager.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -72,13 +72,11 @@
 block discarded – undo
72 72
     					// as they could change by the next call to the method
73 73
     					return false;
74 74
     				}
75
-    			}
76
-    			else {
75
+    			} else {
77 76
     				$this->modules_list[$moduleName] = TRUE;
78 77
     				return true;
79 78
     			}
80
-    		}
81
-    		else {
79
+    		} else {
82 80
     			$this->modules_list[$moduleName] = FALSE;
83 81
     		}
84 82
     	}
Please login to merge, or discard this patch.
src/Webtrees/Module/MiscExtensions/AdminConfigController.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,9 @@
 block discarded – undo
66 66
         global $WT_TREE;
67 67
         
68 68
         $action = Filter::post('action');        
69
-        if($action == 'update' && Filter::checkCsrf()) $this->update();
69
+        if($action == 'update' && Filter::checkCsrf()) {
70
+        	$this->update();
71
+        }
70 72
         
71 73
         Theme::theme(new AdministrationTheme)->init($WT_TREE);        
72 74
         $ctrl = new PageController();
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/Model/GeoAnalysis.php 1 patch
Braces   +10 added lines, -16 removed lines patch added patch discarded remove patch
@@ -217,39 +217,34 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
                     }
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/Model/OutlineMap.php 1 patch
Braces   +24 added lines, -8 removed lines patch added patch discarded remove patch
@@ -70,7 +70,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
                    
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/AdminConfigController.php 1 patch
Braces   +13 added lines, -11 removed lines patch added patch discarded remove patch
@@ -79,7 +79,9 @@  discard block
 block discarded – undo
79 79
         
80 80
         $other_trees = array();
81 81
         foreach (Tree::getAll() as $tree) {
82
-            if($tree->getTreeId() != $WT_TREE->getTreeId()) $other_trees[] = $tree;
82
+            if($tree->getTreeId() != $WT_TREE->getTreeId()) {
83
+            	$other_trees[] = $tree;
84
+            }
83 85
         }      
84 86
         $data->set('other_trees', $other_trees);
85 87
         
@@ -182,7 +184,9 @@  discard block
 block discarded – undo
182 184
         
183 185
         // Generate an AJAX/JSON response for datatables to load a block of rows
184 186
         $search = Filter::postArray('search');
185
-        if($search) $search = $search['value'];
187
+        if($search) {
188
+        	$search = $search['value'];
189
+        }
186 190
         $start  = Filter::postInteger('start');
187 191
         $length = Filter::postInteger('length');
188 192
         $order  = Filter::postArray('order');
@@ -336,8 +340,7 @@  discard block
 block discarded – undo
336 340
                     if($use_map) {
337 341
                         $options->setMap(new OutlineMap($map_file));
338 342
                         $options->setMapLevel($map_top_level + 1);
339
-                    }
340
-                    else {
343
+                    } else {
341 344
                         $options->setMap(null);
342 345
                     }
343 346
                 }
@@ -348,8 +351,7 @@  discard block
 block discarded – undo
348 351
 					Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID “'.$res->getId().'” has been updated.');
349 352
 					$ga = $res;
350 353
 					$success = true;
351
-				}
352
-				else {
354
+				} else {
353 355
 					FlashMessages::addMessage(I18N::translate('An error occured while updating the geographical dispersion analysis “%s”', $ga->getTitle()), 'danger');
354 356
 					Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID “'. $ga->getId() .'” could not be updated. See error log.');
355 357
 				}
@@ -367,8 +369,7 @@  discard block
 block discarded – undo
367 369
 				FlashMessages::addMessage(I18N::translate('The geographical dispersion analysis “%s” has been successfully added.', $ga->getTitle()), 'success');
368 370
 				Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID “'.$ga->getId().'” has been added.');
369 371
 				$success = true;
370
-			}
371
-			else {
372
+			} else {
372 373
 				FlashMessages::addMessage(I18N::translate('An error occured while adding the geographical dispersion analysis “%s”', $description), 'danger');
373 374
 				Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis “'.$description.'” could not be added. See error log.');
374 375
 			}
@@ -378,8 +379,7 @@  discard block
 block discarded – undo
378 379
         if(!$success) {			
379 380
             if($ga) {
380 381
                 $redirection_url = 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig@edit&ga_id='. $ga->getId() .'&ged=' . $WT_TREE->getNameUrl();
381
-            }
382
-            else {
382
+            } else {
383 383
                 $redirection_url = 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig@add&ged=' . $WT_TREE->getNameUrl();
384 384
             }
385 385
         }        
@@ -437,7 +437,9 @@  discard block
 block discarded – undo
437 437
         $data->set('map_list', $map_list);
438 438
     
439 439
         $gen_details = array(0 => I18N::translate('All'));
440
-        for($i = 1; $i <= 10 ; $i++) $gen_details[$i] = $i;
440
+        for($i = 1; $i <= 10 ; $i++) {
441
+        	$gen_details[$i] = $i;
442
+        }
441 443
         $data->set('generation_details', $gen_details);
442 444
     
443 445
         ViewFactory::make('GeoAnalysisEdit', $this, $controller, $data)->render();
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/Views/GeoAnalysisEditView.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,10 @@
 block discarded – undo
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>
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/Views/GeoAnalysisTabGenerationsView.php 1 patch
Braces   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -65,8 +65,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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));         	
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/Views/GeoAnalysisTabGeneralMapView.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,9 @@
 block discarded – undo
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'].' });';
Please login to merge, or discard this patch.