Completed
Push — feature/code-analysis ( ddc57d...5519b1 )
by Jonathan
09:07 queued 04:56
created
src/Webtrees/Hook/HookInterfaces/CustomSimpleTagManagerInterface.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
  /**
3
- * webtrees-lib: MyArtJaub library for webtrees
4
- *
5
- * @package MyArtJaub\Webtrees
6
- * @subpackage Hook
7
- * @author Jonathan Jaubart <[email protected]>
8
- * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
- */
3
+  * webtrees-lib: MyArtJaub library for webtrees
4
+  *
5
+  * @package MyArtJaub\Webtrees
6
+  * @subpackage Hook
7
+  * @author Jonathan Jaubart <[email protected]>
8
+  * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
+  * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
+  */
11 11
 namespace MyArtJaub\Webtrees\Hook\HookInterfaces;
12 12
 
13 13
 /**
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
 interface CustomSimpleTagManager {
19 19
 
20 20
 
21
-    /**
22
-     * Returns the list of expected tags, classified by type of records.
23
-     *
24
-     * @return array List of expected tags
25
-     */
26
-    public function hGetExpectedTags();
21
+	/**
22
+	 * Returns the list of expected tags, classified by type of records.
23
+	 *
24
+	 * @return array List of expected tags
25
+	 */
26
+	public function hGetExpectedTags();
27 27
     
28 28
 	/**
29 29
 	 * Return the HTML code to be display for this tag.
Please login to merge, or discard this patch.
src/Webtrees/Hook/HookInterfaces/RecordNameTextExtenderInterface.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
  /**
3
- * webtrees-lib: MyArtJaub library for webtrees
4
- *
5
- * @package MyArtJaub\Webtrees
6
- * @subpackage Hook
7
- * @author Jonathan Jaubart <[email protected]>
8
- * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
- */
3
+  * webtrees-lib: MyArtJaub library for webtrees
4
+  *
5
+  * @package MyArtJaub\Webtrees
6
+  * @subpackage Hook
7
+  * @author Jonathan Jaubart <[email protected]>
8
+  * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
+  * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
+  */
11 11
 namespace MyArtJaub\Webtrees\Hook;
12 12
 
13 13
 use \Fisharebest\Webtrees as fw;
Please login to merge, or discard this patch.
src/Webtrees/Hook/HookInterfaces/PageFooterExtenderInterface.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
  /**
3
- * webtrees-lib: MyArtJaub library for webtrees
4
- *
5
- * @package MyArtJaub\Webtrees
6
- * @subpackage Hook
7
- * @author Jonathan Jaubart <[email protected]>
8
- * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
- */
3
+  * webtrees-lib: MyArtJaub library for webtrees
4
+  *
5
+  * @package MyArtJaub\Webtrees
6
+  * @subpackage Hook
7
+  * @author Jonathan Jaubart <[email protected]>
8
+  * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
+  * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
+  */
11 11
 namespace MyArtJaub\Webtrees\Hook\HookInterfaces;
12 12
 
13 13
 /**
@@ -15,12 +15,12 @@  discard block
 block discarded – undo
15 15
  */
16 16
 interface PageFooterExtender {
17 17
 		
18
-    /**
19
-     * Get HTML code for extending the footer of a page.
20
-     * 
21
-     * @return string HTML code extension
22
-     */
23
-    public function hPrintFooter();
18
+	/**
19
+	 * Get HTML code for extending the footer of a page.
20
+	 * 
21
+	 * @return string HTML code extension
22
+	 */
23
+	public function hPrintFooter();
24 24
 	
25 25
 }
26 26
 
Please login to merge, or discard this patch.
src/Webtrees/Hook/HookInterfaces/FactSourceTextExtenderInterface.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
  /**
3
- * webtrees-lib: MyArtJaub library for webtrees
4
- *
5
- * @package MyArtJaub\Webtrees
6
- * @subpackage Hook
7
- * @author Jonathan Jaubart <[email protected]>
8
- * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
- */
3
+  * webtrees-lib: MyArtJaub library for webtrees
4
+  *
5
+  * @package MyArtJaub\Webtrees
6
+  * @subpackage Hook
7
+  * @author Jonathan Jaubart <[email protected]>
8
+  * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
+  * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
+  */
11 11
 namespace MyArtJaub\Webtrees\Hook;
12 12
 
13 13
 use \Fisharebest\Webtrees as fw;
Please login to merge, or discard this patch.
src/Webtrees/Hook/HookInterfaces/PageHeaderExtenderInterface.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
  /**
3
- * webtrees-lib: MyArtJaub library for webtrees
4
- *
5
- * @package MyArtJaub\Webtrees
6
- * @subpackage Hook
7
- * @author Jonathan Jaubart <[email protected]>
8
- * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
- */
3
+  * webtrees-lib: MyArtJaub library for webtrees
4
+  *
5
+  * @package MyArtJaub\Webtrees
6
+  * @subpackage Hook
7
+  * @author Jonathan Jaubart <[email protected]>
8
+  * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
+  * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
+  */
11 11
 namespace MyArtJaub\Webtrees\Hook\HookInterfaces;
12 12
 
13 13
 /**
@@ -15,12 +15,12 @@  discard block
 block discarded – undo
15 15
  */
16 16
 interface PageHeaderExtender {
17 17
 		
18
-    /**
19
-     * Get HTML code for extending the header of a page.
20
-     * 
21
-     * @return string HTML code extension
22
-     */
23
-    public function hPrintHeader();
18
+	/**
19
+	 * Get HTML code for extending the header of a page.
20
+	 * 
21
+	 * @return string HTML code extension
22
+	 */
23
+	public function hPrintHeader();
24 24
 	
25 25
 }
26 26
 
Please login to merge, or discard this patch.
src/Webtrees/Hook/HookInterfaces/IndividualHeaderExtenderInterface.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
  /**
3
- * webtrees-lib: MyArtJaub library for webtrees
4
- *
5
- * @package MyArtJaub\Webtrees
6
- * @subpackage Hook
7
- * @author Jonathan Jaubart <[email protected]>
8
- * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
- */
3
+  * webtrees-lib: MyArtJaub library for webtrees
4
+  *
5
+  * @package MyArtJaub\Webtrees
6
+  * @subpackage Hook
7
+  * @author Jonathan Jaubart <[email protected]>
8
+  * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
+  * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
+  */
11 11
 namespace MyArtJaub\Webtrees\Hook;
12 12
 
13 13
 use \Fisharebest\Webtrees as fw;
Please login to merge, or discard this patch.
src/Webtrees/Functions/FunctionsPrint.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 * @return string HTML code of the inserted flag
80 80
 	 */
81 81
 	public static function htmlPlaceIcon(\Fisharebest\Webtrees\Place $place, $icon_path , $size = 50) {
82
-	    return '<img class="flag_gm_h'. $size . '" src="' . $icon_path . '" title="' . $place->getGedcomName() . '" alt="' . $place->getGedcomName() . '" />';
82
+		return '<img class="flag_gm_h'. $size . '" src="' . $icon_path . '" title="' . $place->getGedcomName() . '" alt="' . $place->getGedcomName() . '" />';
83 83
 	}
84 84
 	
85 85
 	/**
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 	 * @return boolean
356 356
 	 */
357 357
 	public static function isDateWithinChartsRange(Date $date) {
358
-	    return $date->gregorianYear() >= 1550 && $date->gregorianYear() < 2030;
358
+		return $date->gregorianYear() >= 1550 && $date->gregorianYear() < 2030;
359 359
 	}
360 360
 
361 361
 }
Please login to merge, or discard this patch.
src/Webtrees/GedcomRecord.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
 		if(!$this->gedcomrecord->canShow($access_level)) return false;
93 93
 		if($access_level === null )
94
-		    $access_level = \Fisharebest\Webtrees\Auth::accessLevel($this->gedcomrecord->getTree());
94
+			$access_level = \Fisharebest\Webtrees\Auth::accessLevel($this->gedcomrecord->getTree());
95 95
 
96 96
 		if (isset($global_facts['SOUR'])) {
97 97
 			return $global_facts['SOUR'] >= $access_level;
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	 * @return int Level of sources
130 130
 	 */
131 131
 	public function isFactSourced($eventslist){
132
-	    if(empty($eventslist)) return 0;
132
+		if(empty($eventslist)) return 0;
133 133
 		$isSourced=0;
134 134
 		$facts = $this->gedcomrecord->getFacts($eventslist);
135 135
 		foreach($facts as $fact){
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/GeoAnalysisController.php 1 patch
Indentation   +231 added lines, -231 removed lines patch added patch discarded remove patch
@@ -35,47 +35,47 @@  discard block
 block discarded – undo
35 35
  */
36 36
 class GeoAnalysisController 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 GeoAnalysis controller
46
-     * @param AbstractModule $module
47
-     */
48
-    public function __construct(AbstractModule $module) {
49
-        parent::__construct($module);
44
+	/**
45
+	 * Constructor for GeoAnalysis 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
-     * GeoAnalysis@index
60
-     */
61
-    public function index() {
58
+	/**
59
+	 * GeoAnalysis@index
60
+	 */
61
+	public function index() {
62 62
         
63
-        $controller = new PageController();
64
-        $controller->setPageTitle(I18N::translate('Sosa Geographical dispersion'));
63
+		$controller = new PageController();
64
+		$controller->setPageTitle(I18N::translate('Sosa Geographical dispersion'));
65 65
         
66
-        $data = new ViewBag();
67
-        $data->set('title', $controller->getPageTitle());
68
-        $data->set('has_analysis', false);
66
+		$data = new ViewBag();
67
+		$data->set('title', $controller->getPageTitle());
68
+		$data->set('has_analysis', false);
69 69
         
70
-        $ga_id = Filter::getInteger('ga_id');        
70
+		$ga_id = Filter::getInteger('ga_id');        
71 71
         
72
-        if($ga_id && $ga = $this->provider->getGeoAnalysis($ga_id)) {
73
-            $data->set('has_analysis', true);
74
-            $data->set('geoanalysis', $ga);
72
+		if($ga_id && $ga = $this->provider->getGeoAnalysis($ga_id)) {
73
+			$data->set('has_analysis', true);
74
+			$data->set('geoanalysis', $ga);
75 75
             
76
-            $controller
77
-                ->addExternalJavascript(Constants::WT_RAPHAEL_JS_URL())
78
-                ->addInlineJavascript('
76
+			$controller
77
+				->addExternalJavascript(Constants::WT_RAPHAEL_JS_URL())
78
+				->addInlineJavascript('
79 79
                 jQuery("#geodispersion-tabs").tabs();
80 80
                 jQuery("#geodispersion-tabs").css("visibility", "visible");
81 81
                 
@@ -96,133 +96,133 @@  discard block
 block discarded – undo
96 96
 					"json"
97 97
 				);
98 98
             ');
99
-        }
99
+		}
100 100
         
101
-        ViewFactory::make('GeoAnalysis', $this, $controller, $data)->render();
102
-    }
101
+		ViewFactory::make('GeoAnalysis', $this, $controller, $data)->render();
102
+	}
103 103
     
104
-    /**
105
-     * GeoAnalysis@listAll
106
-     */
107
-    public function listAll() {
104
+	/**
105
+	 * GeoAnalysis@listAll
106
+	 */
107
+	public function listAll() {
108 108
         
109
-        $controller = new PageController();
110
-        $controller->setPageTitle(I18N::translate('Sosa Geographical dispersion'));
109
+		$controller = new PageController();
110
+		$controller->setPageTitle(I18N::translate('Sosa Geographical dispersion'));
111 111
         
112
-        $data = new ViewBag();
113
-        $data->set('title', $controller->getPageTitle());
114
-        $data->set('has_list', false);
112
+		$data = new ViewBag();
113
+		$data->set('title', $controller->getPageTitle());
114
+		$data->set('has_list', false);
115 115
         
116
-        $ga_list = $this->provider->getGeoAnalysisList();
117
-        if(count($ga_list) > 0 ) {
118
-             $data->set('has_list', true);
119
-             $data->set('geoanalysislist', $ga_list);
120
-        }
116
+		$ga_list = $this->provider->getGeoAnalysisList();
117
+		if(count($ga_list) > 0 ) {
118
+			 $data->set('has_list', true);
119
+			 $data->set('geoanalysislist', $ga_list);
120
+		}
121 121
         
122
-        ViewFactory::make('GeoAnalysisList', $this, $controller, $data)->render();        
123
-    }
122
+		ViewFactory::make('GeoAnalysisList', $this, $controller, $data)->render();        
123
+	}
124 124
     	
125 125
 	/**
126 126
 	 * GeoAnalysis@setStatus
127 127
 	 */
128
-    public function setStatus() {  
129
-        global $WT_TREE;
128
+	public function setStatus() {  
129
+		global $WT_TREE;
130 130
         
131
-        $controller = new JsonController();
131
+		$controller = new JsonController();
132 132
         
133
-        $ga_id = Filter::getInteger('ga_id');
134
-        $ga = $this->provider->getGeoAnalysis($ga_id, false);
133
+		$ga_id = Filter::getInteger('ga_id');
134
+		$ga = $this->provider->getGeoAnalysis($ga_id, false);
135 135
         
136
-        $controller->restrictAccess(
137
-            true // Filter::checkCsrf()   -- Cannot use CSRF on a GET request (modules can only work with GET requests)
138
-            &&  Auth::isManager($WT_TREE) 
139
-            && $ga !== null
140
-        );
136
+		$controller->restrictAccess(
137
+			true // Filter::checkCsrf()   -- Cannot use CSRF on a GET request (modules can only work with GET requests)
138
+			&&  Auth::isManager($WT_TREE) 
139
+			&& $ga !== null
140
+		);
141 141
         
142
-        $status = Filter::getBool('status');
143
-        $res = array('geoanalysis' => $ga->getId() , 'error' => null);
144
-        try{
145
-            $this->provider->setGeoAnalysisStatus($ga, $status);
146
-            $res['status'] = $status;
142
+		$status = Filter::getBool('status');
143
+		$res = array('geoanalysis' => $ga->getId() , 'error' => null);
144
+		try{
145
+			$this->provider->setGeoAnalysisStatus($ga, $status);
146
+			$res['status'] = $status;
147 147
 			Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID "'.$ga->getId().'" has been '. ($status ? 'enabled' : 'disabled') .'.');
148
-        }
149
-        catch (\Exception $ex) {
150
-            $res['error'] = $ex->getMessage();
148
+		}
149
+		catch (\Exception $ex) {
150
+			$res['error'] = $ex->getMessage();
151 151
 			Log::addErrorLog('Module '.$this->module->getName().' : Geo Analysis ID "'.$ga->getId().'" could not be ' . ($status ? 'enabled' : 'disabled') .'. Error: '. $ex->getMessage());
152
-        }
152
+		}
153 153
         
154
-        $controller->pageHeader();
155
-        if($res['error']) http_response_code(500);
154
+		$controller->pageHeader();
155
+		if($res['error']) http_response_code(500);
156 156
         
157
-        echo \Zend_Json::encode($res);
158
-    }
157
+		echo \Zend_Json::encode($res);
158
+	}
159 159
     
160 160
 	/**
161
-     * GeoAnalysis@delete
162
-     */
163
-    public function delete() {
164
-        global $WT_TREE;
161
+	 * GeoAnalysis@delete
162
+	 */
163
+	public function delete() {
164
+		global $WT_TREE;
165 165
     
166
-        $controller = new JsonController();
166
+		$controller = new JsonController();
167 167
     
168
-        $ga_id = Filter::getInteger('ga_id');
169
-        $ga = $this->provider->getGeoAnalysis($ga_id, false);
168
+		$ga_id = Filter::getInteger('ga_id');
169
+		$ga = $this->provider->getGeoAnalysis($ga_id, false);
170 170
     
171
-        $controller->restrictAccess(
172
-            true // Filter::checkCsrf()   -- Cannot use CSRF on a GET request (modules can only work with GET requests)
173
-            &&  Auth::isManager($WT_TREE)
174
-            && $ga
175
-            );
171
+		$controller->restrictAccess(
172
+			true // Filter::checkCsrf()   -- Cannot use CSRF on a GET request (modules can only work with GET requests)
173
+			&&  Auth::isManager($WT_TREE)
174
+			&& $ga
175
+			);
176 176
             
177
-        $res = array('geoanalysis' => $ga->getId() , 'error' => null);
178
-        try{
179
-            $this->provider->deleteGeoAnalysis($ga);
177
+		$res = array('geoanalysis' => $ga->getId() , 'error' => null);
178
+		try{
179
+			$this->provider->deleteGeoAnalysis($ga);
180 180
 			Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID "'.$ga->getId().'" has been deleted.');
181
-        }
182
-        catch (\Exception $ex) {
183
-            $res['error'] = $ex->getMessage();
181
+		}
182
+		catch (\Exception $ex) {
183
+			$res['error'] = $ex->getMessage();
184 184
 			Log::addErrorLog('Module '.$this->module->getName().' : Geo Analysis ID "'.$ga->getId().'" could not be deleted. Error: '. $ex->getMessage());
185
-        }
185
+		}
186 186
     
187
-        $controller->pageHeader();
188
-        if($res['error']) http_response_code(500);
187
+		$controller->pageHeader();
188
+		if($res['error']) http_response_code(500);
189 189
     
190
-        echo \Zend_Json::encode($res);
191
-    }
190
+		echo \Zend_Json::encode($res);
191
+	}
192 192
         	
193
-    /**
194
-     * GeoAnalysis@dataTabs
195
-     */
196
-    public function dataTabs() {
197
-        global $WT_TREE;
193
+	/**
194
+	 * GeoAnalysis@dataTabs
195
+	 */
196
+	public function dataTabs() {
197
+		global $WT_TREE;
198 198
         
199
-        $controller = new JsonController();
199
+		$controller = new JsonController();
200 200
         
201
-        $ga_id = Filter::getInteger('ga_id');
202
-        $ga = $this->provider->getGeoAnalysis($ga_id);
203
-        $sosa_provider = new SosaProvider($WT_TREE, Auth::user());
201
+		$ga_id = Filter::getInteger('ga_id');
202
+		$ga = $this->provider->getGeoAnalysis($ga_id);
203
+		$sosa_provider = new SosaProvider($WT_TREE, Auth::user());
204 204
         
205
-        $controller
206
-            ->restrictAccess($ga && $sosa_provider->isSetup())
207
-            ->pageHeader();
205
+		$controller
206
+			->restrictAccess($ga && $sosa_provider->isSetup())
207
+			->pageHeader();
208 208
         
209
-        $jsonArray = array();
209
+		$jsonArray = array();
210 210
         
211
-        list($placesDispGeneral, $placesDispGenerations) = $ga->getAnalysisResults($sosa_provider->getAllSosaWithGenerations());
211
+		list($placesDispGeneral, $placesDispGenerations) = $ga->getAnalysisResults($sosa_provider->getAllSosaWithGenerations());
212 212
         
213
-        $flags = array();
214
-        if($placesDispGeneral && $ga->getOptions() && $ga->getOptions()->isUsingFlags()) {
215
-            $mapProvider = new GoogleMapsProvider();            
216
-            foreach($placesDispGeneral['places'] as $place => $count) {
217
-                $flags[$place] = $mapProvider->getPlaceIcon(new Place($place, $WT_TREE));
218
-            }
219
-        }
213
+		$flags = array();
214
+		if($placesDispGeneral && $ga->getOptions() && $ga->getOptions()->isUsingFlags()) {
215
+			$mapProvider = new GoogleMapsProvider();            
216
+			foreach($placesDispGeneral['places'] as $place => $count) {
217
+				$flags[$place] = $mapProvider->getPlaceIcon(new Place($place, $WT_TREE));
218
+			}
219
+		}
220 220
         
221
-        $jsonArray['generaltab'] = $this->htmlPlacesAnalysisGeneralTab($ga, $placesDispGeneral, $flags);
222
-        $jsonArray['generationstab'] = $this->htmlPlacesAnalysisGenerationsTab($ga, $placesDispGenerations, $flags);
221
+		$jsonArray['generaltab'] = $this->htmlPlacesAnalysisGeneralTab($ga, $placesDispGeneral, $flags);
222
+		$jsonArray['generationstab'] = $this->htmlPlacesAnalysisGenerationsTab($ga, $placesDispGenerations, $flags);
223 223
         
224
-        echo \Zend_Json::encode($jsonArray);
225
-    }
224
+		echo \Zend_Json::encode($jsonArray);
225
+	}
226 226
     
227 227
 	/**
228 228
 	 * Returns HTML code for the GeoAnalysis general tab (can be either a map or a table).
@@ -232,70 +232,70 @@  discard block
 block discarded – undo
232 232
 	 * @param (null|array) $flags Array of flags
233 233
 	 * @return string HTML code for the general tab
234 234
 	 */
235
-    protected function htmlPlacesAnalysisGeneralTab(GeoAnalysis $ga, $placesGeneralResults, $flags= null) {
236
-        global $WT_TREE;
235
+	protected function htmlPlacesAnalysisGeneralTab(GeoAnalysis $ga, $placesGeneralResults, $flags= null) {
236
+		global $WT_TREE;
237 237
         
238
-        if(!empty($placesGeneralResults)){
239
-            $data = new ViewBag();
238
+		if(!empty($placesGeneralResults)){
239
+			$data = new ViewBag();
240 240
             
241
-            $nb_found = $placesGeneralResults['knownsum'];
242
-            $nb_other = 0;
243
-            if(isset($placesGeneralResults['other'])) $nb_other =$placesGeneralResults['other'];
244
-            $nb_unknown = $placesGeneralResults['unknown'];
241
+			$nb_found = $placesGeneralResults['knownsum'];
242
+			$nb_other = 0;
243
+			if(isset($placesGeneralResults['other'])) $nb_other =$placesGeneralResults['other'];
244
+			$nb_unknown = $placesGeneralResults['unknown'];
245 245
             
246
-            $data->set('stats_gen_nb_found', $nb_found);
247
-            $data->set('stats_gen_nb_other', $nb_other);
248
-            $data->set('stats_gen_nb_unknown', $nb_unknown);
246
+			$data->set('stats_gen_nb_found', $nb_found);
247
+			$data->set('stats_gen_nb_other', $nb_other);
248
+			$data->set('stats_gen_nb_unknown', $nb_unknown);
249 249
             
250
-            $data->set('use_flags', $ga->getOptions() && $ga->getOptions()->isUsingFlags());
250
+			$data->set('use_flags', $ga->getOptions() && $ga->getOptions()->isUsingFlags());
251 251
             
252
-            if($ga->hasMap()) {
253
-                $max = $placesGeneralResults['max'];
254
-                $map = $ga->getOptions()->getMap();
255
-                $results_by_subdivs = $map->getSubdivisions();
256
-                $places_mappings = $map->getPlacesMappings();
257
-                foreach ($placesGeneralResults['places'] as $location => $count) {
258
-                    $levelvalues = array_reverse(array_map('trim',explode(',', $location)));
259
-                    $level_map = $ga->getAnalysisLevel() - $ga->getOptions()->getMapLevel();
260
-                    if($level_map >= 0 && $level_map < count($levelvalues)) {
261
-                        $levelref = $levelvalues[0] . '@' . $levelvalues[$level_map];
262
-                        if(!isset($results_by_subdivs[$levelref])) { $levelref = $levelvalues[0]; }
263
-                    }
264
-                    else {
265
-                        $levelref = $levelvalues[0];
266
-                    }
267
-                    if(isset($places_mappings[$levelref])) $levelref = $places_mappings[$levelref];
268
-                    if(isset($results_by_subdivs[$levelref])) {
269
-                        $count_subd = isset($results_by_subdivs[$levelref]['count']) ? $results_by_subdivs[$levelref]['count'] : 0;
270
-                        $count_subd  += $count;
271
-                        $results_by_subdivs[$levelref]['count'] = $count_subd;   
272
-                        $results_by_subdivs[$levelref]['transparency'] = Functions::safeDivision($count_subd, $max);
273
-                        if($ga->getOptions()->isUsingFlags() && $flags) {
274
-                            $results_by_subdivs[$levelref]['place'] = new Place($location, $WT_TREE);
275
-                            $results_by_subdivs[$levelref]['flag'] = $flags[$location];
276
-                        }
277
-                    }
278
-                }             
252
+			if($ga->hasMap()) {
253
+				$max = $placesGeneralResults['max'];
254
+				$map = $ga->getOptions()->getMap();
255
+				$results_by_subdivs = $map->getSubdivisions();
256
+				$places_mappings = $map->getPlacesMappings();
257
+				foreach ($placesGeneralResults['places'] as $location => $count) {
258
+					$levelvalues = array_reverse(array_map('trim',explode(',', $location)));
259
+					$level_map = $ga->getAnalysisLevel() - $ga->getOptions()->getMapLevel();
260
+					if($level_map >= 0 && $level_map < count($levelvalues)) {
261
+						$levelref = $levelvalues[0] . '@' . $levelvalues[$level_map];
262
+						if(!isset($results_by_subdivs[$levelref])) { $levelref = $levelvalues[0]; }
263
+					}
264
+					else {
265
+						$levelref = $levelvalues[0];
266
+					}
267
+					if(isset($places_mappings[$levelref])) $levelref = $places_mappings[$levelref];
268
+					if(isset($results_by_subdivs[$levelref])) {
269
+						$count_subd = isset($results_by_subdivs[$levelref]['count']) ? $results_by_subdivs[$levelref]['count'] : 0;
270
+						$count_subd  += $count;
271
+						$results_by_subdivs[$levelref]['count'] = $count_subd;   
272
+						$results_by_subdivs[$levelref]['transparency'] = Functions::safeDivision($count_subd, $max);
273
+						if($ga->getOptions()->isUsingFlags() && $flags) {
274
+							$results_by_subdivs[$levelref]['place'] = new Place($location, $WT_TREE);
275
+							$results_by_subdivs[$levelref]['flag'] = $flags[$location];
276
+						}
277
+					}
278
+				}             
279 279
                 
280
-                $data->set('map', $ga->getOptions()->getMap());
281
-                $data->set('results_by_subdivisions', $results_by_subdivs);
280
+				$data->set('map', $ga->getOptions()->getMap());
281
+				$data->set('results_by_subdivisions', $results_by_subdivs);
282 282
                 
283
-                $html = ViewFactory::make('GeoAnalysisTabGeneralMap', $this, new BaseController(), $data)->getHtmlPartial();
284
-            }
285
-            else {
286
-                $results = $placesGeneralResults['places'];
287
-                arsort($results);
288
-                $data->set('results', $results);
289
-                $data->set('analysis_level', $ga->getAnalysisLevel());
283
+				$html = ViewFactory::make('GeoAnalysisTabGeneralMap', $this, new BaseController(), $data)->getHtmlPartial();
284
+			}
285
+			else {
286
+				$results = $placesGeneralResults['places'];
287
+				arsort($results);
288
+				$data->set('results', $results);
289
+				$data->set('analysis_level', $ga->getAnalysisLevel());
290 290
                 
291
-                $html = ViewFactory::make('GeoAnalysisTabGeneralTable', $this, new BaseController(), $data)->getHtmlPartial();
292
-            }
293
-        }
294
-        else {
295
-            $html = '<p class="warning">' . I18N::translate('No data is available for the general analysis.') . '</p>';
296
-        }
297
-        return $html;
298
-    }
291
+				$html = ViewFactory::make('GeoAnalysisTabGeneralTable', $this, new BaseController(), $data)->getHtmlPartial();
292
+			}
293
+		}
294
+		else {
295
+			$html = '<p class="warning">' . I18N::translate('No data is available for the general analysis.') . '</p>';
296
+		}
297
+		return $html;
298
+	}
299 299
     
300 300
 	/**
301 301
 	 * Returns HTML code for the GeoAnalysis generations tab.
@@ -305,68 +305,68 @@  discard block
 block discarded – undo
305 305
 	 * @param (null|array) $flags Array of flags
306 306
 	 * @return string HTML code for the generations tab
307 307
 	 */
308
-    protected function htmlPlacesAnalysisGenerationsTab(GeoAnalysis $ga, $placesGenerationsResults, $flags = null) {
309
-        global $WT_TREE;
308
+	protected function htmlPlacesAnalysisGenerationsTab(GeoAnalysis $ga, $placesGenerationsResults, $flags = null) {
309
+		global $WT_TREE;
310 310
         
311
-        if(!empty($placesGenerationsResults) && $ga->getOptions()){
312
-            $data = new ViewBag();
311
+		if(!empty($placesGenerationsResults) && $ga->getOptions()){
312
+			$data = new ViewBag();
313 313
             
314
-            ksort($placesGenerationsResults);
314
+			ksort($placesGenerationsResults);
315 315
             
316
-            $detailslevel = $ga->getOptions()->getMaxDetailsInGen();
317
-            $data->set('max_details_gen', $detailslevel);    
318
-            $data->set('use_flags', $ga->getOptions()->isUsingFlags());
319
-            $data->set('analysis_level', $ga->getAnalysisLevel());
320
-            $display_all_places = !is_null($detailslevel) && $detailslevel == 0;
321
-            $data->set('display_all_places', $display_all_places);
316
+			$detailslevel = $ga->getOptions()->getMaxDetailsInGen();
317
+			$data->set('max_details_gen', $detailslevel);    
318
+			$data->set('use_flags', $ga->getOptions()->isUsingFlags());
319
+			$data->set('analysis_level', $ga->getAnalysisLevel());
320
+			$display_all_places = !is_null($detailslevel) && $detailslevel == 0;
321
+			$data->set('display_all_places', $display_all_places);
322 322
             
323
-            $results_by_gen = array();
324
-            foreach($placesGenerationsResults as $gen => $genData){
325
-                $sum = 0;
326
-                $other = 0;
327
-                $unknown = 0;
328
-                if(isset($genData['sum'])) $sum = $genData['sum'];
329
-                if(isset($genData['other'])) $other = $genData['other'];
330
-                if(isset($genData['unknown'])) $unknown = $genData['unknown'];
323
+			$results_by_gen = array();
324
+			foreach($placesGenerationsResults as $gen => $genData){
325
+				$sum = 0;
326
+				$other = 0;
327
+				$unknown = 0;
328
+				if(isset($genData['sum'])) $sum = $genData['sum'];
329
+				if(isset($genData['other'])) $other = $genData['other'];
330
+				if(isset($genData['unknown'])) $unknown = $genData['unknown'];
331 331
                 
332
-                if($sum > 0) {                
333
-                    $results_by_gen[$gen]['sum'] = $sum;
334
-                    $results_by_gen[$gen]['other'] = $other;
335
-                    $results_by_gen[$gen]['unknown'] = $unknown;
336
-                    $results_by_gen[$gen]['places'] = array();                    
337
-                    arsort($genData['places']);
332
+				if($sum > 0) {                
333
+					$results_by_gen[$gen]['sum'] = $sum;
334
+					$results_by_gen[$gen]['other'] = $other;
335
+					$results_by_gen[$gen]['unknown'] = $unknown;
336
+					$results_by_gen[$gen]['places'] = array();                    
337
+					arsort($genData['places']);
338 338
                     
339
-                    if($display_all_places){
340
-                        foreach($genData['places'] as $placename=> $count){
341
-                            $results_by_gen[$gen]['places'][$placename]['count'] = $count;
339
+					if($display_all_places){
340
+						foreach($genData['places'] as $placename=> $count){
341
+							$results_by_gen[$gen]['places'][$placename]['count'] = $count;
342 342
                             
343
-                            if($ga->getOptions() && $ga->getOptions()->isUsingFlags() && ($flag = $flags[$placename]) != ''){
344
-                                $results_by_gen[$gen]['places'][$placename]['place'] = new Place($placename, $WT_TREE);
345
-                                $results_by_gen[$gen]['places'][$placename]['flag'] = $flag;
346
-                            }
347
-                        }
348
-                    }
349
-                    else {
350
-                        $tmp = $genData['places'];
351
-                        if($other > 0) {
352
-                            $tmp = array_slice($tmp, 0, 5, true);
353
-                            $tmp['other'] = $other;
354
-                            arsort($tmp);  
355
-                        }                      
356
-                        $results_by_gen[$gen]['places'] = array_slice($tmp, 0, 5, true);                        
357
-                    }
358
-                }
359
-            }
343
+							if($ga->getOptions() && $ga->getOptions()->isUsingFlags() && ($flag = $flags[$placename]) != ''){
344
+								$results_by_gen[$gen]['places'][$placename]['place'] = new Place($placename, $WT_TREE);
345
+								$results_by_gen[$gen]['places'][$placename]['flag'] = $flag;
346
+							}
347
+						}
348
+					}
349
+					else {
350
+						$tmp = $genData['places'];
351
+						if($other > 0) {
352
+							$tmp = array_slice($tmp, 0, 5, true);
353
+							$tmp['other'] = $other;
354
+							arsort($tmp);  
355
+						}                      
356
+						$results_by_gen[$gen]['places'] = array_slice($tmp, 0, 5, true);                        
357
+					}
358
+				}
359
+			}
360 360
             
361
-            $data->set('results_by_generations', $results_by_gen);
361
+			$data->set('results_by_generations', $results_by_gen);
362 362
             
363
-            $html = ViewFactory::make('GeoAnalysisTabGenerations', $this, new BaseController(), $data)->getHtmlPartial();
363
+			$html = ViewFactory::make('GeoAnalysisTabGenerations', $this, new BaseController(), $data)->getHtmlPartial();
364 364
             
365
-        }
366
-        else {
367
-            $html = '<p class="warning">' . I18N::translate('No data is available for the generations analysis.') . '</p>';
368
-        }
369
-        return $html;
370
-    }
365
+		}
366
+		else {
367
+			$html = '<p class="warning">' . I18N::translate('No data is available for the generations analysis.') . '</p>';
368
+		}
369
+		return $html;
370
+	}
371 371
         
372 372
 }
373 373
\ No newline at end of file
Please login to merge, or discard this patch.