@@ -21,175 +21,175 @@ |
||
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 |
@@ -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 |
@@ -70,7 +70,9 @@ discard block |
||
70 | 70 | $this->is_loaded = false; |
71 | 71 | $this->subdivisions = array(); |
72 | 72 | $this->mappings = array(); |
73 | - if($load) $this->load(); |
|
73 | + if($load) { |
|
74 | + $this->load(); |
|
75 | + } |
|
74 | 76 | } |
75 | 77 | |
76 | 78 | /** |
@@ -117,7 +119,9 @@ discard block |
||
117 | 119 | foreach($xml->subdivisions->children() as $subdivision){ |
118 | 120 | $attributes = $subdivision->attributes(); |
119 | 121 | $key = trim($attributes['name']); |
120 | - if(isset($attributes['parent'])) $key .= '@'.trim($attributes['parent']); |
|
122 | + if(isset($attributes['parent'])) { |
|
123 | + $key .= '@'.trim($attributes['parent']); |
|
124 | + } |
|
121 | 125 | $this->subdivisions[$key] = array( |
122 | 126 | 'id' => trim($attributes['id']), |
123 | 127 | 'displayname' => trim($attributes['name']), |
@@ -142,7 +146,9 @@ discard block |
||
142 | 146 | * @return string |
143 | 147 | */ |
144 | 148 | public function getFileName() { |
145 | - if(!$this->is_loaded) $this->load(); |
|
149 | + if(!$this->is_loaded) { |
|
150 | + $this->load(); |
|
151 | + } |
|
146 | 152 | return $this->filename; |
147 | 153 | } |
148 | 154 | |
@@ -151,7 +157,9 @@ discard block |
||
151 | 157 | * @return string |
152 | 158 | */ |
153 | 159 | public function getDescription() { |
154 | - if(!$this->is_loaded) $this->load(); |
|
160 | + if(!$this->is_loaded) { |
|
161 | + $this->load(); |
|
162 | + } |
|
155 | 163 | return $this->description; |
156 | 164 | } |
157 | 165 | |
@@ -160,7 +168,9 @@ discard block |
||
160 | 168 | * @return string |
161 | 169 | */ |
162 | 170 | public function getTopLevelName() { |
163 | - if(!$this->is_loaded) $this->load(); |
|
171 | + if(!$this->is_loaded) { |
|
172 | + $this->load(); |
|
173 | + } |
|
164 | 174 | return $this->top_level_name; |
165 | 175 | } |
166 | 176 | |
@@ -169,7 +179,9 @@ discard block |
||
169 | 179 | * @return \MyArtJaub\Webtrees\Module\GeoDispersion\Model\OutlineMapCanvas |
170 | 180 | */ |
171 | 181 | public function getCanvas() { |
172 | - if(!$this->is_loaded) $this->load(); |
|
182 | + if(!$this->is_loaded) { |
|
183 | + $this->load(); |
|
184 | + } |
|
173 | 185 | return $this->canvas; |
174 | 186 | } |
175 | 187 | |
@@ -178,7 +190,9 @@ discard block |
||
178 | 190 | * @return array |
179 | 191 | */ |
180 | 192 | public function getSubdivisions() { |
181 | - if(!$this->is_loaded) $this->load(); |
|
193 | + if(!$this->is_loaded) { |
|
194 | + $this->load(); |
|
195 | + } |
|
182 | 196 | return $this->subdivisions; |
183 | 197 | } |
184 | 198 | |
@@ -187,7 +201,9 @@ discard block |
||
187 | 201 | * @return array |
188 | 202 | */ |
189 | 203 | public function getPlacesMappings() { |
190 | - if(!$this->is_loaded) $this->load(); |
|
204 | + if(!$this->is_loaded) { |
|
205 | + $this->load(); |
|
206 | + } |
|
191 | 207 | return $this->mappings; |
192 | 208 | } |
193 | 209 |
@@ -24,18 +24,18 @@ |
||
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 | } |
@@ -72,14 +72,14 @@ discard block |
||
72 | 72 | $data->set('title', $controller->getPageTitle()); |
73 | 73 | $data->set('tree', $WT_TREE); |
74 | 74 | |
75 | - $data->set('root_url', 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig'); |
|
75 | + $data->set('root_url', 'module.php?mod='.$this->module->getName().'&mod_action=AdminConfig'); |
|
76 | 76 | |
77 | - $table_id = 'table-geoanalysis-' . Uuid::uuid4(); |
|
77 | + $table_id = 'table-geoanalysis-'.Uuid::uuid4(); |
|
78 | 78 | $data->set('table_id', $table_id); |
79 | 79 | |
80 | 80 | $other_trees = array(); |
81 | 81 | foreach (Tree::getAll() as $tree) { |
82 | - if($tree->getTreeId() != $WT_TREE->getTreeId()) $other_trees[] = $tree; |
|
82 | + if ($tree->getTreeId() != $WT_TREE->getTreeId()) $other_trees[] = $tree; |
|
83 | 83 | } |
84 | 84 | $data->set('other_trees', $other_trees); |
85 | 85 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | processing: true, |
106 | 106 | serverSide : true, |
107 | 107 | ajax : { |
108 | - url : "module.php?mod='.$this->module->getName().'&mod_action=AdminConfig@jsonGeoAnalysisList&ged='. $WT_TREE->getNameUrl().'", |
|
108 | + url : "module.php?mod='.$this->module->getName().'&mod_action=AdminConfig@jsonGeoAnalysisList&ged='.$WT_TREE->getNameUrl().'", |
|
109 | 109 | type : "POST" |
110 | 110 | }, |
111 | 111 | columns: [ |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | url: "module.php", |
130 | 130 | type: "GET", |
131 | 131 | data: { |
132 | - mod: "' . $this->module->getName() .'", |
|
132 | + mod: "' . $this->module->getName().'", |
|
133 | 133 | mod_action: "GeoAnalysis@setStatus", |
134 | 134 | ga_id: ga_id, |
135 | 135 | ged: typeof gedcom === "undefined" ? WT_GEDCOM : gedcom, |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | }, |
138 | 138 | error: function(result, stat, error) { |
139 | 139 | var err = typeof result.responseJSON === "undefined" ? error : result.responseJSON.error; |
140 | - alert("' . I18N::translate('An error occured while editing this analysis:') . '" + err); |
|
140 | + alert("' . I18N::translate('An error occured while editing this analysis:').'" + err); |
|
141 | 141 | }, |
142 | 142 | complete: function(result, stat) { |
143 | 143 | geoAnalysisTable.ajax.reload(null, false); |
@@ -150,14 +150,14 @@ discard block |
||
150 | 150 | url: "module.php", |
151 | 151 | type: "GET", |
152 | 152 | data: { |
153 | - mod: "' . $this->module->getName() .'", |
|
153 | + mod: "' . $this->module->getName().'", |
|
154 | 154 | mod_action: "GeoAnalysis@delete", |
155 | 155 | ga_id: ga_id, |
156 | 156 | ged: typeof gedcom === "undefined" ? WT_GEDCOM : gedcom |
157 | 157 | }, |
158 | 158 | error: function(result, stat, error) { |
159 | 159 | var err = typeof result.responseJSON === "undefined" ? error : result.responseJSON.error; |
160 | - alert("' . I18N::translate('An error occured while deleting this analysis:') . '" + err); |
|
160 | + alert("' . I18N::translate('An error occured while deleting this analysis:').'" + err); |
|
161 | 161 | }, |
162 | 162 | complete: function(result, stat) { |
163 | 163 | geoAnalysisTable.ajax.reload(null, false); |
@@ -182,13 +182,13 @@ discard block |
||
182 | 182 | |
183 | 183 | // Generate an AJAX/JSON response for datatables to load a block of rows |
184 | 184 | $search = Filter::postArray('search'); |
185 | - if($search) $search = $search['value']; |
|
185 | + if ($search) $search = $search['value']; |
|
186 | 186 | $start = Filter::postInteger('start'); |
187 | 187 | $length = Filter::postInteger('length'); |
188 | 188 | $order = Filter::postArray('order'); |
189 | 189 | |
190 | - foreach($order as $key => &$value) { |
|
191 | - switch($value['column']) { |
|
190 | + foreach ($order as $key => &$value) { |
|
191 | + switch ($value['column']) { |
|
192 | 192 | case 3: |
193 | 193 | $value['column'] = 'majgd_descr'; |
194 | 194 | break; |
@@ -209,11 +209,11 @@ discard block |
||
209 | 209 | |
210 | 210 | $data = array(); |
211 | 211 | $place_hierarchy = $this->provider->getPlacesHierarchy(); |
212 | - foreach($list as $ga) { |
|
212 | + foreach ($list as $ga) { |
|
213 | 213 | /** @var GeoAnalysis $ga */ |
214 | 214 | |
215 | 215 | $datum = array(); |
216 | - $options= $ga->getOptions(); |
|
216 | + $options = $ga->getOptions(); |
|
217 | 217 | |
218 | 218 | $datum[0] = ' |
219 | 219 | <div class="btn-group"> |
@@ -223,50 +223,48 @@ discard block |
||
223 | 223 | <ul class="dropdown-menu" role="menu"> |
224 | 224 | <li> |
225 | 225 | <a href="#" onclick="return set_geoanalysis_status('. $ga->getId().', '.($ga->isEnabled() ? 'false' : 'true').', \''.Filter::escapeJs($WT_TREE->getName()).'\');"> |
226 | - <i class="fa fa-fw '.($ga->isEnabled() ? 'fa-times' : 'fa-check').'"></i> ' . ($ga->isEnabled() ? I18N::translate('Disable') : I18N::translate('Enable')) . ' |
|
226 | + <i class="fa fa-fw '.($ga->isEnabled() ? 'fa-times' : 'fa-check').'"></i> '.($ga->isEnabled() ? I18N::translate('Disable') : I18N::translate('Enable')).' |
|
227 | 227 | </a> |
228 | 228 | </li> |
229 | 229 | <li> |
230 | 230 | <a href="module.php?mod='.$this->module->getName().'&mod_action=AdminConfig@edit&ga_id='.$ga->getId().'&ged='.$WT_TREE->getName().'"> |
231 | - <i class="fa fa-fw fa-pencil"></i> ' . I18N::translate('Edit') . ' |
|
231 | + <i class="fa fa-fw fa-pencil"></i> ' . I18N::translate('Edit').' |
|
232 | 232 | </a> |
233 | 233 | </li> |
234 | 234 | <li class="divider" /> |
235 | 235 | <li> |
236 | 236 | <a href="#" onclick="return delete_geoanalysis('. $ga->getId().', \''.Filter::escapeJs($WT_TREE->getName()).'\');"> |
237 | - <i class="fa fa-fw fa-trash-o"></i> ' . I18N::translate('Delete') . ' |
|
237 | + <i class="fa fa-fw fa-trash-o"></i> ' . I18N::translate('Delete').' |
|
238 | 238 | </a> |
239 | 239 | </li> |
240 | 240 | </ul> |
241 | 241 | </div>'; |
242 | 242 | $datum[1] = $ga->getId(); |
243 | 243 | $datum[2] = $ga->isEnabled() ? |
244 | - '<i class="fa fa-check"></i><span class="sr-only">'.I18N::translate('Enabled').'</span>' : |
|
245 | - '<i class="fa fa-times"></i><span class="sr-only">'.I18N::translate('Disabled').'</span>'; |
|
244 | + '<i class="fa fa-check"></i><span class="sr-only">'.I18N::translate('Enabled').'</span>' : '<i class="fa fa-times"></i><span class="sr-only">'.I18N::translate('Disabled').'</span>'; |
|
246 | 245 | $datum[3] = $ga->getTitle(); |
247 | 246 | $analysis_level = $ga->getAnalysisLevel(); |
248 | - if($place_hierarchy['type'] == 'header') { |
|
247 | + if ($place_hierarchy['type'] == 'header') { |
|
249 | 248 | $datum[4] = $place_hierarchy['hierarchy'][$analysis_level - 1]; |
250 | 249 | } else { |
251 | - $datum[4] = $analysis_level . '(' . $place_hierarchy['hierarchy'][$analysis_level - 1] . ')'; |
|
250 | + $datum[4] = $analysis_level.'('.$place_hierarchy['hierarchy'][$analysis_level - 1].')'; |
|
252 | 251 | } |
253 | 252 | $datum[5] = $ga->getAnalysisLevel(); |
254 | 253 | $datum[6] = '<i class="fa fa-times"></i><span class="sr-only">'.I18N::translate('None').'</span>'; |
255 | 254 | $datum[7] = '<i class="fa fa-times"></i><span class="sr-only">'.I18N::translate('None').'</span>'; |
256 | - if($ga->hasMap()) { |
|
255 | + if ($ga->hasMap()) { |
|
257 | 256 | $datum[6] = $options->getMap()->getDescription(); |
258 | - $datum[7] = '<span data-toggle="tooltip" title="' . $options->getMap()->getTopLevelName() . '" />'; |
|
257 | + $datum[7] = '<span data-toggle="tooltip" title="'.$options->getMap()->getTopLevelName().'" />'; |
|
259 | 258 | $top_level = $options->getMapLevel(); |
260 | - if($place_hierarchy['type'] == 'header') { |
|
259 | + if ($place_hierarchy['type'] == 'header') { |
|
261 | 260 | $datum[7] .= $place_hierarchy['hierarchy'][$top_level - 1]; |
262 | 261 | } else { |
263 | - $datum[7] .= $top_level . '(' . $place_hierarchy['hierarchy'][$top_level - 1] . ')'; |
|
262 | + $datum[7] .= $top_level.'('.$place_hierarchy['hierarchy'][$top_level - 1].')'; |
|
264 | 263 | } |
265 | 264 | $datum[7] .= '</span>'; |
266 | 265 | } |
267 | 266 | $datum[8] = $options->isUsingFlags() ? |
268 | - '<i class="fa fa-check"></i><span class="sr-only">'.I18N::translate('Yes').'</span>' : |
|
269 | - '<i class="fa fa-times"></i><span class="sr-only">'.I18N::translate('No').'</span>'; |
|
267 | + '<i class="fa fa-check"></i><span class="sr-only">'.I18N::translate('Yes').'</span>' : '<i class="fa fa-times"></i><span class="sr-only">'.I18N::translate('No').'</span>'; |
|
270 | 268 | $datum[9] = $options->getMaxDetailsInGen() > 0 ? $options->getMaxDetailsInGen() : I18N::translate('All'); |
271 | 269 | |
272 | 270 | $data[] = $datum; |
@@ -316,24 +314,24 @@ discard block |
||
316 | 314 | $description = Filter::post('description'); |
317 | 315 | $analysislevel = Filter::postInteger('analysislevel'); |
318 | 316 | $use_map = Filter::postBool('use_map'); |
319 | - if($use_map) { |
|
317 | + if ($use_map) { |
|
320 | 318 | $map_file = base64_decode(Filter::post('map_file')); |
321 | - $map_top_level = Filter::postInteger('map_top_level'); |
|
319 | + $map_top_level = Filter::postInteger('map_top_level'); |
|
322 | 320 | } |
323 | 321 | $use_flags = Filter::postBool('use_flags'); |
324 | 322 | $gen_details = Filter::postInteger('gen_details'); |
325 | 323 | |
326 | 324 | $success = false; |
327 | - if($ga_id) { |
|
325 | + if ($ga_id) { |
|
328 | 326 | $ga = $this->provider->getGeoAnalysis($ga_id, false); |
329 | - if($ga) { |
|
327 | + if ($ga) { |
|
330 | 328 | $ga->setTitle($description); |
331 | 329 | $ga->setAnalysisLevel($analysislevel + 1); |
332 | 330 | $options = $ga->getOptions(); |
333 | - if($options) { |
|
331 | + if ($options) { |
|
334 | 332 | $options->setIsUsingFlags($use_flags); |
335 | 333 | $options->setMaxDetailsInGen($gen_details); |
336 | - if($use_map) { |
|
334 | + if ($use_map) { |
|
337 | 335 | $options->setMap(new OutlineMap($map_file)); |
338 | 336 | $options->setMapLevel($map_top_level + 1); |
339 | 337 | } |
@@ -343,7 +341,7 @@ discard block |
||
343 | 341 | } |
344 | 342 | |
345 | 343 | $res = $this->provider->updateGeoAnalysis($ga); |
346 | - if($res) { |
|
344 | + if ($res) { |
|
347 | 345 | FlashMessages::addMessage(I18N::translate('The geographical dispersion analysis “%s” has been successfully updated', $res->getTitle()), 'success'); |
348 | 346 | Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID “'.$res->getId().'” has been updated.'); |
349 | 347 | $ga = $res; |
@@ -351,7 +349,7 @@ discard block |
||
351 | 349 | } |
352 | 350 | else { |
353 | 351 | FlashMessages::addMessage(I18N::translate('An error occured while updating the geographical dispersion analysis “%s”', $ga->getTitle()), 'danger'); |
354 | - Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID “'. $ga->getId() .'” could not be updated. See error log.'); |
|
352 | + Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID “'.$ga->getId().'” could not be updated. See error log.'); |
|
355 | 353 | } |
356 | 354 | } |
357 | 355 | } else { |
@@ -363,7 +361,7 @@ discard block |
||
363 | 361 | $use_flags, |
364 | 362 | $gen_details |
365 | 363 | ); |
366 | - if($ga) { |
|
364 | + if ($ga) { |
|
367 | 365 | FlashMessages::addMessage(I18N::translate('The geographical dispersion analysis “%s” has been successfully added.', $ga->getTitle()), 'success'); |
368 | 366 | Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID “'.$ga->getId().'” has been added.'); |
369 | 367 | $success = true; |
@@ -374,16 +372,16 @@ discard block |
||
374 | 372 | } |
375 | 373 | } |
376 | 374 | |
377 | - $redirection_url = 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig&ged=' . $WT_TREE->getNameUrl(); |
|
378 | - if(!$success) { |
|
379 | - if($ga) { |
|
380 | - $redirection_url = 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig@edit&ga_id='. $ga->getId() .'&ged=' . $WT_TREE->getNameUrl(); |
|
375 | + $redirection_url = 'module.php?mod='.$this->module->getName().'&mod_action=AdminConfig&ged='.$WT_TREE->getNameUrl(); |
|
376 | + if (!$success) { |
|
377 | + if ($ga) { |
|
378 | + $redirection_url = 'module.php?mod='.$this->module->getName().'&mod_action=AdminConfig@edit&ga_id='.$ga->getId().'&ged='.$WT_TREE->getNameUrl(); |
|
381 | 379 | } |
382 | 380 | else { |
383 | - $redirection_url = 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig@add&ged=' . $WT_TREE->getNameUrl(); |
|
381 | + $redirection_url = 'module.php?mod='.$this->module->getName().'&mod_action=AdminConfig@add&ged='.$WT_TREE->getNameUrl(); |
|
384 | 382 | } |
385 | 383 | } |
386 | - header('Location: ' . WT_BASE_URL . $redirection_url); |
|
384 | + header('Location: '.WT_BASE_URL.$redirection_url); |
|
387 | 385 | |
388 | 386 | } |
389 | 387 | |
@@ -414,7 +412,7 @@ discard block |
||
414 | 412 | '); |
415 | 413 | |
416 | 414 | $data = new ViewBag(); |
417 | - if($ga) { |
|
415 | + if ($ga) { |
|
418 | 416 | $controller->setPageTitle(I18N::translate('Edit the geographical dispersion analysis')); |
419 | 417 | $data->set('geo_analysis', $ga); |
420 | 418 | } else { |
@@ -422,9 +420,9 @@ discard block |
||
422 | 420 | } |
423 | 421 | |
424 | 422 | $data->set('title', $controller->getPageTitle()); |
425 | - $data->set('admin_config_url', 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig&ged=' . $WT_TREE->getNameUrl()); |
|
423 | + $data->set('admin_config_url', 'module.php?mod='.$this->module->getName().'&mod_action=AdminConfig&ged='.$WT_TREE->getNameUrl()); |
|
426 | 424 | $data->set('module_title', $this->module->getTitle()); |
427 | - $data->set('save_url', 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig@save&ged=' . $WT_TREE->getNameUrl()); |
|
425 | + $data->set('save_url', 'module.php?mod='.$this->module->getName().'&mod_action=AdminConfig@save&ged='.$WT_TREE->getNameUrl()); |
|
428 | 426 | $data->set('places_hierarchy', $this->provider->getPlacesHierarchy()); |
429 | 427 | |
430 | 428 | $map_list = array_map( |
@@ -437,7 +435,7 @@ discard block |
||
437 | 435 | $data->set('map_list', $map_list); |
438 | 436 | |
439 | 437 | $gen_details = array(0 => I18N::translate('All')); |
440 | - for($i = 1; $i <= 10 ; $i++) $gen_details[$i] = $i; |
|
438 | + for ($i = 1; $i <= 10; $i++) $gen_details[$i] = $i; |
|
441 | 439 | $data->set('generation_details', $gen_details); |
442 | 440 | |
443 | 441 | ViewFactory::make('GeoAnalysisEdit', $this, $controller, $data)->render(); |
@@ -79,7 +79,9 @@ discard block |
||
79 | 79 | |
80 | 80 | $other_trees = array(); |
81 | 81 | foreach (Tree::getAll() as $tree) { |
82 | - if($tree->getTreeId() != $WT_TREE->getTreeId()) $other_trees[] = $tree; |
|
82 | + if($tree->getTreeId() != $WT_TREE->getTreeId()) { |
|
83 | + $other_trees[] = $tree; |
|
84 | + } |
|
83 | 85 | } |
84 | 86 | $data->set('other_trees', $other_trees); |
85 | 87 | |
@@ -182,7 +184,9 @@ discard block |
||
182 | 184 | |
183 | 185 | // Generate an AJAX/JSON response for datatables to load a block of rows |
184 | 186 | $search = Filter::postArray('search'); |
185 | - if($search) $search = $search['value']; |
|
187 | + if($search) { |
|
188 | + $search = $search['value']; |
|
189 | + } |
|
186 | 190 | $start = Filter::postInteger('start'); |
187 | 191 | $length = Filter::postInteger('length'); |
188 | 192 | $order = Filter::postArray('order'); |
@@ -336,8 +340,7 @@ discard block |
||
336 | 340 | if($use_map) { |
337 | 341 | $options->setMap(new OutlineMap($map_file)); |
338 | 342 | $options->setMapLevel($map_top_level + 1); |
339 | - } |
|
340 | - else { |
|
343 | + } else { |
|
341 | 344 | $options->setMap(null); |
342 | 345 | } |
343 | 346 | } |
@@ -348,8 +351,7 @@ discard block |
||
348 | 351 | Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID “'.$res->getId().'” has been updated.'); |
349 | 352 | $ga = $res; |
350 | 353 | $success = true; |
351 | - } |
|
352 | - else { |
|
354 | + } else { |
|
353 | 355 | FlashMessages::addMessage(I18N::translate('An error occured while updating the geographical dispersion analysis “%s”', $ga->getTitle()), 'danger'); |
354 | 356 | Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID “'. $ga->getId() .'” could not be updated. See error log.'); |
355 | 357 | } |
@@ -367,8 +369,7 @@ discard block |
||
367 | 369 | FlashMessages::addMessage(I18N::translate('The geographical dispersion analysis “%s” has been successfully added.', $ga->getTitle()), 'success'); |
368 | 370 | Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID “'.$ga->getId().'” has been added.'); |
369 | 371 | $success = true; |
370 | - } |
|
371 | - else { |
|
372 | + } else { |
|
372 | 373 | FlashMessages::addMessage(I18N::translate('An error occured while adding the geographical dispersion analysis “%s”', $description), 'danger'); |
373 | 374 | Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis “'.$description.'” could not be added. See error log.'); |
374 | 375 | } |
@@ -378,8 +379,7 @@ discard block |
||
378 | 379 | if(!$success) { |
379 | 380 | if($ga) { |
380 | 381 | $redirection_url = 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig@edit&ga_id='. $ga->getId() .'&ged=' . $WT_TREE->getNameUrl(); |
381 | - } |
|
382 | - else { |
|
382 | + } else { |
|
383 | 383 | $redirection_url = 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig@add&ged=' . $WT_TREE->getNameUrl(); |
384 | 384 | } |
385 | 385 | } |
@@ -437,7 +437,9 @@ discard block |
||
437 | 437 | $data->set('map_list', $map_list); |
438 | 438 | |
439 | 439 | $gen_details = array(0 => I18N::translate('All')); |
440 | - for($i = 1; $i <= 10 ; $i++) $gen_details[$i] = $i; |
|
440 | + for($i = 1; $i <= 10 ; $i++) { |
|
441 | + $gen_details[$i] = $i; |
|
442 | + } |
|
441 | 443 | $data->set('generation_details', $gen_details); |
442 | 444 | |
443 | 445 | ViewFactory::make('GeoAnalysisEdit', $this, $controller, $data)->render(); |
@@ -35,59 +35,59 @@ discard block |
||
35 | 35 | */ |
36 | 36 | class AdminConfigController extends MvcController |
37 | 37 | { |
38 | - /** |
|
39 | - * GeoAnalysis Provider |
|
40 | - * @var GeoAnalysisProvider $provider |
|
41 | - */ |
|
42 | - protected $provider; |
|
38 | + /** |
|
39 | + * GeoAnalysis Provider |
|
40 | + * @var GeoAnalysisProvider $provider |
|
41 | + */ |
|
42 | + protected $provider; |
|
43 | 43 | |
44 | - /** |
|
45 | - * Constructor for Admin Config controller |
|
46 | - * @param AbstractModule $module |
|
47 | - */ |
|
48 | - public function __construct(AbstractModule $module) { |
|
49 | - parent::__construct($module); |
|
44 | + /** |
|
45 | + * Constructor for Admin Config controller |
|
46 | + * @param AbstractModule $module |
|
47 | + */ |
|
48 | + public function __construct(AbstractModule $module) { |
|
49 | + parent::__construct($module); |
|
50 | 50 | |
51 | - $this->provider = $this->module->getProvider(); |
|
52 | - } |
|
51 | + $this->provider = $this->module->getProvider(); |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * Pages |
|
56 | - */ |
|
54 | + /** |
|
55 | + * Pages |
|
56 | + */ |
|
57 | 57 | |
58 | - /** |
|
59 | - * AdminConfig@index |
|
60 | - */ |
|
61 | - public function index() { |
|
62 | - global $WT_TREE; |
|
58 | + /** |
|
59 | + * AdminConfig@index |
|
60 | + */ |
|
61 | + public function index() { |
|
62 | + global $WT_TREE; |
|
63 | 63 | |
64 | - Theme::theme(new AdministrationTheme)->init($WT_TREE); |
|
65 | - $controller = new PageController(); |
|
66 | - $controller |
|
67 | - ->restrictAccess(Auth::isManager($WT_TREE)) |
|
68 | - ->setPageTitle($this->module->getTitle()); |
|
64 | + Theme::theme(new AdministrationTheme)->init($WT_TREE); |
|
65 | + $controller = new PageController(); |
|
66 | + $controller |
|
67 | + ->restrictAccess(Auth::isManager($WT_TREE)) |
|
68 | + ->setPageTitle($this->module->getTitle()); |
|
69 | 69 | |
70 | - $data = new ViewBag(); |
|
71 | - $data->set('title', $controller->getPageTitle()); |
|
72 | - $data->set('tree', $WT_TREE); |
|
70 | + $data = new ViewBag(); |
|
71 | + $data->set('title', $controller->getPageTitle()); |
|
72 | + $data->set('tree', $WT_TREE); |
|
73 | 73 | |
74 | - $data->set('root_url', 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig'); |
|
74 | + $data->set('root_url', 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig'); |
|
75 | 75 | |
76 | - $table_id = 'table-geoanalysis-' . Uuid::uuid4(); |
|
77 | - $data->set('table_id', $table_id); |
|
76 | + $table_id = 'table-geoanalysis-' . Uuid::uuid4(); |
|
77 | + $data->set('table_id', $table_id); |
|
78 | 78 | |
79 | - $other_trees = array(); |
|
80 | - foreach (Tree::getAll() as $tree) { |
|
81 | - if($tree->getTreeId() != $WT_TREE->getTreeId()) $other_trees[] = $tree; |
|
82 | - } |
|
83 | - $data->set('other_trees', $other_trees); |
|
79 | + $other_trees = array(); |
|
80 | + foreach (Tree::getAll() as $tree) { |
|
81 | + if($tree->getTreeId() != $WT_TREE->getTreeId()) $other_trees[] = $tree; |
|
82 | + } |
|
83 | + $data->set('other_trees', $other_trees); |
|
84 | 84 | |
85 | - $data->set('places_hierarchy', $this->provider->getPlacesHierarchy()); |
|
85 | + $data->set('places_hierarchy', $this->provider->getPlacesHierarchy()); |
|
86 | 86 | |
87 | - $controller |
|
88 | - ->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL) |
|
89 | - ->addExternalJavascript(WT_DATATABLES_BOOTSTRAP_JS_URL) |
|
90 | - ->addInlineJavascript(' |
|
87 | + $controller |
|
88 | + ->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL) |
|
89 | + ->addExternalJavascript(WT_DATATABLES_BOOTSTRAP_JS_URL) |
|
90 | + ->addInlineJavascript(' |
|
91 | 91 | //Datatable initialisation |
92 | 92 | jQuery.fn.dataTableExt.oSort["unicode-asc" ]=function(a,b) {return a.replace(/<[^<]*>/, "").localeCompare(b.replace(/<[^<]*>/, ""))}; |
93 | 93 | jQuery.fn.dataTableExt.oSort["unicode-desc" ]=function(a,b) {return b.replace(/<[^<]*>/, "").localeCompare(a.replace(/<[^<]*>/, ""))}; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | }); |
123 | 123 | |
124 | 124 | ') |
125 | - ->addInlineJavascript(' |
|
125 | + ->addInlineJavascript(' |
|
126 | 126 | function set_geoanalysis_status(ga_id, status, gedcom) { |
127 | 127 | jQuery.ajax({ |
128 | 128 | url: "module.php", |
@@ -166,55 +166,55 @@ discard block |
||
166 | 166 | '); |
167 | 167 | |
168 | 168 | |
169 | - ViewFactory::make('AdminConfig', $this, $controller, $data)->render(); |
|
170 | - } |
|
169 | + ViewFactory::make('AdminConfig', $this, $controller, $data)->render(); |
|
170 | + } |
|
171 | 171 | |
172 | - /** |
|
173 | - * AdminConfig@jsonGeoAnalysisList |
|
174 | - */ |
|
175 | - public function jsonGeoAnalysisList() { |
|
176 | - global $WT_TREE; |
|
172 | + /** |
|
173 | + * AdminConfig@jsonGeoAnalysisList |
|
174 | + */ |
|
175 | + public function jsonGeoAnalysisList() { |
|
176 | + global $WT_TREE; |
|
177 | 177 | |
178 | - $controller = new JsonController(); |
|
179 | - $controller |
|
180 | - ->restrictAccess(Auth::isManager($WT_TREE)); |
|
178 | + $controller = new JsonController(); |
|
179 | + $controller |
|
180 | + ->restrictAccess(Auth::isManager($WT_TREE)); |
|
181 | 181 | |
182 | - // Generate an AJAX/JSON response for datatables to load a block of rows |
|
183 | - $search = Filter::postArray('search'); |
|
184 | - if($search) $search = $search['value']; |
|
185 | - $start = Filter::postInteger('start'); |
|
186 | - $length = Filter::postInteger('length'); |
|
187 | - $order = Filter::postArray('order'); |
|
182 | + // Generate an AJAX/JSON response for datatables to load a block of rows |
|
183 | + $search = Filter::postArray('search'); |
|
184 | + if($search) $search = $search['value']; |
|
185 | + $start = Filter::postInteger('start'); |
|
186 | + $length = Filter::postInteger('length'); |
|
187 | + $order = Filter::postArray('order'); |
|
188 | 188 | |
189 | - foreach($order as $key => &$value) { |
|
190 | - switch($value['column']) { |
|
191 | - case 3: |
|
192 | - $value['column'] = 'majgd_descr'; |
|
193 | - break; |
|
194 | - case 5; |
|
195 | - $value['column'] = 'majgd_sublevel'; |
|
196 | - break; |
|
197 | - default: |
|
198 | - unset($order[$key]); |
|
199 | - } |
|
200 | - } |
|
189 | + foreach($order as $key => &$value) { |
|
190 | + switch($value['column']) { |
|
191 | + case 3: |
|
192 | + $value['column'] = 'majgd_descr'; |
|
193 | + break; |
|
194 | + case 5; |
|
195 | + $value['column'] = 'majgd_sublevel'; |
|
196 | + break; |
|
197 | + default: |
|
198 | + unset($order[$key]); |
|
199 | + } |
|
200 | + } |
|
201 | 201 | |
202 | - /** @var GeoAnalysisProvider $provider */ |
|
203 | - $provider = $this->module->getProvider(); |
|
202 | + /** @var GeoAnalysisProvider $provider */ |
|
203 | + $provider = $this->module->getProvider(); |
|
204 | 204 | |
205 | - $list = $provider->getFilteredGeoAnalysisList($search, $order, $start, $length); |
|
206 | - $recordsFiltered = count($list); |
|
207 | - $recordsTotal = $this->provider->getGeoAnalysisCount(); |
|
205 | + $list = $provider->getFilteredGeoAnalysisList($search, $order, $start, $length); |
|
206 | + $recordsFiltered = count($list); |
|
207 | + $recordsTotal = $this->provider->getGeoAnalysisCount(); |
|
208 | 208 | |
209 | - $data = array(); |
|
210 | - $place_hierarchy = $this->provider->getPlacesHierarchy(); |
|
211 | - foreach($list as $ga) { |
|
212 | - /** @var GeoAnalysis $ga */ |
|
209 | + $data = array(); |
|
210 | + $place_hierarchy = $this->provider->getPlacesHierarchy(); |
|
211 | + foreach($list as $ga) { |
|
212 | + /** @var GeoAnalysis $ga */ |
|
213 | 213 | |
214 | - $datum = array(); |
|
215 | - $options= $ga->getOptions(); |
|
214 | + $datum = array(); |
|
215 | + $options= $ga->getOptions(); |
|
216 | 216 | |
217 | - $datum[0] = ' |
|
217 | + $datum[0] = ' |
|
218 | 218 | <div class="btn-group"> |
219 | 219 | <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> |
220 | 220 | <i class="fa fa-pencil"></i><span class="caret"></span> |
@@ -238,108 +238,108 @@ discard block |
||
238 | 238 | </li> |
239 | 239 | </ul> |
240 | 240 | </div>'; |
241 | - $datum[1] = $ga->getId(); |
|
242 | - $datum[2] = $ga->isEnabled() ? |
|
241 | + $datum[1] = $ga->getId(); |
|
242 | + $datum[2] = $ga->isEnabled() ? |
|
243 | 243 | '<i class="fa fa-check"></i><span class="sr-only">'.I18N::translate('Enabled').'</span>' : |
244 | 244 | '<i class="fa fa-times"></i><span class="sr-only">'.I18N::translate('Disabled').'</span>'; |
245 | - $datum[3] = $ga->getTitle(); |
|
246 | - $analysis_level = $ga->getAnalysisLevel(); |
|
247 | - if($place_hierarchy['type'] == 'header') { |
|
248 | - $datum[4] = $place_hierarchy['hierarchy'][$analysis_level - 1]; |
|
249 | - } else { |
|
250 | - $datum[4] = $analysis_level . '(' . $place_hierarchy['hierarchy'][$analysis_level - 1] . ')'; |
|
251 | - } |
|
252 | - $datum[5] = $ga->getAnalysisLevel(); |
|
253 | - $datum[6] = '<i class="fa fa-times"></i><span class="sr-only">'.I18N::translate('None').'</span>'; |
|
254 | - $datum[7] = '<i class="fa fa-times"></i><span class="sr-only">'.I18N::translate('None').'</span>'; |
|
255 | - if($ga->hasMap()) { |
|
256 | - $datum[6] = $options->getMap()->getDescription(); |
|
257 | - $datum[7] = '<span data-toggle="tooltip" title="' . $options->getMap()->getTopLevelName() . '" />'; |
|
258 | - $top_level = $options->getMapLevel(); |
|
259 | - if($place_hierarchy['type'] == 'header') { |
|
260 | - $datum[7] .= $place_hierarchy['hierarchy'][$top_level - 1]; |
|
261 | - } else { |
|
262 | - $datum[7] .= $top_level . '(' . $place_hierarchy['hierarchy'][$top_level - 1] . ')'; |
|
263 | - } |
|
264 | - $datum[7] .= '</span>'; |
|
265 | - } |
|
266 | - $datum[8] = $options->isUsingFlags() ? |
|
245 | + $datum[3] = $ga->getTitle(); |
|
246 | + $analysis_level = $ga->getAnalysisLevel(); |
|
247 | + if($place_hierarchy['type'] == 'header') { |
|
248 | + $datum[4] = $place_hierarchy['hierarchy'][$analysis_level - 1]; |
|
249 | + } else { |
|
250 | + $datum[4] = $analysis_level . '(' . $place_hierarchy['hierarchy'][$analysis_level - 1] . ')'; |
|
251 | + } |
|
252 | + $datum[5] = $ga->getAnalysisLevel(); |
|
253 | + $datum[6] = '<i class="fa fa-times"></i><span class="sr-only">'.I18N::translate('None').'</span>'; |
|
254 | + $datum[7] = '<i class="fa fa-times"></i><span class="sr-only">'.I18N::translate('None').'</span>'; |
|
255 | + if($ga->hasMap()) { |
|
256 | + $datum[6] = $options->getMap()->getDescription(); |
|
257 | + $datum[7] = '<span data-toggle="tooltip" title="' . $options->getMap()->getTopLevelName() . '" />'; |
|
258 | + $top_level = $options->getMapLevel(); |
|
259 | + if($place_hierarchy['type'] == 'header') { |
|
260 | + $datum[7] .= $place_hierarchy['hierarchy'][$top_level - 1]; |
|
261 | + } else { |
|
262 | + $datum[7] .= $top_level . '(' . $place_hierarchy['hierarchy'][$top_level - 1] . ')'; |
|
263 | + } |
|
264 | + $datum[7] .= '</span>'; |
|
265 | + } |
|
266 | + $datum[8] = $options->isUsingFlags() ? |
|
267 | 267 | '<i class="fa fa-check"></i><span class="sr-only">'.I18N::translate('Yes').'</span>' : |
268 | 268 | '<i class="fa fa-times"></i><span class="sr-only">'.I18N::translate('No').'</span>'; |
269 | - $datum[9] = $options->getMaxDetailsInGen() > 0 ? $options->getMaxDetailsInGen() : I18N::translate('All'); |
|
269 | + $datum[9] = $options->getMaxDetailsInGen() > 0 ? $options->getMaxDetailsInGen() : I18N::translate('All'); |
|
270 | 270 | |
271 | - $data[] = $datum; |
|
272 | - } |
|
271 | + $data[] = $datum; |
|
272 | + } |
|
273 | 273 | |
274 | - $controller->pageHeader(); |
|
274 | + $controller->pageHeader(); |
|
275 | 275 | |
276 | - echo \Zend_Json::encode(array( |
|
277 | - 'draw' => Filter::getInteger('draw'), |
|
278 | - 'recordsTotal' => $recordsTotal, |
|
279 | - 'recordsFiltered' => $recordsFiltered, |
|
280 | - 'data' => $data |
|
281 | - )); |
|
276 | + echo \Zend_Json::encode(array( |
|
277 | + 'draw' => Filter::getInteger('draw'), |
|
278 | + 'recordsTotal' => $recordsTotal, |
|
279 | + 'recordsFiltered' => $recordsFiltered, |
|
280 | + 'data' => $data |
|
281 | + )); |
|
282 | 282 | |
283 | - } |
|
283 | + } |
|
284 | 284 | |
285 | - /** |
|
286 | - * AdminConfig@edit |
|
287 | - */ |
|
288 | - public function edit() { |
|
289 | - $ga_id = Filter::getInteger('ga_id'); |
|
290 | - $ga = $this->provider->getGeoAnalysis($ga_id, false); |
|
285 | + /** |
|
286 | + * AdminConfig@edit |
|
287 | + */ |
|
288 | + public function edit() { |
|
289 | + $ga_id = Filter::getInteger('ga_id'); |
|
290 | + $ga = $this->provider->getGeoAnalysis($ga_id, false); |
|
291 | 291 | |
292 | - $this->renderEdit($ga); |
|
293 | - } |
|
292 | + $this->renderEdit($ga); |
|
293 | + } |
|
294 | 294 | |
295 | - /** |
|
296 | - * AdminConfig@add |
|
297 | - */ |
|
298 | - public function add() { |
|
299 | - $this->renderEdit(null); |
|
300 | - } |
|
295 | + /** |
|
296 | + * AdminConfig@add |
|
297 | + */ |
|
298 | + public function add() { |
|
299 | + $this->renderEdit(null); |
|
300 | + } |
|
301 | 301 | |
302 | - /** |
|
303 | - * AdminConfig@save |
|
304 | - */ |
|
305 | - public function save() { |
|
306 | - global $WT_TREE; |
|
302 | + /** |
|
303 | + * AdminConfig@save |
|
304 | + */ |
|
305 | + public function save() { |
|
306 | + global $WT_TREE; |
|
307 | 307 | |
308 | - $tmp_contrl = new PageController(); |
|
309 | - $tmp_contrl->restrictAccess( |
|
310 | - Auth::isManager($WT_TREE) |
|
311 | - && Filter::checkCsrf() |
|
312 | - ); |
|
308 | + $tmp_contrl = new PageController(); |
|
309 | + $tmp_contrl->restrictAccess( |
|
310 | + Auth::isManager($WT_TREE) |
|
311 | + && Filter::checkCsrf() |
|
312 | + ); |
|
313 | 313 | |
314 | - $ga_id = Filter::postInteger('ga_id'); |
|
315 | - $description = Filter::post('description'); |
|
316 | - $analysislevel = Filter::postInteger('analysislevel'); |
|
317 | - $use_map = Filter::postBool('use_map'); |
|
318 | - if($use_map) { |
|
319 | - $map_file = base64_decode(Filter::post('map_file')); |
|
320 | - $map_top_level = Filter::postInteger('map_top_level'); |
|
321 | - } |
|
322 | - $use_flags = Filter::postBool('use_flags'); |
|
323 | - $gen_details = Filter::postInteger('gen_details'); |
|
314 | + $ga_id = Filter::postInteger('ga_id'); |
|
315 | + $description = Filter::post('description'); |
|
316 | + $analysislevel = Filter::postInteger('analysislevel'); |
|
317 | + $use_map = Filter::postBool('use_map'); |
|
318 | + if($use_map) { |
|
319 | + $map_file = base64_decode(Filter::post('map_file')); |
|
320 | + $map_top_level = Filter::postInteger('map_top_level'); |
|
321 | + } |
|
322 | + $use_flags = Filter::postBool('use_flags'); |
|
323 | + $gen_details = Filter::postInteger('gen_details'); |
|
324 | 324 | |
325 | - $success = false; |
|
326 | - if($ga_id) { |
|
327 | - $ga = $this->provider->getGeoAnalysis($ga_id, false); |
|
328 | - if($ga) { |
|
329 | - $ga->setTitle($description); |
|
330 | - $ga->setAnalysisLevel($analysislevel + 1); |
|
331 | - $options = $ga->getOptions(); |
|
332 | - if($options) { |
|
333 | - $options->setUsingFlags($use_flags); |
|
334 | - $options->setMaxDetailsInGen($gen_details); |
|
335 | - if($use_map) { |
|
336 | - $options->setMap(new OutlineMap($map_file)); |
|
337 | - $options->setMapLevel($map_top_level + 1); |
|
338 | - } |
|
339 | - else { |
|
340 | - $options->setMap(null); |
|
341 | - } |
|
342 | - } |
|
325 | + $success = false; |
|
326 | + if($ga_id) { |
|
327 | + $ga = $this->provider->getGeoAnalysis($ga_id, false); |
|
328 | + if($ga) { |
|
329 | + $ga->setTitle($description); |
|
330 | + $ga->setAnalysisLevel($analysislevel + 1); |
|
331 | + $options = $ga->getOptions(); |
|
332 | + if($options) { |
|
333 | + $options->setUsingFlags($use_flags); |
|
334 | + $options->setMaxDetailsInGen($gen_details); |
|
335 | + if($use_map) { |
|
336 | + $options->setMap(new OutlineMap($map_file)); |
|
337 | + $options->setMapLevel($map_top_level + 1); |
|
338 | + } |
|
339 | + else { |
|
340 | + $options->setMap(null); |
|
341 | + } |
|
342 | + } |
|
343 | 343 | |
344 | 344 | $res = $this->provider->updateGeoAnalysis($ga); |
345 | 345 | if($res) { |
@@ -352,8 +352,8 @@ discard block |
||
352 | 352 | FlashMessages::addMessage(I18N::translate('An error occured while updating the geographical dispersion analysis “%s”', $ga->getTitle()), 'danger'); |
353 | 353 | Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID “'. $ga->getId() .'” could not be updated. See error log.'); |
354 | 354 | } |
355 | - } |
|
356 | - } else { |
|
355 | + } |
|
356 | + } else { |
|
357 | 357 | $ga = $this->provider->createGeoAnalysis( |
358 | 358 | $description, |
359 | 359 | $analysislevel + 1, |
@@ -371,34 +371,34 @@ discard block |
||
371 | 371 | FlashMessages::addMessage(I18N::translate('An error occured while adding the geographical dispersion analysis “%s”', $description), 'danger'); |
372 | 372 | Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis “'.$description.'” could not be added. See error log.'); |
373 | 373 | } |
374 | - } |
|
374 | + } |
|
375 | 375 | |
376 | - $redirection_url = 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig&ged=' . $WT_TREE->getNameUrl(); |
|
377 | - if(!$success) { |
|
378 | - if($ga) { |
|
379 | - $redirection_url = 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig@edit&ga_id='. $ga->getId() .'&ged=' . $WT_TREE->getNameUrl(); |
|
380 | - } |
|
381 | - else { |
|
382 | - $redirection_url = 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig@add&ged=' . $WT_TREE->getNameUrl(); |
|
383 | - } |
|
384 | - } |
|
385 | - header('Location: ' . WT_BASE_URL . $redirection_url); |
|
376 | + $redirection_url = 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig&ged=' . $WT_TREE->getNameUrl(); |
|
377 | + if(!$success) { |
|
378 | + if($ga) { |
|
379 | + $redirection_url = 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig@edit&ga_id='. $ga->getId() .'&ged=' . $WT_TREE->getNameUrl(); |
|
380 | + } |
|
381 | + else { |
|
382 | + $redirection_url = 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig@add&ged=' . $WT_TREE->getNameUrl(); |
|
383 | + } |
|
384 | + } |
|
385 | + header('Location: ' . WT_BASE_URL . $redirection_url); |
|
386 | 386 | |
387 | - } |
|
387 | + } |
|
388 | 388 | |
389 | 389 | /** |
390 | 390 | * Renders the edit form, whether it is an edition of an existing GeoAnalysis, or the addition of a new one. |
391 | 391 | * |
392 | 392 | * @param (GeoAnalysis!null) $ga GeoAnalysis to edit |
393 | 393 | */ |
394 | - protected function renderEdit(GeoAnalysis $ga = null) { |
|
395 | - global $WT_TREE; |
|
394 | + protected function renderEdit(GeoAnalysis $ga = null) { |
|
395 | + global $WT_TREE; |
|
396 | 396 | |
397 | - Theme::theme(new AdministrationTheme)->init($WT_TREE); |
|
398 | - $controller = new PageController(); |
|
399 | - $controller |
|
400 | - ->restrictAccess(Auth::isManager($WT_TREE)) |
|
401 | - ->addInlineJavascript(' |
|
397 | + Theme::theme(new AdministrationTheme)->init($WT_TREE); |
|
398 | + $controller = new PageController(); |
|
399 | + $controller |
|
400 | + ->restrictAccess(Auth::isManager($WT_TREE)) |
|
401 | + ->addInlineJavascript(' |
|
402 | 402 | function toggleMapOptions() { |
403 | 403 | if($("input:radio[name=\'use_map\']:checked").val() == 1) { |
404 | 404 | $("#map_options").show(); |
@@ -412,34 +412,34 @@ discard block |
||
412 | 412 | toggleMapOptions(); |
413 | 413 | '); |
414 | 414 | |
415 | - $data = new ViewBag(); |
|
416 | - if($ga) { |
|
417 | - $controller->setPageTitle(I18N::translate('Edit the geographical dispersion analysis')); |
|
418 | - $data->set('geo_analysis', $ga); |
|
419 | - } else { |
|
420 | - $controller->setPageTitle(I18N::translate('Add a geographical dispersion analysis')); |
|
421 | - } |
|
415 | + $data = new ViewBag(); |
|
416 | + if($ga) { |
|
417 | + $controller->setPageTitle(I18N::translate('Edit the geographical dispersion analysis')); |
|
418 | + $data->set('geo_analysis', $ga); |
|
419 | + } else { |
|
420 | + $controller->setPageTitle(I18N::translate('Add a geographical dispersion analysis')); |
|
421 | + } |
|
422 | 422 | |
423 | - $data->set('title', $controller->getPageTitle()); |
|
424 | - $data->set('admin_config_url', 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig&ged=' . $WT_TREE->getNameUrl()); |
|
425 | - $data->set('module_title', $this->module->getTitle()); |
|
426 | - $data->set('save_url', 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig@save&ged=' . $WT_TREE->getNameUrl()); |
|
427 | - $data->set('places_hierarchy', $this->provider->getPlacesHierarchy()); |
|
423 | + $data->set('title', $controller->getPageTitle()); |
|
424 | + $data->set('admin_config_url', 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig&ged=' . $WT_TREE->getNameUrl()); |
|
425 | + $data->set('module_title', $this->module->getTitle()); |
|
426 | + $data->set('save_url', 'module.php?mod=' . $this->module->getName() . '&mod_action=AdminConfig@save&ged=' . $WT_TREE->getNameUrl()); |
|
427 | + $data->set('places_hierarchy', $this->provider->getPlacesHierarchy()); |
|
428 | 428 | |
429 | - $map_list = array_map( |
|
430 | - function(OutlineMap $map) { |
|
431 | - return $map->getDescription(); |
|
432 | - }, |
|
433 | - $this->provider->getOutlineMapsList() |
|
434 | - ); |
|
435 | - asort($map_list); |
|
436 | - $data->set('map_list', $map_list); |
|
429 | + $map_list = array_map( |
|
430 | + function(OutlineMap $map) { |
|
431 | + return $map->getDescription(); |
|
432 | + }, |
|
433 | + $this->provider->getOutlineMapsList() |
|
434 | + ); |
|
435 | + asort($map_list); |
|
436 | + $data->set('map_list', $map_list); |
|
437 | 437 | |
438 | - $gen_details = array(0 => I18N::translate('All')); |
|
439 | - for($i = 1; $i <= 10 ; $i++) $gen_details[$i] = $i; |
|
440 | - $data->set('generation_details', $gen_details); |
|
438 | + $gen_details = array(0 => I18N::translate('All')); |
|
439 | + for($i = 1; $i <= 10 ; $i++) $gen_details[$i] = $i; |
|
440 | + $data->set('generation_details', $gen_details); |
|
441 | 441 | |
442 | - ViewFactory::make('GeoAnalysisEdit', $this, $controller, $data)->render(); |
|
443 | - } |
|
442 | + ViewFactory::make('GeoAnalysisEdit', $this, $controller, $data)->render(); |
|
443 | + } |
|
444 | 444 | |
445 | 445 | } |
446 | 446 | \ No newline at end of file |
@@ -25,14 +25,14 @@ discard block |
||
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 |
||
155 | 155 | </form> |
156 | 156 | |
157 | 157 | <?php |
158 | - } |
|
158 | + } |
|
159 | 159 | |
160 | 160 | } |
161 | 161 | |
162 | 162 | \ No newline at end of file |
@@ -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”.'); ?> |
@@ -54,7 +54,10 @@ |
||
54 | 54 | <?php echo I18N::translate('Description'); ?> |
55 | 55 | </label> |
56 | 56 | <div class="col-sm-9"> |
57 | - <input class="form-control" type="text" id="description" name="description" required maxlength="70" <?php if(!$is_new) echo 'value="' . Filter::escapeHtml($ga->getTitle()) .'"'; ?> dir="auto"> |
|
57 | + <input class="form-control" type="text" id="description" name="description" required maxlength="70" <?php if(!$is_new) { |
|
58 | + echo 'value="' . Filter::escapeHtml($ga->getTitle()) .'"'; |
|
59 | +} |
|
60 | +?> dir="auto"> |
|
58 | 61 | <p class="small text-muted"> |
59 | 62 | <?php echo I18N::translate('Description to be given to the geographical dispersion analysis. It will be used as the page title for it.'); ?> |
60 | 63 | </p> |
@@ -24,16 +24,16 @@ discard block |
||
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 |
||
66 | 66 | </div> |
67 | 67 | |
68 | 68 | <?php |
69 | - } |
|
69 | + } |
|
70 | 70 | |
71 | 71 | } |
72 | 72 | |
73 | 73 | \ No newline at end of file |
@@ -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)); |
@@ -65,8 +65,7 @@ discard block |
||
65 | 65 | if(!is_null($max_details_gen) && $max_details_gen == 0){ |
66 | 66 | $html .= I18N::translate('<strong><em>Place</em> or <em>Flag</em> aa (bb %%)</strong>: The first number indicates the total number of ancestors born in this place, the percentage relates this count to the total number of found places. No percentage means it is less than 10%%.').'<br />'; |
67 | 67 | $html .= I18N::translate('If any, the darker area indicates the number of unknown places within the generation or places outside the analysed area, and its percentage compared to the number of ancestors. No percentage means it is less than 10%%.'); |
68 | - } |
|
69 | - else{ |
|
68 | + } else{ |
|
70 | 69 | $html .= I18N::translate('<strong><em>Place</em> [aa - bb %%]</strong>: The first number indicates the total number of ancestors born in this place, the percentage compares this count to the total number of found places.').'<br />'; |
71 | 70 | $html .= I18N::translate('Only the %d more frequent places for each generation are displayed.', $max_details_gen); |
72 | 71 | } |
@@ -97,16 +96,16 @@ discard block |
||
97 | 96 | $content = ''; |
98 | 97 | if(isset($dataplace['flag'])){ |
99 | 98 | $content .= '<td class="geodispersion_flag">'. FunctionsPrint::htmlPlaceIcon($dataplace['place'], $dataplace['flag']) .'</td><td>'; |
100 | - } |
|
101 | - else{ |
|
99 | + } else{ |
|
102 | 100 | $content .= '<td><span title="'.implode(I18N::$list_separator, array_reverse($levels)).'">'.$levels[$analysis_level-1].'</span><br/>'; |
103 | 101 | } |
104 | 102 | $count = $dataplace['count']; |
105 | 103 | $content .= I18N::number($count); |
106 | 104 | $perc = Functions::safeDivision($count, $sum_gen + $unknownother); |
107 | 105 | $perc2= Functions::safeDivision($count, $sum_gen); |
108 | - if($perc2>=0.1) |
|
109 | - $content.= '<br/><span class="small">('.I18N::percentage($perc2, 1).')</span>'; |
|
106 | + if($perc2>=0.1) { |
|
107 | + $content.= '<br/><span class="small">('.I18N::percentage($perc2, 1).')</span>'; |
|
108 | + } |
|
110 | 109 | $content .= '</td>'; |
111 | 110 | |
112 | 111 | $html .= ' |
@@ -126,7 +125,9 @@ discard block |
||
126 | 125 | if($unknownother>0){ |
127 | 126 | $perc= Functions::safeDivision($unknownother, $sum_gen + $unknownother); |
128 | 127 | $html .='<td class="geodispersion_unknownitem left" >'.I18N::number($unknownother); |
129 | - if($perc>=0.1) $html.= '<br/><span class="small">('.I18N::percentage($perc, 1).')</span>'; |
|
128 | + if($perc>=0.1) { |
|
129 | + $html.= '<br/><span class="small">('.I18N::percentage($perc, 1).')</span>'; |
|
130 | + } |
|
130 | 131 | $html .='</td>'; |
131 | 132 | } |
132 | 133 | |
@@ -152,8 +153,7 @@ discard block |
||
152 | 153 | if($placename != 'other'){ |
153 | 154 | $levels = array_map('trim',explode(',', $placename)); |
154 | 155 | $placename = '<span title="'.implode(I18N::$list_separator, array_reverse($levels)).'">'.$levels[$analysis_level-1].'</span>'; |
155 | - } |
|
156 | - else{ |
|
156 | + } else{ |
|
157 | 157 | $placename = I18N::translate('Other places'); |
158 | 158 | } |
159 | 159 | $tmp_places[] = I18N::translate('<strong>%s</strong> [%d - %s]', $placename, $count, I18N::percentage(Functions::safeDivision($count, $sum_gen + $other), 1)); |
@@ -24,89 +24,89 @@ discard block |
||
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 |
||
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 |
@@ -25,17 +25,17 @@ discard block |
||
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 |
||
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 |
@@ -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");'. |
@@ -86,7 +86,9 @@ |
||
86 | 86 | $html.= 'map.area'.$location['id'].' = paper.path("'.$location['coord'].'").attr(attr);'; |
87 | 87 | if(isset($location['transparency'])) { |
88 | 88 | $textToolTip = '<strong>'.$location['displayname'].'</strong><br/>'; |
89 | - if($this->data->get('use_flags') && $location['flag'] != '') $textToolTip .= '<span class="geodispersion_flag">'.FunctionsPrint::htmlPlaceIcon($location['place'], $location['flag']).'</span><br/>'; |
|
89 | + if($this->data->get('use_flags') && $location['flag'] != '') { |
|
90 | + $textToolTip .= '<span class="geodispersion_flag">'.FunctionsPrint::htmlPlaceIcon($location['place'], $location['flag']).'</span><br/>'; |
|
91 | + } |
|
90 | 92 | $textToolTip .= I18N::translate('%d individuals', $location['count']).'<br/>'.I18N::percentage(Functions::safeDivision($location['count'], $nb_found - $nb_other), 1); |
91 | 93 | $html.= 'addTip(map.area'.$location['id'].'.node, "'.Filter::escapeJs($textToolTip).'");'; |
92 | 94 | $html.= 'map.area'.$location['id'].'.attr({"fill" : "'. $canvas->max_color .'", "fill-opacity" : '.$location['transparency'].' });'; |
@@ -23,14 +23,14 @@ discard block |
||
23 | 23 | * {@inhericDoc} |
24 | 24 | * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() |
25 | 25 | */ |
26 | - protected function renderContent() { |
|
26 | + protected function renderContent() { |
|
27 | 27 | |
28 | - /** @var Tree $tree */ |
|
29 | - $tree = $this->data->get('tree'); |
|
30 | - $root_url = $this->data->get('root_url'); |
|
31 | - $other_trees = $this->data->get('other_trees'); |
|
32 | - $table_id = $this->data->get('table_id'); |
|
33 | - ?> |
|
28 | + /** @var Tree $tree */ |
|
29 | + $tree = $this->data->get('tree'); |
|
30 | + $root_url = $this->data->get('root_url'); |
|
31 | + $other_trees = $this->data->get('other_trees'); |
|
32 | + $table_id = $this->data->get('table_id'); |
|
33 | + ?> |
|
34 | 34 | <ol class="breadcrumb small"> |
35 | 35 | <li><a href="admin.php"><?php echo I18N::translate('Control panel'); ?></a></li> |
36 | 36 | <li><a href="admin_modules.php"><?php echo I18N::translate('Module administration'); ?></a></li> |
@@ -63,23 +63,23 @@ discard block |
||
63 | 63 | <p> |
64 | 64 | <?php $places_hierarchy = $this->data->get('places_hierarchy'); |
65 | 65 | if($places_hierarchy) { |
66 | - switch ($places_hierarchy['type']) { |
|
67 | - case 'header': |
|
68 | - echo I18N::translate('According to the GEDCOM header, the places within your file follows the structure: '); |
|
69 | - break; |
|
70 | - case 'data': |
|
71 | - echo I18N::translate('Your GEDCOM header does not contain any indication of place structure.'). |
|
72 | - '<br/>'. |
|
73 | - I18N::translate('Here is an example of your place data: '); |
|
74 | - break; |
|
75 | - default: |
|
76 | - break; |
|
77 | - } |
|
78 | - $str_hierarchy = array(); |
|
79 | - foreach($places_hierarchy['hierarchy'] as $key => $level) { |
|
80 | - $str_hierarchy[] = I18N::translate('(%d) %s', $key + 1, $level); |
|
81 | - } |
|
82 | - echo '<strong>' . implode(I18N::$list_separator, $str_hierarchy) . '</strong>'; |
|
66 | + switch ($places_hierarchy['type']) { |
|
67 | + case 'header': |
|
68 | + echo I18N::translate('According to the GEDCOM header, the places within your file follows the structure: '); |
|
69 | + break; |
|
70 | + case 'data': |
|
71 | + echo I18N::translate('Your GEDCOM header does not contain any indication of place structure.'). |
|
72 | + '<br/>'. |
|
73 | + I18N::translate('Here is an example of your place data: '); |
|
74 | + break; |
|
75 | + default: |
|
76 | + break; |
|
77 | + } |
|
78 | + $str_hierarchy = array(); |
|
79 | + foreach($places_hierarchy['hierarchy'] as $key => $level) { |
|
80 | + $str_hierarchy[] = I18N::translate('(%d) %s', $key + 1, $level); |
|
81 | + } |
|
82 | + echo '<strong>' . implode(I18N::$list_separator, $str_hierarchy) . '</strong>'; |
|
83 | 83 | } |
84 | 84 | ?> |
85 | 85 | </p> |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | </a> |
110 | 110 | |
111 | 111 | <?php |
112 | - } |
|
112 | + } |
|
113 | 113 | |
114 | 114 | } |
115 | 115 | |
116 | 116 | \ No newline at end of file |
@@ -41,16 +41,16 @@ discard block |
||
41 | 41 | |
42 | 42 | <h2> |
43 | 43 | <?php echo $tree->getTitleHtml(); ?> |
44 | - <?php if(count($other_trees) > 0) {?> |
|
44 | + <?php if (count($other_trees) > 0) {?> |
|
45 | 45 | <div class="btn-group"> |
46 | 46 | <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> |
47 | 47 | <?php echo I18N::translate('Change tree'); ?> |
48 | 48 | <span class="caret"></span> |
49 | 49 | </button> |
50 | - <?php foreach($other_trees as $other_tree) { ?> |
|
50 | + <?php foreach ($other_trees as $other_tree) { ?> |
|
51 | 51 | <ul class="dropdown-menu" role="menu"> |
52 | 52 | <li> |
53 | - <a href="<?php echo $root_url . '&ged=' . $other_tree->getNameUrl(); ?>"> |
|
53 | + <a href="<?php echo $root_url.'&ged='.$other_tree->getNameUrl(); ?>"> |
|
54 | 54 | <i class="fa fa-fw fa-tree"></i> <?php echo $other_tree->getTitleHtml(); ?> |
55 | 55 | </a> |
56 | 56 | </li> |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | <p> |
64 | 64 | <?php $places_hierarchy = $this->data->get('places_hierarchy'); |
65 | - if($places_hierarchy) { |
|
65 | + if ($places_hierarchy) { |
|
66 | 66 | switch ($places_hierarchy['type']) { |
67 | 67 | case 'header': |
68 | 68 | echo I18N::translate('According to the GEDCOM header, the places within your file follows the structure: '); |
@@ -76,10 +76,10 @@ discard block |
||
76 | 76 | break; |
77 | 77 | } |
78 | 78 | $str_hierarchy = array(); |
79 | - foreach($places_hierarchy['hierarchy'] as $key => $level) { |
|
79 | + foreach ($places_hierarchy['hierarchy'] as $key => $level) { |
|
80 | 80 | $str_hierarchy[] = I18N::translate('(%d) %s', $key + 1, $level); |
81 | 81 | } |
82 | - echo '<strong>' . implode(I18N::$list_separator, $str_hierarchy) . '</strong>'; |
|
82 | + echo '<strong>'.implode(I18N::$list_separator, $str_hierarchy).'</strong>'; |
|
83 | 83 | } |
84 | 84 | ?> |
85 | 85 | </p> |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | </tbody> |
104 | 104 | </table> |
105 | 105 | |
106 | - <a type="button" class="btn btn-primary" href="<?php echo $root_url . '@add&ged=' . $tree->getNameUrl(); ?>" title="<?php echo I18N::translate('Add'); ?>"> |
|
106 | + <a type="button" class="btn btn-primary" href="<?php echo $root_url.'@add&ged='.$tree->getNameUrl(); ?>" title="<?php echo I18N::translate('Add'); ?>"> |
|
107 | 107 | <i class="fa fa-plus"></i> |
108 | 108 | <?php echo I18N::translate('Add'); ?> |
109 | 109 | </a> |
@@ -23,15 +23,15 @@ discard block |
||
23 | 23 | * {@inhericDoc} |
24 | 24 | * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() |
25 | 25 | */ |
26 | - protected function renderContent() { |
|
27 | - ?> |
|
26 | + protected function renderContent() { |
|
27 | + ?> |
|
28 | 28 | <div id="maj-geodisp-list-page" class="center"> |
29 | 29 | <h2><?php echo $this->data->get('title'); ?></h2> |
30 | 30 | |
31 | 31 | <?php |
32 | 32 | if($this->data->get('has_list', false)) { |
33 | - $galist = $this->data->get('geoanalysislist'); |
|
34 | - ?> |
|
33 | + $galist = $this->data->get('geoanalysislist'); |
|
34 | + ?> |
|
35 | 35 | |
36 | 36 | <p class="center"><?php echo I18N::translate('Choose a geographical dispersion analysis:'); ?><p> |
37 | 37 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | </div> |
59 | 59 | |
60 | 60 | <?php |
61 | - } |
|
61 | + } |
|
62 | 62 | |
63 | 63 | } |
64 | 64 | |
65 | 65 | \ No newline at end of file |
@@ -29,17 +29,17 @@ |
||
29 | 29 | <h2><?php echo $this->data->get('title'); ?></h2> |
30 | 30 | |
31 | 31 | <?php |
32 | - if($this->data->get('has_list', false)) { |
|
32 | + if ($this->data->get('has_list', false)) { |
|
33 | 33 | $galist = $this->data->get('geoanalysislist'); |
34 | 34 | ?> |
35 | 35 | |
36 | 36 | <p class="center"><?php echo I18N::translate('Choose a geographical dispersion analysis:'); ?><p> |
37 | 37 | |
38 | 38 | <div class="maj-table"> |
39 | - <?php foreach($galist as $ga) {?> |
|
39 | + <?php foreach ($galist as $ga) {?> |
|
40 | 40 | <div class="maj-row"> |
41 | 41 | <div class="label"> |
42 | - <?php if($ga->hasMap()) { ?> |
|
42 | + <?php if ($ga->hasMap()) { ?> |
|
43 | 43 | <i class="icon-maj-map" title="<?php echo I18N::translate('Map'); ?>"></i> |
44 | 44 | <?php } else { ?> |
45 | 45 | <i class="icon-maj-table" title="<?php echo I18N::translate('Table'); ?>"></i> |