diff --git a/src/Config.php b/src/Config.php index a70d5eb..ed9d42b 100644 --- a/src/Config.php +++ b/src/Config.php @@ -106,7 +106,7 @@ class Config extends dcNsProcess (new Fieldset())->class('fieldset')->legend(new Legend(__('List of disabled actions')))->fields($items), (new Fieldset())->class('fieldset')->legend(new Legend(__('Options')))->fields([ (new Para())->items([ - (new Checkbox('nodetails', dcCore::app()->blog->settings->get(Core::id())->get('nodetails')))->value('1'), + (new Checkbox('nodetails', (bool) dcCore::app()->blog->settings->get(Core::id())->get('nodetails')))->value('1'), (new Label(__('Hide details of rendered actions')))->class('classic')->for('nodetails'), ]), ]), diff --git a/src/Manage.php b/src/Manage.php index 3da5c8b..b01c898 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -258,7 +258,7 @@ class Manage extends dcNsProcess echo '

' . sprintf(__('Configure module "%s"'), self::$action->name()) . '

' . __('Back') . '

-

' . html::escapeHTML(self::$action->description()) . '

+

' . html::escapeHTML(self::$action->description()) . '

' . (empty($res) ? '

' . __('Nothing to configure') . '

' : $res) . '

' . diff --git a/src/module/cssheader.php b/src/module/cssheader.php index c660168..b045466 100644 --- a/src/module/cssheader.php +++ b/src/module/cssheader.php @@ -16,6 +16,17 @@ namespace Dotclear\Plugin\improve\Module; /* dotclear */ use dcCore; +use Dotclear\Helper\Html\Form\{ + Checkbox, + Div, + Fieldset, + Label, + Legend, + Note, + Para, + Select, + Textarea +}; /* improve */ use Dotclear\Plugin\improve\Action; @@ -25,7 +36,7 @@ use form; use html; /* php */ -use Dotclear\Exception; +use Exception; /** * Improve action module php header @@ -112,32 +123,43 @@ class cssheader extends Action $this->redirect($url); } - return ' -

' . __('This feature is experimental and not tested yet.') . '

- -

' . - form::combo('bloc_action', $this->action_bloc, $this->getSetting('bloc_action')) . ' -

- -

- -

- -

' . __('Bloc content:') . '

-

' . - form::textarea('bloc_content', 50, 10, html::escapeHTML($this->bloc_content)) . ' -

' . - sprintf( - __('You can use wildcards %s'), - '%year%, %module_id%, %module_name%, %module_author%, %module_type%, %user_cn%, %user_name%, %user_email%, %user_url%' - ) . '
' . __('Do not put structural elements to the begining of lines.') . '

' . - '

' . __('Exemple') . '

' . self::$exemple . '
'; + return (new Div())->items([ + (new Note())->text(__('This feature is experimental and not tested yet.'))->class('form-note'), + (new Fieldset())->class('fieldset')->legend((new Legend(__('Adjustments'))))->fields([ + // bloc_action + (new Para())->items([ + (new Label(__('Action:')))->for('bloc_action'), + (new Select('bloc_action'))->default($this->getSetting('bloc_action'))->items($this->action_bloc), + ]), + // exclude_locales + (new Para())->items([ + (new Checkbox('exclude_locales', !empty($this->getSetting('exclude_locales'))))->value(1), + (new Label(__('Do not add bloc to files from "locales" and "libs" folder'), Label::OUTSIDE_LABEL_AFTER))->for('exclude_locales')->class('classic'), + ]), + // exclude_templates + (new Para())->items([ + (new Checkbox('exclude_templates', !empty($this->getSetting('exclude_templates'))))->value(1), + (new Label(__('Do not add bloc to files from "tpl" and "default-templates" folder'), Label::OUTSIDE_LABEL_AFTER))->for('exclude_templates')->class('classic'), + ]), + ]), + (new Fieldset())->class('fieldset')->legend((new Legend(__('Contents'))))->fields([ + // bloc_content + (new Para())->items([ + (new Label(__('Bloc content:')))->for('bloc_content'), + (new Textarea('bloc_content', html::escapeHTML($this->bloc_content)))->cols(120)->rows(10), + ]), + (new Note())->text(sprintf( + __('You can use wildcards %s'), + '%year%, %module_id%, %module_name%, %module_author%, %module_type%, %user_cn%, %user_name%, %user_email%, %user_url%' + ))->class('form-note'), + (new Note())->text(__('Do not put structural elements to the begining of lines.'))->class('form-note'), + // exemple + (new Para())->items([ + (new Label(__('Exemple:')))->for('content_exemple'), + (new Textarea('content_exemple', html::escapeHTML(self::$exemple)))->cols(120)->rows(10)->extra('readonly="true"'), + ]), + ]), + ])->render(); } public function openModule(): ?bool diff --git a/src/module/dcstore.php b/src/module/dcstore.php index 492784c..41f86bc 100644 --- a/src/module/dcstore.php +++ b/src/module/dcstore.php @@ -16,9 +16,17 @@ namespace Dotclear\Plugin\improve\Module; /* improve */ use Dotclear\Plugin\improve\Action; +use Dotclear\Helper\Html\Form\{ + Div, + Fieldset, + Input, + Label, + Legend, + Note, + Para +}; /* clearbricks */ -use form; use files; use text; use xmlTag; @@ -64,19 +72,19 @@ class dcstore extends Action $this->redirect($url); } - return - '

' . __('File will be overwritten if it exists') . '

' . - '

' . - '

' . - '

' . - sprintf(__('You can use wildcards %s'), '%author%, %type%, %id%, %version%.') . - '
' . - __('For exemple on github https://github.com/MyGitName/%id%/releases/download/v%version%/%type%-%id%.zip') . - '
' . - __('Note on github, you must create a release and join to it the module zip file.') . ' -

'; + return (new Div())->items([ + (new Note())->text(__('File will be overwritten if it exists'))->class('form-note'), + (new Fieldset())->class('fieldset')->legend((new Legend(__('Contents'))))->fields([ + // phpexe_path + (new Para())->items([ + (new Label(__('Predictable URL to zip file on the external repository:')))->for('dcstore_pattern'), + (new Input('dcstore_pattern'))->size(65)->maxlenght(255)->value($this->pattern), + ]), + (new Note())->text(sprintf(__('You can use wildcards %s'), '%author%, %type%, %id%, %version%.'))->class('form-note'), + (new Note())->text(__('For exemple on github https://github.com/MyGitName/%id%/releases/download/v%version%/%type%-%id%.zip'))->class('form-note'), + (new Note())->text(__('Note on github, you must create a release and join to it the module zip file.'))->class('form-note'), + ]), + ])->render(); } public function openModule(): ?bool diff --git a/src/module/endoffile.php b/src/module/endoffile.php index c5a0046..2abccd5 100644 --- a/src/module/endoffile.php +++ b/src/module/endoffile.php @@ -14,11 +14,21 @@ declare(strict_types=1); namespace Dotclear\Plugin\improve\Module; +/* dotclear */ +use Dotclear\Helper\Html\Form\{ + Checkbox, + Div, + Fieldset, + Label, + Legend, + Note, + Para +}; + /* improve */ use Dotclear\Plugin\improve\Action; /* clearbricks */ -use form; /** * Improve action module end of file @@ -51,13 +61,16 @@ class endoffile extends Action $this->redirect($url); } - return - '

' . - __('PSR2 must have a blank line, whereas PSR12 must not.') . - '

'; + return (new Div())->items([ + (new Fieldset())->class('fieldset')->legend((new Legend(__('Contents'))))->fields([ + // endoffile_psr2 + (new Para())->items([ + (new Checkbox('endoffile_psr2', !empty($this->getSetting('psr2'))))->value(1), + (new Label(__('Add a blank line to the end of file'), Label::OUTSIDE_LABEL_AFTER))->for('endoffile_psr2')->class('classic'), + ]), + (new Note())->text(__('PSR2 must have a blank line, whereas PSR12 must not.'))->class('form-note'), + ]), + ])->render(); } public function readFile(&$content): ?bool diff --git a/src/module/gitshields.php b/src/module/gitshields.php index ec9d76f..22fd1f1 100644 --- a/src/module/gitshields.php +++ b/src/module/gitshields.php @@ -16,12 +16,21 @@ namespace Dotclear\Plugin\improve\Module; /* dotclear */ use dcCore; +use Dotclear\Helper\Html\Form\{ + Checkbox, + Div, + Fieldset, + Input, + Label, + Legend, + Note, + Para +}; /* improve */ use Dotclear\Plugin\improve\Action; /* clearbricks */ -use form; /** * Improve action module Github shields.io @@ -89,16 +98,23 @@ class gitshields extends Action $this->redirect($url); } - return ' -

' . - form::field('username', 60, 100, $this->username) . ' -

' . __('Used in your Github URL: http://github.com/username/module_id.') . '
' . - __('If you have badges not created by this tool in the README.md file you should remove them manually.') . '

- -

-

' . __('If your plugin or theme is on Dotaddict, you can add a badge to link to its details in Dotaddict.') . '

'; + return (new Div())->items([ + (new Fieldset())->class('fieldset')->legend((new Legend(__('Contents'))))->fields([ + // username + (new Para())->items([ + (new Label(__('Your Github user name:')))->for('username'), + (new Input('username'))->size(65)->maxlenght(255)->value($this->username), + ]), + (new Note())->text(__('Used in your Github URL: http://github.com/username/module_id.'))->class('form-note'), + (new Note())->text(__('If you have badges not created by this tool in the README.md file you should remove them manually.'))->class('form-note'), + // dotaddict + (new Para())->items([ + (new Checkbox('dotaddict', $this->dotaddict))->value(1), + (new Label(__('Include Dotaddict badge'), Label::OUTSIDE_LABEL_AFTER))->for('dotaddict')->class('classic'), + ]), + (new Note())->text(__('If your plugin or theme is on Dotaddict, you can add a badge to link to its details in Dotaddict.'))->class('form-note'), + ]), + ])->render(); } public function openModule(): ?bool diff --git a/src/module/licensefile.php b/src/module/licensefile.php index 6dd569b..cf3bd4a 100644 --- a/src/module/licensefile.php +++ b/src/module/licensefile.php @@ -14,11 +14,21 @@ declare(strict_types=1); namespace Dotclear\Plugin\improve\Module; +/* dotclear */ +use Dotclear\Helper\Html\Form\{ + Checkbox, + Div, + Fieldset, + Label, + Legend, + Para, + Select +}; + /* improve */ use Dotclear\Plugin\improve\Action; /* clearbricks */ -use form; use files; /* php */ @@ -86,14 +96,20 @@ class licensefile extends Action $this->redirect($url); } - return ' -

' . - form::combo('action_version', $this->action_version, $this->getSetting('action_version')) . ' -

- -

' . - form::combo('action_full', $this->action_full, $this->getSetting('action_full')) . - '

'; + return (new Div())->items([ + (new Fieldset())->class('fieldset')->legend((new Legend(__('Adjustments'))))->fields([ + // action_version + (new Para())->items([ + (new Label(__('License version:')))->for('action_version'), + (new Select('action_version'))->default($this->getSetting('action_version'))->items($this->action_version), + ]), + // action_full + (new Para())->items([ + (new Label(__('Action on file:')))->for('action_full'), + (new Select('action_full'))->default($this->getSetting('action_full'))->items($this->action_full), + ]), + ]), + ])->render(); } public function openModule(): ?bool diff --git a/src/module/newline.php b/src/module/newline.php index 41527c3..a60fb8e 100644 --- a/src/module/newline.php +++ b/src/module/newline.php @@ -14,12 +14,22 @@ declare(strict_types=1); namespace Dotclear\Plugin\improve\Module; +/* dotclear */ +use Dotclear\Helper\Html\Form\{ + Div, + Fieldset, + Input, + Label, + Legend, + Note, + Para +}; + /* improve */ use Dotclear\Plugin\improve\Action; use Dotclear\Plugin\improve\Core; /* clearbricks */ -use form; /** * Improve action module new line @@ -60,13 +70,16 @@ class newline extends Action $ext = []; } - return - '

' . - __('Use comma separated list of extensions without dot, recommand "php,js,xml,txt,md".') . - '

'; + return (new Div())->items([ + (new Fieldset())->class('fieldset')->legend((new Legend(__('Contents'))))->fields([ + // newline_extensions + (new Para())->items([ + (new Label(__('List of files extension to work on:')))->for('newline_extensions'), + (new Input('newline_extensions'))->size(65)->maxlenght(255)->value(implode(',', $ext)), + ]), + (new Note())->text(__('Use comma separated list of extensions without dot, recommand "php,js,xml,txt,md".'))->class('form-note'), + ]), + ])->render(); } public function readFile(string &$content): ?bool diff --git a/src/module/phpcsfixer.php b/src/module/phpcsfixer.php index ebf6d7a..6863c55 100644 --- a/src/module/phpcsfixer.php +++ b/src/module/phpcsfixer.php @@ -21,10 +21,19 @@ use Dotclear\Plugin\improve\Core; /* dotclear */ use dcCore; use dcPage; +use Dotclear\Helper\Html\Form\{ + Div, + Fieldset, + Input, + Label, + Legend, + Note, + Para, + Textarea +}; /* clearbricks */ use html; -use form; use path; /* php */ @@ -99,22 +108,23 @@ class phpcsfixer extends Action } $content = (string) file_get_contents(__DIR__ . '/phpcsfixer/phpcsfixer.rules.php'); - return - '

' . - '

' . - '

' . - __('If this module does not work you can try to put here directory to php executable (without executable file name).') . - ' C:\path_to\php

' . - - '

' . - '

' . form::textarea('file_content', 120, 60, [ - 'default' => html::escapeHTML($content), - 'class' => 'maximal', - 'extra_html' => 'readonly="true"', - ]) . '

' . - ( + return (new Div())->items([ + (new Fieldset())->class('fieldset')->legend((new Legend(__('Root'))))->fields([ + // phpexe_path + (new Para())->items([ + (new Label(__('Root directory of PHP executable:')))->for('phpexe_path'), + (new Input('phpexe_path'))->size(65)->maxlenght(255)->value($this->phpexe_path), + ]), + (new Note())->text(__('If this module does not work you can try to put here directory to php executable (without executable file name).'))->class('form-note'), + ]), + (new Fieldset())->class('fieldset')->legend((new Legend(__('Bootstrap'))))->fields([ + // file_content + (new Para())->items([ + (new Label(__('PHP CS Fixer configuration file:')))->for('file_content'), + (new Textarea('file_content', html::escapeHTML($content)))->class('maximal')->cols(120)->rows(14)->extra('readonly="true"'), + ]), + ]), + ])->render() . ( !self::$user_ui_colorsyntax ? '' : dcPage::jsModuleLoad(Core::id() . '/inc/module/phpcsfixer/phpcsfixer.improve.js') . dcPage::jsRunCodeMirror('editor', 'file_content', 'dotclear', self::$user_ui_colorsyntax_theme) diff --git a/src/module/phpheader.php b/src/module/phpheader.php index 46f3ce4..d1e37ee 100644 --- a/src/module/phpheader.php +++ b/src/module/phpheader.php @@ -16,12 +16,22 @@ namespace Dotclear\Plugin\improve\Module; /* dotclear */ use dcCore; +use Dotclear\Helper\Html\Form\{ + Checkbox, + Div, + Fieldset, + Label, + Legend, + Note, + Para, + Select, + Textarea +}; /* improve */ use Dotclear\Plugin\improve\Action; /* clearbricks */ -use form; use html; /* php */ @@ -112,30 +122,42 @@ class phpheader extends Action $this->redirect($url); } - return ' -

' . - form::combo('bloc_action', $this->action_bloc, $this->getSetting('bloc_action')) . ' -

- -

- -

- -

' . __('Bloc content:') . '

-

' . - form::textarea('bloc_content', 50, 10, html::escapeHTML($this->bloc_content)) . ' -

' . - sprintf( - __('You can use wildcards %s'), - '%year%, %module_id%, %module_name%, %module_author%, %module_type%, %user_cn%, %user_name%, %user_email%, %user_url%' - ) . '
' . __('Do not put structural elements to the begining of lines.') . '

' . - '

' . __('Exemple') . '

' . self::$exemple . '
'; + return (new Div())->items([ + (new Fieldset())->class('fieldset')->legend((new Legend(__('Adjustments'))))->fields([ + // bloc_action + (new Para())->items([ + (new Label(__('Action:')))->for('bloc_action'), + (new Select('bloc_action'))->default($this->getSetting('bloc_action'))->items($this->action_bloc), + ]), + // remove_old + (new Para())->items([ + (new Checkbox('remove_old', !empty($this->getSetting('remove_old'))))->value(1), + (new Label(__('Remove old style bloc header (using #)'), Label::OUTSIDE_LABEL_AFTER))->for('remove_old')->class('classic'), + ]), + // exclude_locales + (new Para())->items([ + (new Checkbox('exclude_locales', !empty($this->getSetting('exclude_locales'))))->value(1), + (new Label(__('Do not add bloc to files from "locales" and "libs" folder'), Label::OUTSIDE_LABEL_AFTER))->for('exclude_locales')->class('classic'), + ]), + ]), + (new Fieldset())->class('fieldset')->legend((new Legend(__('Contents'))))->fields([ + // bloc_content + (new Para())->items([ + (new Label(__('Bloc content:')))->for('bloc_content'), + (new Textarea('bloc_content', html::escapeHTML($this->bloc_content)))->cols(120)->rows(10), + ]), + (new Note())->text(sprintf( + __('You can use wildcards %s'), + '%year%, %module_id%, %module_name%, %module_author%, %module_type%, %user_cn%, %user_name%, %user_email%, %user_url%' + ))->class('form-note'), + (new Note())->text(__('Do not put structural elements to the begining of lines.'))->class('form-note'), + // exemple + (new Para())->items([ + (new Label(__('Exemple:')))->for('content_exemple'), + (new Textarea('content_exemple', html::escapeHTML(self::$exemple)))->cols(120)->rows(10)->extra('readonly="true"'), + ]), + ]), + ])->render(); } public function openModule(): ?bool diff --git a/src/module/phpstan.php b/src/module/phpstan.php index 635f6b3..5688ddd 100644 --- a/src/module/phpstan.php +++ b/src/module/phpstan.php @@ -21,10 +21,21 @@ use Dotclear\Plugin\improve\Core; /* dotclear */ use dcCore; use dcPage; +use Dotclear\Helper\Html\Form\{ + Checkbox, + Div, + Fieldset, + Input, + Label, + Legend, + Note, + Number, + Para, + Textarea +}; /* clearbricks */ use html; -use form; use path; /* php */ @@ -103,37 +114,46 @@ class phpstan extends Action } $content = (string) file_get_contents(__DIR__ . '/phpstan/phpstan.rules.conf'); - return - '

' . __('You must enable improve details to view analyse results !') . '

' . - '

' . - '

' . - '

' . - __('If this module does not work you can try to put here directory to php executable (without executable file name).') . - ' C:\path_to\php

' . - '

' . - form::number('run_level', ['min' => 0, 'max' => 9, 'default' => $this->run_level]) . '

' . - '

' . - '

' . - '

' . sprintf( - __('If you have errors like "%s", you can add this var here. Use ; as separator and do not put $ ahead.'), - 'Variable $var might not be defined' - ) . ' ' . __('For exemple: var;_othervar;avar') . '
' . __('Some variables like core, _menu, are already set in ignored list.') . '

' . - '

' . - '

' . __('Enable this can cause timeout.') . '

' . - - '

' . - '

' . form::textarea('file_content', 120, 14, [ - 'default' => html::escapeHTML($content), - 'class' => 'maximal', - 'extra_html' => 'readonly="true"', - ]) . '

' . - ( + return (new Div())->items([ + (new Note())->text(__('You must enable improve details to view analyse results !'))->class('form-note'), + (new Fieldset())->class('fieldset')->legend((new Legend(__('Root'))))->fields([ + // phpexe_path + (new Para())->items([ + (new Label(__('Root directory of PHP executable:')))->for('phpexe_path'), + (new Input('phpexe_path'))->size(65)->maxlenght(255)->value($this->phpexe_path), + ]), + (new Note())->text(__('If this module does not work you can try to put here directory to php executable (without executable file name).'))->class('form-note'), + ]), + (new Fieldset())->class('fieldset')->legend((new Legend(__('Adjustments'))))->fields([ + // run_level + (new Para())->items([ + (new Label(__('Level:')))->for('run_level')->class('classic'), + (new Number('run_level'))->min(0)->max(50)->value($this->run_level), + ]), + // ignored_vars + (new Para())->items([ + (new Label(__('List of ignored variables:')))->for('ignored_vars'), + (new Input('ignored_vars'))->size(65)->maxlenght(255)->value($this->ignored_vars), + ]), + (new Note())->text( + sprintf(__('If you have errors like "%s", you can add this var here. Use ; as separator and do not put $ ahead.'), 'Variable $var might not be defined') . + ' ' . __('For exemple: var;_othervar;avar') . '
' . __('Some variables like core, _menu, are already set in ignored list.') + )->class('form-note'), + // split_report + (new Para())->items([ + (new Checkbox('split_report', !empty($this->getSetting('split_report'))))->value(1), + (new Label(__('Split report by file rather than all in the end.'), Label::OUTSIDE_LABEL_AFTER))->for('split_report')->class('classic'), + ]), + (new Note())->text(__('Enable this can cause timeout.'))->class('form-note'), + ]), + (new Fieldset())->class('fieldset')->legend((new Legend(__('Bootstrap'))))->fields([ + // file_content + (new Para())->items([ + (new Label(__('PHPStan configuration file:')))->for('file_content'), + (new Textarea('file_content', html::escapeHTML($content)))->class('maximal')->cols(120)->rows(14)->extra('readonly="true"'), + ]), + ]), + ])->render() . ( !self::$user_ui_colorsyntax ? '' : dcPage::jsModuleLoad(Core::id() . '/inc/module/phpstan/phpstan.improve.js') . dcPage::jsRunCodeMirror('editor', 'file_content', 'dotclear', self::$user_ui_colorsyntax_theme) diff --git a/src/module/zip.php b/src/module/zip.php index 40c3b88..7dbf3ef 100644 --- a/src/module/zip.php +++ b/src/module/zip.php @@ -16,19 +16,28 @@ namespace Dotclear\Plugin\improve\Module; /* dotclear */ use dcCore; +use Dotclear\Helper\Html\Form\{ + Checkbox, + Div, + Fieldset, + Input, + Label, + Legend, + Note, + Para +}; /* improve */ use Dotclear\Plugin\improve\Action; /* clearbricks */ -use form; use path; use files; /** * Improve action module zip */ -class zip extends action +class zip extends Action { /** @var array List of excluded file pattern */ public static $exclude = [ @@ -106,53 +115,52 @@ class zip extends action $this->redirect($url); } - return ' -
-

' . __('Root') . '

- -

' . - '

' . sprintf( - __('Preconization: %s'), - dcCore::app()->blog->public_path ? - path::real(dcCore::app()->blog->public_path) : __("Blog's public directory") - ) . '

-
- -
-

' . __('Files') . '

- -

-

' . sprintf(__('Preconization: %s'), '%type%-%id%') . '

- -

-

' . sprintf(__('Preconization: %s'), '%type%-%id%-%version%') . '

- -

- -
- -
-

' . __('Content') . '

- -

-

' . sprintf(__('Preconization: %s'), '*.zip,*.tar,*.tar.gz') . '
' . - sprintf(__('By default all these files are always removed from packages : %s'), implode(', ', self::$exclude)) . '

- -

- -
'; + return (new Div())->items([ + (new Fieldset())->class('fieldset')->legend((new Legend(__('Root'))))->fields([ + // pack_repository + (new Para())->items([ + (new Label(__('Path to repository:')))->for('pack_repository'), + (new Input('pack_repository'))->size(65)->maxlenght(255)->value($this->getSetting('pack_repository')), + ]), + (new Note())->text(sprintf( + __('Preconization: %s'), + dcCore::app()->blog->public_path ? + path::real(dcCore::app()->blog->public_path) : __("Blog's public directory") + ))->class('form-note'), + ]), + (new Fieldset())->class('fieldset')->legend((new Legend(__('Files'))))->fields([ + // pack_filename + (new Para())->items([ + (new Label(__('Name of exported package:')))->for('pack_filename'), + (new Input('pack_filename'))->size(65)->maxlenght(255)->value($this->getSetting('pack_filename')), + ]), + (new Note())->text(sprintf(__('Preconization: %s'), '%type%-%id%'))->class('form-note'), + // secondpack_filename + (new Para())->items([ + (new Label(__('Name of second exported package:')))->for('secondpack_filename'), + (new Input('secondpack_filename'))->size(65)->maxlenght(255)->value($this->getSetting('secondpack_filename')), + ]), + (new Note())->text(sprintf(__('Preconization: %s'), '%type%-%id%-%version%'))->class('form-note'), + // pack_overwrite + (new Para())->items([ + (new Checkbox('pack_overwrite', !empty($this->getSetting('pack_overwrite'))))->value(1), + (new Label(__('Overwrite existing languages'), Label::OUTSIDE_LABEL_AFTER))->for('pack_overwrite')->class('classic'), + ]), + ]), + (new Fieldset())->class('fieldset')->legend((new Legend(__('Contents'))))->fields([ + // pack_excludefiles + (new Para())->items([ + (new Label(__('Extra files to exclude from package:')))->for('pack_excludefiles'), + (new Input('pack_excludefiles'))->size(65)->maxlenght(255)->value($this->getSetting('pack_excludefiles')), + ]), + (new Note())->text(sprintf(__('By default all these files are always removed from packages : %s'), implode(', ', self::$exclude)))->class('form-note'), + // pack_nocomment + (new Para())->items([ + (new Checkbox('pack_nocomment', !empty($this->getSetting('pack_nocomment'))))->value(1), + (new Label(__('Remove comments from files'), Label::OUTSIDE_LABEL_AFTER))->for('pack_nocomment')->class('classic'), + ]), + ]), + ])->render(); } public function closeModule(): ?bool