change again ui: use table and add option for details

This commit is contained in:
Jean-Christian Denis 2021-11-06 13:58:43 +01:00
parent a2c3f05c36
commit 707176433b
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951
3 changed files with 59 additions and 31 deletions

View file

@ -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) . '</label></p>';
}
echo '</div>';
echo
'</div><div class="fieldset"><h4>' . __('Options') . '</h4>' .
'<p><label class="classic">' .
form::checkbox('nodetails', '1', ['checked' => $core->blog->settings->improve->nodetails]) .
__('Hide details of rendered actions') . '</label></p>' .
'</div>';

View file

@ -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() . '</p>' .
'<form>';
'</form>';
} else {
echo '
<p class="warning">' . __('Unknow module') . '</p>
<p><a class="back" href="' . $back_url . '">' . __('Back') . '</a></p>';
}
} else {
echo '<h3>' . ($type == 'plugin' ? __('Plugins') : __('Themes')) . '</h3>';
if (count($combo_modules) == 1) {
echo '<p class="message">' . __('No module to manage') . '</p>';
} else {
echo '<form action="' . $core->adminurl->get('admin.plugin.improve') . '" method="post" id="form-actions">';
echo '<form action="' . $core->adminurl->get('admin.plugin.improve') . '" method="post" id="form-actions">' .
'<table><caption class="hidden">' . __('Actions') . '</caption><thead><tr>' .
'<th colspan="2" class="first">' . __('Action') . '</td>' .
'<th scope="col">' . __('Description') . '</td>' .
'<th scope="col">' . __('Configuration') . '</td>' .
(DC_DEBUG ? '<th scope="col">' . __('Priority') . '</td>' : '') .
'</tr></thead><tbody>';
foreach ($improve->modules() as $action) {
if (!in_array($type, $action->types)) {
continue;
}
$p = DC_DEBUG ? '<span class="debug">' . $action->priority . '</span> ' : '';
echo
'<p class="modules">' . $p . '<label for="action_' . $action->id . '" class="classic">' .
form::checkbox(
'<tr class="line' . ($action->isConfigured() ? '' : ' offline') . '">' .
'<td class="minimal">' . form::checkbox(
['actions[]',
'action_' . $action->id],
$action->id,
@ -181,28 +186,29 @@ if (!empty($_REQUEST['config'])) {
'',
'',
!$action->isConfigured()
) .
$action->name . '</label>';
if (false !== $action->config) {
echo
' - <a class="module-config" href="' .
) . '</td>' .
'<td class="minimal nowrap">' .
'<label for="action_' . $action->id . '" class="classic">' . html::escapeHTML($action->name) . '</label>' .
'</td>' .
'<td class="maximal">' . $action->desc . '</td>' .
'<td class="minimal nowrap modules">' . (
false === $action->config ? '' :
'<a class="module-config" href="' .
(true === $action->config ? $core->adminurl->get('admin.plugin.improve', ['type' => $type, 'config' => $action->id]) : $action->config) .
'" title="' . sprintf(__("Configure action '%s'"), $action->name) . '">' . __('Configure module') . '</a>';
}
echo '</p>';
'" title="' . sprintf(__("Configure action '%s'"), $action->name) . '">' . __('Configure') . '</a>'
) . '</td>' .
(DC_DEBUG ? '<td class="minimal"><span class="debug">' . $action->priority . '</span></td>' : '') .
'</tr>';
}
echo '
<div>
<hr />
<p><label for="save_preferences" class="classic">' .
echo '</tbody></table>
<div class="two-cols">
<p class="col left"><label for="save_preferences" class="classic">' .
form::checkbox('save_preferences', 1, !empty($_POST['save_preferences'])) .
__('Save fields selection as preference') . '</label></p>
<p class="field"><label for="module" class="classic">' . __('Select a module:') . '</label>' .
form::combo('module', $combo_modules, $module) . '
</p></p>
<input type="submit" name="fix" value="' . __('Fix it') . '" />' .
<p class="col right"><label for="module" class="classic">' . __('Select a module:') . ' </label>' .
form::combo('module', $combo_modules, $module) .
' <input type="submit" name="fix" value="' . __('Fix it') . '" />' .
form::hidden(['type'], $type) .
$core->formNonce() . '
</p>
@ -210,9 +216,7 @@ if (!empty($_REQUEST['config'])) {
<br class="clear" />
</form>';
$logs = $lines = [];
if (!empty($_REQUEST['upd'])) {
if (!empty($_REQUEST['upd']) && !$core->blog->settings->improve->nodetails) {
$logs = $improve->parseLogs($_REQUEST['upd']);
if (!empty($logs)) {

View file

@ -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\""