diff options
Diffstat (limited to 'app/Module')
| -rw-r--r-- | app/Module/AncestorsChartModule.php | 75 | ||||
| -rw-r--r-- | app/Module/CompactTreeChartModule.php | 75 | ||||
| -rw-r--r-- | app/Module/DescendancyChartModule.php | 75 | ||||
| -rw-r--r-- | app/Module/FamilyBookChartModule.php | 75 | ||||
| -rw-r--r-- | app/Module/FanChartModule.php | 81 | ||||
| -rw-r--r-- | app/Module/GoogleMapsModule.php | 23 | ||||
| -rw-r--r-- | app/Module/HourglassChartModule.php | 75 | ||||
| -rw-r--r-- | app/Module/InteractiveTreeModule.php | 25 | ||||
| -rw-r--r-- | app/Module/LifespansChartModule.php | 75 | ||||
| -rw-r--r-- | app/Module/ModuleChartInterface.php | 18 | ||||
| -rw-r--r-- | app/Module/PedigreeChartModule.php | 75 | ||||
| -rw-r--r-- | app/Module/RelationshipsChartModule.php | 86 | ||||
| -rw-r--r-- | app/Module/StatisticsChartModule.php | 75 | ||||
| -rw-r--r-- | app/Module/TimelineChartModule.php | 75 |
14 files changed, 903 insertions, 5 deletions
diff --git a/app/Module/AncestorsChartModule.php b/app/Module/AncestorsChartModule.php new file mode 100644 index 0000000000..58dacde50f --- /dev/null +++ b/app/Module/AncestorsChartModule.php @@ -0,0 +1,75 @@ +<?php +/** + * webtrees: online genealogy + * Copyright (C) 2016 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Module; + +use Fisharebest\Webtrees\Auth; +use Fisharebest\Webtrees\I18N; +use Fisharebest\Webtrees\Menu; +use Fisharebest\Webtrees\Individual; + +/** + * Class AncestorsChartModule + */ +class AncestorsChartModule extends AbstractModule implements ModuleChartInterface { + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ + public function getTitle() { + return /* I18N: Name of a module/chart */ I18N::translate('Ancestors'); + } + + /** + * A sentence describing what this module does. + * + * @return string + */ + public function getDescription() { + return /* I18N: Description of the “AncestorsChart” module */ I18N::translate('A chart of an individual’s ancestors.'); + } + + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ + public function defaultAccessLevel() { + return Auth::PRIV_PRIVATE; + } + + /** + * Return a menu item for this chart. + * + * @return Menu + */ + public function getChartMenu(Individual $individual) { + global $controller, $WT_TREE; + + return new Menu( + $this->getTitle(), + 'ancestry.php?rootid=' . $individual->getXref() . '&ged=' . $WT_TREE->getNameUrl(), + 'menu-chart-ancestry', + array('rel' => 'nofollow') + ); + } + + public function getBoxChartMenu(Individual $individual) { + return $this->getChartMenu($individual); + } +} diff --git a/app/Module/CompactTreeChartModule.php b/app/Module/CompactTreeChartModule.php new file mode 100644 index 0000000000..6b5499af63 --- /dev/null +++ b/app/Module/CompactTreeChartModule.php @@ -0,0 +1,75 @@ +<?php +/** + * webtrees: online genealogy + * Copyright (C) 2016 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Module; + +use Fisharebest\Webtrees\Auth; +use Fisharebest\Webtrees\I18N; +use Fisharebest\Webtrees\Menu; +use Fisharebest\Webtrees\Individual; + +/** + * Class CompactTreeChartModule + */ +class CompactTreeChartModule extends AbstractModule implements ModuleChartInterface { + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ + public function getTitle() { + return /* I18N: Name of a module/chart */ I18N::translate('Compact tree'); + } + + /** + * A sentence describing what this module does. + * + * @return string + */ + public function getDescription() { + return /* I18N: Description of the “CompactTreeChart” module */ I18N::translate('A chart of an individual’s ancestors, as a compact tree.'); + } + + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ + public function defaultAccessLevel() { + return Auth::PRIV_PRIVATE; + } + + /** + * Return a menu item for this chart. + * + * @return Menu + */ + public function getChartMenu(Individual $individual) { + global $controller, $WT_TREE; + + return new Menu( + $this->getTitle(), + 'compact.php?rootid=' . $individual->getXref() . '&ged=' . $WT_TREE->getNameUrl(), + 'menu-chart-compact', + array('rel' => 'nofollow') + ); + } + + public function getBoxChartMenu(Individual $individual) { + return $this->getChartMenu($individual); + } +} diff --git a/app/Module/DescendancyChartModule.php b/app/Module/DescendancyChartModule.php new file mode 100644 index 0000000000..cb218cbad2 --- /dev/null +++ b/app/Module/DescendancyChartModule.php @@ -0,0 +1,75 @@ +<?php +/** + * webtrees: online genealogy + * Copyright (C) 2016 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Module; + +use Fisharebest\Webtrees\Auth; +use Fisharebest\Webtrees\I18N; +use Fisharebest\Webtrees\Menu; +use Fisharebest\Webtrees\Individual; + +/** + * Class DescendancyChartModule + */ +class DescendancyChartModule extends AbstractModule implements ModuleChartInterface { + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ + public function getTitle() { + return /* I18N: Name of a module/chart */ I18N::translate('Descendants'); + } + + /** + * A sentence describing what this module does. + * + * @return string + */ + public function getDescription() { + return /* I18N: Description of the “DescendancyChart” module */ I18N::translate('A chart of an individual’s descendants.'); + } + + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ + public function defaultAccessLevel() { + return Auth::PRIV_PRIVATE; + } + + /** + * Return a menu item for this chart. + * + * @return Menu + */ + public function getChartMenu(Individual $individual) { + global $controller, $WT_TREE; + + return new Menu( + $this->getTitle(), + 'descendancy.php?rootid=' . $individual->getXref() . '&ged=' . $WT_TREE->getNameUrl(), + 'menu-chart-descendants', + array('rel' => 'nofollow') + ); + } + + public function getBoxChartMenu(Individual $individual) { + return $this->getChartMenu($individual); + } +} diff --git a/app/Module/FamilyBookChartModule.php b/app/Module/FamilyBookChartModule.php new file mode 100644 index 0000000000..05b1c471c2 --- /dev/null +++ b/app/Module/FamilyBookChartModule.php @@ -0,0 +1,75 @@ +<?php +/** + * webtrees: online genealogy + * Copyright (C) 2016 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Module; + +use Fisharebest\Webtrees\Auth; +use Fisharebest\Webtrees\I18N; +use Fisharebest\Webtrees\Menu; +use Fisharebest\Webtrees\Individual; + +/** + * Class FamilyBookChartModule + */ +class FamilyBookChartModule extends AbstractModule implements ModuleChartInterface { + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ + public function getTitle() { + return /* I18N: Name of a module/chart */ I18N::translate('Family book'); + } + + /** + * A sentence describing what this module does. + * + * @return string + */ + public function getDescription() { + return /* I18N: Description of the “FamilyBookChart” module */ I18N::translate('A chart of an individual’s ancestors and descendants, as a family book.'); + } + + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ + public function defaultAccessLevel() { + return Auth::PRIV_PRIVATE; + } + + /** + * Return a menu item for this chart. + * + * @return Menu + */ + public function getChartMenu(Individual $individual) { + global $controller, $WT_TREE; + + return new Menu( + $this->getTitle(), + 'familybook.php?rootid=' . $individual->getXref() . '&ged=' . $WT_TREE->getNameUrl(), + 'menu-chart-familybook', + array('rel' => 'nofollow') + ); + } + + public function getBoxChartMenu(Individual $individual) { + return $this->getChartMenu($individual); + } +} diff --git a/app/Module/FanChartModule.php b/app/Module/FanChartModule.php new file mode 100644 index 0000000000..117d9c2b13 --- /dev/null +++ b/app/Module/FanChartModule.php @@ -0,0 +1,81 @@ +<?php +/** + * webtrees: online genealogy + * Copyright (C) 2016 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Module; + +use Fisharebest\Webtrees\Auth; +use Fisharebest\Webtrees\I18N; +use Fisharebest\Webtrees\Menu; +use Fisharebest\Webtrees\Individual; + +/** + * Class FanChartModule + */ +class FanChartModule extends AbstractModule implements ModuleChartInterface { + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ + public function getTitle() { + return /* I18N: Name of a module/chart */ I18N::translate('Fan chart'); + } + + /** + * A sentence describing what this module does. + * + * @return string + */ + public function getDescription() { + return /* I18N: Description of the “FamilyBookChart” module */ I18N::translate('A fan chart of an individual’s ancestors.'); + } + + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ + public function defaultAccessLevel() { + return Auth::PRIV_PRIVATE; + } + + /** + * Return a menu item for this chart. + * + * We can only do this if the GD2 library is installed with TrueType support. + * + * @return Menu + */ + public function getChartMenu(Individual $individual) { + global $controller, $WT_TREE; + + if (function_exists('imagettftext')) { + return new Menu( + $this->getTitle(), + 'fanchart.php?rootid=' . $individual->getXref() . '&ged=' . $WT_TREE->getNameUrl(), + 'menu-chart-fanchart', + array('rel' => 'nofollow') + ); + } else { + return null; + } + } + + public function getBoxChartMenu(Individual $individual) { + return $this->getChartMenu($individual); + } +} diff --git a/app/Module/GoogleMapsModule.php b/app/Module/GoogleMapsModule.php index dbb8e27afc..be926d2023 100644 --- a/app/Module/GoogleMapsModule.php +++ b/app/Module/GoogleMapsModule.php @@ -34,6 +34,7 @@ use Fisharebest\Webtrees\Module; use Fisharebest\Webtrees\Stats; use Fisharebest\Webtrees\Theme; use Fisharebest\Webtrees\Tree; +use Fisharebest\Webtrees\Menu; use PDO; /** @@ -53,7 +54,7 @@ use PDO; * * Hence, use "Google Maps™ mapping service" where appropriate. */ -class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, ModuleTabInterface { +class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, ModuleTabInterface, ModuleChartInterface { // How to update the database schema for this module const SCHEMA_TARGET_VERSION = 6; const SCHEMA_SETTING_NAME = 'GM_SCHEMA_VERSION'; @@ -212,6 +213,26 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface, } /** + * Return a menu item for this chart. + * + * @return Menu + */ + public function getChartMenu(Individual $individual) { + global $controller, $WT_TREE; + + return new Menu( + I18N::translate('Pedigree map'), + 'module.php?mod=googlemap&mod_action=pedigree_map&rootid=' . $individual->getXref() . '&ged=' . $WT_TREE->getNameUrl(), + 'menu-chart-pedigree_map', + array('rel' => 'nofollow') + ); + } + + public function getBoxChartMenu(Individual $individual) { + return $this->getChartMenu($individual); + } + + /** * A form to edit the module configuration. */ private function config() { diff --git a/app/Module/HourglassChartModule.php b/app/Module/HourglassChartModule.php new file mode 100644 index 0000000000..e6797c06c2 --- /dev/null +++ b/app/Module/HourglassChartModule.php @@ -0,0 +1,75 @@ +<?php +/** + * webtrees: online genealogy + * Copyright (C) 2016 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Module; + +use Fisharebest\Webtrees\Auth; +use Fisharebest\Webtrees\I18N; +use Fisharebest\Webtrees\Menu; +use Fisharebest\Webtrees\Individual; + +/** + * Class HourglassChartModule + */ +class HourglassChartModule extends AbstractModule implements ModuleChartInterface { + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ + public function getTitle() { + return /* I18N: Name of a module/chart */ I18N::translate('Hourglass chart'); + } + + /** + * A sentence describing what this module does. + * + * @return string + */ + public function getDescription() { + return /* I18N: Description of the “HourglassChart” module */ I18N::translate('An hourglass chart of an individual’s ancestors and descendants.'); + } + + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ + public function defaultAccessLevel() { + return Auth::PRIV_PRIVATE; + } + + /** + * Return a menu item for this chart. + * + * @return Menu + */ + public function getChartMenu(Individual $individual) { + global $controller, $WT_TREE; + + return new Menu( + $this->getTitle(), + 'hourglass.php?rootid=' . $individual->getXref() . '&ged=' . $WT_TREE->getNameUrl(), + 'menu-chart-hourglass', + array('rel' => 'nofollow') + ); + } + + public function getBoxChartMenu(Individual $individual) { + return $this->getChartMenu($individual); + } +} diff --git a/app/Module/InteractiveTreeModule.php b/app/Module/InteractiveTreeModule.php index dc461efb16..c7de450c6b 100644 --- a/app/Module/InteractiveTreeModule.php +++ b/app/Module/InteractiveTreeModule.php @@ -21,12 +21,13 @@ use Fisharebest\Webtrees\Filter; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Individual; use Fisharebest\Webtrees\Module\InteractiveTree\TreeView; +use Fisharebest\Webtrees\Menu; /** * Class InteractiveTreeModule * Tip : you could change the number of generations loaded before ajax calls both in individual page and in treeview page to optimize speed and server load */ -class InteractiveTreeModule extends AbstractModule implements ModuleTabInterface { +class InteractiveTreeModule extends AbstractModule implements ModuleTabInterface,ModuleChartInterface { /** {@inheritdoc} */ public function getTitle() { return /* I18N: Name of a module */ I18N::translate('Interactive tree'); @@ -70,7 +71,27 @@ class InteractiveTreeModule extends AbstractModule implements ModuleTabInterface public function canLoadAjax() { return true; } - + + /** + * Return a menu item for this chart. + * + * @return Menu + */ + public function getChartMenu(Individual $individual) { + global $controller, $WT_TREE; + + return new Menu( + $this->getTitle(), + 'module.php?mod=tree&mod_action=treeview&rootid=' . $individual->getXref() . '&ged=' . $WT_TREE->getNameUrl(), + 'menu-chart-tree', + array('rel' => 'nofollow') + ); + } + + public function getBoxChartMenu(Individual $individual) { + return $this->getChartMenu($individual); + } + /** {@inheritdoc} */ public function getPreLoadContent() { // We cannot use jQuery("head").append(<link rel="stylesheet" ...as jQuery is not loaded at this time diff --git a/app/Module/LifespansChartModule.php b/app/Module/LifespansChartModule.php new file mode 100644 index 0000000000..29dd3d3bf5 --- /dev/null +++ b/app/Module/LifespansChartModule.php @@ -0,0 +1,75 @@ +<?php +/** + * webtrees: online genealogy + * Copyright (C) 2016 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Module; + +use Fisharebest\Webtrees\Auth; +use Fisharebest\Webtrees\I18N; +use Fisharebest\Webtrees\Menu; +use Fisharebest\Webtrees\Individual; + +/** + * Class LifespansChartModule + */ +class LifespansChartModule extends AbstractModule implements ModuleChartInterface { + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ + public function getTitle() { + return /* I18N: Name of a module/chart */ I18N::translate('Lifespans'); + } + + /** + * A sentence describing what this module does. + * + * @return string + */ + public function getDescription() { + return /* I18N: Description of the “LifespansChart” module */ I18N::translate('A chart of individuals’ lifespans.'); + } + + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ + public function defaultAccessLevel() { + return Auth::PRIV_PRIVATE; + } + + /** + * Return a menu item for this chart. + * + * @return Menu + */ + public function getChartMenu(Individual $individual) { + global $controller, $WT_TREE; + + return new Menu( + $this->getTitle(), + 'lifespan.php', + 'menu-chart-lifespan', + array('rel' => 'nofollow') + ); + } + + public function getBoxChartMenu(Individual $individual) { + return null; + } +} diff --git a/app/Module/ModuleChartInterface.php b/app/Module/ModuleChartInterface.php index 6a11e7bbcb..2c278a1831 100644 --- a/app/Module/ModuleChartInterface.php +++ b/app/Module/ModuleChartInterface.php @@ -15,10 +15,24 @@ */ namespace Fisharebest\Webtrees\Module; +use Fisharebest\Webtrees\Individual; + /** * Interface ModuleChartInterface - Classes and libraries for module system - * - * This class is not currently used. */ interface ModuleChartInterface { + + /** + * Return a menu item for this chart. + * + * @return Menu + */ + public function getChartMenu(Individual $individual); + + /** + * Return a menu item for this chart (for menu in individual box). + * + * @return Menu or null if not applicable in box + */ + public function getBoxChartMenu(Individual $individual); } diff --git a/app/Module/PedigreeChartModule.php b/app/Module/PedigreeChartModule.php new file mode 100644 index 0000000000..8bc657f824 --- /dev/null +++ b/app/Module/PedigreeChartModule.php @@ -0,0 +1,75 @@ +<?php +/** + * webtrees: online genealogy + * Copyright (C) 2016 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Module; + +use Fisharebest\Webtrees\Auth; +use Fisharebest\Webtrees\I18N; +use Fisharebest\Webtrees\Menu; +use Fisharebest\Webtrees\Individual; + +/** + * Class PedigreeChartModule + */ +class PedigreeChartModule extends AbstractModule implements ModuleChartInterface { + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ + public function getTitle() { + return /* I18N: Name of a module/chart */ I18N::translate('Pedigree'); + } + + /** + * A sentence describing what this module does. + * + * @return string + */ + public function getDescription() { + return /* I18N: Description of the “PedigreeChart” module */ I18N::translate('A chart of an individual’s ancestors, formatted as a tree.'); + } + + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ + public function defaultAccessLevel() { + return Auth::PRIV_PRIVATE; + } + + /** + * Return a menu item for this chart. + * + * @return Menu + */ + public function getChartMenu(Individual $individual) { + global $controller, $WT_TREE; + + return new Menu( + $this->getTitle(), + 'pedigree.php?rootid=' . $individual->getXref() . '&ged=' . $WT_TREE->getNameUrl(), + 'menu-chart-pedigree', + array('rel' => 'nofollow') + ); + } + + public function getBoxChartMenu(Individual $individual) { + return $this->getChartMenu($individual); + } +} diff --git a/app/Module/RelationshipsChartModule.php b/app/Module/RelationshipsChartModule.php new file mode 100644 index 0000000000..79c1c3f7ad --- /dev/null +++ b/app/Module/RelationshipsChartModule.php @@ -0,0 +1,86 @@ +<?php +/** + * webtrees: online genealogy + * Copyright (C) 2016 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Module; + +use Fisharebest\Webtrees\Auth; +use Fisharebest\Webtrees\I18N; +use Fisharebest\Webtrees\Menu; +use Fisharebest\Webtrees\Individual; + +/** + * Class RelationshipsChartModule + */ +class RelationshipsChartModule extends AbstractModule implements ModuleChartInterface { + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ + public function getTitle() { + return /* I18N: Name of a module/chart */ I18N::translate('Relationships'); + } + + /** + * A sentence describing what this module does. + * + * @return string + */ + public function getDescription() { + return /* I18N: Description of the “RelationshipsChart” module */ I18N::translate('A chart displaying relationships between two individuals.'); + } + + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ + public function defaultAccessLevel() { + return Auth::PRIV_PRIVATE; + } + + /** + * Return a menu item for this chart. + * + * @return Menu + */ + public function getChartMenu(Individual $individual) { + global $controller, $WT_TREE; + + $gedcomid = $WT_TREE->getUserPreference(Auth::user(), 'gedcomid'); + + if ($gedcomid && $individual->getXref()) { + return new Menu( + I18N::translate('Relationship to me'), + 'relationship.php?pid1=' . $gedcomid . '&pid2=' . $individual->getXref() . '&ged=' . $WT_TREE->getNameUrl(), + 'menu-chart-relationship', + array('rel' => 'nofollow') + ); + } else { + return new Menu( + I18N::translate('Relationships'), + 'relationship.php?pid1=' . $individual->getXref() . '&ged=' . $WT_TREE->getNameUrl(), + 'menu-chart-relationship', + array('rel' => 'nofollow') + ); + } + } + + public function getBoxChartMenu(Individual $individual) { + return $this->getChartMenu($individual); + } +} diff --git a/app/Module/StatisticsChartModule.php b/app/Module/StatisticsChartModule.php new file mode 100644 index 0000000000..d3e9c3c3ca --- /dev/null +++ b/app/Module/StatisticsChartModule.php @@ -0,0 +1,75 @@ +<?php +/** + * webtrees: online genealogy + * Copyright (C) 2016 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Module; + +use Fisharebest\Webtrees\Auth; +use Fisharebest\Webtrees\I18N; +use Fisharebest\Webtrees\Menu; +use Fisharebest\Webtrees\Individual; + +/** + * Class StatisticsChartModule + */ +class StatisticsChartModule extends AbstractModule implements ModuleChartInterface { + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ + public function getTitle() { + return /* I18N: Name of a module/chart */ I18N::translate('Statistics'); + } + + /** + * A sentence describing what this module does. + * + * @return string + */ + public function getDescription() { + return /* I18N: Description of the “StatisticsChart” module */ I18N::translate('Various statistics charts.'); + } + + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ + public function defaultAccessLevel() { + return Auth::PRIV_PRIVATE; + } + + /** + * Return a menu item for this chart. + * + * @return Menu + */ + public function getChartMenu(Individual $individual) { + global $controller, $WT_TREE; + + return new Menu( + $this->getTitle(), + 'statistics.php?ged=' . $WT_TREE->getNameUrl(), + 'menu-chart-statistics', + array('rel' => 'nofollow') + ); + } + + public function getBoxChartMenu(Individual $individual) { + return null; + } +} diff --git a/app/Module/TimelineChartModule.php b/app/Module/TimelineChartModule.php new file mode 100644 index 0000000000..286704ddf3 --- /dev/null +++ b/app/Module/TimelineChartModule.php @@ -0,0 +1,75 @@ +<?php +/** + * webtrees: online genealogy + * Copyright (C) 2016 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Module; + +use Fisharebest\Webtrees\Auth; +use Fisharebest\Webtrees\I18N; +use Fisharebest\Webtrees\Menu; +use Fisharebest\Webtrees\Individual; + +/** + * Class TimelineChartModule + */ +class TimelineChartModule extends AbstractModule implements ModuleChartInterface { + /** + * How should this module be labelled on tabs, menus, etc.? + * + * @return string + */ + public function getTitle() { + return /* I18N: Name of a module/chart */ I18N::translate('Timeline'); + } + + /** + * A sentence describing what this module does. + * + * @return string + */ + public function getDescription() { + return /* I18N: Description of the “TimelineChart” module */ I18N::translate('A timeline displaying individual events.'); + } + + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ + public function defaultAccessLevel() { + return Auth::PRIV_PRIVATE; + } + + /** + * Return a menu item for this chart. + * + * @return Menu + */ + public function getChartMenu(Individual $individual) { + global $controller, $WT_TREE; + + return new Menu( + $this->getTitle(), + 'timeline.php?pids%5B%5D=' . $individual->getXref() . '&ged=' . $WT_TREE->getNameUrl(), + 'menu-chart-timeline', + array('rel' => 'nofollow') + ); + } + + public function getBoxChartMenu(Individual $individual) { + return null; + } +} |
