diff --git a/CHANGELOG.md b/CHANGELOG.md index 27d1f6f..80354c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ -xxxx.xx.xx +2023.03.11 - require Dotclear 2.26 - use PHP namespace - use dcPage open/close module +- use Form helpers - manage modules structure > dc 2.24 2023.01.07 diff --git a/README.md b/README.md index a9e32d4..84f1fd7 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Release](https://img.shields.io/github/v/release/JcDenis/pacKman)](https://github.com/JcDenis/pacKman/releases) [![Date](https://img.shields.io/github/release-date/JcDenis/pacKman)](https://github.com/JcDenis/pacKman/releases) [![Issues](https://img.shields.io/github/issues/JcDenis/pacKman)](https://github.com/JcDenis/pacKman/issues) -[![Dotclear](https://img.shields.io/badge/dotclear-v2.24-blue.svg)](https://fr.dotclear.org/download) +[![Dotclear](https://img.shields.io/badge/dotclear-v2.26-blue.svg)](https://fr.dotclear.org/download) [![Dotaddict](https://img.shields.io/badge/dotaddict-official-green.svg)](https://plugins.dotaddict.org/dc2/details/pacKman) [![License](https://img.shields.io/github/license/JcDenis/pacKman)](https://github.com/JcDenis/pacKman/blob/master/LICENSE) @@ -20,7 +20,7 @@ themes and plugins from Dotclear administration pages. pacKman requires: * Super administrator permissions - * Dotclear 2.24 + * Dotclear 2.26 * A writable cache directory * A writable directory to put packages. (can be VAR dir) diff --git a/_define.php b/_define.php index 03106e8..9b15678 100644 --- a/_define.php +++ b/_define.php @@ -12,20 +12,17 @@ */ declare(strict_types=1); -// can not use namespace as it is included inside a class method, -// and also can be included in third party plugins class methods. - if (!defined('DC_RC_PATH')) { return null; } $this->registerModule( - 'pacKman', + 'Packages repository', 'Manage your Dotclear packages', 'Jean-Christian Denis', - '2023.03.05-dev', + '2023.03.11', [ - 'requires' => [['core', '2.26-dev']], + 'requires' => [['core', '2.26']], 'permissions' => null, 'type' => 'plugin', 'support' => 'https://github.com/JcDenis/' . basename(__DIR__), diff --git a/dcstore.xml b/dcstore.xml index 23283e6..34eb564 100644 --- a/dcstore.xml +++ b/dcstore.xml @@ -1,12 +1,12 @@ - pacKman - 2023.01.07 + Packages repository + 2023.03.11 Jean-Christian Denis Manage your Dotclear packages - https://github.com/JcDenis/pacKman/releases/download/v2023.01.07/plugin-pacKman.zip - 2.24 + https://github.com/JcDenis/pacKman/releases/download/v2023.03.11/plugin-pacKman.zip + 2.26 https://plugins.dotaddict.org/dc2/details/pacKman https://github.com/JcDenis/pacKman diff --git a/locales/fr/main.lang.php b/locales/fr/main.lang.php index 3d37b18..7a3a362 100644 --- a/locales/fr/main.lang.php +++ b/locales/fr/main.lang.php @@ -9,7 +9,6 @@ # DOT NOT MODIFY THIS FILE ! # -l10n::$locales['Packages repository'] = 'Dépôt de paquetages'; l10n::$locales['Configuration has been successfully updated.'] = 'La configuration a été mise à jour avec succès.'; l10n::$locales['Root'] = 'Racine'; l10n::$locales['Path to repository:'] = 'Chemin vers le dépôt :'; @@ -38,6 +37,7 @@ l10n::$locales['pacKman is not well configured.'] = 'pacKman n\' l10n::$locales['Configuration'] = 'Configuration'; l10n::$locales['Plugins root'] = 'Racine des plugins'; l10n::$locales['Themes root'] = 'Racine des thèmes'; +l10n::$locales['Packages repository'] = 'Dépôt de paquetages'; l10n::$locales['Cache directory is not writable.'] = 'Le répertoire de cache n\'est pas accessible en écriture.'; l10n::$locales['Path to repository is not writable.'] = 'Le chemin vers le dépôt n\'est pas accessible en écriture.'; l10n::$locales['You must specify the name of package to export.'] = 'Vous devez spécifier le nom du paquetage exporté.'; diff --git a/locales/fr/main.po b/locales/fr/main.po index 72c961b..2793c89 100644 --- a/locales/fr/main.po +++ b/locales/fr/main.po @@ -1,18 +1,15 @@ msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" -"Project-Id-Version: pacKman 2022.12.19.3\n" +"Project-Id-Version: pacKman 2023.03.11\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2022-12-20T00:29:17+00:00\n" +"PO-Revision-Date: 2023-03-11T17:43:33+00:00\n" "Last-Translator: Jean-Christian Denis\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -msgid "Packages repository" -msgstr "Dépôt de paquetages" - msgid "Configuration has been successfully updated." msgstr "La configuration a été mise à jour avec succès." @@ -97,6 +94,9 @@ msgstr "Racine des plugins" msgid "Themes root" msgstr "Racine des thèmes" +msgid "Packages repository" +msgstr "Dépôt de paquetages" + msgid "Cache directory is not writable." msgstr "Le répertoire de cache n'est pas accessible en écriture." diff --git a/src/Backend.php b/src/Backend.php index 5664ea3..671a434 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -14,7 +14,6 @@ declare(strict_types=1); namespace Dotclear\Plugin\pacKman; -/* dotclear ns */ use dcAdmin; use dcCore; use dcFavorites; @@ -23,14 +22,9 @@ use dcNsProcess; class Backend extends dcNsProcess { - private static $pid = ''; - public static function init(): bool { - if (defined('DC_CONTEXT_ADMIN')) { - self::$pid = basename(dirname(__DIR__)); - self::$init = true; - } + self::$init = defined('DC_CONTEXT_ADMIN'); return self::$init; } @@ -42,20 +36,20 @@ class Backend extends dcNsProcess } dcCore::app()->addBehavior('adminDashboardFavoritesV2', function (dcFavorites $favs): void { - $favs->register(self::$pid, [ - 'title' => __('Packages repository'), - 'url' => dcCore::app()->adminurl->get('admin.plugin.' . self::$pid, [], '#packman-repository-repository'), - 'small-icon' => [dcPage::getPF(self::$pid . '/icon.svg'), dcPage::getPF(self::$pid . '/icon-dark.svg')], - 'large-icon' => [dcPage::getPF(self::$pid . '/icon.svg'), dcPage::getPF(self::$pid . '/icon-dark.svg')], + $favs->register(My::id(), [ + 'title' => My::name(), + 'url' => dcCore::app()->adminurl->get('admin.plugin.' . My::id(), [], '#packman-repository-repository'), + 'small-icon' => [dcPage::getPF(My::id() . '/icon.svg'), dcPage::getPF(My::id() . '/icon-dark.svg')], + 'large-icon' => [dcPage::getPF(My::id() . '/icon.svg'), dcPage::getPF(My::id() . '/icon-dark.svg')], //'permissions' => dcCore::app()->auth->isSuperAdmin(), ]); }); dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem( - __('Packages repository'), - dcCore::app()->adminurl->get('admin.plugin.' . self::$pid) . '#packman-repository-repository', - [dcPage::getPF(self::$pid . '/icon.svg'), dcPage::getPF(self::$pid . '/icon-dark.svg')], - preg_match('/' . preg_quote(dcCore::app()->adminurl->get('admin.plugin.' . self::$pid)) . '(&.*)?$/', $_SERVER['REQUEST_URI']), + My::name(), + dcCore::app()->adminurl->get('admin.plugin.' . My::id()) . '#packman-repository-repository', + [dcPage::getPF(My::id() . '/icon.svg'), dcPage::getPF(My::id() . '/icon-dark.svg')], + preg_match('/' . preg_quote(dcCore::app()->adminurl->get('admin.plugin.' . My::id())) . '(&.*)?$/', $_SERVER['REQUEST_URI']), dcCore::app()->auth->isSuperAdmin() ); diff --git a/src/Config.php b/src/Config.php index e035b7d..9b82e61 100644 --- a/src/Config.php +++ b/src/Config.php @@ -14,35 +14,33 @@ declare(strict_types=1); namespace Dotclear\Plugin\pacKman; -/* dotclear ns */ use dcCore; use dcPage; use dcNsProcess; - -/* clearbricks ns */ -use form; -use http; - -/* php ns */ +use Dotclear\Helper\Html\Form\{ + Checkbox, + Div, + Fieldset, + Input, + Label, + Legend, + Note, + Para +}; use Exception; class Config extends dcNsProcess { - private static $pid = ''; - public static function init(): bool { - if (defined('DC_CONTEXT_ADMIN')) { - self::$pid = basename(dirname(__DIR__)); - self::$init = true; - } + self::$init = defined('DC_CONTEXT_ADMIN'); return self::$init; } public static function process(): bool { - if (!self::$init || !defined('DC_CONTEXT_MODULE')) { + if (!self::$init) { return false; } @@ -67,7 +65,7 @@ class Config extends dcNsProcess ); if ($check) { - $s = dcCore::app()->blog->settings->__get(self::$pid); + $s = dcCore::app()->blog->settings->get(My::id()); $s->put('pack_nocomment', $pack_nocomment); $s->put('pack_fixnewline', $pack_fixnewline); $s->put('pack_overwrite', $pack_overwrite); @@ -79,10 +77,11 @@ class Config extends dcNsProcess dcPage::addSuccessNotice( __('Configuration has been successfully updated.') ); - http::redirect( - dcCore::app()->admin->__get('list')->getURL('module=' . self::$pid . '&conf=1&redir=' . - dcCore::app()->admin->__get('list')->getRedir()) - ); + dcCore::app()->adminurl->redirect('admin.plugins', [ + 'module' => My::id(), + 'conf' => '1', + 'redir' => dcCore::app()->admin->__get('list')->getRedir(), + ]); } } catch (Exception $e) { dcCore::app()->error->add($e->getMessage()); @@ -98,58 +97,63 @@ class Config extends dcNsProcess } # -- Get settings -- - $s = dcCore::app()->blog->settings->__get(self::$pid); + $s = dcCore::app()->blog->settings->get(My::id()); # -- Display form -- - echo ' -
-

' . __('Root') . '

+ echo + (new Div())->items([ + (new Fieldset())->class('fieldset')->legend((new Legend(__('Root'))))->fields([ + // pack_repository + (new Para())->items([ + (new Label(__('Path to repository:')))->for('pack_repository'), + (new Input('pack_repository'))->class('maximal')->size(65)->maxlenght(255)->value((string) $s->get('pack_repository')), + ]), + (new Note())->class('form-note')->text( + sprintf( + __('Preconization: %s'), + dcCore::app()->blog->public_path ? + dcCore::app()->blog->public_path : __("Blog's public directory") + ) . ' ' . __('Leave it empty to use Dotclear VAR directory') + ), + ]), + (new Fieldset())->class('fieldset')->legend((new Legend(__('Files'))))->fields([ + // pack_filename + (new Para())->items([ + (new Label(__('Name of exported package:')))->for('pack_filename'), + (new Input('pack_filename'))->class('maximal')->size(65)->maxlenght(255)->value((string) $s->get('pack_filename')), + ]), + (new Note())->text(sprintf(__('Preconization: %s'), '%type%-%id%'))->class('form-note'), + // secondpack_filename + (new Para())->items([ + (new Label(__('Name of second exported package:')))->for('secondpack_filename'), + (new Input('secondpack_filename'))->class('maximal')->size(65)->maxlenght(255)->value((string) $s->get('secondpack_filename')), + ]), + (new Note())->text(sprintf(__('Preconization: %s'), '%type%-%id%-%version%'))->class('form-note'), + // pack_overwrite + (new Para())->items([ + (new Checkbox('pack_overwrite', (bool) $s->get('pack_overwrite')))->value(1), + (new Label(__('Overwrite existing package'), Label::OUTSIDE_LABEL_AFTER))->for('pack_overwrite')->class('classic'), + ]), + ]), + (new Fieldset())->class('fieldset')->legend((new Legend(__('Content'))))->fields([ + // pack_excludefiles + (new Para())->items([ + (new Label(__('Extra files to exclude from package:')))->for('pack_excludefiles'), + (new Input('pack_excludefiles'))->class('maximal')->size(65)->maxlenght(255)->value((string) $s->get('pack_excludefiles')), + ]), + (new Note())->text(sprintf(__('Preconization: %s'), '*.zip,*.tar,*.tar.gz'))->class('form-note'), + // pack_nocomment + (new Para())->items([ + (new Checkbox('pack_nocomment', (bool) $s->get('pack_nocomment')))->value(1), + (new Label(__('Remove comments from files'), Label::OUTSIDE_LABEL_AFTER))->for('pack_nocomment')->class('classic'), + ]), + // pack_fixnewline + (new Para())->items([ + (new Checkbox('pack_fixnewline', (bool) $s->get('pack_fixnewline')))->value(1), + (new Label(__('Fix newline style from files content'), Label::OUTSIDE_LABEL_AFTER))->for('pack_fixnewline')->class('classic'), + ]), -

' . - '

' . sprintf( - __('Preconization: %s'), - dcCore::app()->blog->public_path ? - dcCore::app()->blog->public_path : __("Blog's public directory") - ) . '
' . __('Leave it empty to use Dotclear VAR directory') . '

-
- -
-

' . __('Files') . '

- -

-

' . sprintf(__('Preconization: %s'), '%type%-%id%') . '

- -

-

' . sprintf(__('Preconization: %s'), '%type%-%id%-%version%') . '

- -

- -
- -
-

' . __('Content') . '

- -

-

' . sprintf(__('Preconization: %s'), '*.zip,*.tar,*.tar.gz') . '

- -

- -

- -
'; + ]), + ])->render(); } } diff --git a/src/Core.php b/src/Core.php index 53433fd..fb5ecd2 100644 --- a/src/Core.php +++ b/src/Core.php @@ -14,50 +14,18 @@ declare(strict_types=1); namespace Dotclear\Plugin\pacKman; -/* dotclear ns */ use dcCore; use dcModules; -use dcThemes; - -/* clearbricks ns */ +use Exception; use files; use fileUnzip; use path; -/* packman ns */ - -/* php ns */ -use Exception; - class Core { - /** @var array Excluded files */ - public static $exclude = [ - '.', - '..', - '__MACOSX', - '.svn', - '.hg*', - '.git*', - 'CVS', - '.DS_Store', - 'Thumbs.db', - '_disabled', - ]; - - public static function id() - { - return basename(dirname(__DIR__)); - } - - public static function name() - { - return __('pacKman'); - } - public static function quote_exclude(array $exclude): array { - foreach ($exclude as $k => $v) { + foreach (My::EXCLUDED_FILES as $k => $v) { $exclude[$k] = '#(^|/)(' . str_replace( ['.', '*'], ['\.', '.*?'], @@ -95,7 +63,6 @@ class Core 'plugin' => clone dcCore::app()->plugins, ]; - $i = 0; foreach ($zip_files as $zip_file) { $zip_file = $root . DIRECTORY_SEPARATOR . $zip_file; @@ -137,8 +104,8 @@ class Core // can't load twice _init.php file ! $unlink = false; if ($zip->hasFile($init) - && !dcCore::app()->plugins->getDefine(basename($destination))->isDefined() - && !dcCore::app()->themes->getDefine(basename($destination))->isDefined() +// && !dcCore::app()->plugins->getDefine(basename($destination))->isDefined() +// && !dcCore::app()->themes->getDefine(basename($destination))->isDefined() ) { $unlink = true; $zip->unzip($init, $destination . DIRECTORY_SEPARATOR . dcModules::MODULE_FILE_INIT); @@ -164,7 +131,6 @@ class Core $module = $sandbox->getDefine(basename($destination)); if (!$module->isDefined() || $module->get('type') != $type) { - throw new Exception('bad module type'); } @@ -174,7 +140,6 @@ class Core $zip->close(); files::deltree($destination); - } catch (Exception $e) { $zip->close(); files::deltree($destination); @@ -256,7 +221,7 @@ class Core private static function getExclude(array $exclude): array { - $exclude = array_merge(self::$exclude, $exclude); + $exclude = array_merge(My::EXCLUDED_FILES, $exclude); return self::quote_exclude($exclude); } diff --git a/src/Filezip.php b/src/Filezip.php index 71242f0..4150dd3 100644 --- a/src/Filezip.php +++ b/src/Filezip.php @@ -14,7 +14,6 @@ declare(strict_types=1); namespace Dotclear\Plugin\pacKman; -/* clearbricks ns */ //use fileZip; class Filezip extends \fileZip diff --git a/src/Install.php b/src/Install.php index 32e2de0..d6345fb 100644 --- a/src/Install.php +++ b/src/Install.php @@ -14,12 +14,9 @@ declare(strict_types=1); namespace Dotclear\Plugin\pacKman; -/* dotclear ns */ use dcCore; use dcNamespace; use dcNsProcess; - -/* php ns */ use Exception; class Install extends dcNsProcess @@ -72,7 +69,7 @@ class Install extends dcNsProcess public static function init(): bool { - self::$init = defined('DC_CONTEXT_ADMIN') && dcCore::app()->newVersion(Core::id(), dcCore::app()->plugins->moduleInfo(Core::id(), 'version')); + self::$init = defined('DC_CONTEXT_ADMIN') && dcCore::app()->newVersion(My::id(), dcCore::app()->plugins->moduleInfo(My::id(), 'version')); return self::$init; } @@ -89,7 +86,7 @@ class Install extends dcNsProcess // Set module settings foreach (self::$mod_conf as $v) { - dcCore::app()->blog->settings->__get(Core::id())->put( + dcCore::app()->blog->settings->get(My::id())->put( $v[0], $v[2], $v[3], @@ -109,7 +106,7 @@ class Install extends dcNsProcess public static function growUp(): void { - $current = dcCore::app()->getVersion(Core::id()); + $current = dcCore::app()->getVersion(My::id()); // Update settings id, ns if ($current && version_compare($current, '2022.12.19.1', '<=')) { @@ -122,7 +119,7 @@ class Install extends dcNsProcess if (preg_match('/^packman_(.*?)$/', $record->setting_id, $match)) { $cur = dcCore::app()->con->openCursor(dcCore::app()->prefix . dcNamespace::NS_TABLE_NAME); $cur->setting_id = $match[1]; - $cur->setting_ns = Core::id(); + $cur->setting_ns = My::id(); $cur->update( "WHERE setting_id = '" . $record->setting_id . "' and setting_ns = 'pacKman' " . 'AND blog_id ' . (null === $record->blog_id ? 'IS NULL ' : ("= '" . dcCore::app()->con->escape($record->blog_id) . "' ")) diff --git a/src/Manage.php b/src/Manage.php index 1835298..68ba60e 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -32,7 +32,6 @@ class Manage extends dcNsProcess { private static $plugins_path = ''; private static $themes_path = ''; - private static $pid = ''; public static function init(): bool { @@ -44,8 +43,6 @@ class Manage extends dcNsProcess $p = array_pop($e); self::$plugins_path = (string) path::real($p); self::$themes_path = dcCore::app()->blog->themes_path; - self::$pid = basename(dirname(__DIR__)); - self::$init = true; } return self::$init; @@ -62,7 +59,7 @@ class Manage extends dcNsProcess $type = isset($_POST['type']) && in_array($_POST['type'], ['plugins', 'themes', 'repository']) ? $_POST['type'] : ''; # Settings - $s = dcCore::app()->blog->settings->get(self::$pid); + $s = dcCore::app()->blog->settings->get(My::id()); $dir = Utils::getRepositoryDir($s->get('pack_repository')); # Modules @@ -129,7 +126,7 @@ class Manage extends dcNsProcess if (!empty($_POST['redir'])) { http::redirect($_POST['redir']); } else { - dcCore::app()->adminurl->redirect('admin.plugin.' . self::$pid, [], '#packman-' . $type); + dcCore::app()->adminurl->redirect('admin.plugin.' . My::id(), [], '#packman-' . $type); } # Pack @@ -168,7 +165,7 @@ class Manage extends dcNsProcess if (!empty($_POST['redir'])) { http::redirect($_POST['redir']); } else { - dcCore::app()->adminurl->redirect('admin.plugin.' . self::$pid, [], '#packman-' . $type); + dcCore::app()->adminurl->redirect('admin.plugin.' . My::id(), [], '#packman-' . $type); } # Delete @@ -193,7 +190,7 @@ class Manage extends dcNsProcess if (!empty($_POST['redir'])) { http::redirect($_POST['redir']); } else { - dcCore::app()->adminurl->redirect('admin.plugin.' . self::$pid, [], '#packman-repository-' . $type); + dcCore::app()->adminurl->redirect('admin.plugin.' . My::id(), [], '#packman-repository-' . $type); } # Install @@ -220,7 +217,7 @@ class Manage extends dcNsProcess if (!empty($_POST['redir'])) { http::redirect($_POST['redir']); } else { - dcCore::app()->adminurl->redirect('admin.plugin.' . self::$pid, [], '#packman-repository-' . $type); + dcCore::app()->adminurl->redirect('admin.plugin.' . My::id(), [], '#packman-repository-' . $type); } # Copy @@ -246,7 +243,7 @@ class Manage extends dcNsProcess if (!empty($_POST['redir'])) { http::redirect($_POST['redir']); } else { - dcCore::app()->adminurl->redirect('admin.plugin.' . self::$pid, [], '#packman-repository-' . $type); + dcCore::app()->adminurl->redirect('admin.plugin.' . My::id(), [], '#packman-repository-' . $type); } # Move @@ -273,7 +270,7 @@ class Manage extends dcNsProcess if (!empty($_POST['redir'])) { http::redirect($_POST['redir']); } else { - dcCore::app()->adminurl->redirect('admin.plugin.' . self::$pid, [], '#packman-repository-' . $type); + dcCore::app()->adminurl->redirect('admin.plugin.' . My::id(), [], '#packman-repository-' . $type); } } } catch (Exception $e) { @@ -290,7 +287,7 @@ class Manage extends dcNsProcess } # Settings - $s = dcCore::app()->blog->settings->get(self::$pid); + $s = dcCore::app()->blog->settings->get(My::id()); $dir = Utils::getRepositoryDir($s->get('pack_repository')); $is_configured = Utils::is_configured( @@ -301,25 +298,25 @@ class Manage extends dcNsProcess # Display dcPage::openModule( - Core::name(), + My::name(), dcPage::jsPageTabs() . - dcPage::jsModuleLoad(self::$pid . '/js/packman.js') . + dcPage::jsModuleLoad(My::id() . '/js/backend.js') . # --BEHAVIOR-- packmanAdminHeader dcCore::app()->callBehavior('packmanAdminHeader') ); - echo + echo dcPage::breadcrumb([ __('Plugins') => '', - Core::name() => '', + My::name() => '', ]) . dcPage::notices(); if (dcCore::app()->error->flag() || !$is_configured) { echo '
' . __('pacKman is not well configured.') . ' ' . - '' . __('Configuration') . '' . + '' . __('Configuration') . '' . '
'; } else { $repo_path_modules = array_merge( diff --git a/src/My.php b/src/My.php new file mode 100644 index 0000000..b692a7f --- /dev/null +++ b/src/My.php @@ -0,0 +1,44 @@ +plugins->moduleInfo(self::id(), 'name')); + } +} diff --git a/src/Uninstall.php b/src/Uninstall.php index 3fbab35..b03566b 100644 --- a/src/Uninstall.php +++ b/src/Uninstall.php @@ -16,12 +16,10 @@ namespace Dotclear\Plugin\pacKman; class Uninstall { - private static $pid = ''; protected static $init = false; public static function init(): bool { - self::$pid = basename(dirname(__DIR__)); self::$init = defined('DC_RC_PATH'); return self::$init; @@ -39,7 +37,7 @@ class Uninstall /* action */ 'delete_all', /* ns */ - self::$pid, + My::id(), /* desc */ __('delete all settings') ); @@ -50,7 +48,7 @@ class Uninstall /* action */ 'delete', /* ns */ - self::$pid, + My::id(), /* desc */ __('delete plugin files') ); @@ -61,7 +59,7 @@ class Uninstall /* action */ 'delete', /* ns */ - self::$pid, + My::id(), /* desc */ __('delete the version number') ); @@ -72,9 +70,9 @@ class Uninstall /* action */ 'delete_all', /* ns */ - self::$pid, + My::id(), /* desc */ - sprintf(__('delete all %s settings'), self::$pid) + sprintf(__('delete all %s settings'), My::id()) ); $uninstaller->addDirectAction( @@ -83,9 +81,9 @@ class Uninstall /* action */ 'delete', /* ns */ - self::$pid, + My::id(), /* desc */ - sprintf(__('delete %s plugin files'), self::$pid) + sprintf(__('delete %s plugin files'), My::id()) ); $uninstaller->addDirectAction( @@ -94,9 +92,9 @@ class Uninstall /* action */ 'delete', /* ns */ - self::$pid, + My::id(), /* desc */ - sprintf(__('delete %s version number'), self::$pid) + sprintf(__('delete %s version number'), My::id()) ); return true; diff --git a/src/Utils.php b/src/Utils.php index fc1dce9..0357e32 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -154,7 +154,7 @@ class Utils html::escapeHTML($_REQUEST['redir']) ) : '' ) . - form::hidden(['p'], basename(dirname('../' . __DIR__))) . + form::hidden(['p'], My::id()) . form::hidden(['type'], $type) . form::hidden(['action'], 'packup') . '' . '' . @@ -251,7 +251,7 @@ class Utils '

' . __('Selected modules action:') . ' ' . form::combo(['action'], $combo_action) . '' . - form::hidden(['p'], basename(dirname('../' . __DIR__))) . + form::hidden(['p'], My::id()) . form::hidden(['tab'], 'repository') . form::hidden(['type'], $type) . dcCore::app()->formNonce() .