From 707176433b83ed6410e462786cbc7b74a9fa307b Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sat, 6 Nov 2021 13:58:43 +0100 Subject: [PATCH] change again ui: use table and add option for details --- _config.php | 10 ++++++-- index.php | 58 +++++++++++++++++++++++++--------------------- locales/fr/main.po | 22 ++++++++++++++++-- 3 files changed, 59 insertions(+), 31 deletions(-) diff --git a/_config.php b/_config.php index e7a13a9..3c25dd2 100644 --- a/_config.php +++ b/_config.php @@ -35,7 +35,8 @@ if (!empty($_POST['save'])) { $pdisabled = implode(';', $_POST['disabled']); } $core->blog->settings->improve->put('disabled', $pdisabled); - dcPage::addSuccessNotice(__('Configuration successfully updated.')); + $core->blog->settings->improve->put('nodetails', !empty($_POST['nodetails'])); + dcPage::addSuccessNotice(__('Configuration successfully updated')); $core->adminurl->redirect( 'admin.plugins', @@ -54,4 +55,9 @@ foreach ($combo_actions as $name => $id) { form::checkbox(['disabled[]'], $id, ['checked' => isset($disabled[$id])]) . __($name) . '

'; } -echo ''; +echo +'

' . __('Options') . '

' . +'

' . +'
'; diff --git a/index.php b/index.php index 23bbb36..47aee2c 100644 --- a/index.php +++ b/index.php @@ -111,6 +111,8 @@ if (!empty($_REQUEST['config'])) { if (null !== ($action = $improve->module($_REQUEST['config']))) { $header = $action->header(); } +} else { + $breadcrumb[$type == 'theme' ? __('Themes actions') : __('Plugins actions')] = ''; } # display header @@ -153,27 +155,30 @@ if (!empty($_REQUEST['config'])) { form::hidden('config', $action->id) . form::hidden('redir', $redir) . $core->formNonce() . '

' . - '
'; + '
'; } else { echo '

' . __('Unknow module') . '

' . __('Back') . '

'; } } else { - echo '

' . ($type == 'plugin' ? __('Plugins') : __('Themes')) . '

'; - if (count($combo_modules) == 1) { echo '

' . __('No module to manage') . '

'; } else { - echo '
'; + echo '' . + '' . + ''; foreach ($improve->modules() as $action) { if (!in_array($type, $action->types)) { continue; } - $p = DC_DEBUG ? '' . $action->priority . ' ' : ''; echo - '

' . $p . '

' . + '' . + '' . + '' . + (DC_DEBUG ? '' : '') . + ''; } - echo ' -
-
-

' . __('Action') . '' . + '' . __('Description') . '' . + '' . __('Configuration') . '' . + (DC_DEBUG ? '' . __('Priority') . '' : '') . + '
' . form::checkbox( ['actions[]', 'action_' . $action->id], $action->id, @@ -181,28 +186,29 @@ if (!empty($_REQUEST['config'])) { '', '', !$action->isConfigured() - ) . - $action->name . ''; - - if (false !== $action->config) { - echo - ' - ' . + '' . + '' . $action->desc . '' . ( + false === $action->config ? '' : + 'name) . '">' . __('Configure module') . ''; - } - echo '

'; + '" title="' . sprintf(__("Configure action '%s'"), $action->name) . '">' . __('Configure') . '' + ) . '
' . $action->priority . '
+
+

-

' . - form::combo('module', $combo_modules, $module) . ' -

- ' . +

' . + form::combo('module', $combo_modules, $module) . + ' ' . form::hidden(['type'], $type) . $core->formNonce() . '

@@ -210,9 +216,7 @@ if (!empty($_REQUEST['config'])) {
'; - $logs = $lines = []; - - if (!empty($_REQUEST['upd'])) { + if (!empty($_REQUEST['upd']) && !$core->blog->settings->improve->nodetails) { $logs = $improve->parseLogs($_REQUEST['upd']); if (!empty($logs)) { diff --git a/locales/fr/main.po b/locales/fr/main.po index fc50bef..a1dc362 100644 --- a/locales/fr/main.po +++ b/locales/fr/main.po @@ -1,15 +1,21 @@ msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" -"Project-Id-Version: improve 0.3\n" +"Project-Id-Version: improve 0.5\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2021-11-02T09:13:41+00:00\n" +"PO-Revision-Date: 2021-11-06T12:55: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 "List of disabled actions:" +msgstr "Listes des actions désactivées :" + +msgid "Hide details of rendered actions" +msgstr "Ne pas afficher le détail des actions effectuées" + msgid "Begin" msgstr "Début" @@ -217,6 +223,9 @@ msgstr "Chemin complet du répertoire de l'exécutable PHP :" msgid "If this module does not work you can try to put here directory to php executable (without executable file name)." msgstr "Si ce module ne fonctionne pas vous pouvez tenter de mettre ici le chemin complet du répertoire de l'exécutable PHP (sans le nom de fichier exécutable)." +msgid "PHP CS Fixer configuration file:" +msgstr "Fichier de configuration de PHP CS Fixer :" + msgid "Failed to run php-cs-fixer" msgstr "Impossible d'exécuter php-cs-fixer" @@ -352,6 +361,12 @@ msgstr "Fixe de \"%s\" complété en %s secondes sans message" msgid "Configure module" msgstr "Configurer le module" +msgid "Themes actions" +msgstr "Actions sur les thèmes" + +msgid "Plugins actions" +msgstr "Actions sur les plugins" + msgid "Themes" msgstr "Thèmes" @@ -367,6 +382,9 @@ msgstr "Module inconnu" msgid "No module to manage" msgstr "Aucun module à gérer" +msgid "Priority" +msgstr "Priorité" + msgid "Configure action '%s'" msgstr "Configurer l'action \"%s\""