Compare commits

..

2 Commits

Author SHA1 Message Date
Jean-Christian Paul Denis 111d495155
release 1.3 2023-08-13 22:10:48 +02:00
Jean-Christian Paul Denis d3818b273c
upgrade to Dotclear 2.27 2023-08-13 22:10:06 +02:00
8 changed files with 119 additions and 93 deletions

View File

@ -1,58 +1,76 @@
dev topWriter 1.3 - 2023.08.13
- [ ] literal rank of writer depending of num of com ===========================================================
* Require Dotclear 2.27
* Require PHP 7.4
* Upgrade to Dotclear 2.27
* Move third party repository
* Use Dotclear style for CHANGELOG
1.2 - 2023.04.23 topWriter 1.2 - 2023.04.23
- require dotclear 2.26 ===========================================================
- use latest dotclear namespace * require dotclear 2.26
- use sql statement * use latest dotclear namespace
- fix plural translations * use sql statement
- fix nullsafe warnings * fix plural translations
* fix nullsafe warnings
1.1 - 2023.03.21 topWriter 1.1 - 2023.03.21
- require Dotclear 2.25 ===========================================================
- use namespace * require Dotclear 2.25
* use namespace
1.0 - 2022.12.23 topWriter 1.0 - 2022.12.23
- use dotclear methods for widgets ===========================================================
- fix permissions * use dotclear methods for widgets
* fix permissions
0.10 - 2022.11.20 topWriter 0.10 - 2022.11.20
- fix compatibility with Dotclear 2.24 (required) ===========================================================
* fix compatibility with Dotclear 2.24 (required)
0.9 - 2021.11.06 topWriter 0.9 - 2021.11.06
- add dashboard module ===========================================================
- update translations * add dashboard module
- update to PSR12 * update translations
* update to PSR12
0.8.1 - 2021.09.17 topWriter 0.8.1 - 2021.09.17
- fix plurals and better translation ===========================================================
- update readme file * fix plurals and better translation
* update readme file
0.8 - 2021.08.27 topWriter 0.8 - 2021.08.27
- clean up (PSR2, short array, ...) ===========================================================
- update widget class * clean up (PSR2, short array, ...)
- fix translations * update widget class
- update license * fix translations
* update license
0.7 - 25-04-2015 - Pierre Van Glabeke topWriter 0.7 - 25-04-2015 - Pierre Van Glabeke
- Modification url support ===========================================================
* Modification url support
0.6 - 23-01-2015 - Pierre Van Glabeke topWriter 0.6 - 23-01-2015 - Pierre Van Glabeke
- Modifications locales pour widget ===========================================================
* Modifications locales pour widget
0.5 - 19-01-2015 - Pierre Van Glabeke topWriter 0.5 - 19-01-2015 - Pierre Van Glabeke
- Compatibilité dc2.7 ===========================================================
* Compatibilité dc2.7
0.4 - 2013-11-12 topWriter 0.4 - 2013-11-12
- Switch to Dotclear 2.6 ===========================================================
- Add widget options * Switch to Dotclear 2.6
- Use plural forms * Add widget options
* Use plural forms
0.3 - 2010-10-06 topWriter 0.3 - 2010-10-06
- Switched to DC 2.2 ===========================================================
- Fixed list order (thanks to Atv') * Switched to DC 2.2
* Fixed list order (thanks to Atv')
0.2 - 2009-08-10 topWriter 0.2 - 2009-08-10
- Fixed php 5.3 compatibility ===========================================================
- Fixed PostGreSQL compatibility * Fixed php 5.3 compatibility
- Added option to exclude post authors from comment list * Fixed PostGreSQL compatibility
* Added option to exclude post authors from comment list

View File

@ -1,11 +1,10 @@
# README # README
[![Release](https://img.shields.io/github/v/release/JcDenis/topWriter)](https://github.com/JcDenis/topWriter/releases) [![Release](https://img.shields.io/badge/release-1.3-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/topWriter/releases)
[![Date](https://img.shields.io/github/release-date/JcDenis/topWriter)](https://github.com/JcDenis/topWriter/releases) [![Date](https://img.shields.io/badge/date-2023.08.13-c44d58.svg)](https://git.dotclear.watch/JcDenis/topWriter/releases)
[![Issues](https://img.shields.io/github/issues/JcDenis/topWriter)](https://github.com/JcDenis/topWriter/issues) [![Dotclear](https://img.shields.io/badge/dotclear-v2.27-137bbb.svg)](https://fr.dotclear.org/download)
[![Dotclear](https://img.shields.io/badge/dotclear-v2.26-blue.svg)](https://fr.dotclear.org/download) [![Dotaddict](https://img.shields.io/badge/dotaddict-official-9ac123.svg)](https://plugins.dotaddict.org/dc2/details/topWriter)
[![Dotaddict](https://img.shields.io/badge/dotaddict-official-green.svg)](https://plugins.dotaddict.org/dc2/details/topWriter) [![License](https://img.shields.io/github/license/JcDenis/topWriter)](https://git.dotclear.watch/JcDenis/topWriter/blob/master/LICENSE)
[![License](https://img.shields.io/github/license/JcDenis/topWriter)](https://github.com/JcDenis/topWriter/blob/master/LICENSE)
## WHAT IS TOPWRITER ? ## WHAT IS TOPWRITER ?
@ -19,7 +18,8 @@ Show most active contributor on a widget.
_topWriter_ requires: _topWriter_ requires:
* permissions to manage widgets * permissions to manage widgets
* Dotclear 2.26 * Dotclear 2.27
* PHP 7.4
## USAGE ## USAGE
@ -28,17 +28,18 @@ Dotaddict repository. (See Dotclear's documentation to know how do this)
Add and configure _Top writer_ from widgets manager. Add and configure _Top writer_ from widgets manager.
There are two widget: entries and comments. There are two widget: entries and comments.
Or add contents to the backend dashboard from your preferences.
## LINKS ## LINKS
* License : [GNU GPL v2](https://www.gnu.org/licenses/old-licenses/lgpl-2.0.html) * License : [GNU GPL v2](https://www.gnu.org/licenses/old-licenses/lgpl-2.0.html)
* Source & contribution : [GitHub Page](https://github.com/JcDenis/topWriter) * Source & contribution : [Gitea Page](https://git.dotclear.watch/JcDenis/topWriter) or [GitHub Page](https://github.com/JcDenis/topWriter)
* Packages & details : [Dotaddict Page](https://plugins.dotaddict.org/dc2/details/topWriter) * Packages & details: [Gitea Page](https://git.dotclear.watch/JcDenis/topWriter/releases) or [Dotaddict Page](https://plugins.dotaddict.org/dc2/details/topWriter)
* Discuss and help : [Dotclear Forum](http://forum.dotclear.org/viewtopic.php?pid=333002#p333002) * Discuss and help : [Dotclear Forum](http://forum.dotclear.org/viewtopic.php?pid=333002#p333002)
## CONTRIBUTORS ## CONTRIBUTORS
* Jean-Christian Denis * Jean-Christian Denis (author)
* Pierre Van Glabeke * Pierre Van Glabeke
You are welcome to contribute to this code. You are welcome to contribute to this code.

View File

@ -10,7 +10,7 @@
* @copyright Jean-Christian Denis * @copyright 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
*/ */
if (!defined('DC_RC_PATH') || is_null(dcCore::app()->auth)) { if (!defined('DC_RC_PATH')) {
return null; return null;
} }
@ -18,15 +18,15 @@ $this->registerModule(
'Top writer', 'Top writer',
'Ranking of the most prolific writers and/or commentators', 'Ranking of the most prolific writers and/or commentators',
'Jean-Christian Denis, Pierre Van Glabeke', 'Jean-Christian Denis, Pierre Van Glabeke',
'1.2', '1.3',
[ [
'requires' => [['core', '2.26']], 'requires' => [['core', '2.27']],
'permissions' => dcCore::app()->auth->makePermissions([ 'permissions' => dcCore::app()->auth->makePermissions([
dcCore::app()->auth::PERMISSION_CONTENT_ADMIN, dcCore::app()->auth::PERMISSION_CONTENT_ADMIN,
]), ]),
'type' => 'plugin', 'type' => 'plugin',
'support' => 'http://forum.dotclear.org/viewtopic.php?pid=333002#p333002', 'support' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/issues',
'details' => 'http://plugins.dotaddict.org/dc2/details/topWriter', 'details' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/src/branch/master/README.md',
'repository' => 'https://raw.githubusercontent.com/JcDenis/topWriter/master/dcstore.xml', 'repository' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/raw/branch/master/dcstore.xml',
] ]
); );

View File

@ -2,12 +2,12 @@
<modules xmlns:da="http://dotaddict.org/da/"> <modules xmlns:da="http://dotaddict.org/da/">
<module id="topWriter"> <module id="topWriter">
<name>Top writer</name> <name>Top writer</name>
<version>1.2</version> <version>1.3</version>
<author>Jean-Christian Denis, Pierre Van Glabeke</author> <author>Jean-Christian Denis, Pierre Van Glabeke</author>
<desc>Ranking of the most prolific writers and/or commentators</desc> <desc>Ranking of the most prolific writers and/or commentators</desc>
<file>https://github.com/JcDenis/topWriter/releases/download/v1.2/plugin-topWriter.zip</file> <file>https://git.dotclear.watch/JcDenis/topWriter/releases/download/v1.3/plugin-topWriter.zip</file>
<da:dcmin>2.26</da:dcmin> <da:dcmin>2.27</da:dcmin>
<da:details>http://plugins.dotaddict.org/dc2/details/topWriter</da:details> <da:details>https://git.dotclear.watch/JcDenis/topWriter/src/branch/master/README.md</da:details>
<da:support>http://forum.dotclear.org/viewtopic.php?pid=333002#p333002</da:support> <da:support>https://git.dotclear.watch/JcDenis/topWriter/issues</da:support>
</module> </module>
</modules> </modules>

View File

@ -15,20 +15,18 @@ declare(strict_types=1);
namespace Dotclear\Plugin\topWriter; namespace Dotclear\Plugin\topWriter;
use dcCore; use dcCore;
use dcNsProcess; use Dotclear\Core\Process;
class Backend extends dcNsProcess class Backend extends Process
{ {
public static function init(): bool public static function init(): bool
{ {
static::$init = defined('DC_CONTEXT_ADMIN'); return self::status(My::checkContext(My::BACKEND));
return static::$init;
} }
public static function process(): bool public static function process(): bool
{ {
if (!static::$init) { if (!self::status()) {
return false; return false;
} }

View File

@ -114,11 +114,6 @@ class BackendBehaviors
public static function adminAfterDashboardOptionsUpdate(?string $user_id): void public static function adminAfterDashboardOptionsUpdate(?string $user_id): void
{ {
// nullsafe
if (is_null(dcCore::app()->auth) || is_null(dcCore::app()->auth->user_prefs)) {
return;
}
dcCore::app()->auth->user_prefs->get('dashboard')->put( dcCore::app()->auth->user_prefs->get('dashboard')->put(
'topWriterPostsItems', 'topWriterPostsItems',
!empty($_POST['topWriterPostsItems']), !empty($_POST['topWriterPostsItems']),
@ -154,11 +149,6 @@ class BackendBehaviors
private static function setDefaultPref(): array private static function setDefaultPref(): array
{ {
// nullsafe
if (is_null(dcCore::app()->auth) || is_null(dcCore::app()->auth->user_prefs)) {
return [];
}
if (!dcCore::app()->auth->user_prefs->get('dashboard')->prefExists('topWriterPostsItems')) { if (!dcCore::app()->auth->user_prefs->get('dashboard')->prefExists('topWriterPostsItems')) {
dcCore::app()->auth->user_prefs->get('dashboard')->put( dcCore::app()->auth->user_prefs->get('dashboard')->put(
'topWriterPostsItems', 'topWriterPostsItems',

View File

@ -15,20 +15,18 @@ declare(strict_types=1);
namespace Dotclear\Plugin\topWriter; namespace Dotclear\Plugin\topWriter;
use dcCore; use dcCore;
use dcNsProcess; use Dotclear\Core\Process;
class Frontend extends dcNsProcess class Frontend extends Process
{ {
public static function init(): bool public static function init(): bool
{ {
static::$init = true; return self::status(My::checkContext(My::FRONTEND));
return static::$init;
} }
public static function process(): bool public static function process(): bool
{ {
if (!static::$init) { if (!self::status()) {
return false; return false;
} }

21
src/My.php 100644
View File

@ -0,0 +1,21 @@
<?php
/**
* @brief topWriter, 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\topWriter;
use Dotclear\Module\MyPlugin;
class My extends MyPlugin
{
}