update admin page design

This commit is contained in:
Jean-Christian Paul Denis 2022-12-10 01:02:38 +01:00
parent 0ab2e947a0
commit f440e7b11c
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
2 changed files with 56 additions and 66 deletions

View File

@ -16,8 +16,6 @@ if (!defined('DC_CONTEXT_ADMIN')) {
dcPage::check(dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN])); dcPage::check(dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN]));
$page_title = __('URL handlers');
try { try {
# Read default handlers # Read default handlers
$handlers = myUrlHandlers::getDefaults(); $handlers = myUrlHandlers::getDefaults();
@ -39,7 +37,7 @@ try {
if (empty($handlers[$name])) { if (empty($handlers[$name])) {
throw new Exception(sprintf( throw new Exception(sprintf(
__('Handler "%s" doesn\'t exist.'), __('Uknown handler "%s".'),
html::escapeHTML($name) html::escapeHTML($name)
)); ));
} }
@ -101,43 +99,54 @@ try {
?> ?>
<html><head> <html><head>
<title><?php echo $page_title; ?></title> <title><?php echo __('URL handlers'); ?></title>
</head><body> </head><body>
<?php <?php
echo dcPage::breadcrumb( echo
[ dcPage::breadcrumb(
html::escapeHTML(dcCore::app()->blog->name) => '', [
'<span class="page-title">' . $page_title . '</span>' => '', html::escapeHTML(dcCore::app()->blog->name) => '',
] __('URL handlers') => '',
) . ]
dcPage::notices(); ) .
dcPage::notices();
?> if (empty($handlers)) {
<?php if (empty($handlers)): ?>
<p class="message"><?php echo __('No URL handler to configure.'); ?></p>
<?php else: ?>
<p><?php echo __('You can write your own URL for each handler of this list.'); ?></p>
<form action="<?php echo dcCore::app()->admin->getPageURL(); ?>" method="post">
<table>
<thead>
<tr><th>Type</th><th>URL</th></tr>
</thead>
<tbody>
<?php
foreach ($handlers as $name => $url) {
echo echo
'<tr><td>' . html::escapeHTML($name) . '</td><td>' . '<p class="message">' . __('No URL handler to configure.') . '</p>';
form::field(['handlers[' . $name . ']'], 20, 255, html::escapeHTML($url)) . } else {
'</td></tr>' . "\n"; echo
'<form action="' . dcCore::app()->admin->getPageURL() . '" method="post">' .
'<div class="table-outer">' .
'<table>' .
'<caption>' . __('URL handlers list') . '</caption>' .
'<thead>' .
'<tr>' .
'<th class="nowrap" scope="col">' . __('Type') . '</th>' .
'<th class="nowrap" scope="col">' . __('URL') . '</th>' .
'</tr>' .
'</thead>' .
'<tbody>';
foreach ($handlers as $name => $url) {
echo
'<tr class="line">' .
'<td class="nowrap minimal">' . html::escapeHTML($name) . '</td>' .
'<td>' .
form::field(['handlers[' . $name . ']'], 20, 255, html::escapeHTML($url)) .
'</td>'.
'</tr>';
}
echo
'</tbody></table></div>' .
'<p class="form-note">' . __('You can write your own URL for each handler of this list.') . '</p>' .
'<p>' .
'<input type="submit" name="act_save" value="' . __('Save') . '" /> ' .
'<input class="delete" type="submit" name="act_restore" value="' . __('Reset') . '" />' .
dcCore::app()->formNonce() . '</p>' .
'</form>';
} }
?> ?>
</tbody>
</table>
<p><input type="submit" name="act_save" value="<?php echo __('Save'); ?>" />
<input type="submit" name="act_restore" value="<?php echo __('Reset'); ?>" />
<?php echo dcCore::app()->formNonce(); ?></p>
</form>
<?php endif; ?>
</body></html> </body></html>

View File

@ -1,58 +1,39 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: myUrlHandlers Dotclear module\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-02-24 22:10+0100\n"
"PO-Revision-Date: 2011-02-24 22:10+0100\n"
"Last-Translator: Alex Pirine <alex pirine.fr>\n"
"Language-Team: Oleksandr Syenchuk <sacha@xn--phnix-csa.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: myUrlHandlers 2022.11.26\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2022-12-09T23:55:36+00:00\n"
"Last-Translator: Jean-Christian Denis\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Poedit-Language: French\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Poedit-KeywordsList: __\n"
"X-Poedit-Basepath: ../..\n"
"X-Poedit-Country: FRANCE\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Poedit-SearchPath-0: .\n"
#: _admin.php:15
#: index.php:87
#: index.php:90
msgid "URL handlers" msgid "URL handlers"
msgstr "Gestionnaires d'URL" msgstr "Gestionnaires d'URL"
#: index.php:40 msgid "Uknown handler \"%s\"."
#, php-format
msgid "Handler \"%s\" doesn't exist."
msgstr "Le gestionnaire \"%s\" n'existe pas." msgstr "Le gestionnaire \"%s\" n'existe pas."
#: index.php:45
#, php-format
msgid "Invalid URL for handler \"%s\"." msgid "Invalid URL for handler \"%s\"."
msgstr "URL invalide pour le gestionnaire \"%s\"." msgstr "URL invalide pour le gestionnaire \"%s\"."
#: index.php:58
#, php-format
msgid "Duplicate URL in handlers \"%s\"." msgid "Duplicate URL in handlers \"%s\"."
msgstr "Doublon d'URL dans les gestionnaires \"%s\"." msgstr "Doublon d'URL dans les gestionnaires \"%s\"."
#: index.php:67
msgid "URL handlers have been successfully updated." msgid "URL handlers have been successfully updated."
msgstr "Les gestionnaires d'URL ont été mis à jour avec succès." msgstr "Les gestionnaires d'URL ont été mis à jour avec succès."
#: index.php:74
msgid "URL handlers have been successfully restored." msgid "URL handlers have been successfully restored."
msgstr "Les gestionnaires d'URL ont été restaurés avec succès." msgstr "Les gestionnaires d'URL ont été restaurés avec succès."
#: index.php:99
msgid "No URL handler to configure." msgid "No URL handler to configure."
msgstr "Il n'y a aucun gestionnaire d'URL à définir." msgstr "Il n'y a aucun gestionnaire d'URL à définir."
#: index.php:101
msgid "You can write your own URL for each handler of this list." msgid "You can write your own URL for each handler of this list."
msgstr "Vous pouvez écrire votre propre URL pour chaque gestionnaire de cette liste." msgstr "Vous pouvez écrire votre propre URL pour chaque gestionnaire de cette liste."
#: index.php:120 msgid "URL handlers list"
msgid "Reset" msgstr "Liste des gestionnaires d'URL"
msgstr "Réinitialiser"