Skip to content

Commit

Permalink
Implement Module Entry Helper
Browse files Browse the repository at this point in the history
  • Loading branch information
jon48 committed Aug 18, 2024
1 parent 49f3d77 commit cddf8e5
Show file tree
Hide file tree
Showing 11 changed files with 9,942 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ Available modules:
* Runs administrative tasks on a scheduled manner.
* **MyArtJaub Certificates** (`myartjaub_certificates`)
* Alternative management of certificates supporting sources.
* **MyArtJaub Entry Helper** (`myartjaub_entryhelper`)
* Provides assistance when entering genealogical data.
* **MyArtJaub Geographical Dispersion** (`myartjaub_geodispersion`)
* Provide geographical dispersion analysis on Sosa ancestors.
* **MyArtJaub Miscellaneous Extensions** (`myartjaub_misc`)
Expand Down
52 changes: 52 additions & 0 deletions modules_v4/myartjaub_entryhelper/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Composer
/vendor/

# npm
/node_modules/

# build products
/resources/css/
/resources/images/
/resources/js/
mix-manifest.json

# Eclipse
.metadata
.project
/bin/
/tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders

# External tool builders
.externalToolBuilders/
/build/

# Locally stored "Eclipse launch configurations"
*.launch

# PDT-specific (PHP Development Tools)
.buildpath

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# Local History for Visual Studio Code
.history/

# dotenv environment variables file
.env
.env.test

/*.txt
80 changes: 80 additions & 0 deletions modules_v4/myartjaub_entryhelper/module.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?php

/**
* MyArtJaub Entry Helper module
*
* @package MyArtJaub\Webtrees
* @subpackage EntryHelper
* @author Jonathan Jaubart <[email protected]>
* @copyright Copyright (c) 2024, Jonathan Jaubart
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
*/

//phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols

declare(strict_types=1);

namespace MyArtJaub\Webtrees\Module\EntryHelper;

use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Module\AbstractModule;
use Fisharebest\Webtrees\Module\ModuleGlobalInterface;
use Fisharebest\Webtrees\Module\ModuleGlobalTrait;
use MyArtJaub\Webtrees\Module\ModuleMyArtJaubInterface;
use MyArtJaub\Webtrees\Module\ModuleMyArtJaubTrait;

/**
* EntryHelper Module
*/
class EntryHelperModule extends AbstractModule implements
ModuleMyArtJaubInterface,
ModuleGlobalInterface
{
use ModuleMyArtJaubTrait;
use ModuleGlobalTrait;

/**
* {@inheritDoc}
* @see \Fisharebest\Webtrees\Module\AbstractModule::title()
*/
public function title(): string
{
return I18N::translate('Data entry helper');
}

/**
* {@inheritDoc}
* @see \Fisharebest\Webtrees\Module\AbstractModule::description()
*/
public function description(): string
{
return I18N::translate('Provides assistance when entering genealogical data.');
}

/**
* {@inheritDoc}
* @see \Fisharebest\Webtrees\Module\ModuleCustomInterface::customModuleVersion()
*/
public function customModuleVersion(): string
{
return '2.1.20-v.1';
}

/**
* {@inheritDoc}
* @see \Fisharebest\Webtrees\Module\ModuleGlobalInterface::bodyContent()
*/
public function bodyContent(): string
{
$translations = [
'citationLabel' => e(I18N::translate('Source citation')),
'citationCopy' => e(I18N::translate('Copy source citation')),
'citationPaste' => e(I18N::translate('Fill source citation from last copy'))
];

return '<script>const MAJ_ENTRYHELPER_TRANSLATIONS = ' . json_encode($translations) . ';</script>' .
'<script src="' . $this->assetUrl('js/entryhelper.min.js') . '"></script>';
}
}

return app(EntryHelperModule::class);
Loading

0 comments on commit cddf8e5

Please sign in to comment.