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
===========================================================
* Require Dotclear 2.28

View File

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

View File

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

View File

@ -2,10 +2,10 @@
<modules xmlns:da="http://dotaddict.org/da/">
<module id="dcLatestVersions">
<name>Dotclear's latest versions</name>
<version>2023.10.11</version>
<version>2023.10.15</version>
<author>Jean-Christian Denis, Pierre Van Glabeke</author>
<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: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>

View File

@ -16,8 +16,8 @@ use Dotclear\Helper\Html\Form\{
use Dotclear\Helper\Html\Html;
/**
* @brief dcLatestVersions backend class.
* @ingroup dcLatestVersions
* @brief dcLatestVersions backend class.
* @ingroup dcLatestVersions
*
* @author Jean-Christian Denis
* @copyright Jean-Christian Denis
@ -37,13 +37,11 @@ class Backend extends Process
}
App::behavior()->addBehaviors([
'initWidgets' => [Widgets::class, 'initWidgets'],
'initWidgets' => Widgets::initWidgets(...),
'adminDashboardItemsV2' => function (ArrayObject $__dashboard_items): void {
if (!App::blog()->isDefined()) {
return;
}
if (!My::prefs()->get('dashboard_items')) {
if (!App::blog()->isDefined()
|| !My::prefs()->get('dashboard_items')
) {
return;
}

View File

@ -8,8 +8,8 @@ use Dotclear\App;
use Dotclear\Core\Process;
/**
* @brief dcLatestVersions frontend class.
* @ingroup dcLatestVersions
* @brief dcLatestVersions frontend class.
* @ingroup dcLatestVersions
*
* @author Jean-Christian Denis
* @copyright Jean-Christian Denis
@ -28,9 +28,7 @@ class Frontend extends Process
return false;
}
App::behavior()->addBehaviors([
'initWidgets' => [Widgets::class, 'initWidgets'],
]);
App::behavior()->addBehavior('initWidgets', Widgets::initWidgets(...));
return true;
}

View File

@ -7,8 +7,8 @@ namespace Dotclear\Plugin\dcLatestVersions;
use Dotclear\Core\Process;
/**
* @brief dcLatestVersions installation class.
* @ingroup dcLatestVersions
* @brief dcLatestVersions installation class.
* @ingroup dcLatestVersions
*
* @author Jean-Christian Denis
* @copyright Jean-Christian Denis

View File

@ -7,8 +7,8 @@ namespace Dotclear\Plugin\dcLatestVersions;
use Dotclear\Module\MyPlugin;
/**
* @brief dcLatestVersions My helper.
* @ingroup dcLatestVersions
* @brief dcLatestVersions My helper.
* @ingroup dcLatestVersions
*
* @author Jean-Christian Denis
* @copyright Jean-Christian Denis

View File

@ -8,8 +8,8 @@ use Dotclear\Core\Process;
use Dotclear\Plugin\Uninstaller\Uninstaller;
/**
* @brief dcLatestVersions uninstall class.
* @ingroup dcLatestVersions
* @brief dcLatestVersions uninstall class.
* @ingroup dcLatestVersions
*
* @author Jean-Christian Denis
* @copyright Jean-Christian Denis

View File

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