From 54a95b6d49e204d06af46654fc136d53fd00afd0 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Wed, 11 Oct 2023 21:49:44 +0200 Subject: [PATCH] release 2023.10.11 --- CHANGELOG.md | 6 ++++++ README.md | 27 +++++++++++++-------------- _define.php | 35 +++++++++++++++-------------------- dcstore.xml | 6 +++--- src/Backend.php | 35 ++++++++++++++++------------------- src/Frontend.php | 24 +++++++++++------------- src/Install.php | 20 +++++++++----------- src/My.php | 20 ++++++++------------ src/Uninstall.php | 23 ++++++++++------------- src/Widgets.php | 34 ++++++++++++++++------------------ 10 files changed, 107 insertions(+), 123 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce1c090..d6b2508 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +dcLatestVersions 2023.10.11 +=========================================================== +* Require Dotclear 2.28 +* Require PHP 8.1 +* Upgrade to Dotclear 2.28 + dcLatestVersions 2023.08.06 =========================================================== * Require Dotclear 2.27 diff --git a/README.md b/README.md index f35de9f..217a3bb 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,22 @@ # README -[![Release](https://img.shields.io/badge/release-2023.08.06-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/dcLatestVersions/releases) -[![Date](https://img.shields.io/badge/date-2023.08.06-c44d58.svg)](https://git.dotclear.watch/JcDenis/dcLatestVersions/releases) -[![Dotclear](https://img.shields.io/badge/dotclear-v2.27-137bbb.svg)](https://fr.dotclear.org/download) +[![Release](https://img.shields.io/badge/release-2023.10.11-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/dcLatestVersions/releases) +![Date](https://img.shields.io/badge/date-2023.10.11-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/dcLatestVersions) [![License](https://img.shields.io/github/license/JcDenis/dcLatestVersions)](https://git.dotclear.watch/JcDenis/dcLatestVersions/blob/master/LICENSE) -## WHAT IS DCLATESTVERSION ? +## ABOUT -"Dotclear's latest versions" is a plugin for the open-source -web publishing software called Dotclear. +_dcLatestVersions_ is a plugin for the open-source web publishing software called [Dotclear](https://www.dotclear.org). -Simply show visitors last versions of nightly build of Dotclear. +> Simply show visitors last versions of nightly build of Dotclear. ## REQUIREMENTS -_dcLatestVersions_ requires: - * permissions to manage widgets -* Dotclear 2.27 +* Dotclear 2.28 +* PHP 8.1 ## USAGE @@ -30,13 +28,14 @@ You can add a dashboard item by enable it from your dashboard preferences. ## MORE -* License : GNU GPL v2 -* Source & contribution : [Gitea Page](https://git.dotclear.watch/JcDenis/dcLatestVersion) or [GitHub Page](https://github.com/JcDenis/dcLatestVersions) -* Packages & details: [Gitea Page](https://git.dotclear.watch/JcDenis/dcLatestVersion/releases) or [Dotaddict Page](https://plugins.dotaddict.org/dc2/details/dcLatestVersions) +* [License](https://git.dotclear.watch/JcDenis/dcLatestVersion/src/branch/master/LICENSE) +* [Packages & details](https://git.dotclear.watch/JcDenis/dcLatestVersion/releases) (or on [Dotaddict](https://plugins.dotaddict.org/dc2/details/dcLatestVersion)) +* [Sources & contributions](https://git.dotclear.watch/JcDenis/dcLatestVersion) (or on [GitHub](https://github.com/JcDenis/dcLatestVersion)) +* [Issues & security](https://git.dotclear.watch/JcDenis/dcLatestVersion/issues) (or on [GitHub](https://github.com/JcDenis/dcLatestVersion/issues)) ## CONTRIBUTORS -* Jean-Chirstian Denis +* Jean-Chirstian Denis (author) * Pierre Van Glabeke You are welcome to contribute to this code. diff --git a/_define.php b/_define.php index 2c677bd..c17210c 100644 --- a/_define.php +++ b/_define.php @@ -1,33 +1,28 @@ registerModule( "Dotclear's latest versions", 'Show the latest available versions of Dotclear', 'Jean-Christian Denis, Pierre Van Glabeke', - '2023.08.06', + '2023.10.11', [ - 'requires' => [['core', '2.27']], - 'permissions' => dcCore::app()->auth->makePermissions([ - dcCore::app()->auth::PERMISSION_USAGE, - dcCore::app()->auth::PERMISSION_CONTENT_ADMIN, - ]), - 'type' => 'plugin', - 'support' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/issues', - 'details' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/src/branch/master/README.md', - 'repository' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/raw/branch/master/dcstore.xml', + 'requires' => [['core', '2.28']], + 'permissions' => 'My', + 'type' => 'plugin', + 'support' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/issues', + 'details' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/src/branch/master/README.md', + 'repository' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/raw/branch/master/dcstore.xml', ] ); diff --git a/dcstore.xml b/dcstore.xml index d5702c8..40506fb 100644 --- a/dcstore.xml +++ b/dcstore.xml @@ -2,11 +2,11 @@ Dotclear's latest versions - 2023.08.06 + 2023.10.11 Jean-Christian Denis, Pierre Van Glabeke Show the latest available versions of Dotclear - https://git.dotclear.watch/JcDenis/dcLatestVersions/releases/download/v2023.08.06/plugin-dcLatestVersions.zip - 2.27 + https://git.dotclear.watch/JcDenis/dcLatestVersions/releases/download/v2023.10.11/plugin-dcLatestVersions.zip + 2.28 https://git.dotclear.watch/JcDenis/dcLatestVersions/src/branch/master/README.md https://git.dotclear.watch/JcDenis/dcLatestVersions/issues diff --git a/src/Backend.php b/src/Backend.php index 66b8238..dad406c 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -1,22 +1,12 @@ addBehaviors([ + App::behavior()->addBehaviors([ 'initWidgets' => [Widgets::class, 'initWidgets'], 'adminDashboardItemsV2' => function (ArrayObject $__dashboard_items): void { - // nullsafe PHP < 8.0 - if (is_null(dcCore::app()->blog)) { + if (!App::blog()->isDefined()) { return; } @@ -63,11 +60,11 @@ class Backend extends Process continue; } - $updater = new dcUpdate( - DC_UPDATE_URL, + $updater = new Update( + App::config()->coreUpdateUrl(), 'dotclear', $build, - DC_TPL_CACHE . '/versions' + App::config()->cacheRoot() . '/versions' ); if (false === $updater->check('0')) { diff --git a/src/Frontend.php b/src/Frontend.php index b572595..b6be59d 100644 --- a/src/Frontend.php +++ b/src/Frontend.php @@ -1,22 +1,20 @@ addBehaviors([ + App::behavior()->addBehaviors([ 'initWidgets' => [Widgets::class, 'initWidgets'], ]); diff --git a/src/Install.php b/src/Install.php index 8989c97..f392703 100644 --- a/src/Install.php +++ b/src/Install.php @@ -1,21 +1,19 @@ plugins->moduleExists('Uninstaller')) { + if (!self::status()) { return false; } diff --git a/src/Widgets.php b/src/Widgets.php index 23ed7ec..cc32c62 100644 --- a/src/Widgets.php +++ b/src/Widgets.php @@ -1,25 +1,23 @@ __get('offline') || !$w->checkHomeOnly(dcCore::app()->url->type) || $w->__get('text') == '') { + if ($w->__get('offline') || !$w->checkHomeOnly(App::url()->type) || $w->__get('text') == '') { return ''; } // nullsafe PHP < 8.0 - if (is_null(dcCore::app()->blog)) { + if (!App::blog()->isDefined()) { return ''; } @@ -71,11 +69,11 @@ class Widgets continue; } - $updater = new dcUpdate( - DC_UPDATE_URL, + $updater = new Update( + App::config()->coreUpdateUrl(), 'dotclear', $build, - DC_TPL_CACHE . '/versions' + App::config()->cacheRoot() . '/versions' ); if (false === $updater->check('0')) {