summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--admin_module_charts.php106
-rw-r--r--admin_modules.php6
-rw-r--r--app/Module/AncestorsChartModule.php75
-rw-r--r--app/Module/CompactTreeChartModule.php75
-rw-r--r--app/Module/DescendancyChartModule.php75
-rw-r--r--app/Module/FamilyBookChartModule.php75
-rw-r--r--app/Module/FanChartModule.php81
-rw-r--r--app/Module/GoogleMapsModule.php23
-rw-r--r--app/Module/HourglassChartModule.php75
-rw-r--r--app/Module/InteractiveTreeModule.php25
-rw-r--r--app/Module/LifespansChartModule.php75
-rw-r--r--app/Module/ModuleChartInterface.php18
-rw-r--r--app/Module/PedigreeChartModule.php75
-rw-r--r--app/Module/RelationshipsChartModule.php86
-rw-r--r--app/Module/StatisticsChartModule.php75
-rw-r--r--app/Module/TimelineChartModule.php75
-rw-r--r--app/Schema/Migration34.php33
-rw-r--r--app/Theme/AbstractTheme.php220
-rw-r--r--app/Theme/AdministrationTheme.php1
-rw-r--r--includes/session.php2
-rw-r--r--modules_v3/ancestors_chart/module.php20
-rw-r--r--modules_v3/compact_tree_chart/module.php20
-rw-r--r--modules_v3/descendancy_chart/module.php20
-rw-r--r--modules_v3/family_book_chart/module.php20
-rw-r--r--modules_v3/fan_chart/module.php20
-rw-r--r--modules_v3/hourglass_chart/module.php20
-rw-r--r--modules_v3/lifespans_chart/module.php20
-rw-r--r--modules_v3/pedigree_chart/module.php20
-rw-r--r--modules_v3/relationships_chart/module.php20
-rw-r--r--modules_v3/statistics_chart/module.php20
-rw-r--r--modules_v3/timeline_chart/module.php20
31 files changed, 1353 insertions, 143 deletions
diff --git a/admin_module_charts.php b/admin_module_charts.php
new file mode 100644
index 0000000000..6dfb58ab2d
--- /dev/null
+++ b/admin_module_charts.php
@@ -0,0 +1,106 @@
+<?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;
+
+use Fisharebest\Webtrees\Controller\PageController;
+use Fisharebest\Webtrees\Functions\FunctionsEdit;
+use Fisharebest\Webtrees\Module\ModuleConfigInterface;
+
+define('WT_SCRIPT_NAME', 'admin_module_charts.php');
+require 'includes/session.php';
+
+$controller = new PageController;
+$controller
+ ->restrictAccess(Auth::isAdmin())
+ ->setPageTitle(I18N::translate('Charts'));
+
+$action = Filter::post('action');
+$modules = Module::getAllModulesByComponent('chart');
+
+if ($action === 'update_mods' && Filter::checkCsrf()) {
+ foreach ($modules as $module) {
+ foreach (Tree::getAll() as $tree) {
+ $access_level = Filter::post('access-' . $module->getName() . '-' . $tree->getTreeId(), WT_REGEX_INTEGER, $module->defaultAccessLevel());
+ Database::prepare(
+ "REPLACE INTO `##module_privacy` (module_name, gedcom_id, component, access_level) VALUES (?, ?, 'chart', ?)"
+ )->execute(array($module->getName(), $tree->getTreeId(), $access_level));
+ }
+ }
+
+ header('Location: ' . WT_BASE_URL . WT_SCRIPT_NAME);
+
+ return;
+}
+
+$controller
+ ->pageHeader();
+
+?>
+<ol class="breadcrumb small">
+ <li><a href="admin.php"><?php echo I18N::translate('Control panel'); ?></a></li>
+ <li><a href="admin_modules.php"><?php echo I18N::translate('Module administration'); ?></a></li>
+ <li class="active"><?php echo $controller->getPageTitle(); ?></li>
+</ol>
+
+<h1><?php echo $controller->getPageTitle(); ?></h1>
+
+<form method="post">
+ <input type="hidden" name="action" value="update_mods">
+ <?php echo Filter::getCsrf(); ?>
+ <table class="table table-bordered">
+ <thead>
+ <tr>
+ <th class="col-xs-2"><?php echo I18N::translate('Chart'); ?></th>
+ <th class="col-xs-5"><?php echo I18N::translate('Description'); ?></th>
+ <th class="col-xs-5"><?php echo I18N::translate('Access level'); ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php foreach ($modules as $module_name => $module): ?>
+ <tr>
+ <td class="col-xs-2">
+ <?php if ($module instanceof ModuleConfigInterface): ?>
+ <a href="<?php echo $module->getConfigLink(); ?>"><?php echo $module->getTitle(); ?> <i class="fa fa-cogs"></i></a>
+ <?php else: ?>
+ <?php echo $module->getTitle(); ?>
+ <?php endif; ?>
+ </td>
+ <td class="col-xs-5"><?php echo $module->getDescription(); ?></td>
+ <td class="col-xs-5">
+ <table class="table">
+ <tbody>
+ <?php foreach (Tree::getAll() as $tree): ?>
+ <tr>
+ <td>
+ <?php echo $tree->getTitleHtml(); ?>
+ </td>
+ <td>
+ <?php echo FunctionsEdit::editFieldAccessLevel('access-' . $module->getName() . '-' . $tree->getTreeId(), $module->getAccessLevel($tree, 'chart')); ?>
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+ <button class="btn btn-primary" type="submit">
+ <i class="fa fa-check"></i>
+ <?php echo I18N::translate('save'); ?>
+ </button>
+</form>
diff --git a/admin_modules.php b/admin_modules.php
index db2a0c3791..d0d540a2f2 100644
--- a/admin_modules.php
+++ b/admin_modules.php
@@ -129,7 +129,7 @@ $controller
{ class: "center" },
{ class: "center" },
{ class: "center" },
- { class: "center", visible: false }, // The Module system does not yet include charts
+ { class: "center" },
{ class: "center" },
{ class: "center", visible: false } // The Module system does not yet include themes
]
@@ -160,7 +160,7 @@ $controller
<th class="hidden-xs"><a href="admin_module_tabs.php"><?php echo I18N::translate('Tabs'); ?></a></th>
<th class="hidden-xs"><a href="admin_module_sidebar.php"><?php echo I18N::translate('Sidebars'); ?></a></th>
<th class="hidden-xs"><a href="admin_module_blocks.php"><?php echo I18N::translate('Blocks'); ?></a></th>
- <th class="hidden"><?php echo I18N::translate('Charts'); ?></th>
+ <th class="hidden-xs"><a href="admin_module_charts.php"><?php echo I18N::translate('Charts'); ?></a></th>
<th class="hidden-xs"><a href="admin_module_reports.php"><?php echo I18N::translate('Reports'); ?></a></th>
<th class="hidden"><?php echo I18N::translate('Themes'); ?></th>
</tr>
@@ -186,7 +186,7 @@ $controller
'<td class="text-center text-muted hidden-xs">', $module instanceof ModuleTabInterface ? '<i class="fa fa-folder" title="' . I18N::translate('Tab') . '"></i>' : '-', '</td>',
'<td class="text-center text-muted hidden-xs">', $module instanceof ModuleSidebarInterface ? '<i class="fa fa-th-large" title="' . I18N::translate('Sidebar') . '"></i>' : '-', '</td>',
'<td class="text-center text-muted hidden-xs">', $module instanceof ModuleBlockInterface ? (($module->isUserBlock() ? '<i class="fa fa-user" title="' . I18N::translate('My page') . '"></i>' : '') . ($module->isGedcomBlock() ? '<i class="fa fa-tree" title="' . I18N::translate('Home page') . '"></i>' : '')) : '-', '</td>',
- '<td class="text-center text-muted hidden">', $module instanceof ModuleChartInterface ? '<i class="fa fa-check" title="' . I18N::translate('Chart') . '"></i>' : '-', '</td>',
+ '<td class="text-center text-muted hidden-xs">', $module instanceof ModuleChartInterface ? '<i class="fa fa-share-alt" title="' . I18N::translate('Chart') . '"></i>' : '-', '</td>',
'<td class="text-center text-muted hidden-xs">', $module instanceof ModuleReportInterface ? '<i class="fa fa-file" title="' . I18N::translate('Report') . '"></i>' : '-', '</td>',
'<td class="text-center text-muted hidden">', $module instanceof ModuleThemeInterface ? '<i class="fa fa-check" title="' . I18N::translate('Theme') . '"></i>' : '-', '</td>',
'</tr>';
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() . '&amp;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() . '&amp;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() . '&amp;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() . '&amp;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() . '&amp;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&amp;mod_action=pedigree_map&amp;rootid=' . $individual->getXref() . '&amp;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() . '&amp;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&amp;mod_action=treeview&amp;rootid=' . $individual->getXref() . '&amp;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() . '&amp;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 . '&amp;pid2=' . $individual->getXref() . '&amp;ged=' . $WT_TREE->getNameUrl(),
+ 'menu-chart-relationship',
+ array('rel' => 'nofollow')
+ );
+ } else {
+ return new Menu(
+ I18N::translate('Relationships'),
+ 'relationship.php?pid1=' . $individual->getXref() . '&amp;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() . '&amp;ged=' . $WT_TREE->getNameUrl(),
+ 'menu-chart-timeline',
+ array('rel' => 'nofollow')
+ );
+ }
+
+ public function getBoxChartMenu(Individual $individual) {
+ return null;
+ }
+}
diff --git a/app/Schema/Migration34.php b/app/Schema/Migration34.php
new file mode 100644
index 0000000000..d41dc48c16
--- /dev/null
+++ b/app/Schema/Migration34.php
@@ -0,0 +1,33 @@
+<?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\Schema;
+
+use Fisharebest\Webtrees\Database;
+use Fisharebest\Webtrees\Module;
+use Fisharebest\Webtrees\I18N;
+
+/**
+ * Upgrade the database schema from version 33 to version 34.
+ */
+class Migration34 implements MigrationInterface {
+
+ /**
+ * Upgrade to to the next version (for 'Charts as modules', the respective modules should be enabled by default)
+ */
+ public function upgrade() {
+ Module::getInstalledModules('enabled');
+ }
+}
diff --git a/app/Theme/AbstractTheme.php b/app/Theme/AbstractTheme.php
index 814c7792ac..213adc2462 100644
--- a/app/Theme/AbstractTheme.php
+++ b/app/Theme/AbstractTheme.php
@@ -35,6 +35,20 @@ use Fisharebest\Webtrees\Site;
use Fisharebest\Webtrees\Theme;
use Fisharebest\Webtrees\Tree;
use Fisharebest\Webtrees\User;
+use Fisharebest\Webtrees\Module\AncestorsChartModule;
+use Fisharebest\Webtrees\Module\CompactTreeChartModule;
+use Fisharebest\Webtrees\Module\DescendancyChartModule;
+use Fisharebest\Webtrees\Module\FamilyBookChartModule;
+use Fisharebest\Webtrees\Module\FanChartModule;
+use Fisharebest\Webtrees\Module\InteractiveTreeModule;
+use Fisharebest\Webtrees\Module\HourglassChartModule;
+use Fisharebest\Webtrees\Module\LifespansChartModule;
+use Fisharebest\Webtrees\Module\PedigreeChartModule;
+use Fisharebest\Webtrees\Module\GoogleMapsModule;
+use Fisharebest\Webtrees\Module\RelationshipsChartModule;
+use Fisharebest\Webtrees\Module\StatisticsChartModule;
+use Fisharebest\Webtrees\Module\TimelineChartModule;
+
/**
* Common functions for all themes.
@@ -951,24 +965,23 @@ abstract class AbstractTheme {
* @return Menu[]
*/
protected function individualBoxMenuCharts(Individual $individual) {
- $menus = array_filter(array(
- $this->menuChartAncestors($individual),
- $this->menuChartCompact($individual),
- $this->menuChartDescendants($individual),
- $this->menuChartFanChart($individual),
- $this->menuChartHourglass($individual),
- $this->menuChartInteractiveTree($individual),
- $this->menuChartPedigree($individual),
- $this->menuChartPedigreeMap($individual),
- $this->menuChartRelationship($individual),
- $this->menuChartTimeline($individual),
- ));
-
- usort($menus, function (Menu $x, Menu $y) {
- return I18N::strcasecmp($x->getLabel(), $y->getLabel());
- });
+ $menus = array();
+ foreach (Module::getActiveCharts($this->tree) as $chart) {
+ $menu = $chart->getBoxChartMenu($individual);
+ if ($menu) {
+ $menus[] = $menu;
+ }
+ }
+
+ if ($menus) {
+ usort($menus, function (Menu $x, Menu $y) {
+ return I18N::strcasecmp($x->getLabel(), $y->getLabel());
+ });
- return $menus;
+ return $menus;
+ } else {
+ return null;
+ }
}
/**
@@ -1082,190 +1095,129 @@ abstract class AbstractTheme {
* @return Menu
*/
protected function menuChart(Individual $individual) {
- $submenus = array_filter(array(
- $this->menuChartAncestors($individual),
- $this->menuChartCompact($individual),
- $this->menuChartDescendants($individual),
- $this->menuChartFamilyBook($individual),
- $this->menuChartFanChart($individual),
- $this->menuChartHourglass($individual),
- $this->menuChartInteractiveTree($individual),
- $this->menuChartLifespan($individual),
- $this->menuChartPedigree($individual),
- $this->menuChartPedigreeMap($individual),
- $this->menuChartRelationship($individual),
- $this->menuChartStatistics(),
- $this->menuChartTimeline($individual),
- ));
-
- usort($submenus, function (Menu $x, Menu $y) {
- return I18N::strcasecmp($x->getLabel(), $y->getLabel());
- });
+ $submenus = array();
+ foreach (Module::getActiveCharts($this->tree) as $chart) {
+ $menu = $chart->getChartMenu($individual);
+ if ($menu) {
+ $submenus[] = $menu;
+ }
+ }
+
+ if ($submenus) {
+ usort($submenus, function (Menu $x, Menu $y) {
+ return I18N::strcasecmp($x->getLabel(), $y->getLabel());
+ });
- return new Menu(I18N::translate('Charts'), '#', 'menu-chart', array('rel' => 'nofollow'), $submenus);
+ return new Menu(I18N::translate('Charts'), '#', 'menu-chart', array('rel' => 'nofollow'), $submenus);
+ } else {
+ return null;
+ }
}
/**
- * Generate a menu item for the ancestors chart (ancestry.php).
- *
- * @param Individual $individual
- *
- * @return Menu
+ * @deprecated
*/
protected function menuChartAncestors(Individual $individual) {
- return new Menu(I18N::translate('Ancestors'), 'ancestry.php?rootid=' . $individual->getXref() . '&amp;' . $this->tree_url, 'menu-chart-ancestry', array('rel' => 'nofollow'));
+ $chart = new AncestorsChartModule(__DIR__);
+ return $chart->getChartMenu($individual);
}
/**
- * Generate a menu item for the compact tree (compact.php).
- *
- * @param Individual $individual
- *
- * @return Menu
+ * @deprecated
*/
protected function menuChartCompact(Individual $individual) {
- return new Menu(I18N::translate('Compact tree'), 'compact.php?rootid=' . $individual->getXref() . '&amp;' . $this->tree_url, 'menu-chart-compact', array('rel' => 'nofollow'));
+ $chart = new CompactTreeChartModule(__DIR__);
+ return $chart->getChartMenu($individual);
}
/**
- * Generate a menu item for the descendants chart (descendancy.php).
- *
- * @param Individual $individual
- *
- * @return Menu
+ * @deprecated
*/
protected function menuChartDescendants(Individual $individual) {
- return new Menu(I18N::translate('Descendants'), 'descendancy.php?rootid=' . $individual->getXref() . '&amp;' . $this->tree_url, 'menu-chart-descendants', array('rel' => 'nofollow'));
+ $chart = new DescendancyChartModule(__DIR__);
+ return $chart->getChartMenu($individual);
}
/**
- * Generate a menu item for the family-book chart (familybook.php).
- *
- * @param Individual $individual
- *
- * @return Menu
+ * @deprecated
*/
protected function menuChartFamilyBook(Individual $individual) {
- return new Menu(I18N::translate('Family book'), 'familybook.php?rootid=' . $individual->getXref() . '&amp;' . $this->tree_url, 'menu-chart-familybook', array('rel' => 'nofollow'));
+ $chart = new FamilyBookChartModule(__DIR__);
+ return $chart->getChartMenu($individual);
}
/**
- * Generate a menu item for the fan chart (fanchart.php).
- *
- * We can only do this if the GD2 library is installed with TrueType support.
- *
- * @param Individual $individual
- *
- * @return Menu|null
+ * @deprecated
*/
protected function menuChartFanChart(Individual $individual) {
- if (function_exists('imagettftext')) {
- return new Menu(I18N::translate('Fan chart'), 'fanchart.php?rootid=' . $individual->getXref() . '&amp;' . $this->tree_url, 'menu-chart-fanchart', array('rel' => 'nofollow'));
- } else {
- return null;
- }
+ $chart = new FanChartModule(__DIR__);
+ return $chart->getChartMenu($individual);
}
/**
- * Generate a menu item for the interactive tree (tree module).
- *
- * @param Individual $individual
- *
- * @return Menu|null
+ * @deprecated
*/
protected function menuChartInteractiveTree(Individual $individual) {
- if (Module::getModuleByName('tree')) {
- return new Menu(I18N::translate('Interactive tree'), 'module.php?mod=tree&amp;mod_action=treeview&amp;' . $this->tree_url . '&amp;rootid=' . $individual->getXref(), 'menu-chart-tree', array('rel' => 'nofollow'));
- } else {
- return null;
- }
+ $chart = new InteractiveTreeModule(__DIR__);
+ return $chart->getChartMenu($individual);
}
/**
- * Generate a menu item for the hourglass chart (hourglass.php).
- *
- * @param Individual $individual
- *
- * @return Menu
+ * @deprecated
*/
protected function menuChartHourglass(Individual $individual) {
- return new Menu(I18N::translate('Hourglass chart'), 'hourglass.php?rootid=' . $individual->getXref() . '&amp;' . $this->tree_url, 'menu-chart-hourglass', array('rel' => 'nofollow'));
+ $chart = new HourglassChartModule(__DIR__);
+ return $chart->getChartMenu($individual);
}
/**
- * Generate a menu item for the lifepsan chart (lifespan.php).
- *
- * @param Individual $individual
- *
- * @return Menu
+ * @deprecated
*/
protected function menuChartLifespan(Individual $individual) {
- return new Menu(I18N::translate('Lifespans'), 'lifespan.php', 'menu-chart-lifespan', array('rel' => 'nofollow'));
+ $chart = new LifespansChartModule(__DIR__);
+ return $chart->getChartMenu($individual);
}
/**
- * Generate a menu item for the pedigree chart (pedigree.php).
- *
- * @param Individual $individual
- *
- * @return Menu
+ * @deprecated
*/
protected function menuChartPedigree(Individual $individual) {
- return new Menu(I18N::translate('Pedigree'), 'pedigree.php?rootid=' . $individual->getXref() . '&amp;' . $this->tree_url, 'menu-chart-pedigree', array('rel' => 'nofollow'));
+ $chart = new PedigreeChartModule(__DIR__);
+ return $chart->getChartMenu($individual);
}
/**
- * Generate a menu item for the pedigree map (googlemap module).
- *
- * @param Individual $individual
- *
- * @return Menu|null
+ * @deprecated
*/
protected function menuChartPedigreeMap(Individual $individual) {
- if (Module::getModuleByName('googlemap')) {
- return new Menu(I18N::translate('Pedigree map'), 'module.php?' . $this->tree_url . '&amp;mod=googlemap&amp;mod_action=pedigree_map&amp;rootid=' . $individual->getXref(), 'menu-chart-pedigree_map', array('rel' => 'nofollow'));
- } else {
- return null;
- }
+ $chart = new GoogleMapsModule(__DIR__);
+ return $chart->getChartMenu($individual);
}
/**
- * Generate a menu item for the relationship chart (relationship.php).
- *
- * @param Individual $individual
- *
- * @return Menu
+ * @deprecated
*/
protected function menuChartRelationship(Individual $individual) {
- $gedcomid = $this->tree->getUserPreference(Auth::user(), 'gedcomid');
-
- if ($gedcomid && $individual->getXref()) {
- return new Menu(I18N::translate('Relationship to me'), 'relationship.php?pid1=' . $gedcomid . '&amp;pid2=' . $individual->getXref() . '&amp;ged=' . $this->tree_url, 'menu-chart-relationship', array('rel' => 'nofollow'));
- } else {
- return new Menu(I18N::translate('Relationships'), 'relationship.php?pid1=' . $individual->getXref() . '&amp;ged=' . $this->tree_url, 'menu-chart-relationship', array('rel' => 'nofollow'));
- }
+ $chart = new RelationshipsChartModule(__DIR__);
+ return $chart->getChartMenu($individual);
}
/**
- * Generate a menu item for the statistics charts (statistics.php).
- *
- * @return Menu
+ * @deprecated
*/
protected function menuChartStatistics() {
- return new Menu(I18N::translate('Statistics'), 'statistics.php?' . $this->tree_url, 'menu-chart-statistics', array('rel' => 'nofollow'));
+ $chart = new StatisticsChartModule(__DIR__);
+ return $chart->getChartMenu(null);
}
/**
- * Generate a menu item for the timeline chart (timeline.php).
- *
- * @param Individual $individual
- *
- * @return Menu
+ * @deprecated
*/
protected function menuChartTimeline(Individual $individual) {
- return new Menu(I18N::translate('Timeline'), 'timeline.php?pids%5B%5D=' . $individual->getXref() . '&amp;' . $this->tree_url, 'menu-chart-timeline', array('rel' => 'nofollow'));
+ $chart = new TimelineChartModule(__DIR__);
+ return $chart->getChartMenu($individual);
}
-
+
/**
* Generate a menu item for the control panel (admin.php).
*
diff --git a/app/Theme/AdministrationTheme.php b/app/Theme/AdministrationTheme.php
index 5ff5b126dd..1544d15997 100644
--- a/app/Theme/AdministrationTheme.php
+++ b/app/Theme/AdministrationTheme.php
@@ -192,6 +192,7 @@ class AdministrationTheme extends AbstractTheme implements ThemeInterface {
new Menu(/* I18N: Menu entry */ I18N::translate('Tabs'), 'admin_module_tabs.php'),
new Menu(/* I18N: Menu entry */ I18N::translate('Blocks'), 'admin_module_blocks.php'),
new Menu(/* I18N: Menu entry */ I18N::translate('Sidebars'), 'admin_module_sidebar.php'),
+ new Menu(/* I18N: Menu entry */ I18N::translate('Charts'), 'admin_module_charts.php'),
new Menu(/* I18N: Menu entry */ I18N::translate('Reports'), 'admin_module_reports.php'),
));
}
diff --git a/includes/session.php b/includes/session.php
index 8b1ccf2518..361dfff991 100644
--- a/includes/session.php
+++ b/includes/session.php
@@ -109,7 +109,7 @@ define('WT_DEBUG', strpos(WT_VERSION, 'dev') !== false);
define('WT_DEBUG_SQL', false);
// Required version of database tables/columns/indexes/etc.
-define('WT_SCHEMA_VERSION', 34);
+define('WT_SCHEMA_VERSION', 35);
// Regular expressions for validating user input, etc.
define('WT_MINIMUM_PASSWORD_LENGTH', 6);
diff --git a/modules_v3/ancestors_chart/module.php b/modules_v3/ancestors_chart/module.php
new file mode 100644
index 0000000000..eca9d65087
--- /dev/null
+++ b/modules_v3/ancestors_chart/module.php
@@ -0,0 +1,20 @@
+<?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;
+
+use Fisharebest\Webtrees\Module\AncestorsChartModule;
+
+return new AncestorsChartModule(__DIR__);
diff --git a/modules_v3/compact_tree_chart/module.php b/modules_v3/compact_tree_chart/module.php
new file mode 100644
index 0000000000..043fc0b280
--- /dev/null
+++ b/modules_v3/compact_tree_chart/module.php
@@ -0,0 +1,20 @@
+<?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;
+
+use Fisharebest\Webtrees\Module\CompactTreeChartModule;
+
+return new CompactTreeChartModule(__DIR__);
diff --git a/modules_v3/descendancy_chart/module.php b/modules_v3/descendancy_chart/module.php
new file mode 100644
index 0000000000..9f877d350d
--- /dev/null
+++ b/modules_v3/descendancy_chart/module.php
@@ -0,0 +1,20 @@
+<?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;
+
+use Fisharebest\Webtrees\Module\DescendancyChartModule;
+
+return new DescendancyChartModule(__DIR__);
diff --git a/modules_v3/family_book_chart/module.php b/modules_v3/family_book_chart/module.php
new file mode 100644
index 0000000000..8a47df3813
--- /dev/null
+++ b/modules_v3/family_book_chart/module.php
@@ -0,0 +1,20 @@
+<?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;
+
+use Fisharebest\Webtrees\Module\FamilyBookChartModule;
+
+return new FamilyBookChartModule(__DIR__);
diff --git a/modules_v3/fan_chart/module.php b/modules_v3/fan_chart/module.php
new file mode 100644
index 0000000000..fa3e9a67f4
--- /dev/null
+++ b/modules_v3/fan_chart/module.php
@@ -0,0 +1,20 @@
+<?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;
+
+use Fisharebest\Webtrees\Module\FanChartModule;
+
+return new FanChartModule(__DIR__);
diff --git a/modules_v3/hourglass_chart/module.php b/modules_v3/hourglass_chart/module.php
new file mode 100644
index 0000000000..ead909a40e
--- /dev/null
+++ b/modules_v3/hourglass_chart/module.php
@@ -0,0 +1,20 @@
+<?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;
+
+use Fisharebest\Webtrees\Module\HourglassChartModule;
+
+return new HourglassChartModule(__DIR__);
diff --git a/modules_v3/lifespans_chart/module.php b/modules_v3/lifespans_chart/module.php
new file mode 100644
index 0000000000..3484382cc2
--- /dev/null
+++ b/modules_v3/lifespans_chart/module.php
@@ -0,0 +1,20 @@
+<?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;
+
+use Fisharebest\Webtrees\Module\LifespansChartModule;
+
+return new LifespansChartModule(__DIR__);
diff --git a/modules_v3/pedigree_chart/module.php b/modules_v3/pedigree_chart/module.php
new file mode 100644
index 0000000000..360081a68b
--- /dev/null
+++ b/modules_v3/pedigree_chart/module.php
@@ -0,0 +1,20 @@
+<?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;
+
+use Fisharebest\Webtrees\Module\PedigreeChartModule;
+
+return new PedigreeChartModule(__DIR__);
diff --git a/modules_v3/relationships_chart/module.php b/modules_v3/relationships_chart/module.php
new file mode 100644
index 0000000000..f85c676d8c
--- /dev/null
+++ b/modules_v3/relationships_chart/module.php
@@ -0,0 +1,20 @@
+<?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;
+
+use Fisharebest\Webtrees\Module\RelationshipsChartModule;
+
+return new RelationshipsChartModule(__DIR__);
diff --git a/modules_v3/statistics_chart/module.php b/modules_v3/statistics_chart/module.php
new file mode 100644
index 0000000000..96f0ddd613
--- /dev/null
+++ b/modules_v3/statistics_chart/module.php
@@ -0,0 +1,20 @@
+<?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;
+
+use Fisharebest\Webtrees\Module\StatisticsChartModule;
+
+return new StatisticsChartModule(__DIR__);
diff --git a/modules_v3/timeline_chart/module.php b/modules_v3/timeline_chart/module.php
new file mode 100644
index 0000000000..ddcf4acbae
--- /dev/null
+++ b/modules_v3/timeline_chart/module.php
@@ -0,0 +1,20 @@
+<?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;
+
+use Fisharebest\Webtrees\Module\TimelineChartModule;
+
+return new TimelineChartModule(__DIR__);