better menu

This commit is contained in:
Jean-Christian Denis 2021-11-01 23:35:13 +01:00
parent 102c4e128a
commit c9b038c024
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951
2 changed files with 26 additions and 9 deletions

View file

@ -101,21 +101,31 @@ if (!empty($_POST['fix'])) {
$breadcrumb = [];
if (!empty($_REQUEST['config'])) {
$breadcrumb = [
($type == 'plugin' ? __('Plugins') : __('Themes')) => $core->adminurl->get('admin.plugin.improve', ['type' => ($type == 'plugin' ? 'plugin' : 'theme')]),
'<span class="page-title">' . __('Configure module') . '</span>' => ''
];
} else {
$breadcrumb = [
'<span class="page-title">' . ($type == 'plugin' ? __('Plugins') : __('Themes')) . '</span>' => '',
($type == 'theme' ? __('Plugins') : __('Themes')) => $core->adminurl->get('admin.plugin.improve', ['type' => ($type == 'theme' ? 'plugin' : 'theme')])
__('Configure module') => ''
];
}
# display header
echo '<html><head><title>' . __('improve') . '</title></head><body>' .
dcPage::breadcrumb(array_merge([__('improve') => ''], $breadcrumb), ['hl' => false]) .
echo '<html><head><title>' . __('improve') . '</title>' .
dcPage::jsLoad(dcPage::getPF('improve/js/index.js')) .
'</head><body>' .
dcPage::breadcrumb(array_merge([
__('Plugins') => '',
__('improve') => ''
], $breadcrumb)) .
dcPage::notices();
# Menu list
if (empty($_REQUEST['config'])) {
echo
'<form method="get" action="' . $core->adminurl->get('admin.plugin.improve') . '" id="improve_menu">' .
'<p class="anchor-nav"><label for="type" class="classic">' . __('Goto:') . ' </label>' .
form::combo('type', [__('Plugins') => 'plugin', __('Themes') => 'theme'], $type) . ' ' .
'<input type="submit" value="' . __('Ok') . '" />' .
form::hidden('p', 'improve') . '</p>' .
'</form>';
}
if (!empty($_REQUEST['config'])) {
$back_url = $_REQUEST['redir'] ?? $core->adminurl->get('admin.plugin.improve', ['type' => $type]);

7
js/index.js Normal file
View file

@ -0,0 +1,7 @@
/*global $, dotclear */
'use strict';
$(function () {
$('#improve_menu input[type=submit]').hide();
$('#improve_menu #type').on('change', function () {this.form.submit();});
});