Skip to content
This repository has been archived by the owner on Jan 8, 2023. It is now read-only.

Commit

Permalink
webtrees has introduced new class constants for custom module version…
Browse files Browse the repository at this point in the history
… and website.

Change our custom module definitions into webtrees defaults.
  • Loading branch information
JustCarmen committed May 20, 2016
1 parent edd6fb6 commit 5933f87
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions module.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
use JustCarmen\WebtreesAddOns\FancyTreeviewPdf\Template\AdminTemplate;
use JustCarmen\WebtreesAddOns\FancyTreeviewPdf\Template\PdfTemplate;

define('FTV_PDF_VERSION', '1.7.5-dev');
define('FTV_COMPATIBLE_VERSION', '1.7.5-dev'); // this module works with this Fancy Treeview version or higher.

/**
Expand All @@ -45,7 +44,7 @@ function intVersion($version) {
}
}

if (!file_exists(WT_MODULES_DIR . 'fancy_treeview') || (file_exists(WT_MODULES_DIR . 'fancy_treeview') && intVersion(FTV_COMPATIBLE_VERSION) > intVersion(FTV_VERSION))) {
if (!file_exists(WT_MODULES_DIR . 'fancy_treeview') || (file_exists(WT_MODULES_DIR . 'fancy_treeview') && intVersion(FTV_COMPATIBLE_VERSION) > intVersion(FancyTreeviewModule::CUSTOM_VERSION))) {
if (Auth::isAdmin()) {
FlashMessages::addMessage(I18N::translate('You have installed the Fancy Treeview PDF module. This module won’t work without the correct version of the Fancy Treeview module installed and enabled. Please install and enable Fancy Treeview version %s or higher to use this module. <a href="http:https://www.justcarmen.nl/fancy-modules/fancy-treeview/">Click here to download the latest release</a>.', FTV_COMPATIBLE_VERSION));
}
Expand All @@ -61,6 +60,9 @@ function intVersion($version) {
}

class FancyTreeviewPdfModule extends FancyTreeviewModule {

const CUSTOM_VERSION = '1.7.5-dev';
const CUSTOM_WEBSITE = 'http:https://www.justcarmen.nl/fancy-modules/fancy-treeview-pdf/';

/** {@inheritdoc} */
public function __construct() {
Expand All @@ -85,7 +87,7 @@ public function getTitle() {

/** {@inheritdoc} */
public function getDescription() {
return /* I18N: Description of the module */ I18N::translate('Fancy Treeview module extension: offer your users to download a Fancy Treeview page as PDF.') . '<br><span class="small text-muted">' . I18N::translate('Version') . ' ' . FTV_PDF_VERSION . ' | by JustCarmen | <a href="http:https://www.justcarmen.nl/fancy-modules/fancy-treeview-pdf/">' . I18N::translate('Show details') . '</a></span>';
return /* I18N: Description of the module */ I18N::translate('Fancy Treeview module extension: offer your users to download a Fancy Treeview page as PDF.');
}

/** {@inheritdoc} */
Expand Down

0 comments on commit 5933f87

Please sign in to comment.