@@ -60,13 +60,13 @@ |
||
60 | 60 | ?> |
61 | 61 | <tr> |
62 | 62 | <td> |
63 | - <input type="hidden" name="hook-<?php echo $hook->id;?>" value="yes" > |
|
64 | - <?php echo FunctionsEdit::twoStateCheckbox('status-'.($hook->id), ($hook->status)=='enabled'); ?> |
|
63 | + <input type="hidden" name="hook-<?php echo $hook->id; ?>" value="yes" > |
|
64 | + <?php echo FunctionsEdit::twoStateCheckbox('status-'.($hook->id), ($hook->status) == 'enabled'); ?> |
|
65 | 65 | </td> |
66 | - <td><?php echo (($hook->status)=='enabled'); ?></td> |
|
66 | + <td><?php echo (($hook->status) == 'enabled'); ?></td> |
|
67 | 67 | <td><?php echo $hook->hook; ?></td> |
68 | 68 | <td><?php echo $hook->context; ?></td> |
69 | - <td><?php if($mod = Module::getModuleByName($hook->module)) echo $mod->getTitle(); ?></td> |
|
69 | + <td><?php if ($mod = Module::getModuleByName($hook->module)) echo $mod->getTitle(); ?></td> |
|
70 | 70 | <td><input type="text" class="center" size="2" value="<?php echo $hook->priority; ?>" name="moduleorder-<?php echo $hook->id; ?>" /></td> |
71 | 71 | <td><?php echo $hook->priority; ?></td> |
72 | 72 | </tr> |
@@ -61,10 +61,10 @@ |
||
61 | 61 | * @see \MyArtJaub\Webtrees\Module\ModuleManagerInterface::isOperational() |
62 | 62 | */ |
63 | 63 | public function isOperational($moduleName) { |
64 | - if(!array_key_exists($moduleName, $this->modules_list)) { |
|
65 | - if($module = fw\Module::getModuleByName($moduleName)) { |
|
66 | - if($module instanceof DependentInterface) { |
|
67 | - if($module->validatePrerequisites()) { |
|
64 | + if (!array_key_exists($moduleName, $this->modules_list)) { |
|
65 | + if ($module = fw\Module::getModuleByName($moduleName)) { |
|
66 | + if ($module instanceof DependentInterface) { |
|
67 | + if ($module->validatePrerequisites()) { |
|
68 | 68 | $this->modules_list[$moduleName] = TRUE; |
69 | 69 | return true; |
70 | 70 | } else { |
@@ -44,7 +44,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -164,7 +164,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 { |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $this->is_loaded = false; |
71 | 71 | $this->subdivisions = array(); |
72 | 72 | $this->mappings = array(); |
73 | - if($load) $this->load(); |
|
73 | + if ($load) $this->load(); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -99,9 +99,9 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -44,7 +44,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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”.'); ?> |
@@ -30,7 +30,7 @@ |
||
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 | ?> |
@@ -38,39 +38,38 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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)); |
@@ -75,23 +75,23 @@ |
||
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");'. |