From cc3bca98c4f0b3400cec7353dbe911c7c1251ce2 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Fri, 6 Jan 2023 00:48:09 +0100 Subject: [PATCH] release 0.3 --- CHANGELOG.md | 8 ++++++-- _admin.php | 25 ++++++++++++++++++------- _define.php | 15 ++++++++++----- _prepend.php | 11 +++++++++++ dcstore.xml | 4 ++-- inc/Admin.php | 17 +++++++++++++---- inc/Manage.php | 26 +++++++++++++++++--------- inc/Prepend.php | 13 ++++++++++++- index.php | 27 +++++++++++++++++++-------- locales/fr/main.lang.php | 18 ++++++++++++++++++ locales/fr/main.po | 15 +++++++++------ 11 files changed, 135 insertions(+), 44 deletions(-) create mode 100644 locales/fr/main.lang.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fdb897..261f115 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +0.3 - 2023.01.06 +* use namespace +* use abstract plugin id + 0.2 - 2022.11.27 -- update to Dotclear 2.24 -- add fr translation \ No newline at end of file +* update to Dotclear 2.24 +* add fr translation \ No newline at end of file diff --git a/_admin.php b/_admin.php index 9f13439..4cbd1de 100644 --- a/_admin.php +++ b/_admin.php @@ -1,7 +1,18 @@ -registerModule( 'Mail test', 'Send a simple mail from admin', 'Osku and contributors', - '0.2', + '0.3', [ 'requires' => [['core', '2.24']], 'permissions' => null, 'type' => 'plugin', - 'support' => 'https://github.com/JcDenis/testMail', - 'details' => 'https://plugins.dotaddict.org/dc2/details/testMail', - 'repository' => 'https://raw.githubusercontent.com/JcDenis/testMail/master/dcstore.xml', + 'support' => 'https://github.com/JcDenis/' . basename(__DIR__), + 'details' => 'https://plugins.dotaddict.org/dc2/details/' . basename(__DIR__), + 'repository' => 'https://raw.githubusercontent.com/JcDenis/' . basename(__DIR__) . '/master/dcstore.xml', ] ); diff --git a/_prepend.php b/_prepend.php index 3296660..f500181 100644 --- a/_prepend.php +++ b/_prepend.php @@ -1,4 +1,15 @@ Mail test - 0.2 + 0.3 Osku and contributors Send a simple mail from admin - https://github.com/JcDenis/testMail/releases/download/v0.2/plugin-testMail.zip + https://github.com/JcDenis/testMail/releases/download/v0.3/plugin-testMail.zip 2.24 https://plugins.dotaddict.org/dc2/details/testMail https://github.com/JcDenis/testMail diff --git a/inc/Admin.php b/inc/Admin.php index 1a1b6ad..b676178 100644 --- a/inc/Admin.php +++ b/inc/Admin.php @@ -1,4 +1,15 @@ menu[dcAdmin::MENU_SYSTEM]->addItem( - self::$name, + dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem( + dcCore::app()->plugins->moduleInfo(basename(__NAMESPACE__), 'name'), dcCore::app()->adminurl->get('admin.plugin.' . basename(__NAMESPACE__)), dcPage::getPF(basename(__NAMESPACE__) . '/icon.svg'), preg_match('/' . preg_quote(dcCore::app()->adminurl->get('admin.plugin.' . basename(__NAMESPACE__))) . '(&.*)?$/', $_SERVER['REQUEST_URI']), diff --git a/inc/Manage.php b/inc/Manage.php index c3980f5..863b8a0 100644 --- a/inc/Manage.php +++ b/inc/Manage.php @@ -7,7 +7,7 @@ * * @author Osku and contributors * - * @copyright Jean-Crhistian Denis + * @copyright Jean-Christian Denis * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html */ declare(strict_types=1); @@ -29,10 +29,10 @@ use text; class Manage { private static $active_headers = false; - private static $mail_to = ''; - private static $mail_subject = ''; - private static $mail_content = ''; - protected static $init = false; + private static $mail_to = ''; + private static $mail_subject = ''; + private static $mail_content = ''; + protected static $init = false; public static function init(): bool { @@ -91,13 +91,21 @@ class Manage dcCore::app()->error->add($e->getMessage()); } } + return null; } public static function render(): void { - echo '' . __('Mail test') . '' . - dcPage::breadcrumb([__('System') => '', __('Mail test') => '']) . + echo + '' . + dcCore::app()->plugins->moduleInfo(basename(__NAMESPACE__), 'name') . + '' . + + dcPage::breadcrumb([ + __('System') => '', + dcCore::app()->plugins->moduleInfo(basename(__NAMESPACE__), 'name') => '', + ]) . dcPage::notices() . '
@@ -127,7 +135,7 @@ class Manage dcCore::app()->formNonce() . '

' . '
- - '; + + '; } } diff --git a/inc/Prepend.php b/inc/Prepend.php index 317e1e0..0679652 100644 --- a/inc/Prepend.php +++ b/inc/Prepend.php @@ -1,4 +1,15 @@ autoload([ - implode('\\', ['Dotclear','Plugin', basename(__NAMESAPCE__), $lib]) => __DIR__ . DIRECTORY_SEPARATOR . $lib . '.php' + implode('\\', ['Dotclear','Plugin', basename(__NAMESPACE__), $lib]) => __DIR__ . DIRECTORY_SEPARATOR . $lib . '.php', ]); } diff --git a/index.php b/index.php index 045048a..8ccdc0e 100644 --- a/index.php +++ b/index.php @@ -1,8 +1,19 @@ - 1);\n" -msgid "Mail test" -msgstr "Mail test" - msgid "You must provide a content." msgstr "Vous devez fournir un contenu." @@ -28,3 +25,9 @@ msgstr "Sujet :" msgid "Active mail headers" msgstr "Activer les entêtes de mail" +msgid "Mail test" +msgstr "Mail test" + +msgid "Send a simple mail from admin" +msgstr "Envoyer un simple mail depuis l'admin" +