upgrade plugin activityReport

This commit is contained in:
Jean-Christian Paul Denis 2023-10-18 23:47:07 +02:00
parent f2a3977f2d
commit 0d96001a25
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
6 changed files with 25 additions and 12 deletions

View File

@ -1,3 +1,9 @@
zoneclearFeedServer 2023.10.18
===========================================================
* Require Dotclear 2.28
* Require PHP 8.1
* Upgrade plugin activityReport
zoneclearFeedServer 2023.10.14 zoneclearFeedServer 2023.10.14
=========================================================== ===========================================================
* Require Dotclear 2.28 * Require Dotclear 2.28

View File

@ -1,7 +1,7 @@
# README # README
[![Release](https://img.shields.io/badge/release-2023.10.14-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/zoneclearFeedServer/releases) [![Release](https://img.shields.io/badge/release-2023.10.18-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/zoneclearFeedServer/releases)
![Date](https://img.shields.io/badge/date-2023.10.14-c44d58.svg) ![Date](https://img.shields.io/badge/date-2023.10.18-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/zoneclearFeedServer) [![Dotaddict](https://img.shields.io/badge/dotaddict-official-9ac123.svg)](https://plugins.dotaddict.org/dc2/details/zoneclearFeedServer)
[![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/JcDenis/zoneclearFeedServer/src/branch/master/LICENSE) [![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/JcDenis/zoneclearFeedServer/src/branch/master/LICENSE)

View File

@ -19,7 +19,7 @@ $this->registerModule(
'Feeds server', 'Feeds server',
'Mix your blog with a feeds planet', 'Mix your blog with a feeds planet',
'Jean-Christian Denis, BG, Pierre Van Glabeke', 'Jean-Christian Denis, BG, Pierre Van Glabeke',
'2023.10.14', '2023.10.18',
[ [
'requires' => [['core', '2.28']], 'requires' => [['core', '2.28']],
'permissions' => 'My', 'permissions' => 'My',

View File

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Dotclear\Plugin\zoneclearFeedServer; namespace Dotclear\Plugin\zoneclearFeedServer;
use Dotclear\App; use Dotclear\App;
use Dotclear\Core\Process;
use Dotclear\Database\Cursor; use Dotclear\Database\Cursor;
use Dotclear\Plugin\activityReport\{ use Dotclear\Plugin\activityReport\{
Action, Action,
@ -13,7 +14,7 @@ use Dotclear\Plugin\activityReport\{
}; };
/** /**
* @brief zoneclearFeedServer activityReport class. * @brief zoneclearFeedServer plugin activityReport class.
* @ingroup zoneclearFeedServer * @ingroup zoneclearFeedServer
* *
* Add feeds actions to the plugin activity report. * Add feeds actions to the plugin activity report.
@ -21,10 +22,19 @@ use Dotclear\Plugin\activityReport\{
* @author Jean-Christian Denis * @author Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/ */
class ActivityReportActions class ActivityReportAction extends Process
{ {
public static function init(): void public static function init(): bool
{ {
return self::status(true);
}
public static function process(): bool
{
if (!self::status()) {
return false;
}
$group = new Group(My::id(), My::name()); $group = new Group(My::id(), My::name());
$group->add(new Action( $group->add(new Action(
@ -141,5 +151,7 @@ class ActivityReportActions
)); ));
ActivityReport::instance()->groups->add($group); ActivityReport::instance()->groups->add($group);
return true;
} }
} }

View File

@ -43,7 +43,7 @@ class Frontend extends Process
return $context == 'zoneclearFeedsPage' ? __('List of feeds') : ''; return $context == 'zoneclearFeedsPage' ? __('List of feeds') : '';
}, },
// widgets registration // widgets registration
'initWidgets' => [Widgets::class, 'init'], 'initWidgets' => Widgets::init(...),
]); ]);
// Register template blocks // Register template blocks

View File

@ -35,11 +35,6 @@ class Prepend extends Process
UrlHandler::zoneclearFeedsPage(...) UrlHandler::zoneclearFeedsPage(...)
); );
// report zoneclearFeedServer activities
if (defined('ACTIVITY_REPORT') && ACTIVITY_REPORT == 3) {
ActivityReportActions::init();
}
return true; return true;
} }
} }