]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Admin/Storage.php
Changes:
[friendica.git] / src / Module / Admin / Storage.php
index b3361b6c179b2499d3ad1dc4d5e59fe0c9d362a6..877d20721d696d9c306350e1cc71480530cab038 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2023, the Friendica project
+ * @copyright Copyright (C) 2010-2024, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -76,7 +76,7 @@ class Storage extends BaseAdmin
                        }
                }
 
-               if (!empty($_POST['submit_save_set']) && !DI::config()->isSetDisabled('storage', 'name') ) {
+               if (!empty($_POST['submit_save_set']) && DI::config()->isWritable('storage', 'name') ) {
                        try {
                                $newstorage = DI::storageManager()->getWritableStorageByName($storagebackend);
 
@@ -129,7 +129,6 @@ class Storage extends BaseAdmin
                                'prefix' => $storage_form_prefix,
                                'form'   => $storage_form,
                                'active' => $current_storage_backend instanceof ICanWriteToStorage && $name === $current_storage_backend::getName(),
-                               'set_disabled' => DI::config()->isSetDisabled('storage', 'name'),
                        ];
                }
 
@@ -146,6 +145,8 @@ class Storage extends BaseAdmin
                        '$save_reload'           => DI::l10n()->t('Save & Reload'),
                        '$noconfig'              => DI::l10n()->t('This backend doesn\'t have custom settings'),
                        '$form_security_token'   => self::getFormSecurityToken("admin_storage"),
+                       '$storagebackend_ro_txt' => !DI::config()->isWritable('storage', 'name') ? DI::l10n()->t('Changing the current backend is prohibited because it is set by an environment variable') : '',
+                       '$is_writable'           => DI::config()->isWritable('storage', 'name'),
                        '$storagebackend'        => $current_storage_backend instanceof ICanWriteToStorage ? $current_storage_backend::getName() : DI::l10n()->t('Database (legacy)'),
                        '$availablestorageforms' => $available_storage_forms,
                ]);