cosmetic fix

master
Jean-Christian Paul Denis 2023-03-05 23:01:10 +01:00
parent 32c2d73daf
commit 275602c804
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
5 changed files with 32 additions and 29 deletions

View File

@ -22,7 +22,7 @@ use dcFavorites;
use dcNsProcess; use dcNsProcess;
/* clearbricks */ /* clearbricks */
use Clearbricks; use Dotclear\Helper\Clearbricks;
use files; use files;
/** /**
@ -49,9 +49,9 @@ class Backend extends dcNsProcess
dcCore::app()->addBehavior('adminDashboardFavoritesV2', function (dcFavorites $favs): void { dcCore::app()->addBehavior('adminDashboardFavoritesV2', function (dcFavorites $favs): void {
$favs->register( $favs->register(
'improve', Core::id(),
[ [
'title' => __('improve'), 'title' => Core::name(),
'url' => dcCore::app()->adminurl->get('admin.plugin.' . Core::id()), 'url' => dcCore::app()->adminurl->get('admin.plugin.' . Core::id()),
'small-icon' => dcPage::getPF(Core::id() . '/icon.svg'), 'small-icon' => dcPage::getPF(Core::id() . '/icon.svg'),
'large-icon' => dcPage::getPF(Core::id() . '/icon.svg'), 'large-icon' => dcPage::getPF(Core::id() . '/icon.svg'),
@ -61,7 +61,7 @@ class Backend extends dcNsProcess
}); });
dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem( dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem(
__('improve'), Core::name(),
dcCore::app()->adminurl->get('admin.plugin.' . Core::id()), dcCore::app()->adminurl->get('admin.plugin.' . Core::id()),
dcPage::getPF(Core::id() . '/icon.svg'), dcPage::getPF(Core::id() . '/icon.svg'),
preg_match('/' . preg_quote(dcCore::app()->adminurl->get('admin.plugin.' . Core::id())) . '(&.*)?$/', $_SERVER['REQUEST_URI']), preg_match('/' . preg_quote(dcCore::app()->adminurl->get('admin.plugin.' . Core::id())) . '(&.*)?$/', $_SERVER['REQUEST_URI']),

View File

@ -20,7 +20,15 @@ use dcPage;
use dcNsProcess; use dcNsProcess;
/* clearbricks */ /* clearbricks */
use form; use Dotclear\Helper\Html\Form\{
Checkbox,
Div,
Fieldset,
Label,
Legend,
Para,
Text
};
/* php */ /* php */
use Exception; use Exception;
@ -64,7 +72,7 @@ class Config extends dcNsProcess
dcCore::app()->adminurl->redirect( dcCore::app()->adminurl->redirect(
'admin.plugins', 'admin.plugins',
['module' => 'improve', 'conf' => 1, 'chk' => 1, 'redir' => dcCore::app()->admin->__get('list')->getRedir()] ['module' => Core::id(), 'conf' => 1, 'chk' => 1, 'redir' => dcCore::app()->admin->__get('list')->getRedir()]
); );
} catch (Exception $e) { } catch (Exception $e) {
dcCore::app()->error->add($e->getMessage()); dcCore::app()->error->add($e->getMessage());
@ -80,26 +88,28 @@ class Config extends dcNsProcess
} }
$improve = new Core(); $improve = new Core();
$modules = $items = [];
$modules = [];
foreach ($improve->modules() as $action) { foreach ($improve->modules() as $action) {
$modules[$action->name()] = $action->id(); $modules[$action->name()] = $action->id();
} }
$modules = array_merge($modules, array_flip($improve->disabled()));
echo '<div class="fieldset"><h4>' . __('List of disabled actions:') . '</h4>'; foreach (array_merge($modules, array_flip($improve->disabled())) as $name => $id) {
$items[] = (new Para())->items([
(new Checkbox(['disabled_' . $id, 'disabled[]'], array_key_exists($id, $improve->disabled())))->value($id),
(new Label($id))->class('classic')->for('disabled_' . $id),
]);
}
foreach ($modules as $name => $id) {
echo echo
'<p><label class="classic" title="' . $id . '">' . (new Div())->items([
form::checkbox(['disabled[]'], $id, ['checked' => array_key_exists($id, $improve->disabled())]) . (new Fieldset())->class('fieldset')->legend(new Legend(__('List of disabled actions')))->fields($items),
__($name) . '</label></p>'; (new Fieldset())->class('fieldset')->legend(new Legend(__('Options')))->fields([
} (new Para())->items([
echo (new Checkbox('nodetails', dcCore::app()->blog->settings->get(Core::id())->get('nodetails')))->value('1'),
'</div><div class="fieldset"><h4>' . __('Options') . '</h4>' . (new Label(__('Hide details of rendered actions')))->class('classic')->for('nodetails'),
'<p><label class="classic">' . ]),
form::checkbox('nodetails', '1', ['checked' => dcCore::app()->blog->settings->get(Core::id())->get('nodetails')]) . ]),
__('Hide details of rendered actions') . '</label></p>' . ])->render();
'</div>';
} }
} }

View File

@ -19,7 +19,6 @@ namespace Dotclear\Plugin\improve;
*/ */
class Utils class Utils
{ {
public static function getActionsDir(): string public static function getActionsDir(): string
{ {
return __DIR__ . '/module/'; return __DIR__ . '/module/';

View File

@ -36,13 +36,7 @@ class newline extends Action
'configurator' => true, 'configurator' => true,
'types' => ['plugin', 'theme'], 'types' => ['plugin', 'theme'],
]); ]);
/*
$ext = @unserialize(dcCore::app()->blog->settings->improve->newline_extensions);
$ext = Improve::cleanExtensions($ext);
if (!empty($ext)) {
$this->extensions = $ext;
}
*/
return true; return true;
} }