parent
43e83b6900
commit
e5790dfa23
|
@ -1,3 +1,9 @@
|
||||||
|
tinyPacker 1.4.2 - 2023.10.20
|
||||||
|
===========================================================
|
||||||
|
* Require Dotclear 2.28
|
||||||
|
* Require PHP 8.1+
|
||||||
|
* Code review
|
||||||
|
|
||||||
tinyPacker 1.4.1 - 2023.10.09
|
tinyPacker 1.4.1 - 2023.10.09
|
||||||
===========================================================
|
===========================================================
|
||||||
* Require Dotclear 2.28
|
* Require Dotclear 2.28
|
||||||
|
|
10
README.md
10
README.md
|
@ -1,7 +1,7 @@
|
||||||
# README
|
# README
|
||||||
|
|
||||||
[![Release](https://img.shields.io/badge/release-1.4.1-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/tinyPacker/releases)
|
[![Release](https://img.shields.io/badge/release-1.4.2-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/tinyPacker/releases)
|
||||||
![Date](https://img.shields.io/badge/date-2023.10.07-c44d58.svg)
|
![Date](https://img.shields.io/badge/date-2023.10.20-c44d58.svg)
|
||||||
[![Dotclear](https://img.shields.io/badge/dotclear-v2.28-137bbb.svg)](https://fr.dotclear.org/download)
|
[![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)
|
[![Dotaddict](https://img.shields.io/badge/dotaddict-official-9ac123.svg)](https://plugins.dotaddict.org/dc2/details/tinyPacker)
|
||||||
[![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/JcDenis/tinyPacker/src/branch/master/LICENSE)
|
[![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/JcDenis/tinyPacker/src/branch/master/LICENSE)
|
||||||
|
@ -16,8 +16,8 @@ _tinyPacker_ is a plugin for the open-source web publishing software called [Dot
|
||||||
|
|
||||||
* Dotclear 2.28
|
* Dotclear 2.28
|
||||||
* PHP 8.1+
|
* PHP 8.1+
|
||||||
* Super administrator permissions
|
* System writable public directory
|
||||||
* A writable public directory.
|
* Dotlear super admin permissions
|
||||||
|
|
||||||
## USAGE
|
## USAGE
|
||||||
|
|
||||||
|
@ -37,6 +37,6 @@ and it's pack into current blog public directory.
|
||||||
|
|
||||||
## CONTRIBUTORS
|
## CONTRIBUTORS
|
||||||
|
|
||||||
* Jean-Christian Denis
|
* Jean-Christian Denis (author)
|
||||||
|
|
||||||
You are welcome to contribute to this code.
|
You are welcome to contribute to this code.
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
* Quick pack theme or plugin into public dir.
|
* Quick pack theme or plugin into public dir.
|
||||||
*
|
*
|
||||||
* @author Jean-Christian Denis
|
* @author 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
|
||||||
*/
|
*/
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
@ -18,9 +17,10 @@ $this->registerModule(
|
||||||
'Tiny packer',
|
'Tiny packer',
|
||||||
'Quick pack theme or plugin into public dir',
|
'Quick pack theme or plugin into public dir',
|
||||||
'Jean-Christian Denis',
|
'Jean-Christian Denis',
|
||||||
'1.4.1',
|
'1.4.2',
|
||||||
[
|
[
|
||||||
'requires' => [['core', '2.28']],
|
'requires' => [['core', '2.28']],
|
||||||
|
'permissions' => 'My',
|
||||||
'type' => 'plugin',
|
'type' => 'plugin',
|
||||||
'support' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/issues',
|
'support' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/issues',
|
||||||
'details' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/src/branch/master/README.md',
|
'details' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/src/branch/master/README.md',
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
<modules xmlns:da="http://dotaddict.org/da/">
|
<modules xmlns:da="http://dotaddict.org/da/">
|
||||||
<module id="tinyPacker">
|
<module id="tinyPacker">
|
||||||
<name>Tiny packer</name>
|
<name>Tiny packer</name>
|
||||||
<version>1.4.1</version>
|
<version>1.4.2</version>
|
||||||
<author>Jean-Christian Denis</author>
|
<author>Jean-Christian Denis</author>
|
||||||
<desc>Quick pack theme or plugin into public dir</desc>
|
<desc>Quick pack theme or plugin into public dir</desc>
|
||||||
<file>https://git.dotclear.watch/JcDenis/tinyPacker/releases/download/v1.4.1/plugin-tinyPacker.zip</file>
|
<file>https://git.dotclear.watch/JcDenis/tinyPacker/releases/download/v1.4.2/plugin-tinyPacker.zip</file>
|
||||||
<da:dcmin>2.28</da:dcmin>
|
<da:dcmin>2.28</da:dcmin>
|
||||||
<da:details>https://git.dotclear.watch/JcDenis/tinyPacker/src/branch/master/README.md</da:details>
|
<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>
|
<da:support>https://git.dotclear.watch/JcDenis/tinyPacker/issues</da:support>
|
||||||
|
|
|
@ -23,7 +23,6 @@ use Exception;
|
||||||
* Add action and button to modules lists.
|
* Add action and button to modules lists.
|
||||||
*
|
*
|
||||||
* @author Jean-Christian Denis
|
* @author 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
|
||||||
*/
|
*/
|
||||||
class Backend extends Process
|
class Backend extends Process
|
||||||
|
@ -69,7 +68,7 @@ class Backend extends Process
|
||||||
$modules = array_keys($_POST[My::id()]);
|
$modules = array_keys($_POST[My::id()]);
|
||||||
$id = $modules[0];
|
$id = $modules[0];
|
||||||
|
|
||||||
$module = $list->modules->getDefine($id);
|
$module = $list->modules->getDefine((string) $id);
|
||||||
if (!$module->isDefined()) {
|
if (!$module->isDefined()) {
|
||||||
throw new Exception(__('No such module.'));
|
throw new Exception(__('No such module.'));
|
||||||
}
|
}
|
||||||
|
@ -93,7 +92,7 @@ class Backend extends Process
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
$zip->addDirectory((string) Path::real($module->get('root')), $id, true);
|
$zip->addDirectory((string) Path::real($module->get('root')), (string) $id, true);
|
||||||
$zip->write();
|
$zip->write();
|
||||||
$zip->close();
|
$zip->close();
|
||||||
unset($zip, $fp);
|
unset($zip, $fp);
|
||||||
|
|
24
src/My.php
24
src/My.php
|
@ -1,15 +1,5 @@
|
||||||
<?php
|
<?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);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Dotclear\Plugin\tinyPacker;
|
namespace Dotclear\Plugin\tinyPacker;
|
||||||
|
@ -17,6 +7,13 @@ namespace Dotclear\Plugin\tinyPacker;
|
||||||
use Dotclear\App;
|
use Dotclear\App;
|
||||||
use Dotclear\Module\MyPlugin;
|
use Dotclear\Module\MyPlugin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief tinyPacker My helper.
|
||||||
|
* @ingroup tinyPacker
|
||||||
|
*
|
||||||
|
* @author Jean-Christian Denis
|
||||||
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
*/
|
||||||
class My extends MyPlugin
|
class My extends MyPlugin
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -48,6 +45,9 @@ class My extends MyPlugin
|
||||||
public static function checkCustomContext(int $context): ?bool
|
public static function checkCustomContext(int $context): ?bool
|
||||||
{
|
{
|
||||||
// Only backend and super admin
|
// Only backend and super admin
|
||||||
return $context === self::INSTALL ? null : App::task()->checkContext('BACKEND') && App::auth()->isSuperAdmin();
|
return match ($context) {
|
||||||
|
self::MODULE => App::task()->checkContext('BACKEND') && App::auth()->isSuperAdmin(),
|
||||||
|
default => null,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue