Completed
Push — master ( b40ea8...2ebfe4 )
by Jonathan
05:27
created
src/Webtrees/Module/Sosa/Views/SosaComputeResultView.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,18 +23,18 @@
 block discarded – undo
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
-        if($this->data->get('is_success', false)) {
29
-        ?>        
28
+		if($this->data->get('is_success', false)) {
29
+		?>        
30 30
         	<i class="icon-maj-success" title="<?php echo I18N::translate('Success'); ?>"></i>&nbsp;
31 31
         	<?php echo I18N::translate('Success'); ?>
32 32
         <?php } else { ?>
33 33
 			<i class="icon-maj-error" title="<?php echo I18N::translate('Error'); ?>"></i>&nbsp;
34 34
 			<?php echo I18N::translate('Error'); ?>
35 35
 			<?php if($error = $this->data->get('error')) { echo '&nbsp;-&nbsp;' . $error; }
36
-        }
37
-    }
36
+		}
37
+	}
38 38
     
39 39
 }
40 40
  
41 41
\ No newline at end of file
Please login to merge, or discard this patch.
src/Webtrees/Module/Hooks/Schema/Migration0.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -23,17 +23,17 @@
 block discarded – undo
23 23
 
24 24
 		Database::exec(
25 25
 		   "CREATE TABLE IF NOT EXISTS `##maj_hooks` (".
26
-	       " majh_id       			INTEGER AUTO_INCREMENT NOT NULL,".
27
-	       " majh_hook_function		VARCHAR(32)            NOT NULL,".
26
+		   " majh_id       			INTEGER AUTO_INCREMENT NOT NULL,".
27
+		   " majh_hook_function		VARCHAR(32)            NOT NULL,".
28 28
 		   " majh_hook_context      VARCHAR(32)            NOT NULL DEFAULT 'all',".
29
-	       " majh_module_name		VARCHAR(32)            NOT NULL,".
30
-	       " majh_module_priority	INTEGER            	   NOT NULL DEFAULT 99,".
31
-	       " majh_status      		ENUM('enabled', 'disabled') NOT NULL DEFAULT 'enabled',".		   
32
-	       " PRIMARY KEY (majh_id),".
33
-	       " UNIQUE KEY `##maj_hooks_uk` (majh_hook_function, majh_hook_context, majh_module_name),".
34
-	       " FOREIGN KEY `##module_name_fk1` (majh_module_name)".
29
+		   " majh_module_name		VARCHAR(32)            NOT NULL,".
30
+		   " majh_module_priority	INTEGER            	   NOT NULL DEFAULT 99,".
31
+		   " majh_status      		ENUM('enabled', 'disabled') NOT NULL DEFAULT 'enabled',".		   
32
+		   " PRIMARY KEY (majh_id),".
33
+		   " UNIQUE KEY `##maj_hooks_uk` (majh_hook_function, majh_hook_context, majh_module_name),".
34
+		   " FOREIGN KEY `##module_name_fk1` (majh_module_name)".
35 35
 		   " REFERENCES `##module` (module_name) ON DELETE CASCADE ON UPDATE CASCADE".
36
-	       ") COLLATE utf8_unicode_ci ENGINE=InnoDB"
36
+		   ") COLLATE utf8_unicode_ci ENGINE=InnoDB"
37 37
 		);
38 38
 	}
39 39
 }
Please login to merge, or discard this patch.
src/Webtrees/Module/Hooks/Views/AdminConfigView.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,11 +25,11 @@  discard block
 block discarded – undo
25 25
 	 * {@inhericDoc}
26 26
 	 * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent()
27 27
 	 */
28
-    protected function renderContent() {
28
+	protected function renderContent() {
29 29
         
30
-        $table_id = $this->data->get('table_id');
30
+		$table_id = $this->data->get('table_id');
31 31
         
32
-        ?>        
32
+		?>        
33 33
         <ol class="breadcrumb small">
34 34
         	<li><a href="admin.php"><?php echo I18N::translate('Control panel'); ?></a></li>
35 35
 			<li><a href="admin_modules.php"><?php echo I18N::translate('Module administration'); ?></a></li>
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 		</div>	
80 80
 		
81 81
 		<?php        
82
-    }
82
+	}
83 83
     
84 84
 }
85 85
  
86 86
\ No newline at end of file
Please login to merge, or discard this patch.
src/Webtrees/Module/ModuleManager.php 1 patch
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -49,62 +49,62 @@
 block discarded – undo
49 49
 	}
50 50
 	
51 51
 	/**
52
-     * Protected constructor.
53
-     */
54
-    protected function __construct()
55
-    {
56
-    	$this->modules_list = array();
57
-    }
52
+	 * Protected constructor.
53
+	 */
54
+	protected function __construct()
55
+	{
56
+		$this->modules_list = array();
57
+	}
58 58
     
59
-    /**
60
-     * {@inheritDoc}
61
-     * @see \MyArtJaub\Webtrees\Module\ModuleManagerInterface::isOperational()
62
-     */
63
-    public function isOperational($moduleName) {
64
-    	if(!array_key_exists($moduleName, $this->modules_list)) {
65
-    		if($module = fw\Module::getModuleByName($moduleName)) {
66
-    			if($module instanceof DependentInterface) {
67
-    				if($module->validatePrerequisites()) {
68
-    					$this->modules_list[$moduleName] = TRUE;
69
-    					return true;
70
-    				} else {
71
-    					// Do not cache the result,
72
-    					// as they could change by the next call to the method
73
-    					return false;
74
-    				}
75
-    			}
76
-    			else {
77
-    				$this->modules_list[$moduleName] = TRUE;
78
-    				return true;
79
-    			}
80
-    		}
81
-    		else {
82
-    			$this->modules_list[$moduleName] = FALSE;
83
-    		}
84
-    	}
85
-    	return $this->modules_list[$moduleName];
59
+	/**
60
+	 * {@inheritDoc}
61
+	 * @see \MyArtJaub\Webtrees\Module\ModuleManagerInterface::isOperational()
62
+	 */
63
+	public function isOperational($moduleName) {
64
+		if(!array_key_exists($moduleName, $this->modules_list)) {
65
+			if($module = fw\Module::getModuleByName($moduleName)) {
66
+				if($module instanceof DependentInterface) {
67
+					if($module->validatePrerequisites()) {
68
+						$this->modules_list[$moduleName] = TRUE;
69
+						return true;
70
+					} else {
71
+						// Do not cache the result,
72
+						// as they could change by the next call to the method
73
+						return false;
74
+					}
75
+				}
76
+				else {
77
+					$this->modules_list[$moduleName] = TRUE;
78
+					return true;
79
+				}
80
+			}
81
+			else {
82
+				$this->modules_list[$moduleName] = FALSE;
83
+			}
84
+		}
85
+		return $this->modules_list[$moduleName];
86 86
     	
87
-    }
87
+	}
88 88
     
89 89
 
90
-    /**
91
-     * Private clone method to prevent cloning of the instance of the
92
-     * *ModuleManager* instance.
93
-     *
94
-     * @return void
95
-     */
96
-    private function __clone()
97
-    {
98
-    }
90
+	/**
91
+	 * Private clone method to prevent cloning of the instance of the
92
+	 * *ModuleManager* instance.
93
+	 *
94
+	 * @return void
95
+	 */
96
+	private function __clone()
97
+	{
98
+	}
99 99
 
100
-    /**
101
-     * Private unserialize method to prevent unserializing of the *ModuleManager*
102
-     * instance.
103
-     *
104
-     * @return void
105
-     */
106
-    private function __wakeup()
107
-    {
108
-    }
100
+	/**
101
+	 * Private unserialize method to prevent unserializing of the *ModuleManager*
102
+	 * instance.
103
+	 *
104
+	 * @return void
105
+	 */
106
+	private function __wakeup()
107
+	{
108
+	}
109 109
     
110 110
 }
Please login to merge, or discard this patch.
src/Webtrees/Module/MiscExtensions/AdminConfigController.php 1 patch
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -28,56 +28,56 @@
 block discarded – undo
28 28
  */
29 29
 class AdminConfigController extends MvcController
30 30
 {    
31
-    /**
32
-     * Manage updates sent from the AdminConfig@index form.
33
-     */
34
-    protected function update() {
35
-        global $WT_TREE;
31
+	/**
32
+	 * Manage updates sent from the AdminConfig@index form.
33
+	 */
34
+	protected function update() {
35
+		global $WT_TREE;
36 36
     
37
-        if(Auth::isAdmin()){
37
+		if(Auth::isAdmin()){
38 38
     
39
-            $this->module->setSetting('MAJ_TITLE_PREFIX', Filter::post('MAJ_TITLE_PREFIX'));
39
+			$this->module->setSetting('MAJ_TITLE_PREFIX', Filter::post('MAJ_TITLE_PREFIX'));
40 40
             
41
-            $this->module->setSetting('MAJ_ADD_HTML_HEADER', Filter::postInteger('MAJ_ADD_HTML_HEADER', 0, 1));
42
-            $this->module->setSetting('MAJ_SHOW_HTML_HEADER', Filter::postInteger('MAJ_SHOW_HTML_HEADER', Auth::PRIV_HIDE, Auth::PRIV_PRIVATE, Auth::PRIV_HIDE));
43
-            $this->module->setSetting('MAJ_HTML_HEADER', Filter::post('MAJ_HTML_HEADER'));
41
+			$this->module->setSetting('MAJ_ADD_HTML_HEADER', Filter::postInteger('MAJ_ADD_HTML_HEADER', 0, 1));
42
+			$this->module->setSetting('MAJ_SHOW_HTML_HEADER', Filter::postInteger('MAJ_SHOW_HTML_HEADER', Auth::PRIV_HIDE, Auth::PRIV_PRIVATE, Auth::PRIV_HIDE));
43
+			$this->module->setSetting('MAJ_HTML_HEADER', Filter::post('MAJ_HTML_HEADER'));
44 44
             
45
-            $this->module->setSetting('MAJ_ADD_HTML_FOOTER', Filter::postInteger('MAJ_ADD_HTML_FOOTER', 0, 1));
46
-            $this->module->setSetting('MAJ_SHOW_HTML_FOOTER', Filter::postInteger('MAJ_SHOW_HTML_FOOTER', Auth::PRIV_HIDE, Auth::PRIV_PRIVATE, Auth::PRIV_HIDE));
47
-            $this->module->setSetting('MAJ_HTML_FOOTER', Filter::post('MAJ_HTML_FOOTER'));
45
+			$this->module->setSetting('MAJ_ADD_HTML_FOOTER', Filter::postInteger('MAJ_ADD_HTML_FOOTER', 0, 1));
46
+			$this->module->setSetting('MAJ_SHOW_HTML_FOOTER', Filter::postInteger('MAJ_SHOW_HTML_FOOTER', Auth::PRIV_HIDE, Auth::PRIV_PRIVATE, Auth::PRIV_HIDE));
47
+			$this->module->setSetting('MAJ_HTML_FOOTER', Filter::post('MAJ_HTML_FOOTER'));
48 48
             
49
-            $this->module->setSetting('MAJ_DISPLAY_CNIL', Filter::postInteger('MAJ_DISPLAY_CNIL', 0, 1));
50
-            $this->module->setSetting('MAJ_CNIL_REFERENCE', Filter::post('MAJ_CNIL_REFERENCE'));
49
+			$this->module->setSetting('MAJ_DISPLAY_CNIL', Filter::postInteger('MAJ_DISPLAY_CNIL', 0, 1));
50
+			$this->module->setSetting('MAJ_CNIL_REFERENCE', Filter::post('MAJ_CNIL_REFERENCE'));
51 51
                 
52
-            FlashMessages::addMessage(I18N::translate('The preferences for the module “%s” have been updated.', $this->module->getTitle()), 'success');
52
+			FlashMessages::addMessage(I18N::translate('The preferences for the module “%s” have been updated.', $this->module->getTitle()), 'success');
53 53
     
54
-            return;
55
-        }
56
-    }
54
+			return;
55
+		}
56
+	}
57 57
     
58
-    /**
59
-     * Pages
60
-     */
58
+	/**
59
+	 * Pages
60
+	 */
61 61
         
62
-    /**
63
-     * AdminConfig@index
64
-     */
65
-    public function index() {      
66
-        global $WT_TREE;
62
+	/**
63
+	 * AdminConfig@index
64
+	 */
65
+	public function index() {      
66
+		global $WT_TREE;
67 67
         
68
-        $action = Filter::post('action');        
69
-        if($action == 'update' && Filter::checkCsrf()) $this->update();
68
+		$action = Filter::post('action');        
69
+		if($action == 'update' && Filter::checkCsrf()) $this->update();
70 70
         
71
-        Theme::theme(new AdministrationTheme)->init($WT_TREE);        
72
-        $ctrl = new PageController();
73
-        $ctrl
74
-            ->restrictAccess(Auth::isAdmin())
75
-            ->setPageTitle($this->module->getTitle());
71
+		Theme::theme(new AdministrationTheme)->init($WT_TREE);        
72
+		$ctrl = new PageController();
73
+		$ctrl
74
+			->restrictAccess(Auth::isAdmin())
75
+			->setPageTitle($this->module->getTitle());
76 76
             
77
-        $view_bag = new ViewBag();
78
-        $view_bag->set('title', $ctrl->getPageTitle());
79
-        $view_bag->set('module', $this->module);
77
+		$view_bag = new ViewBag();
78
+		$view_bag->set('title', $ctrl->getPageTitle());
79
+		$view_bag->set('module', $this->module);
80 80
         
81
-        ViewFactory::make('AdminConfig', $this, $ctrl, $view_bag)->render();
82
-    }
81
+		ViewFactory::make('AdminConfig', $this, $ctrl, $view_bag)->render();
82
+	}
83 83
 }
84 84
\ No newline at end of file
Please login to merge, or discard this patch.
src/Webtrees/Module/MiscExtensions/Views/AdminConfigView.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -28,15 +28,15 @@  discard block
 block discarded – undo
28 28
 	 * {@inhericDoc}
29 29
 	 * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent()
30 30
 	 */
31
-    protected function renderContent() {
31
+	protected function renderContent() {
32 32
         
33
-        if (Module::getModuleByName('ckeditor')) {
34
-            CkeditorModule::enableEditor($this->ctrl);
35
-        }
33
+		if (Module::getModuleByName('ckeditor')) {
34
+			CkeditorModule::enableEditor($this->ctrl);
35
+		}
36 36
         
37
-        /** @var AbstractModule $module  */
38
-        $module = $this->data->get('module');        
39
-        ?>        
37
+		/** @var AbstractModule $module  */
38
+		$module = $this->data->get('module');        
39
+		?>        
40 40
         <ol class="breadcrumb small">
41 41
         	<li><a href="admin.php"><?php echo I18N::translate('Control panel'); ?></a></li>
42 42
 			<li><a href="admin_modules.php"><?php echo I18N::translate('Module administration'); ?></a></li>
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
         </form>
188 188
 		
189 189
 		<?php        
190
-    }
190
+	}
191 191
     
192 192
 }
193 193
  
194 194
\ No newline at end of file
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/Model/OutlineMapCanvas.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -19,49 +19,49 @@  discard block
 block discarded – undo
19 19
 	 * Width of the map (in pixels).
20 20
 	 * @var int $width
21 21
 	 */
22
-    public $width;
22
+	public $width;
23 23
 	
24 24
 	/**
25 25
 	 * Height of the map (in pixels).
26 26
 	 * @var int $height
27 27
 	 */
28
-    public $height;
28
+	public $height;
29 29
 	
30 30
 	/**
31 31
 	 * Background color for the map shapes with values (when no transparency if applied).
32 32
 	 * @var string $max_color
33 33
 	 */
34
-    public $max_color;
34
+	public $max_color;
35 35
 	
36 36
 	/**
37 37
 	 * Background color for the map shapes when hovered.
38 38
 	 * @var string $hover_color
39 39
 	 */
40
-    public $hover_color;
40
+	public $hover_color;
41 41
 	
42 42
 	/**
43 43
 	 * Background color for the map.
44 44
 	 * @var string $background_color
45 45
 	 */
46
-    public $background_color;
46
+	public $background_color;
47 47
 	
48 48
 	/**
49 49
 	 * Border color for the map.
50 50
 	 * @var string $background_stroke
51 51
 	 */
52
-    public $background_stroke;
52
+	public $background_stroke;
53 53
 	
54 54
 	/**
55 55
 	 * Default color for the shapes (without any value).
56 56
 	 * @var string $default_color
57 57
 	 */
58
-    public $default_color;
58
+	public $default_color;
59 59
 	
60 60
 	/**
61 61
 	 * Default border color for the shapes.
62 62
 	 * @var string $default_stroke
63 63
 	 */
64
-    public $default_stroke;
64
+	public $default_stroke;
65 65
     
66 66
 	/**
67 67
 	 * Constructor for OutlineMapCanvas.
@@ -75,25 +75,25 @@  discard block
 block discarded – undo
75 75
 	 * @param string $default_color Default background color for the shapes
76 76
 	 * @param string $default_stroke Default border color for the shapes
77 77
 	 */
78
-    public function __construct(
79
-        $width,
80
-        $height,
81
-        $max_color,
82
-        $hover_color,
83
-        $background_color,
84
-        $background_stroke,
85
-        $default_color,
86
-        $default_stroke
87
-     ) {
88
-        $this->width = $width;
89
-        $this->height = $height;
90
-        $this->max_color = $max_color;
91
-        $this->hover_color = $hover_color;
92
-        $this->background_color = $background_color;
93
-        $this->background_stroke = $background_stroke;
94
-        $this->default_color = $default_color;
95
-        $this->default_stroke = $default_stroke;
96
-    }
78
+	public function __construct(
79
+		$width,
80
+		$height,
81
+		$max_color,
82
+		$hover_color,
83
+		$background_color,
84
+		$background_stroke,
85
+		$default_color,
86
+		$default_stroke
87
+	 ) {
88
+		$this->width = $width;
89
+		$this->height = $height;
90
+		$this->max_color = $max_color;
91
+		$this->hover_color = $hover_color;
92
+		$this->background_color = $background_color;
93
+		$this->background_stroke = $background_stroke;
94
+		$this->default_color = $default_color;
95
+		$this->default_stroke = $default_stroke;
96
+	}
97 97
     
98 98
     
99 99
 }
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/Model/GeoAnalysis.php 1 patch
Indentation   +175 added lines, -175 removed lines patch added patch discarded remove patch
@@ -25,64 +25,64 @@  discard block
 block discarded – undo
25 25
 	 * Geo Analysis ID
26 26
 	 * @var int $id
27 27
 	 */
28
-    protected $id;
28
+	protected $id;
29 29
     
30 30
 	/**
31 31
 	 * Geo Analysis Title
32 32
 	 * @var string $title
33 33
 	 */
34
-    protected $title;
34
+	protected $title;
35 35
     
36 36
 	/**
37 37
 	 * Level of the Gedcom hierarchy for the analysis
38 38
 	 * @var int $analysis_level
39 39
 	 */
40
-    protected $analysis_level;
40
+	protected $analysis_level;
41 41
     
42
-    /**
43
-     * Display options
44
-     * @var GeoDisplayOptions $options
45
-     */
46
-    protected $options;
42
+	/**
43
+	 * Display options
44
+	 * @var GeoDisplayOptions $options
45
+	 */
46
+	protected $options;
47 47
     
48
-    /**
49
-     * Reference tree
50
-     * @var Tree $tree
51
-     */
52
-    protected $tree;
48
+	/**
49
+	 * Reference tree
50
+	 * @var Tree $tree
51
+	 */
52
+	protected $tree;
53 53
     
54
-    /**
55
-     * Is the analysis enabled
56
-     * @var bool $enabled
57
-     */
58
-    protected $enabled;
54
+	/**
55
+	 * Is the analysis enabled
56
+	 * @var bool $enabled
57
+	 */
58
+	protected $enabled;
59 59
     
60
-    /**
61
-     * Constructor for GeoAnalysis.
62
-     *
63
-     * @param Tree $tree Reference tree
60
+	/**
61
+	 * Constructor for GeoAnalysis.
62
+	 *
63
+	 * @param Tree $tree Reference tree
64 64
 	 * @param int $id GeoAnalysis ID
65 65
 	 * @param string $title GeoAnalysis title
66 66
 	 * @param int $analysis_level Analysis level
67 67
 	 * @param (GeoDisplayOptions|null) $options Display options
68 68
 	 * @param bool $enabled Is analysis enabled
69
-     */
70
-    public function __construct(Tree $tree, $id, $title, $analysis_level, GeoDisplayOptions $options = null, $enabled = true) {
71
-        $this->tree = $tree;
72
-        $this->id = $id;
73
-        $this->title = $title;
74
-        $this->analysis_level = $analysis_level;
75
-        $this->options = $options;
76
-        $this->enabled = $enabled;
77
-    }
69
+	 */
70
+	public function __construct(Tree $tree, $id, $title, $analysis_level, GeoDisplayOptions $options = null, $enabled = true) {
71
+		$this->tree = $tree;
72
+		$this->id = $id;
73
+		$this->title = $title;
74
+		$this->analysis_level = $analysis_level;
75
+		$this->options = $options;
76
+		$this->enabled = $enabled;
77
+	}
78 78
     
79 79
 	/**
80 80
 	 * Get the analysis title
81 81
 	 * @return string
82 82
 	 */
83
-    public function getTitle() {
84
-        return $this->title;
85
-    }
83
+	public function getTitle() {
84
+		return $this->title;
85
+	}
86 86
     
87 87
 	/**
88 88
 	 * Set the analysis title
@@ -90,53 +90,53 @@  discard block
 block discarded – undo
90 90
 	 * @param string $title
91 91
 	 * @return self Enable method-chaining
92 92
 	 */
93
-    public function setTitle($title) {
94
-        $this->title = $title;
95
-        return $this;
96
-    }
93
+	public function setTitle($title) {
94
+		$this->title = $title;
95
+		return $this;
96
+	}
97 97
     
98 98
 	/**
99 99
 	 * Get the analysis ID
100 100
 	 * @return int
101 101
 	 */
102
-    public function getId() {
103
-        return $this->id;
104
-    }
102
+	public function getId() {
103
+		return $this->id;
104
+	}
105 105
     
106 106
 	/**
107 107
 	 * Get the analysis status (enabled/disabled)
108 108
 	 * @return bool
109 109
 	 */
110
-    public function isEnabled() {
111
-        return $this->enabled;
112
-    }
110
+	public function isEnabled() {
111
+		return $this->enabled;
112
+	}
113 113
     
114
-    /**
115
-     * Get analysis options
116
-     * @return \MyArtJaub\Webtrees\Module\GeoDispersion\Model\GeoDisplayOptions
117
-     */
118
-    public function getOptions() {
119
-        return $this->options;
120
-    }
114
+	/**
115
+	 * Get analysis options
116
+	 * @return \MyArtJaub\Webtrees\Module\GeoDispersion\Model\GeoDisplayOptions
117
+	 */
118
+	public function getOptions() {
119
+		return $this->options;
120
+	}
121 121
     
122 122
 	/**
123
-     * Set analysis options
123
+	 * Set analysis options
124 124
 	 *
125
-     * @param \MyArtJaub\Webtrees\Module\GeoDispersion\Model\GeoDisplayOptions $options
125
+	 * @param \MyArtJaub\Webtrees\Module\GeoDispersion\Model\GeoDisplayOptions $options
126 126
 	 * @return self Enable method-chaining
127
-     */
128
-    public function setOptions(GeoDisplayOptions $options) {
129
-        $this->options = $options;
130
-        return $this;
131
-    }
127
+	 */
128
+	public function setOptions(GeoDisplayOptions $options) {
129
+		$this->options = $options;
130
+		return $this;
131
+	}
132 132
     
133 133
 	/**
134 134
 	 * Get analysis level
135 135
 	 * @return int
136 136
 	 */
137
-    public function getAnalysisLevel() {
138
-        return $this->analysis_level;
139
-    }
137
+	public function getAnalysisLevel() {
138
+		return $this->analysis_level;
139
+	}
140 140
     
141 141
 	/**
142 142
 	 * Get analysis level
@@ -144,19 +144,19 @@  discard block
 block discarded – undo
144 144
 	 * @param int $analysis_level
145 145
 	 * @return self Enable method-chaining
146 146
 	 */
147
-    public function setAnalysisLevel($analysis_level) {
148
-        $this->analysis_level = $analysis_level;
149
-        return $this;
150
-    }
147
+	public function setAnalysisLevel($analysis_level) {
148
+		$this->analysis_level = $analysis_level;
149
+		return $this;
150
+	}
151 151
     
152 152
 	/**
153 153
 	 * Check whether the analysis has a linked map
154 154
 	 *
155 155
 	 * @return bool
156 156
 	 */
157
-    public function hasMap() {
158
-        return $this->options && $this->options->getMap();
159
-    }
157
+	public function hasMap() {
158
+		return $this->options && $this->options->getMap();
159
+	}
160 160
     
161 161
 	/**
162 162
 	 * Get the URL for the GeoAnalysis.
@@ -164,117 +164,117 @@  discard block
 block discarded – undo
164 164
 	 * @return string
165 165
 	 */
166 166
 	 public function getHtmlUrl() {
167
-        return 'module.php?mod='. Constants::MODULE_MAJ_GEODISP_NAME . '&mod_action=GeoAnalysis&ga_id=' . $this->getId() . '&ged=' . $this->tree->getNameUrl();
168
-    }
167
+		return 'module.php?mod='. Constants::MODULE_MAJ_GEODISP_NAME . '&mod_action=GeoAnalysis&ga_id=' . $this->getId() . '&ged=' . $this->tree->getNameUrl();
168
+	}
169 169
     
170
-    /**
171
-     * Return the dispersion analysis tables.
172
-     * Two arrays are returned :
173
-     * 	- the General analysis, which returns the number of ancestors for each place found, plus 4 additional indicators :
174
-     * 		- knownsum : Number of known places
175
-     * 		- unknown : Number of unknown places
176
-     * 		- max : Maximum count of ancestors within a place
177
-     * 		- other : Other places (not in the top level area)
178
-     * - the Generations analysis, which returns the number of ancestors for each place found for each generation, plus 3 additional indicators within each generation :
179
-     * 		- sum : Number of known places
180
-     * 		- unknown : Number of unknown places
181
-     * 		- other : Other places (not in the top level area)
182
-     *
183
-     * @param array $sosalist List of all sosas
184
-     * @return array Array of the general and generations table
185
-     */
186
-    public function getAnalysisResults($sosalist) {
187
-        $placesDispGeneral = null;
188
-        $placesDispGenerations = null;
170
+	/**
171
+	 * Return the dispersion analysis tables.
172
+	 * Two arrays are returned :
173
+	 * 	- the General analysis, which returns the number of ancestors for each place found, plus 4 additional indicators :
174
+	 * 		- knownsum : Number of known places
175
+	 * 		- unknown : Number of unknown places
176
+	 * 		- max : Maximum count of ancestors within a place
177
+	 * 		- other : Other places (not in the top level area)
178
+	 * - the Generations analysis, which returns the number of ancestors for each place found for each generation, plus 3 additional indicators within each generation :
179
+	 * 		- sum : Number of known places
180
+	 * 		- unknown : Number of unknown places
181
+	 * 		- other : Other places (not in the top level area)
182
+	 *
183
+	 * @param array $sosalist List of all sosas
184
+	 * @return array Array of the general and generations table
185
+	 */
186
+	public function getAnalysisResults($sosalist) {
187
+		$placesDispGeneral = null;
188
+		$placesDispGenerations = null;
189 189
         
190
-        if($sosalist && count($sosalist) > 0) {
191
-            $placesDispGeneral['knownsum'] = 0;
192
-            $placesDispGeneral['unknown'] = 0;
193
-            $placesDispGeneral['max'] = 0;
194
-            $placesDispGeneral['places'] = array();
195
-            foreach($sosalist as $sosaid => $gens) {
196
-                $sosa = Individual::getIntance($sosaid, $this->tree);
197
-                $place =$sosa->getSignificantPlace();
198
-                $genstab = explode(',', $gens);
199
-                $isUnknown=true;
200
-                if($sosa->getDerivedRecord()->canShow() && !is_null($place)){
201
-                    $levels = array_reverse(array_map('trim',explode(',', $place)));
202
-                    if(count($levels)>= $this->analysis_level){                        
203
-                        $toplevelvalues = array();
204
-                        if($this->hasMap() && $toplevelvalue = $this->options->getMap()->getTopLevelName()) {
205
-                            $toplevelvalues = array_map('trim',explode(',', strtolower($toplevelvalue)));
206
-                        }
207
-                        if(!$this->hasMap() 
208
-                            || is_null($this->options->getMapLevel()) 
209
-                            || $this->options->getMap()->getTopLevelName() == '*' 
210
-                            || (
211
-                                $this->options->getMapLevel() <= $this->analysis_level 
212
-                                && $this->options->getMapLevel() > 0
213
-                                && count($levels) >= $this->options->getMapLevel()
214
-                                && in_array(strtolower($levels[$this->options->getMapLevel()-1]), $toplevelvalues)
215
-                            )
216
-                        ) {
217
-                            $placest = implode(I18N::$list_separator, array_slice($levels, 0, $this->analysis_level));
218
-                            if(isset($placesDispGeneral['places'][$placest])) {
219
-                                $placesDispGeneral['places'][$placest] += 1;
220
-                            }
221
-                            else { 
222
-                                $placesDispGeneral['places'][$placest] = 1;
223
-                            }
224
-                            if($placesDispGeneral['places'][$placest]>$placesDispGeneral['max'])
225
-                                $placesDispGeneral['max'] = $placesDispGeneral['places'][$placest];
226
-                            foreach($genstab as $gen) {
227
-                                if(isset($placesDispGenerations[$gen]['places'][$placest])) {
228
-                                    $placesDispGenerations[$gen]['places'][$placest] += 1;
229
-                                }
230
-                                else { 
231
-                                    $placesDispGenerations[$gen]['places'][$placest] = 1;
232
-                                }
233
-                                if(isset($placesDispGenerations[$gen]['sum'])) {
234
-                                    $placesDispGenerations[$gen]['sum'] += 1;
235
-                                }
236
-                                else { 
237
-                                    $placesDispGenerations[$gen]['sum'] = 1;
238
-                                }
239
-                            }
240
-                        }
241
-                        else{
242
-                            if(isset($placesDispGeneral['other'])) {
243
-                                $placesDispGeneral['other'] += 1;
244
-                            }
245
-                            else { 
246
-                                $placesDispGeneral['other'] = 1;
247
-                            }
248
-                            foreach($genstab as $gen) {
249
-                                if(isset($placesDispGenerations[$gen]['other'])) {
250
-                                    $placesDispGenerations[$gen]['other'] += 1;
251
-                                }
252
-                                else { 
253
-                                    $placesDispGenerations[$gen]['other'] = 1;
254
-                                }
255
-                            }
256
-                        }
257
-                        $placesDispGeneral['knownsum'] += 1;
258
-                        $isUnknown = false;
259
-                    }
260
-                }
261
-                if($isUnknown){
262
-                    $placesDispGeneral['unknown'] += 1;
263
-                    foreach($genstab as $gen) {
264
-                        if(isset($placesDispGenerations[$gen]['unknown'])) { 
265
-                            $placesDispGenerations[$gen]['unknown'] += 1;
266
-                        }
267
-                        else { 
268
-                            $placesDispGenerations[$gen]['unknown'] = 1; 
269
-                        }
270
-                    }
271
-                }
272
-            }
190
+		if($sosalist && count($sosalist) > 0) {
191
+			$placesDispGeneral['knownsum'] = 0;
192
+			$placesDispGeneral['unknown'] = 0;
193
+			$placesDispGeneral['max'] = 0;
194
+			$placesDispGeneral['places'] = array();
195
+			foreach($sosalist as $sosaid => $gens) {
196
+				$sosa = Individual::getIntance($sosaid, $this->tree);
197
+				$place =$sosa->getSignificantPlace();
198
+				$genstab = explode(',', $gens);
199
+				$isUnknown=true;
200
+				if($sosa->getDerivedRecord()->canShow() && !is_null($place)){
201
+					$levels = array_reverse(array_map('trim',explode(',', $place)));
202
+					if(count($levels)>= $this->analysis_level){                        
203
+						$toplevelvalues = array();
204
+						if($this->hasMap() && $toplevelvalue = $this->options->getMap()->getTopLevelName()) {
205
+							$toplevelvalues = array_map('trim',explode(',', strtolower($toplevelvalue)));
206
+						}
207
+						if(!$this->hasMap() 
208
+							|| is_null($this->options->getMapLevel()) 
209
+							|| $this->options->getMap()->getTopLevelName() == '*' 
210
+							|| (
211
+								$this->options->getMapLevel() <= $this->analysis_level 
212
+								&& $this->options->getMapLevel() > 0
213
+								&& count($levels) >= $this->options->getMapLevel()
214
+								&& in_array(strtolower($levels[$this->options->getMapLevel()-1]), $toplevelvalues)
215
+							)
216
+						) {
217
+							$placest = implode(I18N::$list_separator, array_slice($levels, 0, $this->analysis_level));
218
+							if(isset($placesDispGeneral['places'][$placest])) {
219
+								$placesDispGeneral['places'][$placest] += 1;
220
+							}
221
+							else { 
222
+								$placesDispGeneral['places'][$placest] = 1;
223
+							}
224
+							if($placesDispGeneral['places'][$placest]>$placesDispGeneral['max'])
225
+								$placesDispGeneral['max'] = $placesDispGeneral['places'][$placest];
226
+							foreach($genstab as $gen) {
227
+								if(isset($placesDispGenerations[$gen]['places'][$placest])) {
228
+									$placesDispGenerations[$gen]['places'][$placest] += 1;
229
+								}
230
+								else { 
231
+									$placesDispGenerations[$gen]['places'][$placest] = 1;
232
+								}
233
+								if(isset($placesDispGenerations[$gen]['sum'])) {
234
+									$placesDispGenerations[$gen]['sum'] += 1;
235
+								}
236
+								else { 
237
+									$placesDispGenerations[$gen]['sum'] = 1;
238
+								}
239
+							}
240
+						}
241
+						else{
242
+							if(isset($placesDispGeneral['other'])) {
243
+								$placesDispGeneral['other'] += 1;
244
+							}
245
+							else { 
246
+								$placesDispGeneral['other'] = 1;
247
+							}
248
+							foreach($genstab as $gen) {
249
+								if(isset($placesDispGenerations[$gen]['other'])) {
250
+									$placesDispGenerations[$gen]['other'] += 1;
251
+								}
252
+								else { 
253
+									$placesDispGenerations[$gen]['other'] = 1;
254
+								}
255
+							}
256
+						}
257
+						$placesDispGeneral['knownsum'] += 1;
258
+						$isUnknown = false;
259
+					}
260
+				}
261
+				if($isUnknown){
262
+					$placesDispGeneral['unknown'] += 1;
263
+					foreach($genstab as $gen) {
264
+						if(isset($placesDispGenerations[$gen]['unknown'])) { 
265
+							$placesDispGenerations[$gen]['unknown'] += 1;
266
+						}
267
+						else { 
268
+							$placesDispGenerations[$gen]['unknown'] = 1; 
269
+						}
270
+					}
271
+				}
272
+			}
273 273
            
274
-        }        
274
+		}        
275 275
         
276
-        return array($placesDispGeneral, $placesDispGenerations);        
277
-    }
276
+		return array($placesDispGeneral, $placesDispGenerations);        
277
+	}
278 278
     
279 279
                    
280 280
 }
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/Model/OutlineMap.php 1 patch
Indentation   +124 added lines, -124 removed lines patch added patch discarded remove patch
@@ -21,175 +21,175 @@
 block discarded – undo
21 21
 	 * Name of the file containing the description of the map.
22 22
 	 * @var string $filename
23 23
 	 */
24
-    protected $filename;
24
+	protected $filename;
25 25
     
26 26
 	/**
27 27
 	 * Indicates whether the description has been loaded from the file.
28 28
 	 * @var bool $is_loaded
29 29
 	 */
30
-    protected $is_loaded;
30
+	protected $is_loaded;
31 31
     
32 32
 	/**
33 33
 	 * Description/title of the map.
34 34
 	 * @var string $description
35 35
 	 */
36
-    protected $description;
36
+	protected $description;
37 37
     
38 38
 	/**
39 39
 	 * Name(s) of the parent level(s) of the map.
40 40
 	 * @var string $is_loaded
41 41
 	 */
42
-    protected $top_level_name;
42
+	protected $top_level_name;
43 43
     
44
-    /**
45
-     * Map canvas
46
-     * @var OutlineMapCanvas $canvas
47
-     */
48
-    protected $canvas;
44
+	/**
45
+	 * Map canvas
46
+	 * @var OutlineMapCanvas $canvas
47
+	 */
48
+	protected $canvas;
49 49
     
50
-    /**
51
-     * Map subdivisions
52
-     * @var array $subdivisions
53
-     */
54
-    protected $subdivisions;
50
+	/**
51
+	 * Map subdivisions
52
+	 * @var array $subdivisions
53
+	 */
54
+	protected $subdivisions;
55 55
     
56
-    /**
57
-     * Places mappings
58
-     * @var array $subdivisions
59
-     */
60
-    protected $mappings;
56
+	/**
57
+	 * Places mappings
58
+	 * @var array $subdivisions
59
+	 */
60
+	protected $mappings;
61 61
     
62
-    /**
63
-     * Constructor for GeoAnalysisMap.
64
-     *
65
-     * @param string $filename Outline map file name
66
-     * @param bool $load Should the map be loaded immediately
67
-     */
68
-    public function __construct($filename, $load = false) {
69
-        $this->filename = $filename;
70
-        $this->is_loaded = false;
71
-        $this->subdivisions = array();
72
-        $this->mappings = array();
73
-        if($load) $this->load();
74
-    }
62
+	/**
63
+	 * Constructor for GeoAnalysisMap.
64
+	 *
65
+	 * @param string $filename Outline map file name
66
+	 * @param bool $load Should the map be loaded immediately
67
+	 */
68
+	public function __construct($filename, $load = false) {
69
+		$this->filename = $filename;
70
+		$this->is_loaded = false;
71
+		$this->subdivisions = array();
72
+		$this->mappings = array();
73
+		if($load) $this->load();
74
+	}
75 75
     
76
-    /**
77
-     * Load the map settings contained within its XML representation
78
-     *
79
-     * XML structure :
80
-     * 	- displayName : Display name of the map
81
-     * 	- topLevel : Values of the top level subdivisions (separated by commas, if multiple)
82
-     * 	- canvas : all settings related to the map canvas.
83
-     * 		- width : canvas width, in px
84
-     * 		- height : canvas height, in px
85
-     * 		- maxcolor : color to identify places with ancestors, RGB hexadecimal
86
-     * 		- hovercolor : same as previous, color when mouse is hovering the place, RGB hexadecimal
87
-     * 		- bgcolor : map background color, RGB hexadecimal
88
-     * 		- bgstroke : map stroke color, RGB hexadecimal
89
-     * 		- defaultcolor : default color of places, RGB hexadecimal
90
-     * 		- defaultstroke : default stroke color, RGB hexadecimal
91
-     * 	- subdvisions : for each subdivision :
76
+	/**
77
+	 * Load the map settings contained within its XML representation
78
+	 *
79
+	 * XML structure :
80
+	 * 	- displayName : Display name of the map
81
+	 * 	- topLevel : Values of the top level subdivisions (separated by commas, if multiple)
82
+	 * 	- canvas : all settings related to the map canvas.
83
+	 * 		- width : canvas width, in px
84
+	 * 		- height : canvas height, in px
85
+	 * 		- maxcolor : color to identify places with ancestors, RGB hexadecimal
86
+	 * 		- hovercolor : same as previous, color when mouse is hovering the place, RGB hexadecimal
87
+	 * 		- bgcolor : map background color, RGB hexadecimal
88
+	 * 		- bgstroke : map stroke color, RGB hexadecimal
89
+	 * 		- defaultcolor : default color of places, RGB hexadecimal
90
+	 * 		- defaultstroke : default stroke color, RGB hexadecimal
91
+	 * 	- subdvisions : for each subdivision :
92 92
 	 *		- id : Subdivision id, must be compatible with PHP variable constraints, and unique
93
-     * 		- name: Display name for the place
93
+	 * 		- name: Display name for the place
94 94
 	 *		- parent: if any, describe to which parent level the place if belonging to
95
-     * 		- <em>Element value<em> : SVG description of the subdvision shape
95
+	 * 		- <em>Element value<em> : SVG description of the subdvision shape
96 96
 	 *	- mapping : for each subdivision :
97 97
 	 *		- name : Name of the place to map
98
-     * 		- mapto: Name of the place to map to
98
+	 * 		- mapto: Name of the place to map to
99 99
 	 * 
100
-     */
101
-    protected function load() {
102
-        if(file_exists(WT_ROOT.WT_MODULES_DIR.Constants::MODULE_MAJ_GEODISP_NAME.'/maps/'.$this->filename)){
103
-            $xml = simplexml_load_file(WT_ROOT.WT_MODULES_DIR.Constants::MODULE_MAJ_GEODISP_NAME.'/maps/'.$this->filename);
104
-            if($xml){
105
-                $this->description = trim($xml->displayName);
106
-                $this->top_level_name = trim($xml->topLevel);
107
-                $this->canvas = new OutlineMapCanvas(
108
-                    trim($xml->canvas->width),
109
-                    trim($xml->canvas->height), 
110
-                    trim($xml->canvas->maxcolor), 
111
-                    trim($xml->canvas->hovercolor), 
112
-                    trim($xml->canvas->bgcolor),
113
-                    trim($xml->canvas->bgstroke),
114
-                    trim($xml->canvas->defaultcolor), 
115
-                    trim($xml->canvas->defaultstroke)
116
-                );
117
-                foreach($xml->subdivisions->children() as $subdivision){
118
-                    $attributes = $subdivision->attributes();
119
-                    $key = trim($attributes['name']);
120
-                    if(isset($attributes['parent'])) $key .= '@'.trim($attributes['parent']);
121
-                    $this->subdivisions[$key] = array(
122
-                        'id' => trim($attributes['id']),
123
-                        'displayname' => trim($attributes['name']),
124
-                        'coord' => trim($subdivision[0])
125
-                    );
126
-                }
127
-                if(isset($xml->mappings)) {
128
-                    foreach($xml->mappings->children() as $mappings){
129
-                        $attributes = $mappings->attributes();
130
-                        $this->mappings[trim($attributes['name'])] = trim($attributes['mapto']);
131
-                    }
132
-                }
133
-                $this->is_loaded = true;
134
-                return;
135
-            }
136
-        }        
137
-        throw new \Exception('The Outline Map could not be loaded from XML.');
138
-    }
100
+	 */
101
+	protected function load() {
102
+		if(file_exists(WT_ROOT.WT_MODULES_DIR.Constants::MODULE_MAJ_GEODISP_NAME.'/maps/'.$this->filename)){
103
+			$xml = simplexml_load_file(WT_ROOT.WT_MODULES_DIR.Constants::MODULE_MAJ_GEODISP_NAME.'/maps/'.$this->filename);
104
+			if($xml){
105
+				$this->description = trim($xml->displayName);
106
+				$this->top_level_name = trim($xml->topLevel);
107
+				$this->canvas = new OutlineMapCanvas(
108
+					trim($xml->canvas->width),
109
+					trim($xml->canvas->height), 
110
+					trim($xml->canvas->maxcolor), 
111
+					trim($xml->canvas->hovercolor), 
112
+					trim($xml->canvas->bgcolor),
113
+					trim($xml->canvas->bgstroke),
114
+					trim($xml->canvas->defaultcolor), 
115
+					trim($xml->canvas->defaultstroke)
116
+				);
117
+				foreach($xml->subdivisions->children() as $subdivision){
118
+					$attributes = $subdivision->attributes();
119
+					$key = trim($attributes['name']);
120
+					if(isset($attributes['parent'])) $key .= '@'.trim($attributes['parent']);
121
+					$this->subdivisions[$key] = array(
122
+						'id' => trim($attributes['id']),
123
+						'displayname' => trim($attributes['name']),
124
+						'coord' => trim($subdivision[0])
125
+					);
126
+				}
127
+				if(isset($xml->mappings)) {
128
+					foreach($xml->mappings->children() as $mappings){
129
+						$attributes = $mappings->attributes();
130
+						$this->mappings[trim($attributes['name'])] = trim($attributes['mapto']);
131
+					}
132
+				}
133
+				$this->is_loaded = true;
134
+				return;
135
+			}
136
+		}        
137
+		throw new \Exception('The Outline Map could not be loaded from XML.');
138
+	}
139 139
     
140 140
 	/**
141 141
 	 * Get the map file name.
142 142
 	 * @return string
143 143
 	 */
144
-    public function getFileName() {
145
-        if(!$this->is_loaded) $this->load();
146
-        return $this->filename;
147
-    }
144
+	public function getFileName() {
145
+		if(!$this->is_loaded) $this->load();
146
+		return $this->filename;
147
+	}
148 148
     
149 149
 	/**
150 150
 	 * Get the map file name.
151 151
 	 * @return string
152 152
 	 */
153
-    public function getDescription() {
154
-        if(!$this->is_loaded) $this->load();
155
-        return $this->description;
156
-    }
153
+	public function getDescription() {
154
+		if(!$this->is_loaded) $this->load();
155
+		return $this->description;
156
+	}
157 157
     
158 158
 	/**
159 159
 	 * Get the name of the map parent level. 
160 160
 	 * @return string
161 161
 	 */
162
-    public function getTopLevelName() {
163
-        if(!$this->is_loaded) $this->load();
164
-        return $this->top_level_name;
165
-    }    
162
+	public function getTopLevelName() {
163
+		if(!$this->is_loaded) $this->load();
164
+		return $this->top_level_name;
165
+	}    
166 166
     
167
-    /**
168
-     * Get the Outline Map canvas.
169
-     * @return \MyArtJaub\Webtrees\Module\GeoDispersion\Model\OutlineMapCanvas
170
-     */
171
-    public function getCanvas() {
172
-        if(!$this->is_loaded) $this->load();
173
-        return $this->canvas;
174
-    }
167
+	/**
168
+	 * Get the Outline Map canvas.
169
+	 * @return \MyArtJaub\Webtrees\Module\GeoDispersion\Model\OutlineMapCanvas
170
+	 */
171
+	public function getCanvas() {
172
+		if(!$this->is_loaded) $this->load();
173
+		return $this->canvas;
174
+	}
175 175
     
176 176
 	/**
177
-     * Get the subdivisions of the map.
178
-     * @return array
179
-     */
180
-    public function getSubdivisions() {
181
-        if(!$this->is_loaded) $this->load();
182
-        return $this->subdivisions;
183
-    }
177
+	 * Get the subdivisions of the map.
178
+	 * @return array
179
+	 */
180
+	public function getSubdivisions() {
181
+		if(!$this->is_loaded) $this->load();
182
+		return $this->subdivisions;
183
+	}
184 184
     
185 185
 	/**
186
-     * Get the places mappings of the map.
187
-     * @return array
188
-     */
189
-    public function getPlacesMappings() {
190
-        if(!$this->is_loaded) $this->load();
191
-        return $this->mappings;
192
-    }
186
+	 * Get the places mappings of the map.
187
+	 * @return array
188
+	 */
189
+	public function getPlacesMappings() {
190
+		if(!$this->is_loaded) $this->load();
191
+		return $this->mappings;
192
+	}
193 193
                    
194 194
 }
195 195
  
196 196
\ No newline at end of file
Please login to merge, or discard this patch.