From 9fbd504107623735505b4616a21d9889344b49c1 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sat, 8 Apr 2023 14:33:32 +0200 Subject: [PATCH] use Dotclear Helper --- src/Manage.php | 49 +++++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/src/Manage.php b/src/Manage.php index 8f9242a..0e14179 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -18,9 +18,17 @@ use dcAuth; use dcCore; use dcNsProcess; use dcPage; +use Dotclear\Helper\Html\Form\{ + Checkbox, + Form, + Hidden, + Label, + Para, + Submit, + Textarea +}; +use Dotclear\Helper\Html\Html; use Exception; -use html; -use form; class Manage extends dcNsProcess { @@ -94,29 +102,26 @@ class Manage extends dcNsProcess echo dcPage::breadcrumb([ - html::escapeHTML(dcCore::app()->blog->name) => '', + Html::escapeHTML(dcCore::app()->blog->name) => '', My::name() => '', ]) . - dcPage::notices() . ' + dcPage::notices() . -
- -

-

' . form::textarea('morecss', 72, 25, [ - 'default' => html::escapeHTML((string) base64_decode((string) $s->get('morecss'))), - 'class' => 'maximal', - ]) . '

- -

- -

' . - form::hidden('p', 'moreCSS') . - dcCore::app()->formNonce() . ' -

- '; + (new Form('file-form'))->method('post')->action(dcCore::app()->admin->getPageURL())->fields([ + (new Para())->items([ + (new Label(__('Style sheet:')))->for('morecss'), + (new Textarea('morecss', Html::escapeHTML((string) base64_decode((string) $s->get('morecss')))))->class('maximal')->cols(72)->rows(25), + ]), + (new Para())->items([ + (new Checkbox('morecss_active'))->value(1), + (new Label(__('Enable additionnal CSS for the active theme'), Label::OUTSIDE_LABEL_AFTER))->for('morecss_active')->class('classic'), + ]), + (new Para())->items([ + dcCore::app()->formNonce(false), + (new Hidden('p', 'moreCSS')), + (new Submit(['write']))->value(__('Save') . ' (s)')->accesskey('s'), + ]), + ])->render(); if (dcCore::app()->auth->user_prefs->get('interface')->get('colorsyntax')) { echo