Compare commits

..

No commits in common. "master" and "v2023.10.13" have entirely different histories.

9 changed files with 53 additions and 34 deletions

View File

@ -1,11 +1,4 @@
simplyFavicon 2023.10.20
===========================================================
* Require Dotclear 2.28
* Require PHP 8.1
* Fix use of interface
* Use default permissions
simplyFavicon 2023.10.14
simplyFavicon 2023.10.13
===========================================================
* Require Dotclear 2.28
* Require PHP 8.1

View File

@ -1,14 +1,14 @@
# README
[![Release](https://img.shields.io/badge/release-2023.10.20-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/simplyFavicon/releases)
![Date](https://img.shields.io/badge/date-2023.10.20-c44d58.svg)
[![Release](https://img.shields.io/badge/release-2023.10.13-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/simplyFavicon/releases)
![Date](https://img.shields.io/badge/date-2023.10.13-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/simplyFavicon)
[![License](https://img.shields.io/github/license/JcDenis/simplyFavicon)](https://git.dotclear.watch/JcDenis/simplyFavicon/blob/master/LICENSE)
## ABOUT
_simplyFavicon_ is a plugin for the open-source web publishing software called [Dotclear](https://www.dotclear.org).
_pacKman_ is a plugin for the open-source web publishing software called [Dotclear](https://www.dotclear.org).
> Add a favicon to your blog.
@ -17,7 +17,7 @@ _simplyFavicon_ is a plugin for the open-source web publishing software called [
* Dotclear 2.28
* PHP 8.1+
* A readable public directory
* Dotclear admin permissions
* Administrator permissions
## USAGE

View File

@ -1,5 +1,16 @@
<?php
/**
* @brief simplyFavicon, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
/*
* @file
* @brief The simplyFavicon pacKman definition
* @ingroup simplyFavicon
@ -17,14 +28,16 @@ $this->registerModule(
'Simply favicon',
'Multi-agents favicon',
'Jean-Christian Denis',
'2023.10.20',
'2023.08.13',
[
'requires' => [['core', '2.28']],
'permissions' => 'My',
'settings' => ['blog' => '#params.' . basename(__DIR__) . '_params'],
'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',
'settings' => [
'blog' => '#params.' . basename(__DIR__) . '_params',
],
'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',
]
);

View File

@ -2,10 +2,10 @@
<modules xmlns:da="http://dotaddict.org/da/">
<module id="simplyFavicon">
<name>Simply favicon</name>
<version>2023.10.20</version>
<version>2023.10.13</version>
<author>Jean-Christian Denis</author>
<desc>Multi-agents favicon</desc>
<file>https://git.dotclear.watch/JcDenis/simplyFavicon/releases/download/v2023.10.20/plugin-simplyFavicon.zip</file>
<file>https://git.dotclear.watch/JcDenis/simplyFavicon/releases/download/v2023.10.13/plugin-simplyFavicon.zip</file>
<da:dcmin>2.28</da:dcmin>
<da:details>https://git.dotclear.watch/JcDenis/simplyFavicon/src/branch/master/README.md</da:details>
<da:support>https://git.dotclear.watch/JcDenis/simplyFavicon/issues</da:support>

View File

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Dotclear\Plugin\simplyFavicon;
use Dotclear\App;
use Dotclear\Core\BlogSettings;
use Dotclear\Core\Process;
use Dotclear\Helper\File\Path;
use Dotclear\Helper\Html\Form\{
@ -14,11 +15,10 @@ use Dotclear\Helper\Html\Form\{
Note,
Para
};
use Dotclear\Interface\Core\BlogSettingsInterface;
/**
* @brief simplyFavicon backend class.
* @ingroup simplyFavicon
* @brief simplyFavicon backend class.
* @ingroup simplyFavicon
*
* @author Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
@ -37,7 +37,7 @@ class Backend extends Process
}
App::behavior()->addBehaviors([
'adminBlogPreferencesFormV2' => function (BlogSettingsInterface $blog_settings): void {
'adminBlogPreferencesFormV2' => function (BlogSettings $blog_settings): void {
if (!App::blog()->isDefined()) {
return;
}
@ -78,7 +78,7 @@ class Backend extends Process
) .
'</div></div><br class="clear" /></div>';
},
'adminBeforeBlogSettingsUpdate' => function (BlogSettingsInterface $blog_settings): void {
'adminBeforeBlogSettingsUpdate' => function (BlogSettings $blog_settings): void {
$blog_settings->get('system')->put('simply_favicon', !empty($_POST['simply_favicon']));
},
]);

View File

@ -9,8 +9,8 @@ use Dotclear\Core\Process;
use Dotclear\Helper\File\Path;
/**
* @brief simplyFavicon frontend class.
* @ingroup simplyFavicon
* @brief simplyFavicon frontend class.
* @ingroup simplyFavicon
*
* @author Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html

View File

@ -4,16 +4,29 @@ declare(strict_types=1);
namespace Dotclear\Plugin\simplyFavicon;
use Dotclear\App;
use Dotclear\Module\MyPlugin;
/**
* @brief simplyFavicon My helper.
* @ingroup simplyFavicon
* @brief simplyFavicon My helper.
* @ingroup simplyFavicon
*
* @author Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
class My extends MyPlugin
{
// Use default permissions
protected static function checkCustomContext(int $context): ?bool
{
return match ($context) {
// Limit BACKEND to admin
self::BACKEND => App::task()->checkContext('BACKEND')
&& App::blog()->isDefined()
&& App::auth()->check(App::auth()->makePermissions([
App::auth()::PERMISSION_ADMIN,
]), App::blog()->id()),
default => null,
};
}
}

View File

@ -8,8 +8,8 @@ use Dotclear\App;
use Dotclear\Core\Process;
/**
* @brief simplyFavicon prepend class.
* @ingroup simplyFavicon
* @brief simplyFavicon prepend class.
* @ingroup simplyFavicon
*
* @author Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html

View File

@ -9,8 +9,8 @@ use Dotclear\Core\Frontend\Url;
use Dotclear\Helper\File\Path;
/**
* @brief simplyFavicon frontend URL handler.
* @ingroup simplyFavicon
* @brief simplyFavicon frontend URL handler.
* @ingroup simplyFavicon
*
* @author Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html