diff --git a/src/Controller/UserPanel.php b/src/Controller/UserPanel.php index 9bcf6c8001..2a186f64ec 100644 --- a/src/Controller/UserPanel.php +++ b/src/Controller/UserPanel.php @@ -37,6 +37,7 @@ namespace App\Controller; // {{{ Imports +use App\Core\Controller; use App\Core\DB\DB; use App\Core\Event; use App\Core\Form; @@ -64,7 +65,7 @@ use Symfony\Component\HttpFoundation\Request; // }}} Imports -class UserPanel extends AbstractController +class UserPanel extends Controller { /** * Return main settings page forms @@ -82,6 +83,7 @@ class UserPanel extends AbstractController 'prof' => $personal_form->createView(), 'acc' => $account_form->createView(), 'tabbed_forms_notify' => $notifications_form_array, + 'open_details_query' => $this->string('open') ]; } diff --git a/src/Twig/Extension.php b/src/Twig/Extension.php index 08d50d6afe..8f287ccb72 100644 --- a/src/Twig/Extension.php +++ b/src/Twig/Extension.php @@ -70,6 +70,7 @@ class Extension extends AbstractExtension new TwigFunction('icon', [Runtime::class, 'embedSvgIcon'], ['needs_environment' => true]), new TwigFunction('is_firefox', [Runtime::class, 'isFirefox']), new TwigFunction('handle_override_template_import', [Runtime::class, 'handleOverrideTemplateImport']), + new TwigFunction('open_details', [Runtime::class, 'openDetails']), ]; } } diff --git a/src/Twig/Runtime.php b/src/Twig/Runtime.php index de8ad7eab7..2dd5c46d14 100644 --- a/src/Twig/Runtime.php +++ b/src/Twig/Runtime.php @@ -134,6 +134,11 @@ class Runtime implements RuntimeExtensionInterface, EventSubscriberInterface return $result; } + public function openDetails(?string $query, array $ids) + { + return in_array($query, $ids) ? 'open=""' : ''; + } + // ---------------------------------------------------------- /** diff --git a/templates/settings/base.html.twig b/templates/settings/base.html.twig index 4b58b3baaf..d24ae25bc4 100644 --- a/templates/settings/base.html.twig +++ b/templates/settings/base.html.twig @@ -13,7 +13,7 @@

Settings