use dcPage notice on error

This commit is contained in:
Jean-Christian Paul Denis 2022-12-20 01:31:07 +01:00
parent 8dcc092f4b
commit f877746e3b
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
2 changed files with 56 additions and 40 deletions

View File

@ -120,7 +120,15 @@ class Manage
http::head(404, 'Not Found'); http::head(404, 'Not Found');
exit; exit;
} elseif (!empty($action) && !$is_editable) { } elseif (!empty($action) && !$is_editable) {
throw new Exception('No selected modules'); dcPage::addErrorNotice(
__('No modules selected.')
);
if (!empty($_POST['redir'])) {
http::redirect($_POST['redir']);
} else {
dcCore::app()->adminurl->redirect('admin.plugin.' . Core::id(), [], '#packman-' . $type);
}
# Pack # Pack
} elseif ($action == 'packup') { } elseif ($action == 'packup') {
@ -164,17 +172,22 @@ class Manage
# Delete # Delete
} elseif ($action == 'delete') { } elseif ($action == 'delete') {
$del_success= false;
foreach ($_POST['modules'] as $root => $id) { foreach ($_POST['modules'] as $root => $id) {
if (!file_exists($root) || !files::isDeletable($root)) { if (!file_exists($root) || !files::isDeletable($root)) {
throw new Exception('Undeletable file: ' . $root); dcPage::addWarningNotice(sprintf(__('Undeletable file "%s"', $root)));
} else {
$del_success = true;
} }
unlink($root); unlink($root);
} }
if ($del_success) {
dcPage::addSuccessNotice( dcPage::addSuccessNotice(
__('Package successfully deleted.') __('Package successfully deleted.')
); );
}
if (!empty($_POST['redir'])) { if (!empty($_POST['redir'])) {
http::redirect($_POST['redir']); http::redirect($_POST['redir']);

View File

@ -1,9 +1,9 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: pacKman 2022.11.20\n" "Project-Id-Version: pacKman 2022.12.19.3\n"
"POT-Creation-Date: \n" "POT-Creation-Date: \n"
"PO-Revision-Date: 2022-11-26T21:19:33+00:00\n" "PO-Revision-Date: 2022-12-20T00:29:17+00:00\n"
"Last-Translator: Jean-Christian Denis\n" "Last-Translator: Jean-Christian Denis\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -28,6 +28,9 @@ msgstr "Préconisation : %s"
msgid "Blog's public directory" msgid "Blog's public directory"
msgstr "Répertoire public du blog" msgstr "Répertoire public du blog"
msgid "Leave it empty to use Dotclear VAR directory"
msgstr "Laisser vide pour utiliser le répertoire VAR de Dotclear"
msgid "Files" msgid "Files"
msgstr "Fichiers" msgstr "Fichiers"
@ -61,6 +64,39 @@ msgstr "Impossible de retrouver les informations du module"
msgid "Failed to get temporary directory" msgid "Failed to get temporary directory"
msgstr "Impossible de retrouver le répertoire temporaire" msgstr "Impossible de retrouver le répertoire temporaire"
msgid "No modules selected."
msgstr "Aucun module sélectionné."
msgid "Package successfully created."
msgstr "Paquetage créé avec succès."
msgid "Undeletable file \"%s\""
msgstr "Impossible de supprimer le fichier \"%s\""
msgid "Package successfully deleted."
msgstr "Paquetage effacé avec succès."
msgid "Package successfully installed."
msgstr "Paquetage installé avec succès."
msgid "Package successfully copied."
msgstr "Paquetage copié avec succès."
msgid "Package successfully moved."
msgstr "Paquetage déplacé avec succès."
msgid "pacKman is not well configured."
msgstr "pacKman n'est pas correctement configuré."
msgid "Configuration"
msgstr "Configuration"
msgid "Plugins root"
msgstr "Racine des plugins"
msgid "Themes root"
msgstr "Racine des thèmes"
msgid "Cache directory is not writable." msgid "Cache directory is not writable."
msgstr "Le répertoire de cache n'est pas accessible en écriture." msgstr "Le répertoire de cache n'est pas accessible en écriture."
@ -103,36 +139,3 @@ msgstr "Fichier"
msgid "Selected modules action:" msgid "Selected modules action:"
msgstr "Action sur les modules sélectionnés :" msgstr "Action sur les modules sélectionnés :"
msgid "Package successfully created."
msgstr "Paquetage créé avec succès."
msgid "Package successfully deleted."
msgstr "Paquetage effacé avec succès."
msgid "Package successfully installed."
msgstr "Paquetage installé avec succès."
msgid "Package successfully copied."
msgstr "Paquetage copié avec succès."
msgid "Package successfully moved."
msgstr "Paquetage déplacé avec succès."
msgid "pacKman is not well configured."
msgstr "pacKman n'est pas correctement configuré."
msgid "Configuration"
msgstr "Configuration"
msgid "Plugins root"
msgstr "Racine des plugins"
msgid "Themes root"
msgstr "Racine des thèmes"
msgid "There are no modules."
msgstr "Il n'y a pas de modules."
msgid "There are no packages"
msgstr "Il n'y a pas de paquetages."