release 1.4.1

This commit is contained in:
Jean-Christian Paul Denis 2023-10-09 21:12:45 +02:00
parent bec0ff9b4f
commit 98cb01295c
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
6 changed files with 53 additions and 46 deletions

View File

@ -1,3 +1,9 @@
tinyPacker 1.4.1 - 2023.10.09
===========================================================
* Require Dotclear 2.28
* Require PHP 8.1+
* Code review
tinyPacker 1.4 - 2023.10.07
===========================================================
* Require Dotclear 2.28

View File

@ -1,23 +1,20 @@
# README
[![Release](https://img.shields.io/badge/release-1.4-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/tinyPacker/releases)
[![Date](https://img.shields.io/badge/date-2023.10.07-c44d58.svg)](https://git.dotclear.watch/JcDenis/tinyPacker/releases)
[![Release](https://img.shields.io/badge/release-1.4.1-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/tinyPacker/releases)
![Date](https://img.shields.io/badge/date-2023.10.07-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/tinyPacker)
[![License](https://img.shields.io/github/license/JcDenis/tinyPacker)](https://git.dotclear.watch/JcDenis/tinyPacker/blob/master/LICENSE)
[![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/JcDenis/tinyPacker/src/branch/master/LICENSE)
## WHAT IS tinyPacker ?
_tinyPacker_ is a plugin for the open-source
web publishing software called Dotclear.
## ABOUT
It is a one button packager for plugins and theme
direct from Dotclear blog manager.
_tinyPacker_ is a plugin for the open-source web publishing software called [Dotclear](https://www.dotclear.org).
> One button packager for plugins and themes direct from Dotclear blog manager.
## REQUIREMENTS
_tinyPacker_ requires:
* Super administrator permissions
* A writable public directory.
* Dotclear 2.28
@ -34,9 +31,10 @@ and it's pack into current blog public directory.
## MORE
* License : [GNU GPL v2](https://www.gnu.org/licenses/old-licenses/lgpl-2.0.html)
* Source & contribution : [Gitea Page](https://git.dotclear.watch/JcDenis/tinyPacker) or [GitHub Page](https://github.com/JcDenis/tinyPacker)
* Packages & details: [Gitea Page](https://git.dotclear.watch/JcDenis/tinyPacker/releases) or [Dotaddict Page](https://plugins.dotaddict.org/dc2/details/tinyPacker)
* [License](https://git.dotclear.watch/JcDenis/tinyPacker/src/branch/master/LICENSE)
* [Packages & details](https://git.dotclear.watch/JcDenis/tinyPacker/releases) (or on [Dotaddict](https://plugins.dotaddict.org/dc2/details/tinyPacker))
* [Sources & contributions](https://git.dotclear.watch/JcDenis/tinyPacker) (or on [GitHub](https://github.com/JcDenis/tinyPacker))
* [Issues & security](https://git.dotclear.watch/JcDenis/tinyPacker/issues) (or on [GitHub](https://github.com/JcDenis/tinyPacker/issues))
## CONTRIBUTORS

View File

@ -1,18 +1,18 @@
<?php
/**
* @brief tinyPacker, a plugin for Dotclear 2
* @file
* @brief The plugin tinyPacker definition
* @ingroup tinyPacker
*
* @package Dotclear
* @subpackage Plugin
* @defgroup tinyPacker Plugin tinyPacker.
*
* Quick pack theme or plugin into public dir.
*
* @author Jean-Christian Denis
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
if (!defined('DC_RC_PATH')) {
return null;
}
declare(strict_types=1);
$this->registerModule(
'Tiny packer',
@ -21,7 +21,6 @@ $this->registerModule(
'1.4',
[
'requires' => [['core', '2.28']],
'permissions' => null,
'type' => 'plugin',
'support' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/issues',
'details' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/src/branch/master/README.md',

View File

@ -2,10 +2,10 @@
<modules xmlns:da="http://dotaddict.org/da/">
<module id="tinyPacker">
<name>Tiny packer</name>
<version>1.4</version>
<version>1.4.1</version>
<author>Jean-Christian Denis</author>
<desc>Quick pack theme or plugin into public dir</desc>
<file>https://git.dotclear.watch/JcDenis/tinyPacker/releases/download/v1.4/plugin-tinyPacker.zip</file>
<file>https://git.dotclear.watch/JcDenis/tinyPacker/releases/download/v1.4.1/plugin-tinyPacker.zip</file>
<da:dcmin>2.28</da:dcmin>
<da:details>https://git.dotclear.watch/JcDenis/tinyPacker/src/branch/master/README.md</da:details>
<da:support>https://git.dotclear.watch/JcDenis/tinyPacker/issues</da:support>

View File

@ -1,15 +1,5 @@
<?php
/**
* @brief tinyPacker, 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
*/
declare(strict_types=1);
namespace Dotclear\Plugin\tinyPacker;
@ -27,9 +17,14 @@ use Dotclear\Helper\Network\Http;
use Exception;
/**
* tinyPacker admin class.
* @brief tinyPacker admin class.
* @ingroup tinyPacker
*
* Add action and button to modules lists.
*
* @author Jean-Christian Denis
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
class Backend extends Process
{
@ -49,7 +44,7 @@ class Backend extends Process
return in_array($list->getList(), [
'plugin-activate',
'theme-activate',
]) ? (new Submit([My::id() . '[' . Html::escapeHTML($id) . ']']))->value(__('Pack'))->render() : '';
]) ? (new Submit([My::id() . '[' . Html::escapeHTML($id) . ']']))->__call('value', [__('Pack')])->render() : '';
},
'adminModulesListDoActions' => function (ModulesList $list, array $modules, string $type): void {
# Pack action

View File

@ -19,10 +19,18 @@ use Dotclear\Module\MyPlugin;
class My extends MyPlugin
{
/** @var string Public packages folder */
/**
* Public packages folder.
*
* @var string TINYPACKER_DIR
*/
public const TINYPACKER_DIR = 'packages';
/** @var array Excluded files and dirs */
/**
* Excluded files and dirs.
*
* @var array<int,string> TINYPACKER_EXCLUDE
*/
public const TINYPACKER_EXCLUDE = [
'\.',
'\.\.',
@ -39,6 +47,7 @@ class My extends MyPlugin
public static function checkCustomContext(int $context): ?bool
{
return defined('DC_CONTEXT_ADMIN') && App::auth()->isSuperAdmin();
// Only backend and super admin
return $context === self::INSTALL ? null : App::task()->checkContext('BACKEND') && App::auth()->isSuperAdmin();
}
}