Compare commits
4 Commits
v2023.08.0
...
master
Author | SHA1 | Date |
---|---|---|
Jean-Christian Paul Denis | 15d8761bed | |
Jean-Christian Paul Denis | 54a95b6d49 | |
Jean-Christian Paul Denis | 3901fa7f30 | |
Jean-Christian Paul Denis | 04b9d71891 |
12
CHANGELOG.md
12
CHANGELOG.md
|
@ -1,3 +1,15 @@
|
|||
dcLatestVersions 2023.10.15
|
||||
===========================================================
|
||||
* Require Dotclear 2.28
|
||||
* Require PHP 8.1
|
||||
* Cosmetic clean
|
||||
|
||||
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
|
||||
|
|
34
README.md
34
README.md
|
@ -1,25 +1,22 @@
|
|||
# README
|
||||
|
||||
[![Release](https://img.shields.io/github/v/release/JcDenis/dcLatestVersions)](https://git.dotclear.watch/JcDenis/dcLatestVersions/releases)
|
||||
[![Date](https://img.shields.io/github/release-date/JcDenis/dcLatestVersions)](https://git.dotclear.watch/JcDenis/dcLatestVersions/releases)
|
||||
[![Issues](https://img.shields.io/github/issues/JcDenis/dcLatestVersions)](https://git.dotclear.watch/JcDenis/dcLatestVersions/issues)
|
||||
[![Dotclear](https://img.shields.io/badge/dotclear-v2.27-blue.svg)](https://fr.dotclear.org/download)
|
||||
[![Dotaddict](https://img.shields.io/badge/dotaddict-official-green.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)
|
||||
[![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/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/JcDenis/dcLatestVersions/src/branch/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
|
||||
* Dotclear permissions to manage widgets
|
||||
|
||||
## USAGE
|
||||
|
||||
|
@ -31,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.
|
||||
|
|
35
_define.php
35
_define.php
|
@ -1,33 +1,28 @@
|
|||
<?php
|
||||
/**
|
||||
* @brief dcLatestVersions, a plugin for Dotclear 2
|
||||
* @file
|
||||
* @brief The plugin dcLatestVersions definition
|
||||
* @ingroup dcLatestVersions
|
||||
*
|
||||
* @package Dotclear
|
||||
* @subpackage Plugin
|
||||
* @defgroup dcLatestVersions Plugin dcLatestVersions.
|
||||
*
|
||||
* @author Jean-Christian Denis, Pierre Van Glabeke
|
||||
* Show the latest available versions of Dotclear.
|
||||
*
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
* @author Jean-Christian Denis
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
if (!defined('DC_RC_PATH')) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$this->registerModule(
|
||||
"Dotclear's latest versions",
|
||||
'Show the latest available versions of Dotclear',
|
||||
'Jean-Christian Denis, Pierre Van Glabeke',
|
||||
'2023.08.06',
|
||||
'2023.10.15',
|
||||
[
|
||||
'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',
|
||||
]
|
||||
);
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
<modules xmlns:da="http://dotaddict.org/da/">
|
||||
<module id="dcLatestVersions">
|
||||
<name>Dotclear's latest versions</name>
|
||||
<version>2023.08.06</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://gitea.dotclear.watch/JcDenis/dcLatestVersions/releases/download/v2023.08.06/plugin-dcLatestVersions.zip</file>
|
||||
<da:dcmin>2.27</da:dcmin>
|
||||
<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>
|
||||
</module>
|
||||
|
|
|
@ -1,22 +1,12 @@
|
|||
<?php
|
||||
/**
|
||||
* @brief dcLatestVersions, a plugin for Dotclear 2
|
||||
*
|
||||
* @package Dotclear
|
||||
* @subpackage Plugin
|
||||
*
|
||||
* @author Jean-Christian Denis, Pierre Van Glabeke
|
||||
*
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dotclear\Plugin\dcLatestVersions;
|
||||
|
||||
use ArrayObject;
|
||||
use dcCore;
|
||||
use dcUpdate;
|
||||
use Dotclear\App;
|
||||
use Dotclear\Core\Backend\Update;
|
||||
use Dotclear\Core\Process;
|
||||
use Dotclear\Helper\Html\Form\{
|
||||
Checkbox,
|
||||
|
@ -25,6 +15,14 @@ use Dotclear\Helper\Html\Form\{
|
|||
};
|
||||
use Dotclear\Helper\Html\Html;
|
||||
|
||||
/**
|
||||
* @brief dcLatestVersions backend class.
|
||||
* @ingroup dcLatestVersions
|
||||
*
|
||||
* @author Jean-Christian Denis
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
class Backend extends Process
|
||||
{
|
||||
public static function init(): bool
|
||||
|
@ -38,15 +36,12 @@ class Backend extends Process
|
|||
return false;
|
||||
}
|
||||
|
||||
dcCore::app()->addBehaviors([
|
||||
'initWidgets' => [Widgets::class, 'initWidgets'],
|
||||
App::behavior()->addBehaviors([
|
||||
'initWidgets' => Widgets::initWidgets(...),
|
||||
'adminDashboardItemsV2' => function (ArrayObject $__dashboard_items): void {
|
||||
// nullsafe PHP < 8.0
|
||||
if (is_null(dcCore::app()->blog)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!My::prefs()->get('dashboard_items')) {
|
||||
if (!App::blog()->isDefined()
|
||||
|| !My::prefs()->get('dashboard_items')
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -63,11 +58,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')) {
|
||||
|
|
|
@ -1,22 +1,20 @@
|
|||
<?php
|
||||
/**
|
||||
* @brief dcLatestVersions, a plugin for Dotclear 2
|
||||
*
|
||||
* @package Dotclear
|
||||
* @subpackage Plugin
|
||||
*
|
||||
* @author Jean-Christian Denis, Pierre Van Glabeke
|
||||
*
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dotclear\Plugin\dcLatestVersions;
|
||||
|
||||
use dcCore;
|
||||
use Dotclear\App;
|
||||
use Dotclear\Core\Process;
|
||||
|
||||
/**
|
||||
* @brief dcLatestVersions frontend class.
|
||||
* @ingroup dcLatestVersions
|
||||
*
|
||||
* @author Jean-Christian Denis
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
class Frontend extends Process
|
||||
{
|
||||
public static function init(): bool
|
||||
|
@ -30,9 +28,7 @@ class Frontend extends Process
|
|||
return false;
|
||||
}
|
||||
|
||||
dcCore::app()->addBehaviors([
|
||||
'initWidgets' => [Widgets::class, 'initWidgets'],
|
||||
]);
|
||||
App::behavior()->addBehavior('initWidgets', Widgets::initWidgets(...));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,21 +1,19 @@
|
|||
<?php
|
||||
/**
|
||||
* @brief dcLatestVersions, a plugin for Dotclear 2
|
||||
*
|
||||
* @package Dotclear
|
||||
* @subpackage Plugin
|
||||
*
|
||||
* @author Jean-Christian Denis, Pierre Van Glabeke
|
||||
*
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dotclear\Plugin\dcLatestVersions;
|
||||
|
||||
use Dotclear\Core\Process;
|
||||
|
||||
/**
|
||||
* @brief dcLatestVersions installation class.
|
||||
* @ingroup dcLatestVersions
|
||||
*
|
||||
* @author Jean-Christian Denis
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
class Install extends Process
|
||||
{
|
||||
public static function init(): bool
|
||||
|
|
20
src/My.php
20
src/My.php
|
@ -1,15 +1,5 @@
|
|||
<?php
|
||||
/**
|
||||
* @brief dcLatestVersions, a plugin for Dotclear 2
|
||||
*
|
||||
* @package Dotclear
|
||||
* @subpackage Plugin
|
||||
*
|
||||
* @author Jean-Christian Denis, Pierre Van Glabeke
|
||||
*
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dotclear\Plugin\dcLatestVersions;
|
||||
|
@ -17,8 +7,14 @@ namespace Dotclear\Plugin\dcLatestVersions;
|
|||
use Dotclear\Module\MyPlugin;
|
||||
|
||||
/**
|
||||
* This module definitions.
|
||||
* @brief dcLatestVersions My helper.
|
||||
* @ingroup dcLatestVersions
|
||||
*
|
||||
* @author Jean-Christian Denis
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
class My extends MyPlugin
|
||||
{
|
||||
// Use default permissions
|
||||
}
|
||||
|
|
|
@ -1,23 +1,20 @@
|
|||
<?php
|
||||
/**
|
||||
* @brief dcLatestVersions, a plugin for Dotclear 2
|
||||
*
|
||||
* @package Dotclear
|
||||
* @subpackage Plugin
|
||||
*
|
||||
* @author Jean-Christian Denis, Pierre Van Glabeke
|
||||
*
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dotclear\Plugin\dcLatestVersions;
|
||||
|
||||
use dcCore;
|
||||
use Dotclear\Core\Process;
|
||||
use Dotclear\Plugin\Uninstaller\Uninstaller;
|
||||
|
||||
/**
|
||||
* @brief dcLatestVersions uninstall class.
|
||||
* @ingroup dcLatestVersions
|
||||
*
|
||||
* @author Jean-Christian Denis
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
class Uninstall extends Process
|
||||
{
|
||||
public static function init(): bool
|
||||
|
@ -27,7 +24,7 @@ class Uninstall extends Process
|
|||
|
||||
public static function process(): bool
|
||||
{
|
||||
if (!self::status() || !dcCore::app()->plugins->moduleExists('Uninstaller')) {
|
||||
if (!self::status()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,25 +1,23 @@
|
|||
<?php
|
||||
/**
|
||||
* @brief dcLatestVersions, a plugin for Dotclear 2
|
||||
*
|
||||
* @package Dotclear
|
||||
* @subpackage Plugin
|
||||
*
|
||||
* @author Jean-Christian Denis, Pierre Van Glabeke
|
||||
*
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dotclear\Plugin\dcLatestVersions;
|
||||
|
||||
use dcCore;
|
||||
use dcUpdate;
|
||||
use Dotclear\App;
|
||||
use Dotclear\Core\Backend\Update;
|
||||
use Dotclear\Helper\Html\Html;
|
||||
use Dotclear\Plugin\widgets\WidgetsStack;
|
||||
use Dotclear\Plugin\widgets\WidgetsElement;
|
||||
|
||||
/**
|
||||
* @brief dcLatestVersions widgets class.
|
||||
* @ingroup dcLatestVersions
|
||||
*
|
||||
* @author Jean-Christian Denis
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
class Widgets
|
||||
{
|
||||
public static function initWidgets(WidgetsStack $w): void
|
||||
|
@ -28,7 +26,7 @@ class Widgets
|
|||
->create(
|
||||
My::id() . 'widget',
|
||||
My::name(),
|
||||
[self::class, 'parseWidget'],
|
||||
self::parseWidget(...),
|
||||
null,
|
||||
__('Show the latest available versions of Dotclear')
|
||||
)
|
||||
|
@ -49,12 +47,11 @@ class Widgets
|
|||
|
||||
public static function parseWidget(WidgetsElement $w): string
|
||||
{
|
||||
if ($w->__get('offline') || !$w->checkHomeOnly(dcCore::app()->url->type) || $w->__get('text') == '') {
|
||||
return '';
|
||||
}
|
||||
|
||||
// nullsafe PHP < 8.0
|
||||
if (is_null(dcCore::app()->blog)) {
|
||||
if ($w->__get('offline')
|
||||
|| !$w->checkHomeOnly(App::url()->type)
|
||||
|| $w->__get('text') == ''
|
||||
|| !App::blog()->isDefined()
|
||||
) {
|
||||
return '';
|
||||
}
|
||||
|
||||
|
@ -71,11 +68,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')) {
|
||||
|
|
Loading…
Reference in New Issue