upgrade to Dotclear 2.27
parent
45ea1216dc
commit
d3818b273c
|
@ -15,20 +15,18 @@ declare(strict_types=1);
|
|||
namespace Dotclear\Plugin\topWriter;
|
||||
|
||||
use dcCore;
|
||||
use dcNsProcess;
|
||||
use Dotclear\Core\Process;
|
||||
|
||||
class Backend extends dcNsProcess
|
||||
class Backend extends Process
|
||||
{
|
||||
public static function init(): bool
|
||||
{
|
||||
static::$init = defined('DC_CONTEXT_ADMIN');
|
||||
|
||||
return static::$init;
|
||||
return self::status(My::checkContext(My::BACKEND));
|
||||
}
|
||||
|
||||
public static function process(): bool
|
||||
{
|
||||
if (!static::$init) {
|
||||
if (!self::status()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -114,11 +114,6 @@ class BackendBehaviors
|
|||
|
||||
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(
|
||||
'topWriterPostsItems',
|
||||
!empty($_POST['topWriterPostsItems']),
|
||||
|
@ -154,11 +149,6 @@ class BackendBehaviors
|
|||
|
||||
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')) {
|
||||
dcCore::app()->auth->user_prefs->get('dashboard')->put(
|
||||
'topWriterPostsItems',
|
||||
|
|
|
@ -15,20 +15,18 @@ declare(strict_types=1);
|
|||
namespace Dotclear\Plugin\topWriter;
|
||||
|
||||
use dcCore;
|
||||
use dcNsProcess;
|
||||
use Dotclear\Core\Process;
|
||||
|
||||
class Frontend extends dcNsProcess
|
||||
class Frontend extends Process
|
||||
{
|
||||
public static function init(): bool
|
||||
{
|
||||
static::$init = true;
|
||||
|
||||
return static::$init;
|
||||
return self::status(My::checkContext(My::FRONTEND));
|
||||
}
|
||||
|
||||
public static function process(): bool
|
||||
{
|
||||
if (!static::$init) {
|
||||
if (!self::status()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
{
|
||||
}
|
Loading…
Reference in New Issue