@@ -14,17 +14,17 @@ discard block |
||
| 14 | 14 | */ |
| 15 | 15 | class Constants { |
| 16 | 16 | |
| 17 | - const LIB_NAMESPACE = __NAMESPACE__; |
|
| 17 | + const LIB_NAMESPACE = __NAMESPACE__; |
|
| 18 | 18 | |
| 19 | - /** Internal name of the Certificates Module |
|
| 20 | - * @var string |
|
| 21 | - */ |
|
| 22 | - const MODULE_MAJ_CERTIF_NAME = 'myartjaub_certificates'; |
|
| 19 | + /** Internal name of the Certificates Module |
|
| 20 | + * @var string |
|
| 21 | + */ |
|
| 22 | + const MODULE_MAJ_CERTIF_NAME = 'myartjaub_certificates'; |
|
| 23 | 23 | |
| 24 | - /** Internal name of the GeoDispersion Module |
|
| 25 | - * @var string |
|
| 26 | - */ |
|
| 27 | - const MODULE_MAJ_GEODISP_NAME = 'myartjaub_geodispersion'; |
|
| 24 | + /** Internal name of the GeoDispersion Module |
|
| 25 | + * @var string |
|
| 26 | + */ |
|
| 27 | + const MODULE_MAJ_GEODISP_NAME = 'myartjaub_geodispersion'; |
|
| 28 | 28 | |
| 29 | 29 | /** Internal name of the Hooks Module |
| 30 | 30 | * @var string |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | * @return string $WT_RAPHAEL_JS_URL |
| 62 | 62 | */ |
| 63 | 63 | public static function WT_RAPHAEL_JS_URL() { |
| 64 | - return WT_STATIC_URL . 'packages/raphael-2.1.4/raphael-min.js'; |
|
| 64 | + return WT_STATIC_URL . 'packages/raphael-2.1.4/raphael-min.js'; |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | } |
| 68 | 68 | \ No newline at end of file |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | * @return string $WT_RAPHAEL_JS_URL |
| 62 | 62 | */ |
| 63 | 63 | public static function WT_RAPHAEL_JS_URL() { |
| 64 | - return WT_STATIC_URL . 'packages/raphael-2.1.4/raphael-min.js'; |
|
| 64 | + return WT_STATIC_URL.'packages/raphael-2.1.4/raphael-min.js'; |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | } |
| 68 | 68 | \ No newline at end of file |
@@ -15,11 +15,11 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | interface ModuleMenuItemInterface |
| 17 | 17 | { |
| 18 | - /** |
|
| 19 | - * Returns a menu item for the module. |
|
| 20 | - * |
|
| 21 | - * @param \Fisharebest\Webtrees\Tree|null $tree |
|
| 22 | - * @param mixed $reference |
|
| 23 | - */ |
|
| 24 | - public function getMenu(\Fisharebest\Webtrees\Tree $tree, $reference); |
|
| 18 | + /** |
|
| 19 | + * Returns a menu item for the module. |
|
| 20 | + * |
|
| 21 | + * @param \Fisharebest\Webtrees\Tree|null $tree |
|
| 22 | + * @param mixed $reference |
|
| 23 | + */ |
|
| 24 | + public function getMenu(\Fisharebest\Webtrees\Tree $tree, $reference); |
|
| 25 | 25 | } |
| 26 | 26 | \ No newline at end of file |
@@ -23,17 +23,17 @@ |
||
| 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 | } |
@@ -25,11 +25,11 @@ 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 | - $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 |
||
| 79 | 79 | </div> |
| 80 | 80 | |
| 81 | 81 | <?php |
| 82 | - } |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | \ No newline at end of file |
@@ -60,13 +60,13 @@ |
||
| 60 | 60 | ?> |
| 61 | 61 | <tr> |
| 62 | 62 | <td> |
| 63 | - <input type="hidden" name="hook-<?php echo $hook->id;?>" value="yes" > |
|
| 64 | - <?php echo FunctionsEdit::twoStateCheckbox('status-'.($hook->id), ($hook->status)=='enabled'); ?> |
|
| 63 | + <input type="hidden" name="hook-<?php echo $hook->id; ?>" value="yes" > |
|
| 64 | + <?php echo FunctionsEdit::twoStateCheckbox('status-'.($hook->id), ($hook->status) == 'enabled'); ?> |
|
| 65 | 65 | </td> |
| 66 | - <td><?php echo (($hook->status)=='enabled'); ?></td> |
|
| 66 | + <td><?php echo (($hook->status) == 'enabled'); ?></td> |
|
| 67 | 67 | <td><?php echo $hook->hook; ?></td> |
| 68 | 68 | <td><?php echo $hook->context; ?></td> |
| 69 | - <td><?php if($mod = Module::getModuleByName($hook->module)) echo $mod->getTitle(); ?></td> |
|
| 69 | + <td><?php if ($mod = Module::getModuleByName($hook->module)) echo $mod->getTitle(); ?></td> |
|
| 70 | 70 | <td><input type="text" class="center" size="2" value="<?php echo $hook->priority; ?>" name="moduleorder-<?php echo $hook->id; ?>" /></td> |
| 71 | 71 | <td><?php echo $hook->priority; ?></td> |
| 72 | 72 | </tr> |
@@ -66,7 +66,10 @@ |
||
| 66 | 66 | <td><?php echo (($hook->status)=='enabled'); ?></td> |
| 67 | 67 | <td><?php echo $hook->hook; ?></td> |
| 68 | 68 | <td><?php echo $hook->context; ?></td> |
| 69 | - <td><?php if($mod = Module::getModuleByName($hook->module)) echo $mod->getTitle(); ?></td> |
|
| 69 | + <td><?php if($mod = Module::getModuleByName($hook->module)) { |
|
| 70 | + echo $mod->getTitle(); |
|
| 71 | +} |
|
| 72 | +?></td> |
|
| 70 | 73 | <td><input type="text" class="center" size="2" value="<?php echo $hook->priority; ?>" name="moduleorder-<?php echo $hook->id; ?>" /></td> |
| 71 | 74 | <td><?php echo $hook->priority; ?></td> |
| 72 | 75 | </tr> |
@@ -49,62 +49,62 @@ |
||
| 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 | } |
@@ -61,10 +61,10 @@ |
||
| 61 | 61 | * @see \MyArtJaub\Webtrees\Module\ModuleManagerInterface::isOperational() |
| 62 | 62 | */ |
| 63 | 63 | public function isOperational($moduleName) { |
| 64 | - if(!array_key_exists($moduleName, $this->modules_list)) { |
|
| 65 | - if($module = fw\Module::getModuleByName($moduleName)) { |
|
| 66 | - if($module instanceof DependentInterface) { |
|
| 67 | - if($module->validatePrerequisites()) { |
|
| 64 | + if (!array_key_exists($moduleName, $this->modules_list)) { |
|
| 65 | + if ($module = fw\Module::getModuleByName($moduleName)) { |
|
| 66 | + if ($module instanceof DependentInterface) { |
|
| 67 | + if ($module->validatePrerequisites()) { |
|
| 68 | 68 | $this->modules_list[$moduleName] = TRUE; |
| 69 | 69 | return true; |
| 70 | 70 | } else { |
@@ -72,13 +72,11 @@ |
||
| 72 | 72 | // as they could change by the next call to the method |
| 73 | 73 | return false; |
| 74 | 74 | } |
| 75 | - } |
|
| 76 | - else { |
|
| 75 | + } else { |
|
| 77 | 76 | $this->modules_list[$moduleName] = TRUE; |
| 78 | 77 | return true; |
| 79 | 78 | } |
| 80 | - } |
|
| 81 | - else { |
|
| 79 | + } else { |
|
| 82 | 80 | $this->modules_list[$moduleName] = FALSE; |
| 83 | 81 | } |
| 84 | 82 | } |
@@ -28,15 +28,15 @@ discard block |
||
| 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 |
||
| 187 | 187 | </form> |
| 188 | 188 | |
| 189 | 189 | <?php |
| 190 | - } |
|
| 190 | + } |
|
| 191 | 191 | |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | \ No newline at end of file |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * |
| 45 | 45 | * @return (OutlineMap|null) |
| 46 | 46 | */ |
| 47 | - public function getMap(){ |
|
| 47 | + public function getMap() { |
|
| 48 | 48 | return $this->map; |
| 49 | 49 | } |
| 50 | 50 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | * |
| 65 | 65 | * @return int |
| 66 | 66 | */ |
| 67 | - public function getMapLevel(){ |
|
| 67 | + public function getMapLevel() { |
|
| 68 | 68 | return $this->map_level; |
| 69 | 69 | } |
| 70 | 70 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * |
| 85 | 85 | * @return bool |
| 86 | 86 | */ |
| 87 | - public function isUsingFlags(){ |
|
| 87 | + public function isUsingFlags() { |
|
| 88 | 88 | return $this->use_flags; |
| 89 | 89 | } |
| 90 | 90 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | * |
| 105 | 105 | * @return int |
| 106 | 106 | */ |
| 107 | - public function getMaxDetailsInGen(){ |
|
| 107 | + public function getMaxDetailsInGen() { |
|
| 108 | 108 | return $this->max_details_in_gen; |
| 109 | 109 | } |
| 110 | 110 | |
@@ -15,58 +15,58 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | class GeoDisplayOptions { |
| 17 | 17 | |
| 18 | - /** |
|
| 18 | + /** |
|
| 19 | 19 | * Outline map to be used for diaplay |
| 20 | - * @var (null|OutlineMap) $map |
|
| 21 | - */ |
|
| 22 | - protected $map; |
|
| 20 | + * @var (null|OutlineMap) $map |
|
| 21 | + */ |
|
| 22 | + protected $map; |
|
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * Level in the Gedcom hierarchy of the parent level of the outline map. |
| 26 | 26 | * @var int $map_level |
| 27 | 27 | */ |
| 28 | - protected $map_level; |
|
| 28 | + protected $map_level; |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * Option to use flags in places display, instead of or in addition to the name. |
| 32 | 32 | * @var bool $use_flags |
| 33 | 33 | */ |
| 34 | - protected $use_flags; |
|
| 34 | + protected $use_flags; |
|
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * Option to define the number of top places to display in the generation view. |
| 38 | 38 | * @var int $max_details_in_gen |
| 39 | 39 | */ |
| 40 | - protected $max_details_in_gen; |
|
| 40 | + protected $max_details_in_gen; |
|
| 41 | 41 | |
| 42 | - /** |
|
| 42 | + /** |
|
| 43 | 43 | * Get the outline map to use for display. |
| 44 | 44 | * |
| 45 | - * @return (OutlineMap|null) |
|
| 46 | - */ |
|
| 47 | - public function getMap(){ |
|
| 48 | - return $this->map; |
|
| 49 | - } |
|
| 45 | + * @return (OutlineMap|null) |
|
| 46 | + */ |
|
| 47 | + public function getMap(){ |
|
| 48 | + return $this->map; |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * Set the outline map to use for display. |
| 53 | 53 | * |
| 54 | - * @param (OutlineMap|null) $map |
|
| 54 | + * @param (OutlineMap|null) $map |
|
| 55 | 55 | * @return self Enable method-chaining |
| 56 | - */ |
|
| 57 | - public function setMap(OutlineMap $map = null) { |
|
| 58 | - $this->map = $map; |
|
| 59 | - return $this; |
|
| 60 | - } |
|
| 56 | + */ |
|
| 57 | + public function setMap(OutlineMap $map = null) { |
|
| 58 | + $this->map = $map; |
|
| 59 | + return $this; |
|
| 60 | + } |
|
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | 63 | * Get the level of the map parent place |
| 64 | 64 | * |
| 65 | 65 | * @return int |
| 66 | 66 | */ |
| 67 | - public function getMapLevel(){ |
|
| 68 | - return $this->map_level; |
|
| 69 | - } |
|
| 67 | + public function getMapLevel(){ |
|
| 68 | + return $this->map_level; |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | 72 | * Set the level of the map parent place |
@@ -74,19 +74,19 @@ discard block |
||
| 74 | 74 | * @param int $maplevel |
| 75 | 75 | * @return self Enable method-chaining |
| 76 | 76 | */ |
| 77 | - public function setMapLevel($maplevel) { |
|
| 78 | - $this->map_level = $maplevel; |
|
| 79 | - return $this; |
|
| 80 | - } |
|
| 77 | + public function setMapLevel($maplevel) { |
|
| 78 | + $this->map_level = $maplevel; |
|
| 79 | + return $this; |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | 82 | /** |
| 83 | 83 | * Get whether flags should be used in places display |
| 84 | 84 | * |
| 85 | 85 | * @return bool |
| 86 | 86 | */ |
| 87 | - public function isUsingFlags(){ |
|
| 88 | - return $this->use_flags; |
|
| 89 | - } |
|
| 87 | + public function isUsingFlags(){ |
|
| 88 | + return $this->use_flags; |
|
| 89 | + } |
|
| 90 | 90 | |
| 91 | 91 | /** |
| 92 | 92 | * Set whether flags should be used in places display |
@@ -94,19 +94,19 @@ discard block |
||
| 94 | 94 | * @param bool $use_flags |
| 95 | 95 | * @return self Enable method-chaining |
| 96 | 96 | */ |
| 97 | - public function setUsingFlags($use_flags) { |
|
| 98 | - $this->use_flags = $use_flags; |
|
| 99 | - return $this; |
|
| 100 | - } |
|
| 97 | + public function setUsingFlags($use_flags) { |
|
| 98 | + $this->use_flags = $use_flags; |
|
| 99 | + return $this; |
|
| 100 | + } |
|
| 101 | 101 | |
| 102 | 102 | /** |
| 103 | 103 | * Get the number of Top Places in the generation view |
| 104 | 104 | * |
| 105 | 105 | * @return int |
| 106 | 106 | */ |
| 107 | - public function getMaxDetailsInGen(){ |
|
| 108 | - return $this->max_details_in_gen; |
|
| 109 | - } |
|
| 107 | + public function getMaxDetailsInGen(){ |
|
| 108 | + return $this->max_details_in_gen; |
|
| 109 | + } |
|
| 110 | 110 | |
| 111 | 111 | /** |
| 112 | 112 | * Set the number of Top Places in the generation view |
@@ -114,10 +114,10 @@ discard block |
||
| 114 | 114 | * @param int $max_details_in_gen |
| 115 | 115 | * @return self Enable method-chaining |
| 116 | 116 | */ |
| 117 | - public function setMaxDetailsInGen($max_details_in_gen) { |
|
| 118 | - $this->max_details_in_gen = $max_details_in_gen; |
|
| 119 | - return $this; |
|
| 120 | - } |
|
| 117 | + public function setMaxDetailsInGen($max_details_in_gen) { |
|
| 118 | + $this->max_details_in_gen = $max_details_in_gen; |
|
| 119 | + return $this; |
|
| 120 | + } |
|
| 121 | 121 | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | \ No newline at end of file |
@@ -19,49 +19,49 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -217,39 +217,34 @@ discard block |
||
| 217 | 217 | $placest = implode(I18N::$list_separator, array_slice($levels, 0, $this->analysis_level)); |
| 218 | 218 | if(isset($placesDispGeneral['places'][$placest])) { |
| 219 | 219 | $placesDispGeneral['places'][$placest] += 1; |
| 220 | - } |
|
| 221 | - else { |
|
| 220 | + } else { |
|
| 222 | 221 | $placesDispGeneral['places'][$placest] = 1; |
| 223 | 222 | } |
| 224 | - if($placesDispGeneral['places'][$placest]>$placesDispGeneral['max']) |
|
| 225 | - $placesDispGeneral['max'] = $placesDispGeneral['places'][$placest]; |
|
| 223 | + if($placesDispGeneral['places'][$placest]>$placesDispGeneral['max']) { |
|
| 224 | + $placesDispGeneral['max'] = $placesDispGeneral['places'][$placest]; |
|
| 225 | + } |
|
| 226 | 226 | foreach($genstab as $gen) { |
| 227 | 227 | if(isset($placesDispGenerations[$gen]['places'][$placest])) { |
| 228 | 228 | $placesDispGenerations[$gen]['places'][$placest] += 1; |
| 229 | - } |
|
| 230 | - else { |
|
| 229 | + } else { |
|
| 231 | 230 | $placesDispGenerations[$gen]['places'][$placest] = 1; |
| 232 | 231 | } |
| 233 | 232 | if(isset($placesDispGenerations[$gen]['sum'])) { |
| 234 | 233 | $placesDispGenerations[$gen]['sum'] += 1; |
| 235 | - } |
|
| 236 | - else { |
|
| 234 | + } else { |
|
| 237 | 235 | $placesDispGenerations[$gen]['sum'] = 1; |
| 238 | 236 | } |
| 239 | 237 | } |
| 240 | - } |
|
| 241 | - else{ |
|
| 238 | + } else{ |
|
| 242 | 239 | if(isset($placesDispGeneral['other'])) { |
| 243 | 240 | $placesDispGeneral['other'] += 1; |
| 244 | - } |
|
| 245 | - else { |
|
| 241 | + } else { |
|
| 246 | 242 | $placesDispGeneral['other'] = 1; |
| 247 | 243 | } |
| 248 | 244 | foreach($genstab as $gen) { |
| 249 | 245 | if(isset($placesDispGenerations[$gen]['other'])) { |
| 250 | 246 | $placesDispGenerations[$gen]['other'] += 1; |
| 251 | - } |
|
| 252 | - else { |
|
| 247 | + } else { |
|
| 253 | 248 | $placesDispGenerations[$gen]['other'] = 1; |
| 254 | 249 | } |
| 255 | 250 | } |
@@ -263,8 +258,7 @@ discard block |
||
| 263 | 258 | foreach($genstab as $gen) { |
| 264 | 259 | if(isset($placesDispGenerations[$gen]['unknown'])) { |
| 265 | 260 | $placesDispGenerations[$gen]['unknown'] += 1; |
| 266 | - } |
|
| 267 | - else { |
|
| 261 | + } else { |
|
| 268 | 262 | $placesDispGenerations[$gen]['unknown'] = 1; |
| 269 | 263 | } |
| 270 | 264 | } |
@@ -24,64 +24,64 @@ discard block |
||
| 24 | 24 | * Geo Analysis ID |
| 25 | 25 | * @var int $id |
| 26 | 26 | */ |
| 27 | - protected $id; |
|
| 27 | + protected $id; |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * Geo Analysis Title |
| 31 | 31 | * @var string $title |
| 32 | 32 | */ |
| 33 | - protected $title; |
|
| 33 | + protected $title; |
|
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * Level of the Gedcom hierarchy for the analysis |
| 37 | 37 | * @var int $analysis_level |
| 38 | 38 | */ |
| 39 | - protected $analysis_level; |
|
| 39 | + protected $analysis_level; |
|
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * Display options |
|
| 43 | - * @var GeoDisplayOptions $options |
|
| 44 | - */ |
|
| 45 | - protected $options; |
|
| 41 | + /** |
|
| 42 | + * Display options |
|
| 43 | + * @var GeoDisplayOptions $options |
|
| 44 | + */ |
|
| 45 | + protected $options; |
|
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * Reference tree |
|
| 49 | - * @var Tree $tree |
|
| 50 | - */ |
|
| 51 | - protected $tree; |
|
| 47 | + /** |
|
| 48 | + * Reference tree |
|
| 49 | + * @var Tree $tree |
|
| 50 | + */ |
|
| 51 | + protected $tree; |
|
| 52 | 52 | |
| 53 | - /** |
|
| 54 | - * Is the analysis enabled |
|
| 55 | - * @var bool $enabled |
|
| 56 | - */ |
|
| 57 | - protected $enabled; |
|
| 53 | + /** |
|
| 54 | + * Is the analysis enabled |
|
| 55 | + * @var bool $enabled |
|
| 56 | + */ |
|
| 57 | + protected $enabled; |
|
| 58 | 58 | |
| 59 | - /** |
|
| 60 | - * Constructor for GeoAnalysis. |
|
| 61 | - * |
|
| 62 | - * @param Tree $tree Reference tree |
|
| 59 | + /** |
|
| 60 | + * Constructor for GeoAnalysis. |
|
| 61 | + * |
|
| 62 | + * @param Tree $tree Reference tree |
|
| 63 | 63 | * @param int $id GeoAnalysis ID |
| 64 | 64 | * @param string $title GeoAnalysis title |
| 65 | 65 | * @param int $analysis_level Analysis level |
| 66 | 66 | * @param (GeoDisplayOptions|null) $options Display options |
| 67 | 67 | * @param bool $enabled Is analysis enabled |
| 68 | - */ |
|
| 69 | - public function __construct(Tree $tree, $id, $title, $analysis_level, GeoDisplayOptions $options = null, $enabled = true) { |
|
| 70 | - $this->tree = $tree; |
|
| 71 | - $this->id = $id; |
|
| 72 | - $this->title = $title; |
|
| 73 | - $this->analysis_level = $analysis_level; |
|
| 74 | - $this->options = $options; |
|
| 75 | - $this->enabled = $enabled; |
|
| 76 | - } |
|
| 68 | + */ |
|
| 69 | + public function __construct(Tree $tree, $id, $title, $analysis_level, GeoDisplayOptions $options = null, $enabled = true) { |
|
| 70 | + $this->tree = $tree; |
|
| 71 | + $this->id = $id; |
|
| 72 | + $this->title = $title; |
|
| 73 | + $this->analysis_level = $analysis_level; |
|
| 74 | + $this->options = $options; |
|
| 75 | + $this->enabled = $enabled; |
|
| 76 | + } |
|
| 77 | 77 | |
| 78 | 78 | /** |
| 79 | 79 | * Get the analysis title |
| 80 | 80 | * @return string |
| 81 | 81 | */ |
| 82 | - public function getTitle() { |
|
| 83 | - return $this->title; |
|
| 84 | - } |
|
| 82 | + public function getTitle() { |
|
| 83 | + return $this->title; |
|
| 84 | + } |
|
| 85 | 85 | |
| 86 | 86 | /** |
| 87 | 87 | * Set the analysis title |
@@ -89,53 +89,53 @@ discard block |
||
| 89 | 89 | * @param string $title |
| 90 | 90 | * @return self Enable method-chaining |
| 91 | 91 | */ |
| 92 | - public function setTitle($title) { |
|
| 93 | - $this->title = $title; |
|
| 94 | - return $this; |
|
| 95 | - } |
|
| 92 | + public function setTitle($title) { |
|
| 93 | + $this->title = $title; |
|
| 94 | + return $this; |
|
| 95 | + } |
|
| 96 | 96 | |
| 97 | 97 | /** |
| 98 | 98 | * Get the analysis ID |
| 99 | 99 | * @return int |
| 100 | 100 | */ |
| 101 | - public function getId() { |
|
| 102 | - return $this->id; |
|
| 103 | - } |
|
| 101 | + public function getId() { |
|
| 102 | + return $this->id; |
|
| 103 | + } |
|
| 104 | 104 | |
| 105 | 105 | /** |
| 106 | 106 | * Get the analysis status (enabled/disabled) |
| 107 | 107 | * @return bool |
| 108 | 108 | */ |
| 109 | - public function isEnabled() { |
|
| 110 | - return $this->enabled; |
|
| 111 | - } |
|
| 109 | + public function isEnabled() { |
|
| 110 | + return $this->enabled; |
|
| 111 | + } |
|
| 112 | 112 | |
| 113 | - /** |
|
| 114 | - * Get analysis options |
|
| 115 | - * @return \MyArtJaub\Webtrees\Module\GeoDispersion\Model\GeoDisplayOptions |
|
| 116 | - */ |
|
| 117 | - public function getOptions() { |
|
| 118 | - return $this->options; |
|
| 119 | - } |
|
| 113 | + /** |
|
| 114 | + * Get analysis options |
|
| 115 | + * @return \MyArtJaub\Webtrees\Module\GeoDispersion\Model\GeoDisplayOptions |
|
| 116 | + */ |
|
| 117 | + public function getOptions() { |
|
| 118 | + return $this->options; |
|
| 119 | + } |
|
| 120 | 120 | |
| 121 | 121 | /** |
| 122 | - * Set analysis options |
|
| 122 | + * Set analysis options |
|
| 123 | 123 | * |
| 124 | - * @param \MyArtJaub\Webtrees\Module\GeoDispersion\Model\GeoDisplayOptions $options |
|
| 124 | + * @param \MyArtJaub\Webtrees\Module\GeoDispersion\Model\GeoDisplayOptions $options |
|
| 125 | 125 | * @return self Enable method-chaining |
| 126 | - */ |
|
| 127 | - public function setOptions(GeoDisplayOptions $options) { |
|
| 128 | - $this->options = $options; |
|
| 129 | - return $this; |
|
| 130 | - } |
|
| 126 | + */ |
|
| 127 | + public function setOptions(GeoDisplayOptions $options) { |
|
| 128 | + $this->options = $options; |
|
| 129 | + return $this; |
|
| 130 | + } |
|
| 131 | 131 | |
| 132 | 132 | /** |
| 133 | 133 | * Get analysis level |
| 134 | 134 | * @return int |
| 135 | 135 | */ |
| 136 | - public function getAnalysisLevel() { |
|
| 137 | - return $this->analysis_level; |
|
| 138 | - } |
|
| 136 | + public function getAnalysisLevel() { |
|
| 137 | + return $this->analysis_level; |
|
| 138 | + } |
|
| 139 | 139 | |
| 140 | 140 | /** |
| 141 | 141 | * Get analysis level |
@@ -143,19 +143,19 @@ discard block |
||
| 143 | 143 | * @param int $analysis_level |
| 144 | 144 | * @return self Enable method-chaining |
| 145 | 145 | */ |
| 146 | - public function setAnalysisLevel($analysis_level) { |
|
| 147 | - $this->analysis_level = $analysis_level; |
|
| 148 | - return $this; |
|
| 149 | - } |
|
| 146 | + public function setAnalysisLevel($analysis_level) { |
|
| 147 | + $this->analysis_level = $analysis_level; |
|
| 148 | + return $this; |
|
| 149 | + } |
|
| 150 | 150 | |
| 151 | 151 | /** |
| 152 | 152 | * Check whether the analysis has a linked map |
| 153 | 153 | * |
| 154 | 154 | * @return bool |
| 155 | 155 | */ |
| 156 | - public function hasMap() { |
|
| 157 | - return $this->options && $this->options->getMap(); |
|
| 158 | - } |
|
| 156 | + public function hasMap() { |
|
| 157 | + return $this->options && $this->options->getMap(); |
|
| 158 | + } |
|
| 159 | 159 | |
| 160 | 160 | /** |
| 161 | 161 | * Get the URL for the GeoAnalysis. |
@@ -163,120 +163,120 @@ discard block |
||
| 163 | 163 | * @return string |
| 164 | 164 | */ |
| 165 | 165 | public function getHtmlUrl() { |
| 166 | - return 'module.php?mod='. Constants::MODULE_MAJ_GEODISP_NAME . '&mod_action=GeoAnalysis&ga_id=' . $this->getId() . '&ged=' . $this->tree->getNameUrl(); |
|
| 167 | - } |
|
| 166 | + return 'module.php?mod='. Constants::MODULE_MAJ_GEODISP_NAME . '&mod_action=GeoAnalysis&ga_id=' . $this->getId() . '&ged=' . $this->tree->getNameUrl(); |
|
| 167 | + } |
|
| 168 | 168 | |
| 169 | - /** |
|
| 170 | - * Return the dispersion analysis tables. |
|
| 171 | - * Two arrays are returned : |
|
| 172 | - * - the General analysis, which returns the number of ancestors for each place found, plus 4 additional indicators : |
|
| 173 | - * - knownsum : Number of known places |
|
| 174 | - * - unknown : Number of unknown places |
|
| 175 | - * - max : Maximum count of ancestors within a place |
|
| 176 | - * - other : Other places (not in the top level area) |
|
| 177 | - * - the Generations analysis, which returns the number of ancestors for each place found for each generation, plus 3 additional indicators within each generation : |
|
| 178 | - * - sum : Number of known places |
|
| 179 | - * - unknown : Number of unknown places |
|
| 180 | - * - other : Other places (not in the top level area) |
|
| 181 | - * |
|
| 182 | - * @param array $sosalist List of all sosas |
|
| 183 | - * @return array Array of the general and generations table |
|
| 184 | - */ |
|
| 185 | - public function getAnalysisResults($sosalist) { |
|
| 186 | - $placesDispGeneral = null; |
|
| 187 | - $placesDispGenerations = null; |
|
| 169 | + /** |
|
| 170 | + * Return the dispersion analysis tables. |
|
| 171 | + * Two arrays are returned : |
|
| 172 | + * - the General analysis, which returns the number of ancestors for each place found, plus 4 additional indicators : |
|
| 173 | + * - knownsum : Number of known places |
|
| 174 | + * - unknown : Number of unknown places |
|
| 175 | + * - max : Maximum count of ancestors within a place |
|
| 176 | + * - other : Other places (not in the top level area) |
|
| 177 | + * - the Generations analysis, which returns the number of ancestors for each place found for each generation, plus 3 additional indicators within each generation : |
|
| 178 | + * - sum : Number of known places |
|
| 179 | + * - unknown : Number of unknown places |
|
| 180 | + * - other : Other places (not in the top level area) |
|
| 181 | + * |
|
| 182 | + * @param array $sosalist List of all sosas |
|
| 183 | + * @return array Array of the general and generations table |
|
| 184 | + */ |
|
| 185 | + public function getAnalysisResults($sosalist) { |
|
| 186 | + $placesDispGeneral = null; |
|
| 187 | + $placesDispGenerations = null; |
|
| 188 | 188 | |
| 189 | - if($sosalist && count($sosalist) > 0) { |
|
| 190 | - $placesDispGeneral['knownsum'] = 0; |
|
| 191 | - $placesDispGeneral['unknown'] = 0; |
|
| 192 | - $placesDispGeneral['max'] = 0; |
|
| 193 | - $placesDispGeneral['places'] = array(); |
|
| 194 | - foreach($sosalist as $sosaid => $gens) { |
|
| 195 | - $sosa = Individual::getIntance($sosaid, $this->tree); |
|
| 196 | - $place =$sosa->getSignificantPlace(); |
|
| 197 | - $genstab = explode(',', $gens); |
|
| 198 | - $isUnknown=true; |
|
| 199 | - if($sosa->getDerivedRecord()->canShow() && !is_null($place)){ |
|
| 200 | - $levels = array_reverse(array_map('trim',explode(',', $place))); |
|
| 201 | - if(count($levels)>= $this->analysis_level){ |
|
| 202 | - $toplevelvalues = array(); |
|
| 203 | - if($this->hasMap() |
|
| 204 | - && $this->options->getMap()->isLoaded() |
|
| 205 | - && $toplevelvalue = $this->options->getMap()->getTopLevelName() |
|
| 206 | - ) { |
|
| 207 | - $toplevelvalues = array_map('trim',explode(',', strtolower($toplevelvalue))); |
|
| 208 | - } |
|
| 209 | - if(!$this->hasMap() |
|
| 210 | - || is_null($this->options->getMapLevel()) |
|
| 211 | - || ( $this->options->getMap()->isLoaded() && $this->options->getMap()->getTopLevelName() == '*') |
|
| 212 | - || ( |
|
| 213 | - $this->options->getMapLevel() <= $this->analysis_level |
|
| 214 | - && $this->options->getMapLevel() > 0 |
|
| 215 | - && count($levels) >= $this->options->getMapLevel() |
|
| 216 | - && in_array(strtolower($levels[$this->options->getMapLevel()-1]), $toplevelvalues) |
|
| 217 | - ) |
|
| 218 | - ) { |
|
| 219 | - $placest = implode(I18N::$list_separator, array_slice($levels, 0, $this->analysis_level)); |
|
| 220 | - if(isset($placesDispGeneral['places'][$placest])) { |
|
| 221 | - $placesDispGeneral['places'][$placest] += 1; |
|
| 222 | - } |
|
| 223 | - else { |
|
| 224 | - $placesDispGeneral['places'][$placest] = 1; |
|
| 225 | - } |
|
| 226 | - if($placesDispGeneral['places'][$placest]>$placesDispGeneral['max']) |
|
| 227 | - $placesDispGeneral['max'] = $placesDispGeneral['places'][$placest]; |
|
| 228 | - foreach($genstab as $gen) { |
|
| 229 | - if(isset($placesDispGenerations[$gen]['places'][$placest])) { |
|
| 230 | - $placesDispGenerations[$gen]['places'][$placest] += 1; |
|
| 231 | - } |
|
| 232 | - else { |
|
| 233 | - $placesDispGenerations[$gen]['places'][$placest] = 1; |
|
| 234 | - } |
|
| 235 | - if(isset($placesDispGenerations[$gen]['sum'])) { |
|
| 236 | - $placesDispGenerations[$gen]['sum'] += 1; |
|
| 237 | - } |
|
| 238 | - else { |
|
| 239 | - $placesDispGenerations[$gen]['sum'] = 1; |
|
| 240 | - } |
|
| 241 | - } |
|
| 242 | - } |
|
| 243 | - else{ |
|
| 244 | - if(isset($placesDispGeneral['other'])) { |
|
| 245 | - $placesDispGeneral['other'] += 1; |
|
| 246 | - } |
|
| 247 | - else { |
|
| 248 | - $placesDispGeneral['other'] = 1; |
|
| 249 | - } |
|
| 250 | - foreach($genstab as $gen) { |
|
| 251 | - if(isset($placesDispGenerations[$gen]['other'])) { |
|
| 252 | - $placesDispGenerations[$gen]['other'] += 1; |
|
| 253 | - } |
|
| 254 | - else { |
|
| 255 | - $placesDispGenerations[$gen]['other'] = 1; |
|
| 256 | - } |
|
| 257 | - } |
|
| 258 | - } |
|
| 259 | - $placesDispGeneral['knownsum'] += 1; |
|
| 260 | - $isUnknown = false; |
|
| 261 | - } |
|
| 262 | - } |
|
| 263 | - if($isUnknown){ |
|
| 264 | - $placesDispGeneral['unknown'] += 1; |
|
| 265 | - foreach($genstab as $gen) { |
|
| 266 | - if(isset($placesDispGenerations[$gen]['unknown'])) { |
|
| 267 | - $placesDispGenerations[$gen]['unknown'] += 1; |
|
| 268 | - } |
|
| 269 | - else { |
|
| 270 | - $placesDispGenerations[$gen]['unknown'] = 1; |
|
| 271 | - } |
|
| 272 | - } |
|
| 273 | - } |
|
| 274 | - } |
|
| 189 | + if($sosalist && count($sosalist) > 0) { |
|
| 190 | + $placesDispGeneral['knownsum'] = 0; |
|
| 191 | + $placesDispGeneral['unknown'] = 0; |
|
| 192 | + $placesDispGeneral['max'] = 0; |
|
| 193 | + $placesDispGeneral['places'] = array(); |
|
| 194 | + foreach($sosalist as $sosaid => $gens) { |
|
| 195 | + $sosa = Individual::getIntance($sosaid, $this->tree); |
|
| 196 | + $place =$sosa->getSignificantPlace(); |
|
| 197 | + $genstab = explode(',', $gens); |
|
| 198 | + $isUnknown=true; |
|
| 199 | + if($sosa->getDerivedRecord()->canShow() && !is_null($place)){ |
|
| 200 | + $levels = array_reverse(array_map('trim',explode(',', $place))); |
|
| 201 | + if(count($levels)>= $this->analysis_level){ |
|
| 202 | + $toplevelvalues = array(); |
|
| 203 | + if($this->hasMap() |
|
| 204 | + && $this->options->getMap()->isLoaded() |
|
| 205 | + && $toplevelvalue = $this->options->getMap()->getTopLevelName() |
|
| 206 | + ) { |
|
| 207 | + $toplevelvalues = array_map('trim',explode(',', strtolower($toplevelvalue))); |
|
| 208 | + } |
|
| 209 | + if(!$this->hasMap() |
|
| 210 | + || is_null($this->options->getMapLevel()) |
|
| 211 | + || ( $this->options->getMap()->isLoaded() && $this->options->getMap()->getTopLevelName() == '*') |
|
| 212 | + || ( |
|
| 213 | + $this->options->getMapLevel() <= $this->analysis_level |
|
| 214 | + && $this->options->getMapLevel() > 0 |
|
| 215 | + && count($levels) >= $this->options->getMapLevel() |
|
| 216 | + && in_array(strtolower($levels[$this->options->getMapLevel()-1]), $toplevelvalues) |
|
| 217 | + ) |
|
| 218 | + ) { |
|
| 219 | + $placest = implode(I18N::$list_separator, array_slice($levels, 0, $this->analysis_level)); |
|
| 220 | + if(isset($placesDispGeneral['places'][$placest])) { |
|
| 221 | + $placesDispGeneral['places'][$placest] += 1; |
|
| 222 | + } |
|
| 223 | + else { |
|
| 224 | + $placesDispGeneral['places'][$placest] = 1; |
|
| 225 | + } |
|
| 226 | + if($placesDispGeneral['places'][$placest]>$placesDispGeneral['max']) |
|
| 227 | + $placesDispGeneral['max'] = $placesDispGeneral['places'][$placest]; |
|
| 228 | + foreach($genstab as $gen) { |
|
| 229 | + if(isset($placesDispGenerations[$gen]['places'][$placest])) { |
|
| 230 | + $placesDispGenerations[$gen]['places'][$placest] += 1; |
|
| 231 | + } |
|
| 232 | + else { |
|
| 233 | + $placesDispGenerations[$gen]['places'][$placest] = 1; |
|
| 234 | + } |
|
| 235 | + if(isset($placesDispGenerations[$gen]['sum'])) { |
|
| 236 | + $placesDispGenerations[$gen]['sum'] += 1; |
|
| 237 | + } |
|
| 238 | + else { |
|
| 239 | + $placesDispGenerations[$gen]['sum'] = 1; |
|
| 240 | + } |
|
| 241 | + } |
|
| 242 | + } |
|
| 243 | + else{ |
|
| 244 | + if(isset($placesDispGeneral['other'])) { |
|
| 245 | + $placesDispGeneral['other'] += 1; |
|
| 246 | + } |
|
| 247 | + else { |
|
| 248 | + $placesDispGeneral['other'] = 1; |
|
| 249 | + } |
|
| 250 | + foreach($genstab as $gen) { |
|
| 251 | + if(isset($placesDispGenerations[$gen]['other'])) { |
|
| 252 | + $placesDispGenerations[$gen]['other'] += 1; |
|
| 253 | + } |
|
| 254 | + else { |
|
| 255 | + $placesDispGenerations[$gen]['other'] = 1; |
|
| 256 | + } |
|
| 257 | + } |
|
| 258 | + } |
|
| 259 | + $placesDispGeneral['knownsum'] += 1; |
|
| 260 | + $isUnknown = false; |
|
| 261 | + } |
|
| 262 | + } |
|
| 263 | + if($isUnknown){ |
|
| 264 | + $placesDispGeneral['unknown'] += 1; |
|
| 265 | + foreach($genstab as $gen) { |
|
| 266 | + if(isset($placesDispGenerations[$gen]['unknown'])) { |
|
| 267 | + $placesDispGenerations[$gen]['unknown'] += 1; |
|
| 268 | + } |
|
| 269 | + else { |
|
| 270 | + $placesDispGenerations[$gen]['unknown'] = 1; |
|
| 271 | + } |
|
| 272 | + } |
|
| 273 | + } |
|
| 274 | + } |
|
| 275 | 275 | |
| 276 | - } |
|
| 276 | + } |
|
| 277 | 277 | |
| 278 | - return array($placesDispGeneral, $placesDispGenerations); |
|
| 279 | - } |
|
| 278 | + return array($placesDispGeneral, $placesDispGenerations); |
|
| 279 | + } |
|
| 280 | 280 | |
| 281 | 281 | |
| 282 | 282 | } |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | * @return string |
| 164 | 164 | */ |
| 165 | 165 | public function getHtmlUrl() { |
| 166 | - return 'module.php?mod='. Constants::MODULE_MAJ_GEODISP_NAME . '&mod_action=GeoAnalysis&ga_id=' . $this->getId() . '&ged=' . $this->tree->getNameUrl(); |
|
| 166 | + return 'module.php?mod='.Constants::MODULE_MAJ_GEODISP_NAME.'&mod_action=GeoAnalysis&ga_id='.$this->getId().'&ged='.$this->tree->getNameUrl(); |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | /** |
@@ -186,53 +186,53 @@ discard block |
||
| 186 | 186 | $placesDispGeneral = null; |
| 187 | 187 | $placesDispGenerations = null; |
| 188 | 188 | |
| 189 | - if($sosalist && count($sosalist) > 0) { |
|
| 189 | + if ($sosalist && count($sosalist) > 0) { |
|
| 190 | 190 | $placesDispGeneral['knownsum'] = 0; |
| 191 | 191 | $placesDispGeneral['unknown'] = 0; |
| 192 | 192 | $placesDispGeneral['max'] = 0; |
| 193 | 193 | $placesDispGeneral['places'] = array(); |
| 194 | - foreach($sosalist as $sosaid => $gens) { |
|
| 194 | + foreach ($sosalist as $sosaid => $gens) { |
|
| 195 | 195 | $sosa = Individual::getIntance($sosaid, $this->tree); |
| 196 | - $place =$sosa->getSignificantPlace(); |
|
| 196 | + $place = $sosa->getSignificantPlace(); |
|
| 197 | 197 | $genstab = explode(',', $gens); |
| 198 | - $isUnknown=true; |
|
| 199 | - if($sosa->getDerivedRecord()->canShow() && !is_null($place)){ |
|
| 200 | - $levels = array_reverse(array_map('trim',explode(',', $place))); |
|
| 201 | - if(count($levels)>= $this->analysis_level){ |
|
| 198 | + $isUnknown = true; |
|
| 199 | + if ($sosa->getDerivedRecord()->canShow() && !is_null($place)) { |
|
| 200 | + $levels = array_reverse(array_map('trim', explode(',', $place))); |
|
| 201 | + if (count($levels) >= $this->analysis_level) { |
|
| 202 | 202 | $toplevelvalues = array(); |
| 203 | - if($this->hasMap() |
|
| 203 | + if ($this->hasMap() |
|
| 204 | 204 | && $this->options->getMap()->isLoaded() |
| 205 | 205 | && $toplevelvalue = $this->options->getMap()->getTopLevelName() |
| 206 | 206 | ) { |
| 207 | - $toplevelvalues = array_map('trim',explode(',', strtolower($toplevelvalue))); |
|
| 207 | + $toplevelvalues = array_map('trim', explode(',', strtolower($toplevelvalue))); |
|
| 208 | 208 | } |
| 209 | - if(!$this->hasMap() |
|
| 209 | + if (!$this->hasMap() |
|
| 210 | 210 | || is_null($this->options->getMapLevel()) |
| 211 | - || ( $this->options->getMap()->isLoaded() && $this->options->getMap()->getTopLevelName() == '*') |
|
| 211 | + || ($this->options->getMap()->isLoaded() && $this->options->getMap()->getTopLevelName() == '*') |
|
| 212 | 212 | || ( |
| 213 | 213 | $this->options->getMapLevel() <= $this->analysis_level |
| 214 | 214 | && $this->options->getMapLevel() > 0 |
| 215 | 215 | && count($levels) >= $this->options->getMapLevel() |
| 216 | - && in_array(strtolower($levels[$this->options->getMapLevel()-1]), $toplevelvalues) |
|
| 216 | + && in_array(strtolower($levels[$this->options->getMapLevel() - 1]), $toplevelvalues) |
|
| 217 | 217 | ) |
| 218 | 218 | ) { |
| 219 | 219 | $placest = implode(I18N::$list_separator, array_slice($levels, 0, $this->analysis_level)); |
| 220 | - if(isset($placesDispGeneral['places'][$placest])) { |
|
| 220 | + if (isset($placesDispGeneral['places'][$placest])) { |
|
| 221 | 221 | $placesDispGeneral['places'][$placest] += 1; |
| 222 | 222 | } |
| 223 | 223 | else { |
| 224 | 224 | $placesDispGeneral['places'][$placest] = 1; |
| 225 | 225 | } |
| 226 | - if($placesDispGeneral['places'][$placest]>$placesDispGeneral['max']) |
|
| 226 | + if ($placesDispGeneral['places'][$placest] > $placesDispGeneral['max']) |
|
| 227 | 227 | $placesDispGeneral['max'] = $placesDispGeneral['places'][$placest]; |
| 228 | - foreach($genstab as $gen) { |
|
| 229 | - if(isset($placesDispGenerations[$gen]['places'][$placest])) { |
|
| 228 | + foreach ($genstab as $gen) { |
|
| 229 | + if (isset($placesDispGenerations[$gen]['places'][$placest])) { |
|
| 230 | 230 | $placesDispGenerations[$gen]['places'][$placest] += 1; |
| 231 | 231 | } |
| 232 | 232 | else { |
| 233 | 233 | $placesDispGenerations[$gen]['places'][$placest] = 1; |
| 234 | 234 | } |
| 235 | - if(isset($placesDispGenerations[$gen]['sum'])) { |
|
| 235 | + if (isset($placesDispGenerations[$gen]['sum'])) { |
|
| 236 | 236 | $placesDispGenerations[$gen]['sum'] += 1; |
| 237 | 237 | } |
| 238 | 238 | else { |
@@ -240,15 +240,15 @@ discard block |
||
| 240 | 240 | } |
| 241 | 241 | } |
| 242 | 242 | } |
| 243 | - else{ |
|
| 244 | - if(isset($placesDispGeneral['other'])) { |
|
| 243 | + else { |
|
| 244 | + if (isset($placesDispGeneral['other'])) { |
|
| 245 | 245 | $placesDispGeneral['other'] += 1; |
| 246 | 246 | } |
| 247 | 247 | else { |
| 248 | 248 | $placesDispGeneral['other'] = 1; |
| 249 | 249 | } |
| 250 | - foreach($genstab as $gen) { |
|
| 251 | - if(isset($placesDispGenerations[$gen]['other'])) { |
|
| 250 | + foreach ($genstab as $gen) { |
|
| 251 | + if (isset($placesDispGenerations[$gen]['other'])) { |
|
| 252 | 252 | $placesDispGenerations[$gen]['other'] += 1; |
| 253 | 253 | } |
| 254 | 254 | else { |
@@ -260,10 +260,10 @@ discard block |
||
| 260 | 260 | $isUnknown = false; |
| 261 | 261 | } |
| 262 | 262 | } |
| 263 | - if($isUnknown){ |
|
| 263 | + if ($isUnknown) { |
|
| 264 | 264 | $placesDispGeneral['unknown'] += 1; |
| 265 | - foreach($genstab as $gen) { |
|
| 266 | - if(isset($placesDispGenerations[$gen]['unknown'])) { |
|
| 265 | + foreach ($genstab as $gen) { |
|
| 266 | + if (isset($placesDispGenerations[$gen]['unknown'])) { |
|
| 267 | 267 | $placesDispGenerations[$gen]['unknown'] += 1; |
| 268 | 268 | } |
| 269 | 269 | else { |