diff --git a/htdocs/admin/tools/ui/class/documentation.class.php b/htdocs/admin/tools/ui/class/documentation.class.php index c9381a9e8c740..388579726d324 100644 --- a/htdocs/admin/tools/ui/class/documentation.class.php +++ b/htdocs/admin/tools/ui/class/documentation.class.php @@ -234,6 +234,12 @@ private function setMenu() 'DocContributeStep3' => '#contributesection-step3', ), ), + 'HiddenConf' => array( + 'url' => dol_buildpath($this->baseUrl.'/resources/hidden-conf.php', 1), + 'icon' => 'fas fa-code', + 'submenu' => array(), + 'summary' => array(), + ), ) ); diff --git a/htdocs/admin/tools/ui/components/inputs.php b/htdocs/admin/tools/ui/components/inputs.php index e0307fae42700..a2309480b2e0c 100644 --- a/htdocs/admin/tools/ui/components/inputs.php +++ b/htdocs/admin/tools/ui/components/inputs.php @@ -383,6 +383,7 @@ 'print $form->getSearchFilterToolInput(', ' \'#demo-filter .search-item\',', ' \'search-tools-input\',', + ' \'\',', ' [\'attr\' => [', ' \'data-no-item-target\' => \'#demo-filter .search-tool-no-results\', ', ' \'data-counter-target\' => \'#demo-filter .counter\', ', diff --git a/htdocs/admin/tools/ui/css/hidden-conf.css b/htdocs/admin/tools/ui/css/hidden-conf.css new file mode 100644 index 0000000000000..465951b524ec8 --- /dev/null +++ b/htdocs/admin/tools/ui/css/hidden-conf.css @@ -0,0 +1,71 @@ +.conf-container { + display: flex; + flex-direction: column; + gap: 25px; +} + +.conf-list { + display: flex; + flex-direction: column; + gap: 12px; +} + +.conf-item { + border: 1px solid #eee; + border-radius: 6px; + padding: 12px; + background: #fafafa; +} + +.conf-header { + display: flex; + justify-content: space-between; + align-items: center; + gap: 10px; +} + +.conf-name { + font-weight: bold; + font-family: monospace; +} + +.conf-body { + margin-top: 8px; +} + +.conf-desc { + margin-bottom: 10px; + color: #333; +} + +.conf-meta { + display: flex; + flex-wrap: wrap; + gap: 10px; + font-size: 12px; + color: #666; +} + +.conf-meta-line { + margin-right: 10px; +} + +#search-form-container { + position: sticky; + top:0; +} +#search-form-container .search-tool-container { + margin: 0; +} + +#hidden-conf-counter{ + display: block; + position: absolute; + right: 10px; + bottom: 0; + transform: translateY(50%); +} + +.conf-item summary.conf-title{ + cursor: pointer; +} diff --git a/htdocs/admin/tools/ui/index.php b/htdocs/admin/tools/ui/index.php index 66372a6354e6d..bf7c1df57fad2 100644 --- a/htdocs/admin/tools/ui/index.php +++ b/htdocs/admin/tools/ui/index.php @@ -64,6 +64,10 @@
en_US language option in combo boxes (other languages can easily be removed in langs directory but not en_US)',
+ 'type' => 'bool',
+ 'example' => '1',
+ 'added_in' => '10.0',
+ 'removed_in' => null,
+ 'deprecated' => false,
+ 'deprecated_since' => null,
+ 'module' => 'core',
+ 'tags' => ['ui'],
+ ],
+
+ // 'MAIN_LANGUAGES_ALLOWED' => [
+ // 'name' => 'MAIN_LANGUAGES_ALLOWED',
+ // 'title' => 'Restrict allowed languages list',
+ // 'description' => '',
+ // 'type' => 'string',
+ // 'example' => 'fr_FR,en_US,de_DE',
+ // 'added_in' => '11.0',
+ // 'removed_in' => null,
+ // 'deprecated' => false,
+ // 'deprecated_since' => null,
+ // 'module' => 'core',
+ // 'tags' => ['ui'],
+ // ],
+ //
+ // 'MAIN_DISABLE_FULL_SCANLIST' => [
+ // 'name' => 'MAIN_DISABLE_FULL_SCANLIST',
+ // 'title' => 'Disable full table scan for pagination performance',
+ // 'description' => '',
+ // 'type' => 'bool',
+ // 'example' => '1',
+ // 'added_in' => null,
+ // 'removed_in' => null,
+ // 'deprecated' => false,
+ // 'deprecated_since' => null,
+ // 'module' => 'core',
+ // 'tags' => ['performance'],
+ // ],
+ //
+ // 'MAIN_DISABLE_JQUERY_JNOTIFY' => [
+ // 'name' => 'MAIN_DISABLE_JQUERY_JNOTIFY',
+ // 'title' => 'Disable JNotify alerts',
+ // 'description' => '',
+ // 'type' => 'bool',
+ // 'example' => '1',
+ // 'added_in' => null,
+ // 'removed_in' => null,
+ // 'deprecated' => false,
+ // 'deprecated_since' => null,
+ // 'module' => 'core',
+ // 'tags' => ['ui'],
+ // ],
+ //
+ // 'MAIN_DISABLE_AJAX_COMBOX' => [
+ // 'name' => 'MAIN_DISABLE_AJAX_COMBOX',
+ // 'title' => 'Disable AJAX autocomplete in selects',
+ // 'description' => '',
+ // 'type' => 'bool',
+ // 'example' => '1',
+ // 'added_in' => '3.6',
+ // 'removed_in' => null,
+ // 'deprecated' => false,
+ // 'deprecated_since' => null,
+ // 'module' => 'core',
+ // 'tags' => ['ui'],
+ // ],
+ //
+ // 'MAIN_DISABLE_MULTIPLE_FILEUPLOAD' => [
+ // 'name' => 'MAIN_DISABLE_MULTIPLE_FILEUPLOAD',
+ // 'title' => 'Disable multiple file upload',
+ // 'description' => '',
+ // 'type' => 'bool',
+ // 'example' => '1',
+ // 'added_in' => null,
+ // 'removed_in' => null,
+ // 'deprecated' => false,
+ // 'deprecated_since' => null,
+ // 'module' => 'core',
+ // 'tags' => ['upload'],
+ // ],
+ //
+ // 'MAIN_DISABLE_TRUNC' => [
+ // 'name' => 'MAIN_DISABLE_TRUNC',
+ // 'title' => 'Disable truncation in select lists',
+ // 'description' => '',
+ // 'type' => 'bool',
+ // 'example' => '1',
+ // 'added_in' => '7.0',
+ // 'removed_in' => null,
+ // 'deprecated' => false,
+ // 'deprecated_since' => null,
+ // 'module' => 'core',
+ // 'tags' => ['ui'],
+ // ],
+ ],
+ ],
+
+ // 'SECURITY' => [
+ // 'label' => 'Security',
+ // 'confs' => [
+ // 'MAIN_SECURITY_CSRF_WITH_TOKEN' => [
+ // 'name' => 'MAIN_SECURITY_CSRF_WITH_TOKEN',
+ // 'title' => 'CSRF protection level',
+ // 'description' => '',
+ // 'type' => 'int',
+ // 'example' => '2',
+ // 'added_in' => null,
+ // 'removed_in' => null,
+ // 'deprecated' => false,
+ // 'deprecated_since' => null,
+ // 'module' => 'core',
+ // 'tags' => ['security'],
+ // ],
+ //
+ // 'MAIN_RESTRICT_IPS' => [
+ // 'name' => 'MAIN_RESTRICT_IPS',
+ // 'title' => 'Restrict access by IP range',
+ // 'description' => '',
+ // 'type' => 'string',
+ // 'example' => '192.168.0.0/24',
+ // 'added_in' => null,
+ // 'removed_in' => null,
+ // 'deprecated' => false,
+ // 'deprecated_since' => null,
+ // 'module' => 'core',
+ // 'tags' => ['security'],
+ // ],
+ //
+ // 'MAIN_ALLOW_SVG_FILES_AS_IMAGES' => [
+ // 'name' => 'MAIN_ALLOW_SVG_FILES_AS_IMAGES',
+ // 'title' => 'Allow SVG upload (security risk)',
+ // 'description' => '',
+ // 'type' => 'bool',
+ // 'example' => '1',
+ // 'added_in' => null,
+ // 'removed_in' => null,
+ // 'deprecated' => true,
+ // 'deprecated_since' => null,
+ // 'module' => 'core',
+ // 'tags' => ['danger'],
+ // ],
+ // ],
+ // ],
+ //
+ // 'INVOICE' => [
+ // 'label' => 'Invoices',
+ // 'confs' => [
+ // 'INVOICE_CAN_BE_EDITED_EVEN_IF_PAYMENT_DONE' => [
+ // 'name' => 'INVOICE_CAN_BE_EDITED_EVEN_IF_PAYMENT_DONE',
+ // 'title' => 'Allow invoice editing after payment started',
+ // 'description' => '',
+ // 'type' => 'bool',
+ // 'example' => '1',
+ // 'added_in' => null,
+ // 'removed_in' => null,
+ // 'deprecated' => false,
+ // 'deprecated_since' => null,
+ // 'module' => 'invoice',
+ // 'tags' => ['danger'],
+ // ],
+ //
+ // 'INVOICE_CAN_ALWAYS_BE_REMOVED' => [
+ // 'name' => 'INVOICE_CAN_ALWAYS_BE_REMOVED',
+ // 'title' => 'Allow invoice deletion even if not last',
+ // 'description' => '',
+ // 'type' => 'bool',
+ // 'example' => '1',
+ // 'added_in' => null,
+ // 'removed_in' => null,
+ // 'deprecated' => false,
+ // 'deprecated_since' => null,
+ // 'module' => 'invoice',
+ // 'tags' => ['danger'],
+ // ],
+ // ],
+ // ],
+ //
+ // 'PRODUCT' => [
+ // 'label' => 'Products',
+ // 'confs' => [
+ // 'PRODUCT_DISABLE_SELLBY' => [
+ // 'name' => 'PRODUCT_DISABLE_SELLBY',
+ // 'title' => 'Hide sell-by date field',
+ // 'description' => '',
+ // 'type' => 'bool',
+ // 'example' => '1',
+ // 'added_in' => '13',
+ // 'removed_in' => null,
+ // 'deprecated' => false,
+ // 'deprecated_since' => null,
+ // 'module' => 'product',
+ // 'tags' => ['ui'],
+ // ],
+ //
+ // 'PRODUCT_DISABLE_EATBY' => [
+ // 'name' => 'PRODUCT_DISABLE_EATBY',
+ // 'title' => 'Hide eat-by date field',
+ // 'description' => '',
+ // 'type' => 'bool',
+ // 'example' => '1',
+ // 'added_in' => '13',
+ // 'removed_in' => null,
+ // 'deprecated' => false,
+ // 'deprecated_since' => null,
+ // 'module' => 'product',
+ // 'tags' => ['ui'],
+ // ],
+ //
+ // 'PRODUCT_DENY_CHANGE_PRODUCT_TYPE' => [
+ // 'name' => 'PRODUCT_DENY_CHANGE_PRODUCT_TYPE',
+ // 'title' => 'Prevent changing product type',
+ // 'description' => '',
+ // 'type' => 'bool',
+ // 'example' => '1',
+ // 'added_in' => null,
+ // 'removed_in' => null,
+ // 'deprecated' => false,
+ // 'deprecated_since' => null,
+ // 'module' => 'product',
+ // 'tags' => ['security'],
+ // ],
+ // ],
+ // ],
+ ];
+}
+
+
+
+
+
+/**
+ * Render hidden Dolibarr configuration list
+ *
+ * @return void
+ */
+function renderHiddenConfList(): void
+{
+ $data = getListOfHiddenConf();
+
+ foreach ($data as $sectionKey => $section) {
+ renderSection($sectionKey, $section);
+ }
+}
+
+/**
+ * Render one section
+ *
+ * @param string $sectionKey the selection
+ * @param array