diff --git a/phpBB/adm/style/acp_storage.html b/phpBB/adm/style/acp_storage.html
index f064438aca..f3b93020f8 100644
--- a/phpBB/adm/style/acp_storage.html
+++ b/phpBB/adm/style/acp_storage.html
@@ -47,7 +47,7 @@
{% for provider in PROVIDERS %}
{% if provider.is_available %}
{% endif %}
{% endfor %}
@@ -59,43 +59,42 @@
{% for provider in PROVIDERS %}
{% if provider.is_available %}
diff --git a/phpBB/config/default/container/services_storage.yml b/phpBB/config/default/container/services_storage.yml
index 1109aa626b..8db8ceaede 100644
--- a/phpBB/config/default/container/services_storage.yml
+++ b/phpBB/config/default/container/services_storage.yml
@@ -72,6 +72,7 @@ services:
storage.provider.local:
class: phpbb\storage\provider\local
arguments:
+ - '@language'
tags:
- { name: storage.provider }
diff --git a/phpBB/language/en/acp/storage.php b/phpBB/language/en/acp/storage.php
index 9f928ee58e..575805e650 100644
--- a/phpBB/language/en/acp/storage.php
+++ b/phpBB/language/en/acp/storage.php
@@ -65,6 +65,7 @@ $lang = array_merge($lang, [
// Local adapter
'STORAGE_ADAPTER_LOCAL_NAME' => 'Local',
'STORAGE_ADAPTER_LOCAL_OPTION_PATH' => 'Path',
+ 'STORAGE_ADAPTER_LOCAL_OPTION_PATH_EXPLAIN' => 'Storage path for files.
For example: files, images/avatars/upload or store.',
// Form validation
'STORAGE_UPDATE_SUCCESSFUL' => 'All storage types were successfully updated.',
diff --git a/phpBB/phpbb/storage/provider/local.php b/phpBB/phpbb/storage/provider/local.php
index 67a1789434..11bca055ce 100644
--- a/phpBB/phpbb/storage/provider/local.php
+++ b/phpBB/phpbb/storage/provider/local.php
@@ -13,8 +13,25 @@
namespace phpbb\storage\provider;
+use phpbb\language\language;
+
class local implements provider_interface
{
+ /**
+ * @var language
+ */
+ protected $language;
+
+ /**
+ * Constructor
+ *
+ * @param language $language
+ */
+ public function __construct(language $language)
+ {
+ $this->language = $language;
+ }
+
/**
* {@inheritdoc}
*/
@@ -23,6 +40,11 @@ class local implements provider_interface
return 'local';
}
+ public function get_title(): string
+ {
+ return $this->language->lang('STORAGE_ADAPTER_LOCAL_NAME');
+ }
+
/**
* {@inheritdoc}
*/
@@ -38,8 +60,12 @@ class local implements provider_interface
{
return [
'path' => [
- 'tag' => 'input',
- 'type' => 'text',
+ 'title' => $this->language->lang('STORAGE_ADAPTER_LOCAL_OPTION_PATH'),
+ 'description' => $this->language->lang('STORAGE_ADAPTER_LOCAL_OPTION_PATH_EXPLAIN'),
+ 'form_macro' => [
+ 'tag' => 'input',
+ 'type' => 'text',
+ ],
],
];
}
diff --git a/phpBB/phpbb/storage/provider/provider_interface.php b/phpBB/phpbb/storage/provider/provider_interface.php
index aa01a51e37..7baac79f72 100644
--- a/phpBB/phpbb/storage/provider/provider_interface.php
+++ b/phpBB/phpbb/storage/provider/provider_interface.php
@@ -22,6 +22,13 @@ interface provider_interface
*/
public function get_name(): string;
+ /**
+ * Gets adapter title for acp
+ *
+ * @return string
+ */
+ public function get_title(): string;
+
/**
* Gets adapter class
*
@@ -32,7 +39,67 @@ interface provider_interface
/**
* Gets adapter options
*
- * @return array Configuration keys
+ * Example:
+ * public function get_options()
+ * {
+ * return [
+ * 'text-test' => [
+ * 'title' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_TEXT_TEST'),
+ * 'description' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_TEXT_TEST_EXPLAIN'),
+ * 'form_macro' => [
+ * 'tag' => 'input',
+ * 'type' => 'text',
+ * ],
+ * ],
+ * 'password-test' => [
+ * 'title' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_PASSWORD_TEST'),
+ * 'description' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_PASSWORD_TEST_EXPLAIN'),
+ * 'form_macro' => [
+ * 'tag' => 'input',
+ * 'type' => 'password',
+ * ],
+ * ],
+ * 'radio-test' => [
+ * 'title' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_RADIO_TEST'),
+ * 'description' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_RADIO_TEST_EXPLAIN'),
+ * 'form_macro' => [
+ * 'tag' => 'radio',
+ * 'buttons' => [
+ * [
+ * 'type' => 'radio',
+ * 'value' => '1',
+ * 'label' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_RADIO_TEST_LABEL_ONE'),
+ * ],
+ * [
+ * 'type' => 'radio',
+ * 'value' => '2',
+ * 'label' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_RADIO_TEST_LABEL_TWO'),
+ * ],
+ * ],
+ * ],
+ * ],
+ * 'select-test' => [
+ * 'title' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_SELECT_TEST'),
+ * 'description' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_SELECT_TEST_EXPLAIN'),
+ * 'form_macro' => [
+ * 'tag' => 'select',
+ * 'options' => [
+ * ['value' => 'one', 'label' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_SELECT_TEST_LABEL_ONE')],
+ * ['value' => 'two', 'label' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_SELECT_TEST_LABEL_TWO')],
+ * ],
+ * ],
+ * ],
+ * 'textarea-test' => [
+ * 'title' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_TEXTAREA_TEST'),
+ * 'description' => $this->language->lang('STORAGE_ADAPTER_DEMO_OPTION_TEXTAREA_TEST_EXPLAIN'),
+ * 'form_macro' => [
+ * 'tag' => 'textarea',
+ * ]
+ * ],
+ * ];
+ * }
+ *
+ * @return array Configuration keys
*/
public function get_options(): array;
diff --git a/phpBB/phpbb/template/twig/extension/forms.php b/phpBB/phpbb/template/twig/extension/forms.php
index b146aacfb9..bf1bed006e 100644
--- a/phpBB/phpbb/template/twig/extension/forms.php
+++ b/phpBB/phpbb/template/twig/extension/forms.php
@@ -206,7 +206,7 @@ class forms extends AbstractExtension
{
return $environment->render('macros/forms/textarea.twig', [
'CLASS' => (string) ($form_data['class'] ?? ''),
- 'ID' => (string) $form_data['id'],
+ 'ID' => (string) ($form_data['id'] ?? ''),
'DATA' => $form_data['data'] ?? [],
'NAME' => (string) $form_data['name'],
'ROWS' => (int) ($form_data['rows'] ?? ''),