Compare commits

...

1 Commits

Author SHA1 Message Date
Jean-Christian Paul Denis 15d8761bed
cosmetic clean 2023-10-15 22:48:23 +02:00
10 changed files with 36 additions and 35 deletions

View File

@ -1,3 +1,9 @@
dcLatestVersions 2023.10.15
===========================================================
* Require Dotclear 2.28
* Require PHP 8.1
* Cosmetic clean
dcLatestVersions 2023.10.11 dcLatestVersions 2023.10.11
=========================================================== ===========================================================
* Require Dotclear 2.28 * Require Dotclear 2.28

View File

@ -1,10 +1,10 @@
# README # README
[![Release](https://img.shields.io/badge/release-2023.10.11-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/dcLatestVersions/releases) [![Release](https://img.shields.io/badge/release-2023.10.15-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/dcLatestVersions/releases)
![Date](https://img.shields.io/badge/date-2023.10.11-c44d58.svg) ![Date](https://img.shields.io/badge/date-2023.10.15-c44d58.svg)
[![Dotclear](https://img.shields.io/badge/dotclear-v2.28-137bbb.svg)](https://fr.dotclear.org/download) [![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) [![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) [![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/JcDenis/dcLatestVersions/src/branch/master/LICENSE)
## ABOUT ## ABOUT
@ -14,9 +14,9 @@ _dcLatestVersions_ is a plugin for the open-source web publishing software calle
## REQUIREMENTS ## REQUIREMENTS
* permissions to manage widgets
* Dotclear 2.28 * Dotclear 2.28
* PHP 8.1 * PHP 8.1
* Dotclear permissions to manage widgets
## USAGE ## USAGE

View File

@ -16,7 +16,7 @@ $this->registerModule(
"Dotclear's latest versions", "Dotclear's latest versions",
'Show the latest available versions of Dotclear', 'Show the latest available versions of Dotclear',
'Jean-Christian Denis, Pierre Van Glabeke', 'Jean-Christian Denis, Pierre Van Glabeke',
'2023.10.11', '2023.10.15',
[ [
'requires' => [['core', '2.28']], 'requires' => [['core', '2.28']],
'permissions' => 'My', 'permissions' => 'My',

View File

@ -2,10 +2,10 @@
<modules xmlns:da="http://dotaddict.org/da/"> <modules xmlns:da="http://dotaddict.org/da/">
<module id="dcLatestVersions"> <module id="dcLatestVersions">
<name>Dotclear's latest versions</name> <name>Dotclear's latest versions</name>
<version>2023.10.11</version> <version>2023.10.15</version>
<author>Jean-Christian Denis, Pierre Van Glabeke</author> <author>Jean-Christian Denis, Pierre Van Glabeke</author>
<desc>Show the latest available versions of Dotclear</desc> <desc>Show the latest available versions of Dotclear</desc>
<file>https://git.dotclear.watch/JcDenis/dcLatestVersions/releases/download/v2023.10.11/plugin-dcLatestVersions.zip</file> <file>https://git.dotclear.watch/JcDenis/dcLatestVersions/releases/download/v2023.10.15/plugin-dcLatestVersions.zip</file>
<da:dcmin>2.28</da:dcmin> <da:dcmin>2.28</da:dcmin>
<da:details>https://git.dotclear.watch/JcDenis/dcLatestVersions/src/branch/master/README.md</da:details> <da:details>https://git.dotclear.watch/JcDenis/dcLatestVersions/src/branch/master/README.md</da:details>
<da:support>https://git.dotclear.watch/JcDenis/dcLatestVersions/issues</da:support> <da:support>https://git.dotclear.watch/JcDenis/dcLatestVersions/issues</da:support>

View File

@ -37,13 +37,11 @@ class Backend extends Process
} }
App::behavior()->addBehaviors([ App::behavior()->addBehaviors([
'initWidgets' => [Widgets::class, 'initWidgets'], 'initWidgets' => Widgets::initWidgets(...),
'adminDashboardItemsV2' => function (ArrayObject $__dashboard_items): void { 'adminDashboardItemsV2' => function (ArrayObject $__dashboard_items): void {
if (!App::blog()->isDefined()) { if (!App::blog()->isDefined()
return; || !My::prefs()->get('dashboard_items')
} ) {
if (!My::prefs()->get('dashboard_items')) {
return; return;
} }

View File

@ -28,9 +28,7 @@ class Frontend extends Process
return false; return false;
} }
App::behavior()->addBehaviors([ App::behavior()->addBehavior('initWidgets', Widgets::initWidgets(...));
'initWidgets' => [Widgets::class, 'initWidgets'],
]);
return true; return true;
} }

View File

@ -26,7 +26,7 @@ class Widgets
->create( ->create(
My::id() . 'widget', My::id() . 'widget',
My::name(), My::name(),
[self::class, 'parseWidget'], self::parseWidget(...),
null, null,
__('Show the latest available versions of Dotclear') __('Show the latest available versions of Dotclear')
) )
@ -47,12 +47,11 @@ class Widgets
public static function parseWidget(WidgetsElement $w): string public static function parseWidget(WidgetsElement $w): string
{ {
if ($w->__get('offline') || !$w->checkHomeOnly(App::url()->type) || $w->__get('text') == '') { if ($w->__get('offline')
return ''; || !$w->checkHomeOnly(App::url()->type)
} || $w->__get('text') == ''
|| !App::blog()->isDefined()
// nullsafe PHP < 8.0 ) {
if (!App::blog()->isDefined()) {
return ''; return '';
} }