]> git.mxchange.org Git - friendica-addons.git/commitdiff
Accessibility: Use different id values for options
authorMichael <heluecht@pirati.ca>
Tue, 28 Jan 2025 20:27:52 +0000 (20:27 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 28 Jan 2025 20:27:52 +0000 (20:27 +0000)
invidious/invidious.php
markdown/markdown.php

index 033ecce5997009954678ff56642e2fea90c37451..5fa2eca9a8b5e4d32592b2916d7f45e939f0b668 100644 (file)
@@ -54,8 +54,8 @@ function invidious_settings(array &$data)
 
        $t    = Renderer::getMarkupTemplate('settings.tpl', 'addon/invidious/');
        $html = Renderer::replaceMacros($t, [
-               '$enabled' => ['enabled', DI::l10n()->t('Replace Youtube links with links to an Invidious server'), $enabled, DI::l10n()->t('If enabled, Youtube links are replaced with the links to the specified Invidious server.')],
-               '$server'  => ['server', DI::l10n()->t('Invidious server'), $server, DI::l10n()->t('See %s for a list of available Invidious servers.', '<a href="https://api.invidious.io/">https://api.invidious.io/</a>')],
+               '$enabled' => ['invidious-enabled', DI::l10n()->t('Replace Youtube links with links to an Invidious server'), $enabled, DI::l10n()->t('If enabled, Youtube links are replaced with the links to the specified Invidious server.')],
+               '$server'  => ['invidious-server', DI::l10n()->t('Invidious server'), $server, DI::l10n()->t('See %s for a list of available Invidious servers.', '<a href="https://api.invidious.io/">https://api.invidious.io/</a>')],
        ]);
 
        $data = [
@@ -71,9 +71,9 @@ function invidious_settings_post(array &$b)
                return;
        }
 
-       DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'invidious', 'enabled', (bool)$_POST['enabled']);
+       DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'invidious', 'enabled', (bool)$_POST['invidious-enabled']);
 
-       $server = trim($_POST['server'], " \n\r\t\v\x00/");
+       $server = trim($_POST['invidious-server'], " \n\r\t\v\x00/");
        if ($server != DI::config()->get('invidious', 'server', INVIDIOUS_DEFAULT) && !empty($server)) {
                DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'invidious', 'server', $server);
        } else {
index 0822ac836dc7d8f637c947835f8d835470f03f97..1ef6cd9aae37275b09e20cc38e5a1bc6b95edee3 100644 (file)
@@ -26,7 +26,7 @@ function markdown_addon_settings(array &$data)
 
        $t    = Renderer::getMarkupTemplate('settings.tpl', 'addon/markdown/');
        $html = Renderer::replaceMacros($t, [
-               '$enabled' => ['enabled', DI::l10n()->t('Enable Markdown parsing'), $enabled, DI::l10n()->t('If enabled, adds Markdown support to the Compose Post form.')],
+               '$enabled' => ['markdown-enabled', DI::l10n()->t('Enable Markdown parsing'), $enabled, DI::l10n()->t('If enabled, adds Markdown support to the Compose Post form.')],
        ]);
 
        $data = [
@@ -42,7 +42,7 @@ function markdown_addon_settings_post(array &$b)
                return;
        }
 
-       DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'markdown', 'enabled', intval($_POST['enabled']));
+       DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'markdown', 'enabled', intval($_POST['markdown-enabled']));
 }
 
 function markdown_post_local_start(&$request) {