Completed
Push — feature/code-analysis ( c314d5...820b23 )
by Jonathan
02:56
created
src/Webtrees/Module/GeoDispersion/Model/GeoDisplayOptions.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	 *
45 45
      * @return (OutlineMap|null)
46 46
      */
47
-    public function getMap(){
47
+    public function getMap() {
48 48
         return $this->map;
49 49
     }
50 50
     
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	 *
65 65
 	 * @return int
66 66
 	 */
67
-    public function getMapLevel(){
67
+    public function getMapLevel() {
68 68
         return $this->map_level;
69 69
     }
70 70
     
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	 *
85 85
 	 * @return bool
86 86
 	 */
87
-    public function isUsingFlags(){
87
+    public function isUsingFlags() {
88 88
         return $this->use_flags;
89 89
     }
90 90
     
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 	 *
105 105
 	 * @return int
106 106
 	 */
107
-    public function getMaxDetailsInGen(){
107
+    public function getMaxDetailsInGen() {
108 108
         return $this->max_details_in_gen;
109 109
     }
110 110
     
Please login to merge, or discard this patch.
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -15,58 +15,58 @@  discard block
 block discarded – undo
15 15
  */
16 16
 class GeoDisplayOptions {
17 17
     
18
-    /**
18
+	/**
19 19
 	 * Outline map to be used for diaplay
20
-     * @var (null|OutlineMap) $map
21
-     */
22
-    protected $map;
20
+	 * @var (null|OutlineMap) $map
21
+	 */
22
+	protected $map;
23 23
     
24 24
 	/**
25 25
 	 * Level in the Gedcom hierarchy of the parent level of the outline map.
26 26
 	 * @var int $map_level
27 27
 	 */
28
-    protected $map_level;
28
+	protected $map_level;
29 29
     
30 30
 	/**
31 31
 	 * Option to use flags in places display, instead of or in addition to the name.
32 32
 	 * @var bool $use_flags
33 33
 	 */
34
-    protected $use_flags;
34
+	protected $use_flags;
35 35
     
36 36
 	/**
37 37
 	 * Option to define the number of top places to display in the generation view.
38 38
 	 * @var int $max_details_in_gen
39 39
 	 */
40
-    protected $max_details_in_gen;
40
+	protected $max_details_in_gen;
41 41
     
42
-    /**
42
+	/**
43 43
 	 * Get the outline map to use for display.
44 44
 	 *
45
-     * @return (OutlineMap|null)
46
-     */
47
-    public function getMap(){
48
-        return $this->map;
49
-    }
45
+	 * @return (OutlineMap|null)
46
+	 */
47
+	public function getMap(){
48
+		return $this->map;
49
+	}
50 50
     
51 51
 	/**
52 52
 	 * Set the outline map to use for display.
53 53
 	 *
54
-     * @param (OutlineMap|null) $map
54
+	 * @param (OutlineMap|null) $map
55 55
 	 * @return self Enable method-chaining
56
-     */
57
-    public function setMap(OutlineMap $map = null) {
58
-        $this->map = $map;
59
-        return $this;
60
-    }
56
+	 */
57
+	public function setMap(OutlineMap $map = null) {
58
+		$this->map = $map;
59
+		return $this;
60
+	}
61 61
     
62 62
 	/**
63 63
 	 * Get the level of the map parent place
64 64
 	 *
65 65
 	 * @return int
66 66
 	 */
67
-    public function getMapLevel(){
68
-        return $this->map_level;
69
-    }
67
+	public function getMapLevel(){
68
+		return $this->map_level;
69
+	}
70 70
     
71 71
 	/**
72 72
 	 * Set the level of the map parent place
@@ -74,19 +74,19 @@  discard block
 block discarded – undo
74 74
 	 * @param int $maplevel
75 75
 	 * @return self Enable method-chaining
76 76
 	 */
77
-    public function setMapLevel($maplevel) {
78
-        $this->map_level = $maplevel;
79
-        return $this;
80
-    }
77
+	public function setMapLevel($maplevel) {
78
+		$this->map_level = $maplevel;
79
+		return $this;
80
+	}
81 81
     
82 82
 	/**
83 83
 	 * Get whether flags should be used in places display
84 84
 	 *
85 85
 	 * @return bool
86 86
 	 */
87
-    public function isUsingFlags(){
88
-        return $this->use_flags;
89
-    }
87
+	public function isUsingFlags(){
88
+		return $this->use_flags;
89
+	}
90 90
     
91 91
 	/**
92 92
 	 * Set whether flags should be used in places display
@@ -94,19 +94,19 @@  discard block
 block discarded – undo
94 94
 	 * @param bool $use_flags
95 95
 	 * @return self Enable method-chaining
96 96
 	 */
97
-    public function setUsingFlags($use_flags) {
98
-        $this->use_flags = $use_flags;
99
-        return $this;
100
-    }
97
+	public function setUsingFlags($use_flags) {
98
+		$this->use_flags = $use_flags;
99
+		return $this;
100
+	}
101 101
     
102 102
 	/**
103 103
 	 * Get the number of Top Places in the generation view
104 104
 	 *
105 105
 	 * @return int
106 106
 	 */
107
-    public function getMaxDetailsInGen(){
108
-        return $this->max_details_in_gen;
109
-    }
107
+	public function getMaxDetailsInGen(){
108
+		return $this->max_details_in_gen;
109
+	}
110 110
     
111 111
 	/**
112 112
 	 * Set the number of Top Places in the generation view
@@ -114,10 +114,10 @@  discard block
 block discarded – undo
114 114
 	 * @param int $max_details_in_gen
115 115
 	 * @return self Enable method-chaining
116 116
 	 */
117
-    public function setMaxDetailsInGen($max_details_in_gen) {
118
-        $this->max_details_in_gen = $max_details_in_gen;
119
-        return $this;
120
-    }
117
+	public function setMaxDetailsInGen($max_details_in_gen) {
118
+		$this->max_details_in_gen = $max_details_in_gen;
119
+		return $this;
120
+	}
121 121
                    
122 122
 }
123 123
  
124 124
\ No newline at end of file
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/Model/OutlineMapCanvas.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -19,49 +19,49 @@  discard block
 block discarded – undo
19 19
 	 * Width of the map (in pixels).
20 20
 	 * @var int $width
21 21
 	 */
22
-    public $width;
22
+	public $width;
23 23
 	
24 24
 	/**
25 25
 	 * Height of the map (in pixels).
26 26
 	 * @var int $height
27 27
 	 */
28
-    public $height;
28
+	public $height;
29 29
 	
30 30
 	/**
31 31
 	 * Background color for the map shapes with values (when no transparency if applied).
32 32
 	 * @var string $max_color
33 33
 	 */
34
-    public $max_color;
34
+	public $max_color;
35 35
 	
36 36
 	/**
37 37
 	 * Background color for the map shapes when hovered.
38 38
 	 * @var string $hover_color
39 39
 	 */
40
-    public $hover_color;
40
+	public $hover_color;
41 41
 	
42 42
 	/**
43 43
 	 * Background color for the map.
44 44
 	 * @var string $background_color
45 45
 	 */
46
-    public $background_color;
46
+	public $background_color;
47 47
 	
48 48
 	/**
49 49
 	 * Border color for the map.
50 50
 	 * @var string $background_stroke
51 51
 	 */
52
-    public $background_stroke;
52
+	public $background_stroke;
53 53
 	
54 54
 	/**
55 55
 	 * Default color for the shapes (without any value).
56 56
 	 * @var string $default_color
57 57
 	 */
58
-    public $default_color;
58
+	public $default_color;
59 59
 	
60 60
 	/**
61 61
 	 * Default border color for the shapes.
62 62
 	 * @var string $default_stroke
63 63
 	 */
64
-    public $default_stroke;
64
+	public $default_stroke;
65 65
     
66 66
 	/**
67 67
 	 * Constructor for OutlineMapCanvas.
@@ -75,25 +75,25 @@  discard block
 block discarded – undo
75 75
 	 * @param string $default_color Default background color for the shapes
76 76
 	 * @param string $default_stroke Default border color for the shapes
77 77
 	 */
78
-    public function __construct(
79
-        $width,
80
-        $height,
81
-        $max_color,
82
-        $hover_color,
83
-        $background_color,
84
-        $background_stroke,
85
-        $default_color,
86
-        $default_stroke
87
-     ) {
88
-        $this->width = $width;
89
-        $this->height = $height;
90
-        $this->max_color = $max_color;
91
-        $this->hover_color = $hover_color;
92
-        $this->background_color = $background_color;
93
-        $this->background_stroke = $background_stroke;
94
-        $this->default_color = $default_color;
95
-        $this->default_stroke = $default_stroke;
96
-    }
78
+	public function __construct(
79
+		$width,
80
+		$height,
81
+		$max_color,
82
+		$hover_color,
83
+		$background_color,
84
+		$background_stroke,
85
+		$default_color,
86
+		$default_stroke
87
+	 ) {
88
+		$this->width = $width;
89
+		$this->height = $height;
90
+		$this->max_color = $max_color;
91
+		$this->hover_color = $hover_color;
92
+		$this->background_color = $background_color;
93
+		$this->background_stroke = $background_stroke;
94
+		$this->default_color = $default_color;
95
+		$this->default_stroke = $default_stroke;
96
+	}
97 97
     
98 98
     
99 99
 }
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/Model/GeoAnalysis.php 3 patches
Indentation   +175 added lines, -175 removed lines patch added patch discarded remove patch
@@ -25,64 +25,64 @@  discard block
 block discarded – undo
25 25
 	 * Geo Analysis ID
26 26
 	 * @var int $id
27 27
 	 */
28
-    protected $id;
28
+	protected $id;
29 29
     
30 30
 	/**
31 31
 	 * Geo Analysis Title
32 32
 	 * @var string $title
33 33
 	 */
34
-    protected $title;
34
+	protected $title;
35 35
     
36 36
 	/**
37 37
 	 * Level of the Gedcom hierarchy for the analysis
38 38
 	 * @var int $analysis_level
39 39
 	 */
40
-    protected $analysis_level;
40
+	protected $analysis_level;
41 41
     
42
-    /**
43
-     * Display options
44
-     * @var GeoDisplayOptions $options
45
-     */
46
-    protected $options;
42
+	/**
43
+	 * Display options
44
+	 * @var GeoDisplayOptions $options
45
+	 */
46
+	protected $options;
47 47
     
48
-    /**
49
-     * Reference tree
50
-     * @var Tree $tree
51
-     */
52
-    protected $tree;
48
+	/**
49
+	 * Reference tree
50
+	 * @var Tree $tree
51
+	 */
52
+	protected $tree;
53 53
     
54
-    /**
55
-     * Is the analysis enabled
56
-     * @var bool $enabled
57
-     */
58
-    protected $enabled;
54
+	/**
55
+	 * Is the analysis enabled
56
+	 * @var bool $enabled
57
+	 */
58
+	protected $enabled;
59 59
     
60
-    /**
61
-     * Constructor for GeoAnalysis.
62
-     *
63
-     * @param Tree $tree Reference tree
60
+	/**
61
+	 * Constructor for GeoAnalysis.
62
+	 *
63
+	 * @param Tree $tree Reference tree
64 64
 	 * @param int $id GeoAnalysis ID
65 65
 	 * @param string $title GeoAnalysis title
66 66
 	 * @param int $analysis_level Analysis level
67 67
 	 * @param (GeoDisplayOptions|null) $options Display options
68 68
 	 * @param bool $enabled Is analysis enabled
69
-     */
70
-    public function __construct(Tree $tree, $id, $title, $analysis_level, GeoDisplayOptions $options = null, $enabled = true) {
71
-        $this->tree = $tree;
72
-        $this->id = $id;
73
-        $this->title = $title;
74
-        $this->analysis_level = $analysis_level;
75
-        $this->options = $options;
76
-        $this->enabled = $enabled;
77
-    }
69
+	 */
70
+	public function __construct(Tree $tree, $id, $title, $analysis_level, GeoDisplayOptions $options = null, $enabled = true) {
71
+		$this->tree = $tree;
72
+		$this->id = $id;
73
+		$this->title = $title;
74
+		$this->analysis_level = $analysis_level;
75
+		$this->options = $options;
76
+		$this->enabled = $enabled;
77
+	}
78 78
     
79 79
 	/**
80 80
 	 * Get the analysis title
81 81
 	 * @return string
82 82
 	 */
83
-    public function getTitle() {
84
-        return $this->title;
85
-    }
83
+	public function getTitle() {
84
+		return $this->title;
85
+	}
86 86
     
87 87
 	/**
88 88
 	 * Set the analysis title
@@ -90,53 +90,53 @@  discard block
 block discarded – undo
90 90
 	 * @param string $title
91 91
 	 * @return self Enable method-chaining
92 92
 	 */
93
-    public function setTitle($title) {
94
-        $this->title = $title;
95
-        return $this;
96
-    }
93
+	public function setTitle($title) {
94
+		$this->title = $title;
95
+		return $this;
96
+	}
97 97
     
98 98
 	/**
99 99
 	 * Get the analysis ID
100 100
 	 * @return int
101 101
 	 */
102
-    public function getId() {
103
-        return $this->id;
104
-    }
102
+	public function getId() {
103
+		return $this->id;
104
+	}
105 105
     
106 106
 	/**
107 107
 	 * Get the analysis status (enabled/disabled)
108 108
 	 * @return bool
109 109
 	 */
110
-    public function isEnabled() {
111
-        return $this->enabled;
112
-    }
110
+	public function isEnabled() {
111
+		return $this->enabled;
112
+	}
113 113
     
114
-    /**
115
-     * Get analysis options
116
-     * @return \MyArtJaub\Webtrees\Module\GeoDispersion\Model\GeoDisplayOptions
117
-     */
118
-    public function getOptions() {
119
-        return $this->options;
120
-    }
114
+	/**
115
+	 * Get analysis options
116
+	 * @return \MyArtJaub\Webtrees\Module\GeoDispersion\Model\GeoDisplayOptions
117
+	 */
118
+	public function getOptions() {
119
+		return $this->options;
120
+	}
121 121
     
122 122
 	/**
123
-     * Set analysis options
123
+	 * Set analysis options
124 124
 	 *
125
-     * @param \MyArtJaub\Webtrees\Module\GeoDispersion\Model\GeoDisplayOptions $options
125
+	 * @param \MyArtJaub\Webtrees\Module\GeoDispersion\Model\GeoDisplayOptions $options
126 126
 	 * @return self Enable method-chaining
127
-     */
128
-    public function setOptions(GeoDisplayOptions $options) {
129
-        $this->options = $options;
130
-        return $this;
131
-    }
127
+	 */
128
+	public function setOptions(GeoDisplayOptions $options) {
129
+		$this->options = $options;
130
+		return $this;
131
+	}
132 132
     
133 133
 	/**
134 134
 	 * Get analysis level
135 135
 	 * @return int
136 136
 	 */
137
-    public function getAnalysisLevel() {
138
-        return $this->analysis_level;
139
-    }
137
+	public function getAnalysisLevel() {
138
+		return $this->analysis_level;
139
+	}
140 140
     
141 141
 	/**
142 142
 	 * Get analysis level
@@ -144,19 +144,19 @@  discard block
 block discarded – undo
144 144
 	 * @param int $analysis_level
145 145
 	 * @return self Enable method-chaining
146 146
 	 */
147
-    public function setAnalysisLevel($analysis_level) {
148
-        $this->analysis_level = $analysis_level;
149
-        return $this;
150
-    }
147
+	public function setAnalysisLevel($analysis_level) {
148
+		$this->analysis_level = $analysis_level;
149
+		return $this;
150
+	}
151 151
     
152 152
 	/**
153 153
 	 * Check whether the analysis has a linked map
154 154
 	 *
155 155
 	 * @return bool
156 156
 	 */
157
-    public function hasMap() {
158
-        return $this->options && $this->options->getMap();
159
-    }
157
+	public function hasMap() {
158
+		return $this->options && $this->options->getMap();
159
+	}
160 160
     
161 161
 	/**
162 162
 	 * Get the URL for the GeoAnalysis.
@@ -164,117 +164,117 @@  discard block
 block discarded – undo
164 164
 	 * @return string
165 165
 	 */
166 166
 	 public function getHtmlUrl() {
167
-        return 'module.php?mod='. Constants::MODULE_MAJ_GEODISP_NAME . '&mod_action=GeoAnalysis&ga_id=' . $this->getId() . '&ged=' . $this->tree->getNameUrl();
168
-    }
167
+		return 'module.php?mod='. Constants::MODULE_MAJ_GEODISP_NAME . '&mod_action=GeoAnalysis&ga_id=' . $this->getId() . '&ged=' . $this->tree->getNameUrl();
168
+	}
169 169
     
170
-    /**
171
-     * Return the dispersion analysis tables.
172
-     * Two arrays are returned :
173
-     * 	- the General analysis, which returns the number of ancestors for each place found, plus 4 additional indicators :
174
-     * 		- knownsum : Number of known places
175
-     * 		- unknown : Number of unknown places
176
-     * 		- max : Maximum count of ancestors within a place
177
-     * 		- other : Other places (not in the top level area)
178
-     * - the Generations analysis, which returns the number of ancestors for each place found for each generation, plus 3 additional indicators within each generation :
179
-     * 		- sum : Number of known places
180
-     * 		- unknown : Number of unknown places
181
-     * 		- other : Other places (not in the top level area)
182
-     *
183
-     * @param array $sosalist List of all sosas
184
-     * @return array Array of the general and generations table
185
-     */
186
-    public function getAnalysisResults($sosalist) {
187
-        $placesDispGeneral = null;
188
-        $placesDispGenerations = null;
170
+	/**
171
+	 * Return the dispersion analysis tables.
172
+	 * Two arrays are returned :
173
+	 * 	- the General analysis, which returns the number of ancestors for each place found, plus 4 additional indicators :
174
+	 * 		- knownsum : Number of known places
175
+	 * 		- unknown : Number of unknown places
176
+	 * 		- max : Maximum count of ancestors within a place
177
+	 * 		- other : Other places (not in the top level area)
178
+	 * - the Generations analysis, which returns the number of ancestors for each place found for each generation, plus 3 additional indicators within each generation :
179
+	 * 		- sum : Number of known places
180
+	 * 		- unknown : Number of unknown places
181
+	 * 		- other : Other places (not in the top level area)
182
+	 *
183
+	 * @param array $sosalist List of all sosas
184
+	 * @return array Array of the general and generations table
185
+	 */
186
+	public function getAnalysisResults($sosalist) {
187
+		$placesDispGeneral = null;
188
+		$placesDispGenerations = null;
189 189
         
190
-        if($sosalist && count($sosalist) > 0) {
191
-            $placesDispGeneral['knownsum'] = 0;
192
-            $placesDispGeneral['unknown'] = 0;
193
-            $placesDispGeneral['max'] = 0;
194
-            $placesDispGeneral['places'] = array();
195
-            foreach($sosalist as $sosaid => $gens) {
196
-                $sosa = Individual::getIntance($sosaid, $this->tree);
197
-                $place =$sosa->getSignificantPlace();
198
-                $genstab = explode(',', $gens);
199
-                $isUnknown=true;
200
-                if($sosa->getDerivedRecord()->canShow() && !is_null($place)){
201
-                    $levels = array_reverse(array_map('trim',explode(',', $place)));
202
-                    if(count($levels)>= $this->analysis_level){                        
203
-                        $toplevelvalues = array();
204
-                        if($this->hasMap() && $toplevelvalue = $this->options->getMap()->getTopLevelName()) {
205
-                            $toplevelvalues = array_map('trim',explode(',', strtolower($toplevelvalue)));
206
-                        }
207
-                        if(!$this->hasMap() 
208
-                            || is_null($this->options->getMapLevel()) 
209
-                            || $this->options->getMap()->getTopLevelName() == '*' 
210
-                            || (
211
-                                $this->options->getMapLevel() <= $this->analysis_level 
212
-                                && $this->options->getMapLevel() > 0
213
-                                && count($levels) >= $this->options->getMapLevel()
214
-                                && in_array(strtolower($levels[$this->options->getMapLevel()-1]), $toplevelvalues)
215
-                            )
216
-                        ) {
217
-                            $placest = implode(I18N::$list_separator, array_slice($levels, 0, $this->analysis_level));
218
-                            if(isset($placesDispGeneral['places'][$placest])) {
219
-                                $placesDispGeneral['places'][$placest] += 1;
220
-                            }
221
-                            else { 
222
-                                $placesDispGeneral['places'][$placest] = 1;
223
-                            }
224
-                            if($placesDispGeneral['places'][$placest]>$placesDispGeneral['max'])
225
-                                $placesDispGeneral['max'] = $placesDispGeneral['places'][$placest];
226
-                            foreach($genstab as $gen) {
227
-                                if(isset($placesDispGenerations[$gen]['places'][$placest])) {
228
-                                    $placesDispGenerations[$gen]['places'][$placest] += 1;
229
-                                }
230
-                                else { 
231
-                                    $placesDispGenerations[$gen]['places'][$placest] = 1;
232
-                                }
233
-                                if(isset($placesDispGenerations[$gen]['sum'])) {
234
-                                    $placesDispGenerations[$gen]['sum'] += 1;
235
-                                }
236
-                                else { 
237
-                                    $placesDispGenerations[$gen]['sum'] = 1;
238
-                                }
239
-                            }
240
-                        }
241
-                        else{
242
-                            if(isset($placesDispGeneral['other'])) {
243
-                                $placesDispGeneral['other'] += 1;
244
-                            }
245
-                            else { 
246
-                                $placesDispGeneral['other'] = 1;
247
-                            }
248
-                            foreach($genstab as $gen) {
249
-                                if(isset($placesDispGenerations[$gen]['other'])) {
250
-                                    $placesDispGenerations[$gen]['other'] += 1;
251
-                                }
252
-                                else { 
253
-                                    $placesDispGenerations[$gen]['other'] = 1;
254
-                                }
255
-                            }
256
-                        }
257
-                        $placesDispGeneral['knownsum'] += 1;
258
-                        $isUnknown = false;
259
-                    }
260
-                }
261
-                if($isUnknown){
262
-                    $placesDispGeneral['unknown'] += 1;
263
-                    foreach($genstab as $gen) {
264
-                        if(isset($placesDispGenerations[$gen]['unknown'])) { 
265
-                            $placesDispGenerations[$gen]['unknown'] += 1;
266
-                        }
267
-                        else { 
268
-                            $placesDispGenerations[$gen]['unknown'] = 1; 
269
-                        }
270
-                    }
271
-                }
272
-            }
190
+		if($sosalist && count($sosalist) > 0) {
191
+			$placesDispGeneral['knownsum'] = 0;
192
+			$placesDispGeneral['unknown'] = 0;
193
+			$placesDispGeneral['max'] = 0;
194
+			$placesDispGeneral['places'] = array();
195
+			foreach($sosalist as $sosaid => $gens) {
196
+				$sosa = Individual::getIntance($sosaid, $this->tree);
197
+				$place =$sosa->getSignificantPlace();
198
+				$genstab = explode(',', $gens);
199
+				$isUnknown=true;
200
+				if($sosa->getDerivedRecord()->canShow() && !is_null($place)){
201
+					$levels = array_reverse(array_map('trim',explode(',', $place)));
202
+					if(count($levels)>= $this->analysis_level){                        
203
+						$toplevelvalues = array();
204
+						if($this->hasMap() && $toplevelvalue = $this->options->getMap()->getTopLevelName()) {
205
+							$toplevelvalues = array_map('trim',explode(',', strtolower($toplevelvalue)));
206
+						}
207
+						if(!$this->hasMap() 
208
+							|| is_null($this->options->getMapLevel()) 
209
+							|| $this->options->getMap()->getTopLevelName() == '*' 
210
+							|| (
211
+								$this->options->getMapLevel() <= $this->analysis_level 
212
+								&& $this->options->getMapLevel() > 0
213
+								&& count($levels) >= $this->options->getMapLevel()
214
+								&& in_array(strtolower($levels[$this->options->getMapLevel()-1]), $toplevelvalues)
215
+							)
216
+						) {
217
+							$placest = implode(I18N::$list_separator, array_slice($levels, 0, $this->analysis_level));
218
+							if(isset($placesDispGeneral['places'][$placest])) {
219
+								$placesDispGeneral['places'][$placest] += 1;
220
+							}
221
+							else { 
222
+								$placesDispGeneral['places'][$placest] = 1;
223
+							}
224
+							if($placesDispGeneral['places'][$placest]>$placesDispGeneral['max'])
225
+								$placesDispGeneral['max'] = $placesDispGeneral['places'][$placest];
226
+							foreach($genstab as $gen) {
227
+								if(isset($placesDispGenerations[$gen]['places'][$placest])) {
228
+									$placesDispGenerations[$gen]['places'][$placest] += 1;
229
+								}
230
+								else { 
231
+									$placesDispGenerations[$gen]['places'][$placest] = 1;
232
+								}
233
+								if(isset($placesDispGenerations[$gen]['sum'])) {
234
+									$placesDispGenerations[$gen]['sum'] += 1;
235
+								}
236
+								else { 
237
+									$placesDispGenerations[$gen]['sum'] = 1;
238
+								}
239
+							}
240
+						}
241
+						else{
242
+							if(isset($placesDispGeneral['other'])) {
243
+								$placesDispGeneral['other'] += 1;
244
+							}
245
+							else { 
246
+								$placesDispGeneral['other'] = 1;
247
+							}
248
+							foreach($genstab as $gen) {
249
+								if(isset($placesDispGenerations[$gen]['other'])) {
250
+									$placesDispGenerations[$gen]['other'] += 1;
251
+								}
252
+								else { 
253
+									$placesDispGenerations[$gen]['other'] = 1;
254
+								}
255
+							}
256
+						}
257
+						$placesDispGeneral['knownsum'] += 1;
258
+						$isUnknown = false;
259
+					}
260
+				}
261
+				if($isUnknown){
262
+					$placesDispGeneral['unknown'] += 1;
263
+					foreach($genstab as $gen) {
264
+						if(isset($placesDispGenerations[$gen]['unknown'])) { 
265
+							$placesDispGenerations[$gen]['unknown'] += 1;
266
+						}
267
+						else { 
268
+							$placesDispGenerations[$gen]['unknown'] = 1; 
269
+						}
270
+					}
271
+				}
272
+			}
273 273
            
274
-        }        
274
+		}        
275 275
         
276
-        return array($placesDispGeneral, $placesDispGenerations);        
277
-    }
276
+		return array($placesDispGeneral, $placesDispGenerations);        
277
+	}
278 278
     
279 279
                    
280 280
 }
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 	 * @return string
165 165
 	 */
166 166
 	 public function getHtmlUrl() {
167
-        return 'module.php?mod='. Constants::MODULE_MAJ_GEODISP_NAME . '&mod_action=GeoAnalysis&ga_id=' . $this->getId() . '&ged=' . $this->tree->getNameUrl();
167
+        return 'module.php?mod='.Constants::MODULE_MAJ_GEODISP_NAME.'&mod_action=GeoAnalysis&ga_id='.$this->getId().'&ged='.$this->tree->getNameUrl();
168 168
     }
169 169
     
170 170
     /**
@@ -187,50 +187,50 @@  discard block
 block discarded – undo
187 187
         $placesDispGeneral = null;
188 188
         $placesDispGenerations = null;
189 189
         
190
-        if($sosalist && count($sosalist) > 0) {
190
+        if ($sosalist && count($sosalist) > 0) {
191 191
             $placesDispGeneral['knownsum'] = 0;
192 192
             $placesDispGeneral['unknown'] = 0;
193 193
             $placesDispGeneral['max'] = 0;
194 194
             $placesDispGeneral['places'] = array();
195
-            foreach($sosalist as $sosaid => $gens) {
195
+            foreach ($sosalist as $sosaid => $gens) {
196 196
                 $sosa = Individual::getIntance($sosaid, $this->tree);
197
-                $place =$sosa->getSignificantPlace();
197
+                $place = $sosa->getSignificantPlace();
198 198
                 $genstab = explode(',', $gens);
199
-                $isUnknown=true;
200
-                if($sosa->getDerivedRecord()->canShow() && !is_null($place)){
201
-                    $levels = array_reverse(array_map('trim',explode(',', $place)));
202
-                    if(count($levels)>= $this->analysis_level){                        
199
+                $isUnknown = true;
200
+                if ($sosa->getDerivedRecord()->canShow() && !is_null($place)) {
201
+                    $levels = array_reverse(array_map('trim', explode(',', $place)));
202
+                    if (count($levels) >= $this->analysis_level) {                        
203 203
                         $toplevelvalues = array();
204
-                        if($this->hasMap() && $toplevelvalue = $this->options->getMap()->getTopLevelName()) {
205
-                            $toplevelvalues = array_map('trim',explode(',', strtolower($toplevelvalue)));
204
+                        if ($this->hasMap() && $toplevelvalue = $this->options->getMap()->getTopLevelName()) {
205
+                            $toplevelvalues = array_map('trim', explode(',', strtolower($toplevelvalue)));
206 206
                         }
207
-                        if(!$this->hasMap() 
207
+                        if (!$this->hasMap() 
208 208
                             || is_null($this->options->getMapLevel()) 
209 209
                             || $this->options->getMap()->getTopLevelName() == '*' 
210 210
                             || (
211 211
                                 $this->options->getMapLevel() <= $this->analysis_level 
212 212
                                 && $this->options->getMapLevel() > 0
213 213
                                 && count($levels) >= $this->options->getMapLevel()
214
-                                && in_array(strtolower($levels[$this->options->getMapLevel()-1]), $toplevelvalues)
214
+                                && in_array(strtolower($levels[$this->options->getMapLevel() - 1]), $toplevelvalues)
215 215
                             )
216 216
                         ) {
217 217
                             $placest = implode(I18N::$list_separator, array_slice($levels, 0, $this->analysis_level));
218
-                            if(isset($placesDispGeneral['places'][$placest])) {
218
+                            if (isset($placesDispGeneral['places'][$placest])) {
219 219
                                 $placesDispGeneral['places'][$placest] += 1;
220 220
                             }
221 221
                             else { 
222 222
                                 $placesDispGeneral['places'][$placest] = 1;
223 223
                             }
224
-                            if($placesDispGeneral['places'][$placest]>$placesDispGeneral['max'])
224
+                            if ($placesDispGeneral['places'][$placest] > $placesDispGeneral['max'])
225 225
                                 $placesDispGeneral['max'] = $placesDispGeneral['places'][$placest];
226
-                            foreach($genstab as $gen) {
227
-                                if(isset($placesDispGenerations[$gen]['places'][$placest])) {
226
+                            foreach ($genstab as $gen) {
227
+                                if (isset($placesDispGenerations[$gen]['places'][$placest])) {
228 228
                                     $placesDispGenerations[$gen]['places'][$placest] += 1;
229 229
                                 }
230 230
                                 else { 
231 231
                                     $placesDispGenerations[$gen]['places'][$placest] = 1;
232 232
                                 }
233
-                                if(isset($placesDispGenerations[$gen]['sum'])) {
233
+                                if (isset($placesDispGenerations[$gen]['sum'])) {
234 234
                                     $placesDispGenerations[$gen]['sum'] += 1;
235 235
                                 }
236 236
                                 else { 
@@ -238,15 +238,15 @@  discard block
 block discarded – undo
238 238
                                 }
239 239
                             }
240 240
                         }
241
-                        else{
242
-                            if(isset($placesDispGeneral['other'])) {
241
+                        else {
242
+                            if (isset($placesDispGeneral['other'])) {
243 243
                                 $placesDispGeneral['other'] += 1;
244 244
                             }
245 245
                             else { 
246 246
                                 $placesDispGeneral['other'] = 1;
247 247
                             }
248
-                            foreach($genstab as $gen) {
249
-                                if(isset($placesDispGenerations[$gen]['other'])) {
248
+                            foreach ($genstab as $gen) {
249
+                                if (isset($placesDispGenerations[$gen]['other'])) {
250 250
                                     $placesDispGenerations[$gen]['other'] += 1;
251 251
                                 }
252 252
                                 else { 
@@ -258,10 +258,10 @@  discard block
 block discarded – undo
258 258
                         $isUnknown = false;
259 259
                     }
260 260
                 }
261
-                if($isUnknown){
261
+                if ($isUnknown) {
262 262
                     $placesDispGeneral['unknown'] += 1;
263
-                    foreach($genstab as $gen) {
264
-                        if(isset($placesDispGenerations[$gen]['unknown'])) { 
263
+                    foreach ($genstab as $gen) {
264
+                        if (isset($placesDispGenerations[$gen]['unknown'])) { 
265 265
                             $placesDispGenerations[$gen]['unknown'] += 1;
266 266
                         }
267 267
                         else { 
Please login to merge, or discard this 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 3 patches
Indentation   +124 added lines, -124 removed lines patch added patch discarded remove patch
@@ -21,175 +21,175 @@
 block discarded – undo
21 21
 	 * Name of the file containing the description of the map.
22 22
 	 * @var string $filename
23 23
 	 */
24
-    protected $filename;
24
+	protected $filename;
25 25
     
26 26
 	/**
27 27
 	 * Indicates whether the description has been loaded from the file.
28 28
 	 * @var bool $is_loaded
29 29
 	 */
30
-    protected $is_loaded;
30
+	protected $is_loaded;
31 31
     
32 32
 	/**
33 33
 	 * Description/title of the map.
34 34
 	 * @var string $description
35 35
 	 */
36
-    protected $description;
36
+	protected $description;
37 37
     
38 38
 	/**
39 39
 	 * Name(s) of the parent level(s) of the map.
40 40
 	 * @var string $is_loaded
41 41
 	 */
42
-    protected $top_level_name;
42
+	protected $top_level_name;
43 43
     
44
-    /**
45
-     * Map canvas
46
-     * @var OutlineMapCanvas $canvas
47
-     */
48
-    protected $canvas;
44
+	/**
45
+	 * Map canvas
46
+	 * @var OutlineMapCanvas $canvas
47
+	 */
48
+	protected $canvas;
49 49
     
50
-    /**
51
-     * Map subdivisions
52
-     * @var array $subdivisions
53
-     */
54
-    protected $subdivisions;
50
+	/**
51
+	 * Map subdivisions
52
+	 * @var array $subdivisions
53
+	 */
54
+	protected $subdivisions;
55 55
     
56
-    /**
57
-     * Places mappings
58
-     * @var array $subdivisions
59
-     */
60
-    protected $mappings;
56
+	/**
57
+	 * Places mappings
58
+	 * @var array $subdivisions
59
+	 */
60
+	protected $mappings;
61 61
     
62
-    /**
63
-     * Constructor for GeoAnalysisMap.
64
-     *
65
-     * @param string $filename Outline map file name
66
-     * @param bool $load Should the map be loaded immediately
67
-     */
68
-    public function __construct($filename, $load = false) {
69
-        $this->filename = $filename;
70
-        $this->is_loaded = false;
71
-        $this->subdivisions = array();
72
-        $this->mappings = array();
73
-        if($load) $this->load();
74
-    }
62
+	/**
63
+	 * Constructor for GeoAnalysisMap.
64
+	 *
65
+	 * @param string $filename Outline map file name
66
+	 * @param bool $load Should the map be loaded immediately
67
+	 */
68
+	public function __construct($filename, $load = false) {
69
+		$this->filename = $filename;
70
+		$this->is_loaded = false;
71
+		$this->subdivisions = array();
72
+		$this->mappings = array();
73
+		if($load) $this->load();
74
+	}
75 75
     
76
-    /**
77
-     * Load the map settings contained within its XML representation
78
-     *
79
-     * XML structure :
80
-     * 	- displayName : Display name of the map
81
-     * 	- topLevel : Values of the top level subdivisions (separated by commas, if multiple)
82
-     * 	- canvas : all settings related to the map canvas.
83
-     * 		- width : canvas width, in px
84
-     * 		- height : canvas height, in px
85
-     * 		- maxcolor : color to identify places with ancestors, RGB hexadecimal
86
-     * 		- hovercolor : same as previous, color when mouse is hovering the place, RGB hexadecimal
87
-     * 		- bgcolor : map background color, RGB hexadecimal
88
-     * 		- bgstroke : map stroke color, RGB hexadecimal
89
-     * 		- defaultcolor : default color of places, RGB hexadecimal
90
-     * 		- defaultstroke : default stroke color, RGB hexadecimal
91
-     * 	- subdvisions : for each subdivision :
76
+	/**
77
+	 * Load the map settings contained within its XML representation
78
+	 *
79
+	 * XML structure :
80
+	 * 	- displayName : Display name of the map
81
+	 * 	- topLevel : Values of the top level subdivisions (separated by commas, if multiple)
82
+	 * 	- canvas : all settings related to the map canvas.
83
+	 * 		- width : canvas width, in px
84
+	 * 		- height : canvas height, in px
85
+	 * 		- maxcolor : color to identify places with ancestors, RGB hexadecimal
86
+	 * 		- hovercolor : same as previous, color when mouse is hovering the place, RGB hexadecimal
87
+	 * 		- bgcolor : map background color, RGB hexadecimal
88
+	 * 		- bgstroke : map stroke color, RGB hexadecimal
89
+	 * 		- defaultcolor : default color of places, RGB hexadecimal
90
+	 * 		- defaultstroke : default stroke color, RGB hexadecimal
91
+	 * 	- subdvisions : for each subdivision :
92 92
 	 *		- id : Subdivision id, must be compatible with PHP variable constraints, and unique
93
-     * 		- name: Display name for the place
93
+	 * 		- name: Display name for the place
94 94
 	 *		- parent: if any, describe to which parent level the place if belonging to
95
-     * 		- <em>Element value<em> : SVG description of the subdvision shape
95
+	 * 		- <em>Element value<em> : SVG description of the subdvision shape
96 96
 	 *	- mapping : for each subdivision :
97 97
 	 *		- name : Name of the place to map
98
-     * 		- mapto: Name of the place to map to
98
+	 * 		- mapto: Name of the place to map to
99 99
 	 * 
100
-     */
101
-    protected function load() {
102
-        if(file_exists(WT_ROOT.WT_MODULES_DIR.Constants::MODULE_MAJ_GEODISP_NAME.'/maps/'.$this->filename)){
103
-            $xml = simplexml_load_file(WT_ROOT.WT_MODULES_DIR.Constants::MODULE_MAJ_GEODISP_NAME.'/maps/'.$this->filename);
104
-            if($xml){
105
-                $this->description = trim($xml->displayName);
106
-                $this->top_level_name = trim($xml->topLevel);
107
-                $this->canvas = new OutlineMapCanvas(
108
-                    trim($xml->canvas->width),
109
-                    trim($xml->canvas->height), 
110
-                    trim($xml->canvas->maxcolor), 
111
-                    trim($xml->canvas->hovercolor), 
112
-                    trim($xml->canvas->bgcolor),
113
-                    trim($xml->canvas->bgstroke),
114
-                    trim($xml->canvas->defaultcolor), 
115
-                    trim($xml->canvas->defaultstroke)
116
-                );
117
-                foreach($xml->subdivisions->children() as $subdivision){
118
-                    $attributes = $subdivision->attributes();
119
-                    $key = trim($attributes['name']);
120
-                    if(isset($attributes['parent'])) $key .= '@'.trim($attributes['parent']);
121
-                    $this->subdivisions[$key] = array(
122
-                        'id' => trim($attributes['id']),
123
-                        'displayname' => trim($attributes['name']),
124
-                        'coord' => trim($subdivision[0])
125
-                    );
126
-                }
127
-                if(isset($xml->mappings)) {
128
-                    foreach($xml->mappings->children() as $mappings){
129
-                        $attributes = $mappings->attributes();
130
-                        $this->mappings[trim($attributes['name'])] = trim($attributes['mapto']);
131
-                    }
132
-                }
133
-                $this->is_loaded = true;
134
-                return;
135
-            }
136
-        }        
137
-        throw new \Exception('The Outline Map could not be loaded from XML.');
138
-    }
100
+	 */
101
+	protected function load() {
102
+		if(file_exists(WT_ROOT.WT_MODULES_DIR.Constants::MODULE_MAJ_GEODISP_NAME.'/maps/'.$this->filename)){
103
+			$xml = simplexml_load_file(WT_ROOT.WT_MODULES_DIR.Constants::MODULE_MAJ_GEODISP_NAME.'/maps/'.$this->filename);
104
+			if($xml){
105
+				$this->description = trim($xml->displayName);
106
+				$this->top_level_name = trim($xml->topLevel);
107
+				$this->canvas = new OutlineMapCanvas(
108
+					trim($xml->canvas->width),
109
+					trim($xml->canvas->height), 
110
+					trim($xml->canvas->maxcolor), 
111
+					trim($xml->canvas->hovercolor), 
112
+					trim($xml->canvas->bgcolor),
113
+					trim($xml->canvas->bgstroke),
114
+					trim($xml->canvas->defaultcolor), 
115
+					trim($xml->canvas->defaultstroke)
116
+				);
117
+				foreach($xml->subdivisions->children() as $subdivision){
118
+					$attributes = $subdivision->attributes();
119
+					$key = trim($attributes['name']);
120
+					if(isset($attributes['parent'])) $key .= '@'.trim($attributes['parent']);
121
+					$this->subdivisions[$key] = array(
122
+						'id' => trim($attributes['id']),
123
+						'displayname' => trim($attributes['name']),
124
+						'coord' => trim($subdivision[0])
125
+					);
126
+				}
127
+				if(isset($xml->mappings)) {
128
+					foreach($xml->mappings->children() as $mappings){
129
+						$attributes = $mappings->attributes();
130
+						$this->mappings[trim($attributes['name'])] = trim($attributes['mapto']);
131
+					}
132
+				}
133
+				$this->is_loaded = true;
134
+				return;
135
+			}
136
+		}        
137
+		throw new \Exception('The Outline Map could not be loaded from XML.');
138
+	}
139 139
     
140 140
 	/**
141 141
 	 * Get the map file name.
142 142
 	 * @return string
143 143
 	 */
144
-    public function getFileName() {
145
-        if(!$this->is_loaded) $this->load();
146
-        return $this->filename;
147
-    }
144
+	public function getFileName() {
145
+		if(!$this->is_loaded) $this->load();
146
+		return $this->filename;
147
+	}
148 148
     
149 149
 	/**
150 150
 	 * Get the map file name.
151 151
 	 * @return string
152 152
 	 */
153
-    public function getDescription() {
154
-        if(!$this->is_loaded) $this->load();
155
-        return $this->description;
156
-    }
153
+	public function getDescription() {
154
+		if(!$this->is_loaded) $this->load();
155
+		return $this->description;
156
+	}
157 157
     
158 158
 	/**
159 159
 	 * Get the name of the map parent level. 
160 160
 	 * @return string
161 161
 	 */
162
-    public function getTopLevelName() {
163
-        if(!$this->is_loaded) $this->load();
164
-        return $this->top_level_name;
165
-    }    
162
+	public function getTopLevelName() {
163
+		if(!$this->is_loaded) $this->load();
164
+		return $this->top_level_name;
165
+	}    
166 166
     
167
-    /**
168
-     * Get the Outline Map canvas.
169
-     * @return \MyArtJaub\Webtrees\Module\GeoDispersion\Model\OutlineMapCanvas
170
-     */
171
-    public function getCanvas() {
172
-        if(!$this->is_loaded) $this->load();
173
-        return $this->canvas;
174
-    }
167
+	/**
168
+	 * Get the Outline Map canvas.
169
+	 * @return \MyArtJaub\Webtrees\Module\GeoDispersion\Model\OutlineMapCanvas
170
+	 */
171
+	public function getCanvas() {
172
+		if(!$this->is_loaded) $this->load();
173
+		return $this->canvas;
174
+	}
175 175
     
176 176
 	/**
177
-     * Get the subdivisions of the map.
178
-     * @return array
179
-     */
180
-    public function getSubdivisions() {
181
-        if(!$this->is_loaded) $this->load();
182
-        return $this->subdivisions;
183
-    }
177
+	 * Get the subdivisions of the map.
178
+	 * @return array
179
+	 */
180
+	public function getSubdivisions() {
181
+		if(!$this->is_loaded) $this->load();
182
+		return $this->subdivisions;
183
+	}
184 184
     
185 185
 	/**
186
-     * Get the places mappings of the map.
187
-     * @return array
188
-     */
189
-    public function getPlacesMappings() {
190
-        if(!$this->is_loaded) $this->load();
191
-        return $this->mappings;
192
-    }
186
+	 * Get the places mappings of the map.
187
+	 * @return array
188
+	 */
189
+	public function getPlacesMappings() {
190
+		if(!$this->is_loaded) $this->load();
191
+		return $this->mappings;
192
+	}
193 193
                    
194 194
 }
195 195
  
196 196
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  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) $this->load();
74 74
     }
75 75
     
76 76
     /**
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
 	 * 
100 100
      */
101 101
     protected function load() {
102
-        if(file_exists(WT_ROOT.WT_MODULES_DIR.Constants::MODULE_MAJ_GEODISP_NAME.'/maps/'.$this->filename)){
102
+        if (file_exists(WT_ROOT.WT_MODULES_DIR.Constants::MODULE_MAJ_GEODISP_NAME.'/maps/'.$this->filename)) {
103 103
             $xml = simplexml_load_file(WT_ROOT.WT_MODULES_DIR.Constants::MODULE_MAJ_GEODISP_NAME.'/maps/'.$this->filename);
104
-            if($xml){
104
+            if ($xml) {
105 105
                 $this->description = trim($xml->displayName);
106 106
                 $this->top_level_name = trim($xml->topLevel);
107 107
                 $this->canvas = new OutlineMapCanvas(
@@ -114,18 +114,18 @@  discard block
 block discarded – undo
114 114
                     trim($xml->canvas->defaultcolor), 
115 115
                     trim($xml->canvas->defaultstroke)
116 116
                 );
117
-                foreach($xml->subdivisions->children() as $subdivision){
117
+                foreach ($xml->subdivisions->children() as $subdivision) {
118 118
                     $attributes = $subdivision->attributes();
119 119
                     $key = trim($attributes['name']);
120
-                    if(isset($attributes['parent'])) $key .= '@'.trim($attributes['parent']);
120
+                    if (isset($attributes['parent'])) $key .= '@'.trim($attributes['parent']);
121 121
                     $this->subdivisions[$key] = array(
122 122
                         'id' => trim($attributes['id']),
123 123
                         'displayname' => trim($attributes['name']),
124 124
                         'coord' => trim($subdivision[0])
125 125
                     );
126 126
                 }
127
-                if(isset($xml->mappings)) {
128
-                    foreach($xml->mappings->children() as $mappings){
127
+                if (isset($xml->mappings)) {
128
+                    foreach ($xml->mappings->children() as $mappings) {
129 129
                         $attributes = $mappings->attributes();
130 130
                         $this->mappings[trim($attributes['name'])] = trim($attributes['mapto']);
131 131
                     }
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	 * @return string
143 143
 	 */
144 144
     public function getFileName() {
145
-        if(!$this->is_loaded) $this->load();
145
+        if (!$this->is_loaded) $this->load();
146 146
         return $this->filename;
147 147
     }
148 148
     
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 	 * @return string
152 152
 	 */
153 153
     public function getDescription() {
154
-        if(!$this->is_loaded) $this->load();
154
+        if (!$this->is_loaded) $this->load();
155 155
         return $this->description;
156 156
     }
157 157
     
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 	 * @return string
161 161
 	 */
162 162
     public function getTopLevelName() {
163
-        if(!$this->is_loaded) $this->load();
163
+        if (!$this->is_loaded) $this->load();
164 164
         return $this->top_level_name;
165 165
     }    
166 166
     
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
      * @return \MyArtJaub\Webtrees\Module\GeoDispersion\Model\OutlineMapCanvas
170 170
      */
171 171
     public function getCanvas() {
172
-        if(!$this->is_loaded) $this->load();
172
+        if (!$this->is_loaded) $this->load();
173 173
         return $this->canvas;
174 174
     }
175 175
     
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
      * @return array
179 179
      */
180 180
     public function getSubdivisions() {
181
-        if(!$this->is_loaded) $this->load();
181
+        if (!$this->is_loaded) $this->load();
182 182
         return $this->subdivisions;
183 183
     }
184 184
     
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
      * @return array
188 188
      */
189 189
     public function getPlacesMappings() {
190
-        if(!$this->is_loaded) $this->load();
190
+        if (!$this->is_loaded) $this->load();
191 191
         return $this->mappings;
192 192
     }
193 193
                    
Please login to merge, or discard this 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/Schema/Migration0.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -24,18 +24,18 @@
 block discarded – undo
24 24
 	 */
25 25
 	public function upgrade() {
26 26
 		Database::exec(
27
-            'CREATE TABLE IF NOT EXISTS `##maj_geodispersion` ('.
28
-            ' majgd_id       	INTEGER AUTO_INCREMENT NOT NULL,'.
29
-            ' majgd_file      	INTEGER 	 		NOT NULL,'.
30
-            ' majgd_descr		VARCHAR(70)			NOT NULL,'.
31
-            ' majgd_sublevel	TINYINT				NOT NULL,'.
32
-            ' majgd_map			VARCHAR(70)			NULL,'.
33
-            ' majgd_toplevel	TINYINT				NULL,'.
34
-            ' majgd_status      ENUM(\'enabled\', \'disabled\') NOT NULL DEFAULT \'enabled\','.
35
-            ' majgd_useflagsgen	ENUM(\'yes\', \'no\') NOT NULL DEFAULT \'no\','.
36
-            ' majgd_detailsgen	TINYINT				NOT NULL DEFAULT 0,'.
37
-            ' PRIMARY KEY (majgd_id)'.
38
-            ') COLLATE utf8_unicode_ci ENGINE=InnoDB'
27
+			'CREATE TABLE IF NOT EXISTS `##maj_geodispersion` ('.
28
+			' majgd_id       	INTEGER AUTO_INCREMENT NOT NULL,'.
29
+			' majgd_file      	INTEGER 	 		NOT NULL,'.
30
+			' majgd_descr		VARCHAR(70)			NOT NULL,'.
31
+			' majgd_sublevel	TINYINT				NOT NULL,'.
32
+			' majgd_map			VARCHAR(70)			NULL,'.
33
+			' majgd_toplevel	TINYINT				NULL,'.
34
+			' majgd_status      ENUM(\'enabled\', \'disabled\') NOT NULL DEFAULT \'enabled\','.
35
+			' majgd_useflagsgen	ENUM(\'yes\', \'no\') NOT NULL DEFAULT \'no\','.
36
+			' majgd_detailsgen	TINYINT				NOT NULL DEFAULT 0,'.
37
+			' PRIMARY KEY (majgd_id)'.
38
+			') COLLATE utf8_unicode_ci ENGINE=InnoDB'
39 39
 		);
40 40
 	}
41 41
 }
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/Views/GeoAnalysisEditView.php 3 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,14 +25,14 @@  discard block
 block discarded – undo
25 25
 	 * {@inhericDoc}
26 26
 	 * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent()
27 27
 	 */
28
-    protected function renderContent() {
28
+	protected function renderContent() {
29 29
         
30
-        /** @var GeoAnalysis $ga */
31
-        $ga = $this->data->get('geo_analysis');
32
-        $is_new = is_null($ga);
30
+		/** @var GeoAnalysis $ga */
31
+		$ga = $this->data->get('geo_analysis');
32
+		$is_new = is_null($ga);
33 33
         
34
-        $places_hierarchy = $this->data->get('places_hierarchy');
35
-        ?>        
34
+		$places_hierarchy = $this->data->get('places_hierarchy');
35
+		?>        
36 36
         <ol class="breadcrumb small">
37 37
         	<li><a href="admin.php"><?php echo I18N::translate('Control panel'); ?></a></li>
38 38
 			<li><a href="admin_modules.php"><?php echo I18N::translate('Module administration'); ?></a></li>
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
     	</form>
156 156
 		
157 157
 		<?php        
158
-    }
158
+	}
159 159
     
160 160
 }
161 161
  
162 162
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 		
45 45
 		<form class="form-horizontal" name="newform" method="post" role="form" action="<?php echo $this->data->get('save_url'); ?>" autocomplete="off">
46 46
     		<?php echo Filter::getCsrf(); ?>
47
-    		<?php if(!$is_new) { ?>
47
+    		<?php if (!$is_new) { ?>
48 48
     		<input type="hidden" name="ga_id" value="<?php echo $ga->getId(); ?>">
49 49
     		<?php } ?>
50 50
     
@@ -54,7 +54,7 @@  discard block
 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) echo 'value="'.Filter::escapeHtml($ga->getTitle()).'"'; ?> dir="auto">
58 58
     				<p class="small text-muted">
59 59
     					<?php echo I18N::translate('Description to be given to the geographical dispersion analysis. It will be used as the page title for it.'); ?>
60 60
     				</p>
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         				<?php echo I18N::translate('Map'); ?>
98 98
         			</label>
99 99
         			<div class="col-sm-9">
100
-        				<?php echo FunctionsEdit::selectEditControl('map_file', $this->data->get('map_list') , null, $is_new || ! $ga->hasMap() ? '' : base64_encode($ga->getOptions()->getMap()->getFileName()), 'class="form-control"'); ?>
100
+        				<?php echo FunctionsEdit::selectEditControl('map_file', $this->data->get('map_list'), null, $is_new || !$ga->hasMap() ? '' : base64_encode($ga->getOptions()->getMap()->getFileName()), 'class="form-control"'); ?>
101 101
         				<p class="small text-muted">
102 102
         					<?php echo I18N::translate('Map outline to be used for the result display.'); ?>
103 103
         				</p>
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
         				<?php echo I18N::translate('Map parent level'); ?>
111 111
         			</label>
112 112
         			<div class="col-sm-9">
113
-        				<?php echo FunctionsEdit::selectEditControl('map_top_level', $places_hierarchy['hierarchy'], null, $is_new || ! $ga->hasMap() ? '' : $ga->getOptions()->getMapLevel() - 1, 'class="form-control"'); ?>
113
+        				<?php echo FunctionsEdit::selectEditControl('map_top_level', $places_hierarchy['hierarchy'], null, $is_new || !$ga->hasMap() ? '' : $ga->getOptions()->getMapLevel() - 1, 'class="form-control"'); ?>
114 114
         				<p class="small text-muted">
115 115
         					<?php echo I18N::translate('Subdivision level of the parent subdivision(s) represented by the map.'); ?><br />
116 116
         					<?php echo I18N::translate('For instance, if the map is intended to represent a country by county analysis, then the map parent level would be “Country”, and the analysis level would be “County”.'); ?>
Please login to merge, or discard this 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/GeoAnalysisView.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,16 +24,16 @@  discard block
 block discarded – undo
24 24
 	 * {@inhericDoc}
25 25
 	 * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent()
26 26
 	 */
27
-    protected function renderContent() {        
28
-        ?>                
27
+	protected function renderContent() {        
28
+		?>                
29 29
         <div id="maj-geodisp-list-page" class="center">
30 30
 			<h2><?php echo $this->data->get('title'); ?></h2>
31 31
 			
32 32
 			<?php
33 33
 			if($this->data->get('has_analysis', false)) { 
34
-			    /** @var GeoAnalysis $ga  */
35
-    		    $ga = $this->data->get('geoanalysis');
36
-    		?>
34
+				/** @var GeoAnalysis $ga  */
35
+				$ga = $this->data->get('geoanalysis');
36
+			?>
37 37
     		
38 38
     		<div id="geodispersion-panel">
39 39
     			<h3><?php echo $ga->getTitle() ?></h3>
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     	</div>
67 67
     	
68 68
     	<?php 
69
-    }
69
+	}
70 70
     
71 71
 }
72 72
  
73 73
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 			<h2><?php echo $this->data->get('title'); ?></h2>
31 31
 			
32 32
 			<?php
33
-			if($this->data->get('has_analysis', false)) { 
33
+			if ($this->data->get('has_analysis', false)) { 
34 34
 			    /** @var GeoAnalysis $ga  */
35 35
     		    $ga = $this->data->get('geoanalysis');
36 36
     		?>
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/Views/GeoAnalysisTabGenerationsView.php 3 patches
Spacing   +30 added lines, -31 removed lines patch added patch discarded remove patch
@@ -38,39 +38,38 @@  discard block
 block discarded – undo
38 38
         '<div id="geodispersion_gen">
39 39
         	<table id="geodispersion_gentable" class="center">';
40 40
             
41
-        foreach($results_by_gen as $gen => $genData){
41
+        foreach ($results_by_gen as $gen => $genData) {
42 42
             $html .= 
43 43
             '<tr>
44 44
                 <td class="descriptionbox">' .
45 45
                     I18N::translate("Generation %s", I18N::number($gen)).
46 46
                     ($display_all_places ? '<br />' : ' ').
47
-                    I18N::translate('(%s)', I18N::percentage(Functions::safeDivision($genData['sum'] + $genData['other'], $genData['sum'] + $genData['other'] + $genData['unknown']),1)) . 
47
+                    I18N::translate('(%s)', I18N::percentage(Functions::safeDivision($genData['sum'] + $genData['other'], $genData['sum'] + $genData['other'] + $genData['unknown']), 1)). 
48 48
                 '</td>
49 49
                  <td class="optionbox left">'.
50 50
                     ($display_all_places ? 
51
-                        $this->htmlGenerationAllPlacesRow($genData, $analysis_level) :
52
-                        $this->htmlGenerationTopPlacesRow($genData, $analysis_level)
53
-                     ) .
51
+                        $this->htmlGenerationAllPlacesRow($genData, $analysis_level) : $this->htmlGenerationTopPlacesRow($genData, $analysis_level)
52
+                     ).
54 53
                 '</ditdv>
55 54
             </tr>';
56 55
         }       
57 56
         
58
-        $html.= 
57
+        $html .= 
59 58
             '</table>
60 59
             <div class="left">
61
-                <strong>' . I18N::translate('Interpretation help:') . '</strong>
60
+                <strong>' . I18N::translate('Interpretation help:').'</strong>
62 61
                 <br />'.
63
-                I18N::translate('<strong>Generation X (yy %%)</strong>: The percentage indicates the number of found places compared to the total number of ancestors in this generation.') . 
62
+                I18N::translate('<strong>Generation X (yy %%)</strong>: The percentage indicates the number of found places compared to the total number of ancestors in this generation.'). 
64 63
                 '<br />';
65
-        if(!is_null($max_details_gen) && $max_details_gen == 0){
64
+        if (!is_null($max_details_gen) && $max_details_gen == 0) {
66 65
             $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 66
             $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 67
         }
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
         }
73
-        $html.= 
72
+        $html .= 
74 73
             '</div>
75 74
         </div>';
76 75
         
@@ -92,25 +91,25 @@  discard block
 block discarded – undo
92 91
         
93 92
         $sum_gen = $data['sum'];
94 93
         $unknownother = $data['unknown'] + $data['other'];
95
-        foreach($data['places'] as $placename=> $dataplace){
96
-            $levels = array_map('trim',explode(',', $placename));
94
+        foreach ($data['places'] as $placename=> $dataplace) {
95
+            $levels = array_map('trim', explode(',', $placename));
97 96
             $content = '';
98
-            if(isset($dataplace['flag'])){
99
-                $content .= '<td class="geodispersion_flag">'. FunctionsPrint::htmlPlaceIcon($dataplace['place'], $dataplace['flag']) .'</td><td>';
97
+            if (isset($dataplace['flag'])) {
98
+                $content .= '<td class="geodispersion_flag">'.FunctionsPrint::htmlPlaceIcon($dataplace['place'], $dataplace['flag']).'</td><td>';
100 99
             }
101
-            else{
102
-                $content .= '<td><span title="'.implode(I18N::$list_separator, array_reverse($levels)).'">'.$levels[$analysis_level-1].'</span><br/>';
100
+            else {
101
+                $content .= '<td><span title="'.implode(I18N::$list_separator, array_reverse($levels)).'">'.$levels[$analysis_level - 1].'</span><br/>';
103 102
             }
104 103
             $count = $dataplace['count'];
105 104
             $content .= I18N::number($count);
106 105
             $perc = Functions::safeDivision($count, $sum_gen + $unknownother);
107
-            $perc2= Functions::safeDivision($count, $sum_gen);
108
-            if($perc2>=0.1) 
109
-                $content.= '<br/><span class="small">('.I18N::percentage($perc2, 1).')</span>';
106
+            $perc2 = Functions::safeDivision($count, $sum_gen);
107
+            if ($perc2 >= 0.1) 
108
+                $content .= '<br/><span class="small">('.I18N::percentage($perc2, 1).')</span>';
110 109
             $content .= '</td>';
111 110
                
112 111
             $html .= '
113
-                <td class="geodispersion_rowitem" width="'.max(round(100*$perc, 0),1).'%">
112
+                <td class="geodispersion_rowitem" width="'.max(round(100 * $perc, 0), 1).'%">
114 113
                     <table>
115 114
                         <tr>
116 115
                             <td>
@@ -123,11 +122,11 @@  discard block
 block discarded – undo
123 122
                 </td>';
124 123
         }
125 124
         
126
-        if($unknownother>0){
127
-            $perc= Functions::safeDivision($unknownother, $sum_gen + $unknownother);
128
-            $html .='<td class="geodispersion_unknownitem left" >'.I18N::number($unknownother);
129
-            if($perc>=0.1) $html.= '<br/><span class="small">('.I18N::percentage($perc, 1).')</span>';
130
-            $html .='</td>';
125
+        if ($unknownother > 0) {
126
+            $perc = Functions::safeDivision($unknownother, $sum_gen + $unknownother);
127
+            $html .= '<td class="geodispersion_unknownitem left" >'.I18N::number($unknownother);
128
+            if ($perc >= 0.1) $html .= '<br/><span class="small">('.I18N::percentage($perc, 1).')</span>';
129
+            $html .= '</td>';
131 130
         }
132 131
         
133 132
         $html .= 
@@ -148,12 +147,12 @@  discard block
 block discarded – undo
148 147
         $sum_gen = $data['sum'];
149 148
         $other = $data['other'];
150 149
         
151
-        foreach($data['places'] as $placename => $count) {
152
-            if($placename != 'other'){
153
-                $levels = array_map('trim',explode(',', $placename));
154
-                $placename = '<span title="'.implode(I18N::$list_separator, array_reverse($levels)).'">'.$levels[$analysis_level-1].'</span>';
150
+        foreach ($data['places'] as $placename => $count) {
151
+            if ($placename != 'other') {
152
+                $levels = array_map('trim', explode(',', $placename));
153
+                $placename = '<span title="'.implode(I18N::$list_separator, array_reverse($levels)).'">'.$levels[$analysis_level - 1].'</span>';
155 154
             }
156
-            else{
155
+            else {
157 156
                 $placename = I18N::translate('Other places');
158 157
             }
159 158
             $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.
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.
Indentation   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -24,89 +24,89 @@  discard block
 block discarded – undo
24 24
 	 * {@inhericDoc}
25 25
 	 * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent()
26 26
 	 */
27
-    protected function renderContent() {       
27
+	protected function renderContent() {       
28 28
 
29
-        $max_details_gen = $this->data->get('max_details_gen');
30
-        $analysis_level = $this->data->get('analysis_level');
31
-        $results_by_gen = $this->data->get('results_by_generations');
32
-        $display_all_places = $this->data->get('display_all_places', true);
29
+		$max_details_gen = $this->data->get('max_details_gen');
30
+		$analysis_level = $this->data->get('analysis_level');
31
+		$results_by_gen = $this->data->get('results_by_generations');
32
+		$display_all_places = $this->data->get('display_all_places', true);
33 33
         
34
-        $html = 
35
-        '<div id="geodispersion_gen">
34
+		$html = 
35
+		'<div id="geodispersion_gen">
36 36
         	<table id="geodispersion_gentable" class="center">';
37 37
             
38
-        foreach($results_by_gen as $gen => $genData){
39
-            $html .= 
40
-            '<tr>
38
+		foreach($results_by_gen as $gen => $genData){
39
+			$html .= 
40
+			'<tr>
41 41
                 <td class="descriptionbox">' .
42
-                    I18N::translate("Generation %s", I18N::number($gen)).
43
-                    ($display_all_places ? '<br />' : ' ').
44
-                    I18N::translate('(%s)', I18N::percentage(Functions::safeDivision($genData['sum'] + $genData['other'], $genData['sum'] + $genData['other'] + $genData['unknown']),1)) . 
45
-                '</td>
42
+					I18N::translate("Generation %s", I18N::number($gen)).
43
+					($display_all_places ? '<br />' : ' ').
44
+					I18N::translate('(%s)', I18N::percentage(Functions::safeDivision($genData['sum'] + $genData['other'], $genData['sum'] + $genData['other'] + $genData['unknown']),1)) . 
45
+				'</td>
46 46
                  <td class="optionbox left">'.
47
-                    ($display_all_places ? 
48
-                        $this->htmlGenerationAllPlacesRow($genData, $analysis_level) :
49
-                        $this->htmlGenerationTopPlacesRow($genData, $analysis_level)
50
-                     ) .
51
-                '</ditdv>
47
+					($display_all_places ? 
48
+						$this->htmlGenerationAllPlacesRow($genData, $analysis_level) :
49
+						$this->htmlGenerationTopPlacesRow($genData, $analysis_level)
50
+					 ) .
51
+				'</ditdv>
52 52
             </tr>';
53
-        }       
53
+		}       
54 54
         
55
-        $html.= 
56
-            '</table>
55
+		$html.= 
56
+			'</table>
57 57
             <div class="left">
58 58
                 <strong>' . I18N::translate('Interpretation help:') . '</strong>
59 59
                 <br />'.
60
-                I18N::translate('<strong>Generation X (yy %%)</strong>: The percentage indicates the number of found places compared to the total number of ancestors in this generation.') . 
61
-                '<br />';
62
-        if(!is_null($max_details_gen) && $max_details_gen == 0){
63
-            $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 />';
64
-            $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%%.');
65
-        }
66
-        else{
67
-            $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 />';
68
-            $html .= I18N::translate('Only the %d more frequent places for each generation are displayed.', $max_details_gen);
69
-        }
70
-        $html.= 
71
-            '</div>
60
+				I18N::translate('<strong>Generation X (yy %%)</strong>: The percentage indicates the number of found places compared to the total number of ancestors in this generation.') . 
61
+				'<br />';
62
+		if(!is_null($max_details_gen) && $max_details_gen == 0){
63
+			$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 />';
64
+			$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%%.');
65
+		}
66
+		else{
67
+			$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 />';
68
+			$html .= I18N::translate('Only the %d more frequent places for each generation are displayed.', $max_details_gen);
69
+		}
70
+		$html.= 
71
+			'</div>
72 72
         </div>';
73 73
         
74
-        return $html;
75
-    }
74
+		return $html;
75
+	}
76 76
     
77 77
     
78
-    /**
79
-     * Return the HTML code to display a row with all places found in a generation.
80
-     *
81
-     * @param array $data Data array
82
-     * @param int $analysis_level Level of subdivision of analysis
83
-     * @return string HTML code for all places row
84
-     */
85
-    protected function htmlGenerationAllPlacesRow($data, $analysis_level) {
86
-        $html =
87
-        '<table class="geodispersion_bigrow">
78
+	/**
79
+	 * Return the HTML code to display a row with all places found in a generation.
80
+	 *
81
+	 * @param array $data Data array
82
+	 * @param int $analysis_level Level of subdivision of analysis
83
+	 * @return string HTML code for all places row
84
+	 */
85
+	protected function htmlGenerationAllPlacesRow($data, $analysis_level) {
86
+		$html =
87
+		'<table class="geodispersion_bigrow">
88 88
             <tr>';
89 89
         
90
-        $sum_gen = $data['sum'];
91
-        $unknownother = $data['unknown'] + $data['other'];
92
-        foreach($data['places'] as $placename=> $dataplace){
93
-            $levels = array_map('trim',explode(',', $placename));
94
-            $content = '';
95
-            if(isset($dataplace['flag'])){
96
-                $content .= '<td class="geodispersion_flag">'. FunctionsPrint::htmlPlaceIcon($dataplace['place'], $dataplace['flag']) .'</td><td>';
97
-            }
98
-            else{
99
-                $content .= '<td><span title="'.implode(I18N::$list_separator, array_reverse($levels)).'">'.$levels[$analysis_level-1].'</span><br/>';
100
-            }
101
-            $count = $dataplace['count'];
102
-            $content .= I18N::number($count);
103
-            $perc = Functions::safeDivision($count, $sum_gen + $unknownother);
104
-            $perc2= Functions::safeDivision($count, $sum_gen);
105
-            if($perc2>=0.1) 
106
-                $content.= '<br/><span class="small">('.I18N::percentage($perc2, 1).')</span>';
107
-            $content .= '</td>';
90
+		$sum_gen = $data['sum'];
91
+		$unknownother = $data['unknown'] + $data['other'];
92
+		foreach($data['places'] as $placename=> $dataplace){
93
+			$levels = array_map('trim',explode(',', $placename));
94
+			$content = '';
95
+			if(isset($dataplace['flag'])){
96
+				$content .= '<td class="geodispersion_flag">'. FunctionsPrint::htmlPlaceIcon($dataplace['place'], $dataplace['flag']) .'</td><td>';
97
+			}
98
+			else{
99
+				$content .= '<td><span title="'.implode(I18N::$list_separator, array_reverse($levels)).'">'.$levels[$analysis_level-1].'</span><br/>';
100
+			}
101
+			$count = $dataplace['count'];
102
+			$content .= I18N::number($count);
103
+			$perc = Functions::safeDivision($count, $sum_gen + $unknownother);
104
+			$perc2= Functions::safeDivision($count, $sum_gen);
105
+			if($perc2>=0.1) 
106
+				$content.= '<br/><span class="small">('.I18N::percentage($perc2, 1).')</span>';
107
+			$content .= '</td>';
108 108
                
109
-            $html .= '
109
+			$html .= '
110 110
                 <td class="geodispersion_rowitem" width="'.max(round(100*$perc, 0),1).'%">
111 111
                     <table>
112 112
                         <tr>
@@ -118,46 +118,46 @@  discard block
 block discarded – undo
118 118
                         </tr>
119 119
                     </table>
120 120
                 </td>';
121
-        }
121
+		}
122 122
         
123
-        if($unknownother>0){
124
-            $perc= Functions::safeDivision($unknownother, $sum_gen + $unknownother);
125
-            $html .='<td class="geodispersion_unknownitem left" >'.I18N::number($unknownother);
126
-            if($perc>=0.1) $html.= '<br/><span class="small">('.I18N::percentage($perc, 1).')</span>';
127
-            $html .='</td>';
128
-        }
123
+		if($unknownother>0){
124
+			$perc= Functions::safeDivision($unknownother, $sum_gen + $unknownother);
125
+			$html .='<td class="geodispersion_unknownitem left" >'.I18N::number($unknownother);
126
+			if($perc>=0.1) $html.= '<br/><span class="small">('.I18N::percentage($perc, 1).')</span>';
127
+			$html .='</td>';
128
+		}
129 129
         
130
-        $html .= 
131
-            '</tr>
130
+		$html .= 
131
+			'</tr>
132 132
         </table>';
133
-        return $html;
134
-    }
133
+		return $html;
134
+	}
135 135
     
136 136
 	/**
137 137
 	 * Returns the HTML code fo display a row of the Top Places found for a generation.
138 138
 	 *
139 139
 	 * @param array $data Data array
140
-     * @param int $analysis_level Level of subdivision of analysis
140
+	 * @param int $analysis_level Level of subdivision of analysis
141 141
 	 * @return string HTML code for Top Places row
142 142
 	 */
143
-    protected function htmlGenerationTopPlacesRow($data, $analysis_level) {
144
-        $tmp_places = array();
145
-        $sum_gen = $data['sum'];
146
-        $other = $data['other'];
143
+	protected function htmlGenerationTopPlacesRow($data, $analysis_level) {
144
+		$tmp_places = array();
145
+		$sum_gen = $data['sum'];
146
+		$other = $data['other'];
147 147
         
148
-        foreach($data['places'] as $placename => $count) {
149
-            if($placename != 'other'){
150
-                $levels = array_map('trim',explode(',', $placename));
151
-                $placename = '<span title="'.implode(I18N::$list_separator, array_reverse($levels)).'">'.$levels[$analysis_level-1].'</span>';
152
-            }
153
-            else{
154
-                $placename = I18N::translate('Other places');
155
-            }
156
-            $tmp_places[] = I18N::translate('<strong>%s</strong> [%d - %s]', $placename, $count, I18N::percentage(Functions::safeDivision($count, $sum_gen + $other), 1));         	
157
-        }
148
+		foreach($data['places'] as $placename => $count) {
149
+			if($placename != 'other'){
150
+				$levels = array_map('trim',explode(',', $placename));
151
+				$placename = '<span title="'.implode(I18N::$list_separator, array_reverse($levels)).'">'.$levels[$analysis_level-1].'</span>';
152
+			}
153
+			else{
154
+				$placename = I18N::translate('Other places');
155
+			}
156
+			$tmp_places[] = I18N::translate('<strong>%s</strong> [%d - %s]', $placename, $count, I18N::percentage(Functions::safeDivision($count, $sum_gen + $other), 1));         	
157
+		}
158 158
         
159
-        return implode(I18N::$list_separator, $tmp_places);
160
-    }
159
+		return implode(I18N::$list_separator, $tmp_places);
160
+	}
161 161
     
162 162
 }
163 163
  
164 164
\ No newline at end of file
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/Views/GeoAnalysisTabGeneralMapView.php 3 patches
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -25,17 +25,17 @@  discard block
 block discarded – undo
25 25
 	 * {@inheritDoc}
26 26
 	 * @see \MyArtJaub\Webtrees\Module\GeoDispersion\Views\AbstractGeoAnalysisTabGeneralView::htmlAnalysisData()
27 27
 	 */
28
-    protected function htmlAnalysisData() {
28
+	protected function htmlAnalysisData() {
29 29
         
30
-        /** @var OutlineMap $map */
31
-        $map = $this->data->get('map');
32
-        $canvas = $map->getCanvas();
33
-        $subdvisions_results = $this->data->get('results_by_subdivisions');
30
+		/** @var OutlineMap $map */
31
+		$map = $this->data->get('map');
32
+		$canvas = $map->getCanvas();
33
+		$subdvisions_results = $this->data->get('results_by_subdivisions');
34 34
         
35
-        $nb_found = $this->data->get('stats_gen_nb_found');
36
-        $nb_other = $this->data->get('stats_gen_nb_other');
35
+		$nb_found = $this->data->get('stats_gen_nb_found');
36
+		$nb_other = $this->data->get('stats_gen_nb_other');
37 37
         
38
-        $html = '<script>
38
+		$html = '<script>
39 39
 			var tip = null;
40 40
 			var tipText = "";
41 41
 			var over = false;
@@ -82,29 +82,29 @@  discard block
 block discarded – undo
82 82
 				var map = {};
83 83
 		';
84 84
         
85
-        foreach($subdvisions_results as $name => $location){
86
-            $html.= 'map.area'.$location['id'].' = paper.path("'.$location['coord'].'").attr(attr);';
87
-            if(isset($location['transparency'])) {
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/>';
90
-                $textToolTip .= I18N::translate('%d individuals', $location['count']).'<br/>'.I18N::percentage(Functions::safeDivision($location['count'], $nb_found - $nb_other), 1);
91
-                $html.= 'addTip(map.area'.$location['id'].'.node, "'.Filter::escapeJs($textToolTip).'");';
92
-                $html.= 'map.area'.$location['id'].'.attr({"fill" : "'. $canvas->max_color .'", "fill-opacity" : '.$location['transparency'].' });';
93
-                $html.= 'map.area'.$location['id'].'.mouseover(function () {'.
94
-                    'map.area'.$location['id'].'.stop().animate({"fill" : "'. $canvas->hover_color .'", "fill-opacity" : 1}, 100, "linear");'.
95
-                    '});'.
96
-                    'map.area'.$location['id'].'.mouseout(function () {'.
97
-                    'map.area'.$location['id'].'.stop().animate({"fill" : "'.$canvas->max_color.'", "fill-opacity" : '.$location['transparency'].'}, 100, "linear");'.
98
-                    '});';
99
-            }
100
-        }
101
-        $html .= '});
85
+		foreach($subdvisions_results as $name => $location){
86
+			$html.= 'map.area'.$location['id'].' = paper.path("'.$location['coord'].'").attr(attr);';
87
+			if(isset($location['transparency'])) {
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/>';
90
+				$textToolTip .= I18N::translate('%d individuals', $location['count']).'<br/>'.I18N::percentage(Functions::safeDivision($location['count'], $nb_found - $nb_other), 1);
91
+				$html.= 'addTip(map.area'.$location['id'].'.node, "'.Filter::escapeJs($textToolTip).'");';
92
+				$html.= 'map.area'.$location['id'].'.attr({"fill" : "'. $canvas->max_color .'", "fill-opacity" : '.$location['transparency'].' });';
93
+				$html.= 'map.area'.$location['id'].'.mouseover(function () {'.
94
+					'map.area'.$location['id'].'.stop().animate({"fill" : "'. $canvas->hover_color .'", "fill-opacity" : 1}, 100, "linear");'.
95
+					'});'.
96
+					'map.area'.$location['id'].'.mouseout(function () {'.
97
+					'map.area'.$location['id'].'.stop().animate({"fill" : "'.$canvas->max_color.'", "fill-opacity" : '.$location['transparency'].'}, 100, "linear");'.
98
+					'});';
99
+			}
100
+		}
101
+		$html .= '});
102 102
             </script>
103 103
             
104 104
             <div id="geodispersion_map"></div>
105 105
     	   <div id="geodispersion_tip"></div>';
106 106
         
107
-        return $html;
108
-    }
107
+		return $html;
108
+	}
109 109
     
110 110
 } 
111 111
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -75,23 +75,23 @@
 block discarded – undo
75 75
 				    }
76 76
 				});
77 77
 
78
-				var paper = new Raphael(document.getElementById("geodispersion_map"), '. $canvas->width .', '. $canvas->height .');
79
-				var background = paper.rect(0, 0, ' . $canvas->width . ', '. $canvas->height . ');
80
-				background.attr({"fill" : "'. $canvas->background_color .'", "stroke" : "'. $canvas->background_stroke .'", "stroke-width": 1, "stroke-linejoin": "round" });
81
-				var attr = { fill: "'. $canvas->default_color .'", stroke: "'. $canvas->default_stroke .'", "stroke-width": 1, "stroke-linejoin": "round" };
78
+				var paper = new Raphael(document.getElementById("geodispersion_map"), '. $canvas->width.', '.$canvas->height.');
79
+				var background = paper.rect(0, 0, ' . $canvas->width.', '.$canvas->height.');
80
+				background.attr({"fill" : "'. $canvas->background_color.'", "stroke" : "'.$canvas->background_stroke.'", "stroke-width": 1, "stroke-linejoin": "round" });
81
+				var attr = { fill: "'. $canvas->default_color.'", stroke: "'.$canvas->default_stroke.'", "stroke-width": 1, "stroke-linejoin": "round" };
82 82
 				var map = {};
83 83
 		';
84 84
         
85
-        foreach($subdvisions_results as $name => $location){
86
-            $html.= 'map.area'.$location['id'].' = paper.path("'.$location['coord'].'").attr(attr);';
87
-            if(isset($location['transparency'])) {
85
+        foreach ($subdvisions_results as $name => $location) {
86
+            $html .= 'map.area'.$location['id'].' = paper.path("'.$location['coord'].'").attr(attr);';
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'] != '') $textToolTip .= '<span class="geodispersion_flag">'.FunctionsPrint::htmlPlaceIcon($location['place'], $location['flag']).'</span><br/>';
90 90
                 $textToolTip .= I18N::translate('%d individuals', $location['count']).'<br/>'.I18N::percentage(Functions::safeDivision($location['count'], $nb_found - $nb_other), 1);
91
-                $html.= 'addTip(map.area'.$location['id'].'.node, "'.Filter::escapeJs($textToolTip).'");';
92
-                $html.= 'map.area'.$location['id'].'.attr({"fill" : "'. $canvas->max_color .'", "fill-opacity" : '.$location['transparency'].' });';
93
-                $html.= 'map.area'.$location['id'].'.mouseover(function () {'.
94
-                    'map.area'.$location['id'].'.stop().animate({"fill" : "'. $canvas->hover_color .'", "fill-opacity" : 1}, 100, "linear");'.
91
+                $html .= 'addTip(map.area'.$location['id'].'.node, "'.Filter::escapeJs($textToolTip).'");';
92
+                $html .= 'map.area'.$location['id'].'.attr({"fill" : "'.$canvas->max_color.'", "fill-opacity" : '.$location['transparency'].' });';
93
+                $html .= 'map.area'.$location['id'].'.mouseover(function () {'.
94
+                    'map.area'.$location['id'].'.stop().animate({"fill" : "'.$canvas->hover_color.'", "fill-opacity" : 1}, 100, "linear");'.
95 95
                     '});'.
96 96
                     'map.area'.$location['id'].'.mouseout(function () {'.
97 97
                     'map.area'.$location['id'].'.stop().animate({"fill" : "'.$canvas->max_color.'", "fill-opacity" : '.$location['transparency'].'}, 100, "linear");'.
Please login to merge, or discard this 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.