upgrade to Dotclear 2.27
This commit is contained in:
parent
fa8cb9c291
commit
d7c50d8656
@ -15,20 +15,18 @@ declare(strict_types=1);
|
||||
namespace Dotclear\Plugin\bloganniv;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -15,20 +15,18 @@ declare(strict_types=1);
|
||||
namespace Dotclear\Plugin\bloganniv;
|
||||
|
||||
use dcCore;
|
||||
use dcNsProcess;
|
||||
use Dotclear\Core\Process;
|
||||
|
||||
class Frontend extends dcNsProcess
|
||||
class Frontend extends Process
|
||||
{
|
||||
public static function init(): bool
|
||||
{
|
||||
static::$init = defined('DC_RC_PATH');
|
||||
|
||||
return static::$init;
|
||||
return self::status(My::checkContext(My::FRONTEND));
|
||||
}
|
||||
|
||||
public static function process(): bool
|
||||
{
|
||||
if (!static::$init) {
|
||||
if (!self::status()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
29
src/My.php
29
src/My.php
@ -14,36 +14,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace Dotclear\Plugin\bloganniv;
|
||||
|
||||
use dcCore;
|
||||
use Dotclear\Module\MyPlugin;
|
||||
|
||||
/**
|
||||
* This module definitions.
|
||||
*/
|
||||
class My
|
||||
class My extends MyPlugin
|
||||
{
|
||||
/**
|
||||
* This module id.
|
||||
*/
|
||||
public static function id(): string
|
||||
{
|
||||
return basename(dirname(__DIR__));
|
||||
}
|
||||
|
||||
/**
|
||||
* This module name.
|
||||
*/
|
||||
public static function name(): string
|
||||
{
|
||||
$name = dcCore::app()->plugins->moduleInfo(self::id(), 'name');
|
||||
|
||||
return __(is_string($name) ? $name : self::id());
|
||||
}
|
||||
|
||||
/**
|
||||
* This module path.
|
||||
*/
|
||||
public static function path(): string
|
||||
{
|
||||
return dirname(__DIR__);
|
||||
}
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ class Widgets
|
||||
$nbrejours = abs($timestamp2 - $timestamp1) / 86400;
|
||||
$nbreannee = abs($annee2 - $annee - 1);
|
||||
}
|
||||
// abs($timestamp2 - $timestamp1)/(86400*7); //Affichage du nombre de semaine : 3.85
|
||||
// abs($timestamp2 - $timestamp1)/(86400*7); //Affichage du nombre de semaine : 3.85
|
||||
} else {
|
||||
// date invalide
|
||||
return '';
|
||||
|
Loading…
Reference in New Issue
Block a user