' .
'
' .
- '
' .
+ // active
+ (new Para())->items([
+ (new Checkbox('epc_active', $active))->value(1),
+ (new Label(__('Enable plugin'), Label::OUTSIDE_LABEL_AFTER))->for('epc_active')->class('classic'),
+ ])->render() .
'
' .
__('This enable public widgets and contents filter.') .
'
' .
@@ -85,11 +91,17 @@ class Backend extends dcNsProcess
'
' .
'
' . __('Extra') . '
' .
'
' . __('This is a special feature to edit list of allowed template values and public pages where this plugin works.') . '
' .
- '
' .
- form::field('epc_allowedtplvalues', 100, 0, Epc::implode($allowedtplvalues)) . '
' .
+ // allowedtplvalues
+ (new Para())->items([
+ (new Label(__('Allowed DC template values:'), Label::OUTSIDE_LABEL_BEFORE))->for('epc_allowedtplvalues'),
+ (new Input('epc_allowedtplvalues'))->size(100)->maxlenght(0)->value(Epc::implode($allowedtplvalues)),
+ ])->render() .
'
' . __('Use "readable_name1:template_value1;readable_name2:template_value2;" like "entry content:EntryContent;entry excerpt:EntryExcerpt;".') . '
' .
- '
' .
- form::field('epc_allowedpubpages', 100, 0, Epc::implode($allowedpubpages)) . '
' .
+ // allowedpubpages
+ (new Para())->items([
+ (new Label(__('Allowed public pages:'), Label::OUTSIDE_LABEL_BEFORE))->for('epc_allowedpubpages'),
+ (new Input('epc_allowedpubpages'))->size(100)->maxlenght(0)->value(Epc::implode($allowedpubpages)),
+ ])->render() .
'
' . __('Use "readable_name1:template_page1;readable_name2:template_page2;" like "post page:post.html;home page:home.html;".') . '
' .
'
' .
'
' .
diff --git a/src/Manage.php b/src/Manage.php
index 7e1d978..765e9d0 100644
--- a/src/Manage.php
+++ b/src/Manage.php
@@ -19,12 +19,24 @@ use adminGenericFilterV2;
use dcCore;
use dcNsProcess;
use dcPage;
+use Dotclear\Helper\Html\Form\{
+ Checkbox,
+ Div,
+ Form,
+ Hidden,
+ Input,
+ label,
+ Note,
+ Number,
+ Para,
+ Select,
+ Submit,
+ Text
+};
use Dotclear\Helper\Html\Html;
use Dotclear\Helper\Network\Http;
use Exception;
-use form;
-
class Manage extends dcNsProcess
{
public static function init(): bool
@@ -192,109 +204,86 @@ class Manage extends dcNsProcess
My::name() => '',
$current->filter->name => '',
]) .
- dcPage::notices() .
+ dcPage::notices();
# Filters select menu list
- '';
+ echo
+ (new Form('filters_menu'))->method('get')->action(dcCore::app()->adminurl->get('admin.plugin.' . My::id()))->fields([
+ (new Para())->class('anchor-nav')->items([
+ (new Select('part'))->items($current->combo)->default($current->part),
+ (new Submit(['do']))->value(__('Ok')),
+ (new Hidden(['p'], My::id())),
+ ]),
+ ])->render();
# Filter title and description
- echo '
-
' . $current->filter->name . '
-
' . $current->filter->help . '
';
+ echo
+ '
' . $current->filter->name . '
' .
+ '
' . $current->filter->help . '
';
# Filter settings
- echo '
-
';
+ ])),
+ (new Div())->class('clear')->items([
+ dcCore::app()->formNonce(false),
+ (new Hidden(['action'], 'savefiltersetting')),
+ (new Hidden(['part'], $current->part)),
+ (new Submit(['save']))->value(__('Save')),
+ ]),
+ ]),
+ ])->render();
# Filter records list
if ($current->filter->has_list && isset($sorts) && isset($pager)) {
@@ -303,7 +292,7 @@ class Manage extends dcNsProcess
echo '
';
- $sorts->display(['admin.plugin.' . My::id(), '#record'], form::hidden('p', My::id()) . form::hidden('part', $current->part));
+ $sorts->display(['admin.plugin.' . My::id(), '#record'], (new Hidden('p', My::id()))->render() . (new Hidden('part', $current->part))->render());
$pager->display(
$sorts,
@@ -314,12 +303,15 @@ class Manage extends dcNsProcess
'
' .
'
' .
- '
' .
- form::hidden('action', 'deleterecords') .
- '
' .
- dcCore::app()->adminurl->getHiddenFormFields('admin.plugin.' . My::id(), array_merge(['p' => My::id()], $sorts->values(true))) .
- form::hidden('redir', dcCore::app()->adminurl->get('admin.plugin.' . My::id(), $sorts->values(true))) .
- dcCore::app()->formNonce() .
+ (new Para())->class('col right')->items(array_merge(
+ dcCore::app()->adminurl->hiddenFormFields('admin.plugin.' . My::id(), array_merge(['p' => My::id()], $sorts->values(true))),
+ [
+ dcCore::app()->formNonce(false),
+ (new Hidden('redir', dcCore::app()->adminurl->get('admin.plugin.' . My::id(), $sorts->values(true)))),
+ (new Hidden('action', 'deleterecords')),
+ (new Submit(['save', 'del-action']))->value(__('Delete selected records')),
+ ]
+ ))->render() .
'
' .
''
);
@@ -327,26 +319,25 @@ class Manage extends dcNsProcess
echo '
';
# New record
- echo '
-
';
+ echo
+ (new Div('newrecord'))->class('multi-part')->title(__('New record'))->items([
+ (new Form('form-create'))->method('post')->action(dcCore::app()->adminurl->get('admin.plugin.' . My::id()) . '#record')->fields([
+ (new Para())->items([
+ (new Label(__('Key:'), Label::OUTSIDE_LABEL_BEFORE))->for('new_key'),
+ (new Input('new_key'))->size(60)->maxlenght(255)->required(true),
+ ]),
+ (new Para())->items([
+ (new Label(__('Value:'), Label::OUTSIDE_LABEL_BEFORE))->for('new_value'),
+ (new Input('new_value'))->size(60)->maxlenght(255)->required(true),
+ ]),
+ (new Para())->class('clear')->items([
+ dcCore::app()->formNonce(false),
+ (new Hidden(['action'], 'savenewrecord')),
+ (new Hidden(['part'], $current->part)),
+ (new Submit(['save', 'new-action']))->value(__('Save')),
+ ]),
+ ]),
+ ])->render();
}
# --BEHAVIOR-- enhancePostContentAdminPage