From f96aec632d76c24150562731753f42d4a6cf281e Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sat, 7 Oct 2023 22:57:21 +0200 Subject: [PATCH] release 1.7 --- CHANGELOG.md | 6 ++++++ README.md | 26 ++++++++++++-------------- _define.php | 4 ++-- dcstore.xml | 6 +++--- src/Backend.php | 4 ++-- src/Manage.php | 16 ++++++++-------- src/ManageVars.php | 8 ++++---- src/My.php | 4 ++-- 8 files changed, 39 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0ceb8f..37a884f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +dcLog 1.7 - 2023.10.07 +=========================================================== +* Require Dotclear 2.28 +* Require PHP 8.1 +* Upgrade to Dotclear 2.28 + dcLog 1.6 - 2023.08.14 =========================================================== * Require Dotclear 2.27 diff --git a/README.md b/README.md index 74a44c6..77cf56e 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,21 @@ # README -[![Release](https://img.shields.io/badge/release-1.6-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/dcLog/releases) -[![Date](https://img.shields.io/badge/date-2023.08.14-c44d58.svg)](https://git.dotclear.watch/JcDenis/dcLog/releases) -[![Dotclear](https://img.shields.io/badge/dotclear-v2.27-137bbb.svg)](https://fr.dotclear.org/download) +[![Release](https://img.shields.io/badge/release-1.7-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/dcLog/releases) +![Date](https://img.shields.io/badge/date-2023.10.07-c44d58.svg) +[![Dotclear](https://img.shields.io/badge/dotclear-v2.28-137bbb.svg)](https://fr.dotclear.org/download) [![Dotaddict](https://img.shields.io/badge/dotaddict-official-9ac123.svg)](https://plugins.dotaddict.org/dc2/details/dcLog) -[![License](https://img.shields.io/github/license/JcDenis/dcLog)](https://git.dotclear.watch/JcDenis/dcLog/blob/master/LICENSE) +[![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/JcDenis/dcLog/src/branch/master/LICENSE) -## WHAT IS DCLOG ? +## ABOUT -_dcLog_ is a plugin for the open-source -web publishing software called Dotclear. +_dcLog_ is a plugin for the open-source web publishing software called [Dotclear](https://www.dotclear.org). -Display dotclear's logs. +> Display dotclear's logs. ## REQUIREMENTS -_dcLog_ requires: - * PHP 8.1+ -* Dotclear 2.27 +* Dotclear 2.28 * super admin permission ## USAGE @@ -31,9 +28,10 @@ Once it's done you can manage your logs from menu ## LINKS -* License : [GNU GPL v2](https://www.gnu.org/licenses/old-licenses/lgpl-2.0.html) -* Source & contribution : [Gitea Page](https://git.dotclear.watch/JcDenis/dcLog) or [GitHub Page](https://github.com/JcDenis/dcLog) -* Packages & details: [Gitea Page](https://git.dotclear.watch/JcDenis/dcLog/releases) or [Dotaddict Page](https://plugins.dotaddict.org/dc2/details/dcLog) +* [License](https://git.dotclear.watch/JcDenis/dcLog/src/branch/master/LICENSE) +* [Packages & details](https://git.dotclear.watch/JcDenis/dcLog/releases) (or on [Dotaddict](https://plugins.dotaddict.org/dc2/details/dcLog)) +* [Sources & contributions](https://git.dotclear.watch/JcDenis/dcLog) (or on [GitHub](https://github.com/JcDenis/dcLog)) +* [Issues & security](https://git.dotclear.watch/JcDenis/dcLog/issues) (or on [GitHub](https://github.com/JcDenis/dcLog/issues)) ## CONTRIBUTORS diff --git a/_define.php b/_define.php index ee54c58..94b33b0 100644 --- a/_define.php +++ b/_define.php @@ -18,11 +18,11 @@ $this->registerModule( "Dotclear's logs", 'Displays Dotclear logs', 'Tomtom and Contributors', - '1.6', + '1.7', [ 'requires' => [ ['php', '8.1'], - ['core', '2.27'], + ['core', '2.28'], ], 'permissions' => null, 'type' => 'plugin', diff --git a/dcstore.xml b/dcstore.xml index 8bcb286..a70d579 100644 --- a/dcstore.xml +++ b/dcstore.xml @@ -2,11 +2,11 @@ Dotclear's logs - 1.6 + 1.7 Tomtom and Contributors Displays Dotclear logs - https://git.dotclear.watch/JcDenis/dcLog/releases/download/v1.6/plugin-dcLog.zip - 2.27 + https://git.dotclear.watch/JcDenis/dcLog/releases/download/v1.7/plugin-dcLog.zip + 2.28 https://git.dotclear.watch/JcDenis/dcLog/src/branch/master/README.md https://git.dotclear.watch/JcDenis/dcLog/issues diff --git a/src/Backend.php b/src/Backend.php index a7a8398..1b82dfe 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -15,7 +15,7 @@ declare(strict_types=1); namespace Dotclear\Plugin\dcLog; use ArrayObject; -use dcCore; +use Dotclear\App; use Dotclear\Core\Process; use Dotclear\Core\Backend\Favorites; use Dotclear\Core\Backend\Menus; @@ -35,7 +35,7 @@ class Backend extends Process My::addBackendMenuItem(Menus::MENU_SYSTEM); - dcCore::app()->addBehaviors([ + App::behavior()->addBehaviors([ // backend user preference for logs list columns 'adminColumnsListsV2' => function (ArrayObject $cols): void { $cols[My::BACKEND_LIST_ID] = [ diff --git a/src/Manage.php b/src/Manage.php index 152ca50..88a9bdd 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -14,7 +14,7 @@ declare(strict_types=1); namespace Dotclear\Plugin\dcLog; -use dcCore; +use Dotclear\App; use Dotclear\Core\Process; use Dotclear\Core\Backend\{ Notices, @@ -51,7 +51,11 @@ class Manage extends Process // Delete logs if ($current->selected_logs && !empty($current->entries) || $current->all_logs) { try { - dcCore::app()->log->delLogs($current->entries, $current->all_logs); + if ($current->all_logs) { + App::log()->delAllLogs(); + } else { + App::log()->delLogs($current->entries); + } Notices::addSuccessNotice( $current->all_logs ? __('All logs have been successfully deleted') : @@ -59,7 +63,7 @@ class Manage extends Process ); My::redirect(); } catch (Exception $e) { - dcCore::app()->error->add($e->getMessage()); + App::error()->add($e->getMessage()); } } @@ -128,11 +132,7 @@ class Manage extends Process ->class('delete') ->value(__('Delete all logs')), ]), - (new Text( - '', - dcCore::app()->admin->url->getHiddenFormFields('admin.plugin.' . My::id(), $current->filter->values()) . - dcCore::app()->formNonce() - )), + ... My::hiddenFields($current->filter->values()), ]), ])->render(), $current->filter->show() diff --git a/src/ManageVars.php b/src/ManageVars.php index 35285ea..dbac9a2 100644 --- a/src/ManageVars.php +++ b/src/ManageVars.php @@ -14,7 +14,7 @@ declare(strict_types=1); namespace Dotclear\Plugin\dcLog; -use dcCore; +use Dotclear\App; use Dotclear\Core\Backend\Filter\{ Filters, FiltersLibrary @@ -66,12 +66,12 @@ class ManageVars $params = $this->filter->params(); try { - $this->logs = dcCore::app()->log->getLogs($params); - $count = dcCore::app()->log->getLogs($params, true)->f(0); + $this->logs = App::log()->getLogs($params); + $count = App::log()->getLogs($params, true)->f(0); $count = is_numeric($count) ? (int) $count : 0; $this->list = new BackendList($this->logs, $count); } catch (Exception $e) { - dcCore::app()->error->add($e->getMessage()); + App::error()->add($e->getMessage()); } } diff --git a/src/My.php b/src/My.php index 5366d34..7719a3a 100644 --- a/src/My.php +++ b/src/My.php @@ -14,7 +14,7 @@ declare(strict_types=1); namespace Dotclear\Plugin\dcLog; -use dcCore; +use Dotclear\App; use Dotclear\Module\MyPlugin; class My extends MyPlugin @@ -24,6 +24,6 @@ class My extends MyPlugin public static function checkCustomContext(int $context): ?bool { - return dcCore::app()->auth->isSuperAdmin(); + return App::auth()->isSuperAdmin(); } }